refactor: reuse Microsoft Reauthorize and Banner
This commit is contained in:
@@ -21,10 +21,7 @@
|
||||
</woot-tabs>
|
||||
</setting-intro-banner>
|
||||
|
||||
<inbox-reconnection-required
|
||||
v-if="isReconnectionRequired"
|
||||
class="mx-8 mt-5"
|
||||
/>
|
||||
<microsoft-reauthorize v-if="microsoftUnauthorized" :inbox="inbox" />
|
||||
|
||||
<div v-if="selectedTabKey === 'inbox_settings'" class="mx-8">
|
||||
<settings-section
|
||||
@@ -440,7 +437,7 @@ import WeeklyAvailability from './components/WeeklyAvailability.vue';
|
||||
import GreetingsEditor from 'shared/components/GreetingsEditor.vue';
|
||||
import ConfigurationPage from './settingsPage/ConfigurationPage.vue';
|
||||
import CollaboratorsPage from './settingsPage/CollaboratorsPage.vue';
|
||||
import InboxReconnectionRequired from './components/InboxReconnectionRequired';
|
||||
import MicrosoftReauthorize from './channels/microsoft/Reauthorize.vue';
|
||||
import WidgetBuilder from './WidgetBuilder.vue';
|
||||
import BotConfiguration from './components/BotConfiguration.vue';
|
||||
import { FEATURE_FLAGS } from '../../../../featureFlags';
|
||||
@@ -459,7 +456,7 @@ export default {
|
||||
WeeklyAvailability,
|
||||
WidgetBuilder,
|
||||
SenderNameExamplePreview,
|
||||
InboxReconnectionRequired,
|
||||
MicrosoftReauthorize,
|
||||
},
|
||||
mixins: [alertMixin, configMixin, inboxMixin],
|
||||
data() {
|
||||
@@ -621,8 +618,8 @@ export default {
|
||||
return true;
|
||||
return false;
|
||||
},
|
||||
isReconnectionRequired() {
|
||||
return false;
|
||||
microsoftUnauthorized() {
|
||||
return this.inbox.microsoft_reauthorization;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
+6
-21
@@ -1,31 +1,16 @@
|
||||
<template>
|
||||
<div class="mx-8">
|
||||
<settings-section
|
||||
:title="$t('INBOX_MGMT.MICROSOFT.TITLE')"
|
||||
:sub-title="$t('INBOX_MGMT.MICROSOFT.SUBTITLE')"
|
||||
>
|
||||
<div class="mb-6">
|
||||
<form @submit.prevent="requestAuthorization">
|
||||
<woot-submit-button
|
||||
icon="brand-twitter"
|
||||
button-text="Sign in with Microsoft"
|
||||
type="submit"
|
||||
:loading="isRequestingAuthorization"
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
</settings-section>
|
||||
</div>
|
||||
<inbox-reconnection-required
|
||||
class="mx-8 mt-5"
|
||||
@reauthorize="requestAuthorization"
|
||||
/>
|
||||
</template>
|
||||
<script>
|
||||
import alertMixin from 'shared/mixins/alertMixin';
|
||||
import InboxReconnectionRequired from '../../components/InboxReconnectionRequired';
|
||||
import microsoftClient from '../../../../../../api/channel/microsoftClient';
|
||||
import SettingsSection from '../../../../../../components/SettingsSection.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
SettingsSection,
|
||||
},
|
||||
components: { InboxReconnectionRequired },
|
||||
mixins: [alertMixin],
|
||||
props: {
|
||||
inbox: {
|
||||
|
||||
+9
-14
@@ -1,19 +1,14 @@
|
||||
<script setup>
|
||||
defineProps({
|
||||
actionUrl: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
import Banner from 'dashboard/components/ui/Banner.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
class="flex items-center gap-2 px-4 py-3 text-sm text-white bg-red-500 rounded-md dark:bg-red-800/30 dark:text-red-50 min-h-10"
|
||||
>
|
||||
<fluent-icon icon="error-circle" class="text-white dark:text-red-50" />
|
||||
<slot>
|
||||
<span v-html="$t('INBOX_MGMT.RECONNECTION_REQUIRED', { actionUrl })" />
|
||||
</slot>
|
||||
</div>
|
||||
<banner
|
||||
color-scheme="alert"
|
||||
class="justify-start rounded-md"
|
||||
:banner-message="$t('INBOX_MGMT.RECONNECTION_REQUIRED')"
|
||||
:action-button-label="$t('INBOX_MGMT.CLICK_TO_RECONNECT')"
|
||||
has-action-button
|
||||
@click="$emit('reauthorize')"
|
||||
/>
|
||||
</template>
|
||||
|
||||
+1
-7
@@ -104,10 +104,6 @@
|
||||
</div>
|
||||
<imap-settings :inbox="inbox" />
|
||||
<smtp-settings v-if="inbox.imap_enabled" :inbox="inbox" />
|
||||
<microsoft-reauthorize
|
||||
v-if="inbox.microsoft_reauthorization"
|
||||
:inbox="inbox"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="isAWhatsAppChannel && !isATwilioChannel">
|
||||
<div v-if="inbox.provider_config" class="mx-8">
|
||||
@@ -130,7 +126,7 @@
|
||||
"
|
||||
>
|
||||
<div
|
||||
class="whatsapp-settings--content items-center flex flex-1 justify-between mt-2"
|
||||
class="flex items-center justify-between flex-1 mt-2 whatsapp-settings--content"
|
||||
>
|
||||
<woot-input
|
||||
v-model.trim="whatsAppInboxAPIKey"
|
||||
@@ -160,7 +156,6 @@ import inboxMixin from 'shared/mixins/inboxMixin';
|
||||
import SettingsSection from '../../../../../components/SettingsSection.vue';
|
||||
import ImapSettings from '../ImapSettings.vue';
|
||||
import SmtpSettings from '../SmtpSettings.vue';
|
||||
import MicrosoftReauthorize from '../channels/microsoft/Reauthorize.vue';
|
||||
import { required } from 'vuelidate/lib/validators';
|
||||
|
||||
export default {
|
||||
@@ -168,7 +163,6 @@ export default {
|
||||
SettingsSection,
|
||||
ImapSettings,
|
||||
SmtpSettings,
|
||||
MicrosoftReauthorize,
|
||||
},
|
||||
mixins: [inboxMixin, alertMixin],
|
||||
props: {
|
||||
|
||||
Reference in New Issue
Block a user