chore: Replace inboxMixin with useInbox composable
This commit is contained in:
+10
-5
@@ -9,12 +9,11 @@ import CannedResponse from 'dashboard/components/widgets/conversation/CannedResp
|
||||
import MessageSignatureMissingAlert from 'dashboard/components/widgets/conversation/MessageSignatureMissingAlert';
|
||||
import InboxDropdownItem from 'dashboard/components/widgets/InboxDropdownItem.vue';
|
||||
import WhatsappTemplates from './WhatsappTemplates.vue';
|
||||
import { INBOX_TYPES } from 'shared/mixins/inboxMixin';
|
||||
import { ExceptionWithMessage } from 'shared/helpers/CustomErrors';
|
||||
import { getInboxSource } from 'dashboard/helper/inbox';
|
||||
import { useVuelidate } from '@vuelidate/core';
|
||||
import { required, requiredIf } from '@vuelidate/validators';
|
||||
import inboxMixin from 'shared/mixins/inboxMixin';
|
||||
import { useInbox, INBOX_TYPES } from 'shared/composables/useInbox';
|
||||
import FileUpload from 'vue-upload-component';
|
||||
import AttachmentPreview from 'dashboard/components/widgets/AttachmentsPreview';
|
||||
import { ALLOWED_FILE_TYPES } from 'shared/constants/messages';
|
||||
@@ -36,7 +35,7 @@ export default {
|
||||
AttachmentPreview,
|
||||
MessageSignatureMissingAlert,
|
||||
},
|
||||
mixins: [inboxMixin, fileUploadMixin],
|
||||
mixins: [fileUploadMixin],
|
||||
props: {
|
||||
contact: {
|
||||
type: Object,
|
||||
@@ -47,12 +46,18 @@ export default {
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
setup(props) {
|
||||
const { channelType } = useInbox({ inboxObj: props.targetInbox });
|
||||
const { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox } =
|
||||
useUISettings();
|
||||
const v$ = useVuelidate();
|
||||
|
||||
return { fetchSignatureFlagFromUISettings, setSignatureFlagForInbox, v$ };
|
||||
return {
|
||||
fetchSignatureFlagFromUISettings,
|
||||
setSignatureFlagForInbox,
|
||||
v$,
|
||||
channelType,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useAlert } from 'dashboard/composables';
|
||||
import { useVuelidate } from '@vuelidate/core';
|
||||
import SettingIntroBanner from 'dashboard/components/widgets/SettingIntroBanner.vue';
|
||||
import SettingsSection from '../../../../components/SettingsSection.vue';
|
||||
import inboxMixin from 'shared/mixins/inboxMixin';
|
||||
import { useInbox } from 'shared/composables/useInbox';
|
||||
import FacebookReauthorize from './facebook/Reauthorize.vue';
|
||||
import PreChatFormSettings from './PreChatForm/Settings.vue';
|
||||
import WeeklyAvailability from './components/WeeklyAvailability.vue';
|
||||
@@ -33,9 +33,42 @@ export default {
|
||||
SenderNameExamplePreview,
|
||||
MicrosoftReauthorize,
|
||||
},
|
||||
mixins: [inboxMixin],
|
||||
setup() {
|
||||
return { v$: useVuelidate() };
|
||||
const {
|
||||
isAMicrosoftInbox,
|
||||
isAGoogleInbox,
|
||||
isAPIInbox,
|
||||
isATwitterInbox,
|
||||
isAFacebookInbox,
|
||||
isAWebWidgetInbox,
|
||||
isATwilioChannel,
|
||||
isALineChannel,
|
||||
isAnEmailChannel,
|
||||
isATwilioSMSChannel,
|
||||
isASmsInbox,
|
||||
isATwilioWhatsAppChannel,
|
||||
isAWhatsAppCloudChannel,
|
||||
is360DialogWhatsAppChannel,
|
||||
isAWhatsAppChannel,
|
||||
} = useInbox({ inboxId: this.currentInboxId });
|
||||
return {
|
||||
v$: useVuelidate(),
|
||||
isAMicrosoftInbox,
|
||||
isAGoogleInbox,
|
||||
isAPIInbox,
|
||||
isATwitterInbox,
|
||||
isAFacebookInbox,
|
||||
isAWebWidgetInbox,
|
||||
isATwilioChannel,
|
||||
isALineChannel,
|
||||
isAnEmailChannel,
|
||||
isATwilioSMSChannel,
|
||||
isASmsInbox,
|
||||
isATwilioWhatsAppChannel,
|
||||
isAWhatsAppCloudChannel,
|
||||
is360DialogWhatsAppChannel,
|
||||
isAWhatsAppChannel,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
+11
-2
@@ -1,7 +1,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import inboxMixin from 'shared/mixins/inboxMixin';
|
||||
import { useInbox } from 'shared/composables/useInbox';
|
||||
import SettingsSection from 'dashboard/components/SettingsSection.vue';
|
||||
import WootMessageEditor from 'dashboard/components/widgets/WootWriter/Editor.vue';
|
||||
import BusinessDay from './BusinessDay.vue';
|
||||
@@ -23,13 +23,22 @@ export default {
|
||||
BusinessDay,
|
||||
WootMessageEditor,
|
||||
},
|
||||
mixins: [inboxMixin],
|
||||
props: {
|
||||
inbox: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const { isATwilioChannel, isATwitterInbox, isAFacebookInbox } = useInbox({
|
||||
inboxObj: props.inbox,
|
||||
});
|
||||
return {
|
||||
isATwitterInbox,
|
||||
isAFacebookInbox,
|
||||
isATwilioChannel,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isBusinessHoursEnabled: false,
|
||||
|
||||
+19
-4
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { useAlert } from 'dashboard/composables';
|
||||
import inboxMixin from 'shared/mixins/inboxMixin';
|
||||
import { useInbox } from 'shared/composables/useInbox';
|
||||
import SettingsSection from '../../../../../components/SettingsSection.vue';
|
||||
import ImapSettings from '../ImapSettings.vue';
|
||||
import SmtpSettings from '../SmtpSettings.vue';
|
||||
@@ -13,15 +13,30 @@ export default {
|
||||
ImapSettings,
|
||||
SmtpSettings,
|
||||
},
|
||||
mixins: [inboxMixin],
|
||||
props: {
|
||||
inbox: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
return { v$: useVuelidate() };
|
||||
setup(props) {
|
||||
const {
|
||||
isAPIInbox,
|
||||
isAWebWidgetInbox,
|
||||
isATwilioChannel,
|
||||
isALineChannel,
|
||||
isAnEmailChannel,
|
||||
} = useInbox({
|
||||
inboxObj: props.inbox,
|
||||
});
|
||||
return {
|
||||
v$: useVuelidate(),
|
||||
isAPIInbox,
|
||||
isAWebWidgetInbox,
|
||||
isATwilioChannel,
|
||||
isALineChannel,
|
||||
isAnEmailChannel,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user