From 2e6a88add08aeee1dedb2a424465000145877874 Mon Sep 17 00:00:00 2001 From: lizacoma Date: Wed, 25 Oct 2023 22:50:23 +0300 Subject: [PATCH 1/4] refactor: used delete-popup composable and removed delete mixin in progress [WTEL-3606] --- .../baseTableMixin/baseTableMixin.js | 2 +- .../deleteMixin/deleteConfirmationMixin.js | 1 + .../deleteMixin/tableDeleteMixin.js | 18 ++++---- .../modules/queues/components/the-queues.vue | 44 ++++++++++++++++--- 4 files changed, 48 insertions(+), 17 deletions(-) diff --git a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js index 2bf9b80f4..aee952fcf 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js @@ -11,7 +11,7 @@ import tableActionsHandlerMixin from './tableActionsMixin'; */ export default { mixins: [ - deleteMixin, + // deleteMixin, itemLinkMixin, tableActionsHandlerMixin, ], diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js index c976fbea1..034c12b23 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js @@ -15,6 +15,7 @@ export default { }), methods: { askDeleteConfirmation({ deleted, callback }) { + console.log('askDeleteConfirmation'); if (Array.isArray(deleted)) this.deleteConfirmation.deleteCount = deleted.length; else this.deleteConfirmation.deleteCount = 1; this.deleteConfirmation.isDeleteConfirmationPopup = true; diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js index 8bf92fe22..1228defb1 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js @@ -1,16 +1,16 @@ import deleteConfirmationMixin from './deleteConfirmationMixin'; export default { - mixins: [deleteConfirmationMixin], + // mixins: [deleteConfirmationMixin], methods: { - callDelete(deleted) { - if (this.isDeleteConfirmation) { - this.askDeleteConfirmation({ - deleted, - callback: this.makeDelete.bind(this, deleted), - }); - } else this.makeDelete(deleted); - }, + // callDelete(deleted) { + // if (this.isDeleteConfirmation) { + // this.askDeleteConfirmation({ + // deleted, + // callback: this.makeDelete.bind(this, deleted), + // }); + // } else this.makeDelete(deleted); + // }, makeDelete(deleted) { return this.dispatchDelete(deleted); }, diff --git a/src/modules/contact-center/modules/queues/components/the-queues.vue b/src/modules/contact-center/modules/queues/components/the-queues.vue index fe3c3c5bc..c44a41f7b 100644 --- a/src/modules/contact-center/modules/queues/components/the-queues.vue +++ b/src/modules/contact-center/modules/queues/components/the-queues.vue @@ -17,9 +17,9 @@ @close="isQueueSelectPopup = false" /> @@ -44,7 +44,10 @@ v-if="hasDeleteAccess" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: [selectedRows], + callback: () => deleteData(selectedRows), + })" /> @@ -123,7 +126,10 @@ v-if="hasDeleteAccess" action="delete" class="table-action" - @click="callDelete(item)" + @click="askDeleteConfirmation({ + deleted: [item], + callback: () => deleteData(item), + })" /> @@ -149,17 +155,41 @@ import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/obj import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import QueueTypeProperties from '../lookups/QueueTypeProperties.lookup'; import QueuePopup from './create-queue-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; +import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; const namespace = 'ccenter/queues'; export default { name: 'TheQueues', - components: { QueuePopup }, + components: { QueuePopup, DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + const { deleteData } = useTableStore(namespace); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + deleteData, + }; }, data: () => ({ namespace, From 55cf49c663a84b335acf3674304cc946b90eba5e Mon Sep 17 00:00:00 2001 From: lizacoma Date: Fri, 27 Oct 2023 00:26:54 +0300 Subject: [PATCH 2/4] refactor: fixed bug with store, deleted deleteConfirmation mixin, refactored few cpmponents [WTEL-3606] --- .../baseTableMixin/baseTableMixin.js | 2 +- .../deleteMixin/deleteConfirmationMixin.js | 31 ------------- .../deleteMixin/tableDeleteMixin.js | 4 +- .../modules/agents/components/the-agents.vue | 41 ++++++++++++++--- .../modules/queues/components/the-queues.vue | 10 ++--- .../opened-queue-member-communication.vue | 41 ++++++++++++++--- .../members/components/the-queue-members.vue | 36 +++++++++++++-- .../components/the-resource-groups.vue | 39 +++++++++++++--- .../devices/components/the-devices.vue | 39 +++++++++++++--- .../components/the-agent-skills.vue | 42 +++++++++++++++--- .../components/the-communication-types.vue | 39 +++++++++++++--- .../regions/components/the-regions.vue | 44 ++++++++++++++++--- .../modules/flow/components/the-flow.vue | 41 ++++++++++++++--- 13 files changed, 316 insertions(+), 93 deletions(-) delete mode 100644 src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js diff --git a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js index aee952fcf..2bf9b80f4 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js @@ -11,7 +11,7 @@ import tableActionsHandlerMixin from './tableActionsMixin'; */ export default { mixins: [ - // deleteMixin, + deleteMixin, itemLinkMixin, tableActionsHandlerMixin, ], diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js deleted file mode 100644 index 034c12b23..000000000 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/deleteConfirmationMixin.js +++ /dev/null @@ -1,31 +0,0 @@ -import DeleteConfirmationPopup - from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; - -export default { - components: { - DeleteConfirmationPopup, - }, - data: () => ({ - isDeleteConfirmation: true, - deleteConfirmation: { - isDeleteConfirmationPopup: false, - deleteCount: null, - callback: null, - }, - }), - methods: { - askDeleteConfirmation({ deleted, callback }) { - console.log('askDeleteConfirmation'); - if (Array.isArray(deleted)) this.deleteConfirmation.deleteCount = deleted.length; - else this.deleteConfirmation.deleteCount = 1; - this.deleteConfirmation.isDeleteConfirmationPopup = true; - this.deleteConfirmation.callback = callback; - }, - confirmDelete() { - this.deleteConfirmation.callback(); - }, - closeDelete() { - this.deleteConfirmation.isDeleteConfirmationPopup = false; - }, - }, -}; diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js index 1228defb1..d7a37c4da 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js @@ -1,4 +1,4 @@ -import deleteConfirmationMixin from './deleteConfirmationMixin'; +// import deleteConfirmationMixin from './deleteConfirmationMixin'; export default { // mixins: [deleteConfirmationMixin], @@ -11,7 +11,7 @@ export default { // }); // } else this.makeDelete(deleted); // }, - makeDelete(deleted) { + deleteData(deleted) { return this.dispatchDelete(deleted); }, dispatchDelete() { diff --git a/src/modules/contact-center/modules/agents/components/the-agents.vue b/src/modules/contact-center/modules/agents/components/the-agents.vue index cfec64ff6..b16a544dd 100644 --- a/src/modules/contact-center/modules/agents/components/the-agents.vue +++ b/src/modules/contact-center/modules/agents/components/the-agents.vue @@ -11,9 +11,9 @@ @@ -135,17 +141,38 @@ import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/obj import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import agentStatusMixin from '../../../mixins/agentStatusMixin'; import HistoryPopup from './agent-history-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; + const namespace = 'ccenter/agents'; export default { name: 'TheAgents', - components: { HistoryPopup }, + components: { HistoryPopup, DeleteConfirmationPopup }, mixins: [tableComponentMixin, agentStatusMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ diff --git a/src/modules/contact-center/modules/queues/components/the-queues.vue b/src/modules/contact-center/modules/queues/components/the-queues.vue index c44a41f7b..ee14b6d14 100644 --- a/src/modules/contact-center/modules/queues/components/the-queues.vue +++ b/src/modules/contact-center/modules/queues/components/the-queues.vue @@ -45,10 +45,11 @@ :class="{'hidden': anySelected}" :selected-count="selectedRows.length" @click="askDeleteConfirmation({ - deleted: [selectedRows], + deleted: selectedRows, callback: () => deleteData(selectedRows), })" /> + @@ -155,10 +156,9 @@ import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/obj import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import QueueTypeProperties from '../lookups/QueueTypeProperties.lookup'; import QueuePopup from './create-queue-popup.vue'; -import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; -import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore'; import DeleteConfirmationPopup from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/queues'; @@ -178,8 +178,6 @@ export default { closeDelete, } = useDeleteConfirmationPopup(); - const { deleteData } = useTableStore(namespace); - return { dummy, isDeleteConfirmationPopup, @@ -188,9 +186,9 @@ export default { askDeleteConfirmation, closeDelete, - deleteData, }; }, + data: () => ({ namespace, isQueueSelectPopup: false, diff --git a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue index 96ef97057..506af9ad2 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/communications/opened-queue-member-communication.vue @@ -7,9 +7,9 @@ /> @@ -25,7 +25,10 @@ v-if="!disableUserInput" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -79,11 +85,34 @@ import { mapActions, mapState } from 'vuex'; import openedObjectTableTabMixin from '../../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin'; import CommunicationPopup from './opened-queue-member-communication-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; + export default { name: 'OpenedQueueMemberCommunication', - components: { CommunicationPopup }, + components: { CommunicationPopup, DeleteConfirmationPopup }, mixins: [openedObjectTableTabMixin], + setup() { + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; + }, data: () => ({ dataListValue: [], searchValue: '', diff --git a/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue b/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue index 689e59e98..2ac24007c 100644 --- a/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue +++ b/src/modules/contact-center/modules/queues/modules/members/components/the-queue-members.vue @@ -45,9 +45,9 @@ /> @@ -172,7 +172,10 @@ @@ -203,6 +206,9 @@ import TheQueueMembersFilters from '../modules/filters/components/the-queue-memb import destinationsPopup from './communications/opened-queue-member-destinations-popup.vue'; import ResetPopup from './reset-members-popup.vue'; import uploadPopup from './upload-members-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; export default { name: 'TheQueueMembers', @@ -212,8 +218,30 @@ export default { destinationsPopup, ResetPopup, TheQueueMembersFilters, + DeleteConfirmationPopup, }, mixins: [tableComponentMixin], + + setup() { + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; + }, + data: () => ({ namespace: 'ccenter/queues/members', isUploadPopup: false, diff --git a/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue b/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue index 461ecb15a..e2ecb2b81 100644 --- a/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue +++ b/src/modules/contact-center/modules/resource-groups/components/the-resource-groups.vue @@ -11,9 +11,9 @@ @@ -114,16 +120,37 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/resGroups'; export default { name: 'TheResourceGroups', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/directory/modules/devices/components/the-devices.vue b/src/modules/directory/modules/devices/components/the-devices.vue index 43618e2b8..55c35289a 100644 --- a/src/modules/directory/modules/devices/components/the-devices.vue +++ b/src/modules/directory/modules/devices/components/the-devices.vue @@ -30,9 +30,9 @@ /> @@ -57,7 +57,10 @@ v-if="hasDeleteAccess" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -162,6 +168,9 @@ import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import DevicePopup from './create-device-popup.vue'; import HistoryPopup from './device-history-popup.vue'; import UploadPopup from './upload-devices-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'directory/devices'; @@ -172,12 +181,30 @@ export default { UploadPopup, DevicePopup, UploadFileIconBtn, + DeleteConfirmationPopup, }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue b/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue index 609c5c5a4..b5cba3849 100644 --- a/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue +++ b/src/modules/lookups/modules/agent-skills/components/the-agent-skills.vue @@ -20,9 +20,9 @@ @@ -129,18 +135,40 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import AddSkillToAgentPopup from '../modules/agents/components/add-skill-to-agent-popup/add-skill-to-agent-popup.vue'; +import DeleteConfirmationPopup +from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; + const namespace = 'lookups/skills'; export default { name: 'TheAgentSkills', - components: { AddSkillToAgentPopup }, + components: { AddSkillToAgentPopup, DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, + data: () => ({ namespace, routeName: RouteNames.SKILLS, diff --git a/src/modules/lookups/modules/communications/components/the-communication-types.vue b/src/modules/lookups/modules/communications/components/the-communication-types.vue index c7ddaf8df..aeaf98f1d 100644 --- a/src/modules/lookups/modules/communications/components/the-communication-types.vue +++ b/src/modules/lookups/modules/communications/components/the-communication-types.vue @@ -11,9 +11,9 @@ @@ -116,16 +122,37 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'lookups/communications'; export default { name: 'TheCommunicationTypes', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ diff --git a/src/modules/lookups/modules/regions/components/the-regions.vue b/src/modules/lookups/modules/regions/components/the-regions.vue index 5e3b66ed7..0ed770d63 100644 --- a/src/modules/lookups/modules/regions/components/the-regions.vue +++ b/src/modules/lookups/modules/regions/components/the-regions.vue @@ -11,9 +11,9 @@ @@ -111,16 +117,42 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; +import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore'; const namespace = 'lookups/regions'; export default { name: 'TheRegions', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + const { deleteData } = useTableStore(namespace); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + deleteData, + }; }, data: () => ({ diff --git a/src/modules/routing/modules/flow/components/the-flow.vue b/src/modules/routing/modules/flow/components/the-flow.vue index c3506f112..f09a7feca 100644 --- a/src/modules/routing/modules/flow/components/the-flow.vue +++ b/src/modules/routing/modules/flow/components/the-flow.vue @@ -26,9 +26,9 @@ @close="closeUploadPopup" /> @@ -49,7 +49,10 @@ v-if="hasDeleteAccess" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -165,6 +171,9 @@ import FlowEditor from '../enums/FlowEditor.enum'; import TheFlowFilters from '../modules/filters/components/the-flow-filters.vue'; import CreateFlowPopup from './create-flow-popup.vue'; import UploadPopup from './upload-flow-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'routing/flow'; @@ -176,8 +185,30 @@ export default { UploadFileIconBtn, TheFlowFilters, FilterSearch, + DeleteConfirmationPopup, }, mixins: [tableComponentMixin], + + setup() { + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; + }, + data: () => ({ namespace, routeName: RouteNames.FLOW, From 515957884dcdf5a87e40e78b775be1145e88e482 Mon Sep 17 00:00:00 2001 From: lizacoma Date: Fri, 27 Oct 2023 15:11:02 +0300 Subject: [PATCH 3/4] refactor: remove comented code from mixin [WTEL-3606] --- .../baseTableMixin/deleteMixin/tableDeleteMixin.js | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js index d7a37c4da..d74b7935d 100644 --- a/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js +++ b/src/app/mixins/baseMixins/baseTableMixin/deleteMixin/tableDeleteMixin.js @@ -1,16 +1,5 @@ -// import deleteConfirmationMixin from './deleteConfirmationMixin'; - export default { - // mixins: [deleteConfirmationMixin], methods: { - // callDelete(deleted) { - // if (this.isDeleteConfirmation) { - // this.askDeleteConfirmation({ - // deleted, - // callback: this.makeDelete.bind(this, deleted), - // }); - // } else this.makeDelete(deleted); - // }, deleteData(deleted) { return this.dispatchDelete(deleted); }, From 5cd97fefe200bc7893e6cfb6ddc70e7587568039 Mon Sep 17 00:00:00 2001 From: lizacoma Date: Mon, 30 Oct 2023 20:58:49 +0200 Subject: [PATCH 4/4] refactor: remove delete mixin from components and added delte-popup composable [WTEL-3606] --- .../opened-resource-group-resources.vue | 40 +++++++++++++--- .../resources/components/the-resources.vue | 39 +++++++++++++--- .../components/opened-resource-numbers.vue | 41 ++++++++++++++--- .../modules/teams/components/the-teams.vue | 39 +++++++++++++--- .../agents/components/opened-team-agents.vue | 40 +++++++++++++--- .../components/opened-team-supervisors.vue | 44 +++++++++++++++--- .../modules/users/components/the-users.vue | 45 +++++++++++++++--- .../tokens/components/opened-user-token.vue | 46 ++++++++++++++++--- .../components/the-cognitive-profiles.vue | 39 +++++++++++++--- .../components/the-email-profiles.vue | 39 +++++++++++++--- .../import-csv/components/the-import-csv.vue | 40 +++++++++++++--- .../components/the-single-sign-on.vue | 39 ++++++++++++++-- .../storage/components/the-storage.vue | 40 +++++++++++++--- .../triggers/components/the-triggers.vue | 39 +++++++++++++--- .../components/the-agent-pause-cause.vue | 39 +++++++++++++--- .../agents/components/opened-skill-agents.vue | 44 +++++++++++++++--- .../blacklists/components/the-blacklists.vue | 39 +++++++++++++--- .../components/opened-blacklist-numbers.vue | 45 +++++++++++++++--- .../buckets/components/the-buckets.vue | 39 +++++++++++++--- .../components/opened-calendar-holidays.vue | 42 ++++++++++++++--- .../calendars/components/the-calendars.vue | 40 +++++++++++++--- .../modules/media/components/the-media.vue | 39 +++++++++++++--- .../opened-role-permissions.vue | 40 +++++++++++++--- .../modules/roles/components/the-roles.vue | 39 +++++++++++++--- .../components/the-chat-gateways.vue | 43 ++++++++++++++--- .../whatsapp/components/whatsapp-tab.vue | 34 ++++++++++++-- .../chatplan/components/the-chatplan.vue | 39 +++++++++++++--- .../dialplan/components/the-dialplan.vue | 39 +++++++++++++--- .../gateways/components/the-sip-gateways.vue | 40 +++++++++++++--- .../changelogs/components/the-changelogs.vue | 39 +++++++++++++--- .../components/the-configuration.vue | 40 +++++++++++++--- 31 files changed, 1056 insertions(+), 194 deletions(-) diff --git a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue index 692cae4c1..20d716f8a 100644 --- a/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue +++ b/src/modules/contact-center/modules/resource-groups/modules/resources/components/opened-resource-group-resources.vue @@ -5,9 +5,9 @@ @close="closePopup" /> @@ -31,7 +31,10 @@ v-if="!disableUserInput" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -110,17 +116,37 @@ import { useDummy } from '../../../../../../../app/composables/useDummy'; import openedObjectTableTabMixin from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin'; import ResPopup from './opened-resource-group-resource-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/resGroups'; const subNamespace = 'res'; export default { name: 'OpenedResourceGroupResources', - components: { ResPopup }, + components: { ResPopup, DeleteConfirmationPopup }, mixins: [openedObjectTableTabMixin], setup() { const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/contact-center/modules/resources/components/the-resources.vue b/src/modules/contact-center/modules/resources/components/the-resources.vue index 515b1765f..a56fdf387 100644 --- a/src/modules/contact-center/modules/resources/components/the-resources.vue +++ b/src/modules/contact-center/modules/resources/components/the-resources.vue @@ -11,9 +11,9 @@ @@ -116,16 +122,37 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/res'; export default { name: 'TheResources', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue index a058e5d1b..b0e108d90 100644 --- a/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue +++ b/src/modules/contact-center/modules/resources/modules/display/components/opened-resource-numbers.vue @@ -5,9 +5,9 @@ @close="closePopup" /> @@ -31,7 +31,10 @@ v-if="!disableUserInput" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -95,19 +101,40 @@ import { useDummy } from '../../../../../../../app/composables/useDummy'; import openedObjectTableTabMixin from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin'; import NumberPopup from './opened-resource-numbers-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/res'; const subNamespace = 'numbers'; export default { name: 'OpenedResourceNumber', - components: { NumberPopup }, + components: { NumberPopup, DeleteConfirmationPopup }, mixins: [openedObjectTableTabMixin], setup() { const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, + data: () => ({ namespace, subNamespace, diff --git a/src/modules/contact-center/modules/teams/components/the-teams.vue b/src/modules/contact-center/modules/teams/components/the-teams.vue index be6b58d4a..6b1b0c6b9 100644 --- a/src/modules/contact-center/modules/teams/components/the-teams.vue +++ b/src/modules/contact-center/modules/teams/components/the-teams.vue @@ -11,9 +11,9 @@ @@ -107,16 +113,37 @@ import { kebabToCamel } from '@webitel/ui-sdk/src/scripts/caseConverters'; import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/teams'; export default { name: 'TheTeams', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue index 1bee1cc36..c10a73482 100644 --- a/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue +++ b/src/modules/contact-center/modules/teams/modules/agents/components/opened-team-agents.vue @@ -5,9 +5,9 @@ @close="closePopup" /> @@ -137,18 +143,38 @@ import RouteNames from '../../../../../../../app/router/_internals/RouteNames.en import agentStatusMixin from '../../../../../mixins/agentStatusMixin'; import agentSupervisorsAndSkillsPopupMixin from '../../../../../mixins/agentSupervisorsAndSkillsPopupMixin'; import AgentPopup from './opened-team-agent-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/teams'; const subNamespace = 'agents'; export default { name: 'OpenedTeamAgents', - components: { AgentPopup, ObjectListPopup }, + components: { AgentPopup, ObjectListPopup, DeleteConfirmationPopup }, mixins: [openedObjectTableTabMixin, agentSupervisorsAndSkillsPopupMixin, agentStatusMixin], setup() { const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue index a227e0ea1..00678577d 100644 --- a/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue +++ b/src/modules/contact-center/modules/teams/modules/supervisors/components/opened-team-supervisors.vue @@ -10,9 +10,9 @@ @close="closeSubordinates" /> @@ -36,7 +36,10 @@ v-if="!disableUserInput" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -117,18 +123,42 @@ import openedObjectTableTabMixin import RouteNames from '../../../../../../../app/router/_internals/RouteNames.enum'; import SupervisorSubordinatesPopup from './opened-team-supervisor-subordinates-popup.vue'; import SupervisorPopup from './opened-team-supervisors-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'ccenter/teams'; const subNamespace = 'supervisors'; export default { name: 'OpenedTeamSupervisors', - components: { SupervisorPopup, SupervisorSubordinatesPopup }, + components: { + SupervisorPopup, + SupervisorSubordinatesPopup, + DeleteConfirmationPopup, + }, mixins: [openedObjectTableTabMixin], setup() { const { dummy } = useDummy({ namespace: `${namespace}/${subNamespace}`, hiddenText: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/directory/modules/users/components/the-users.vue b/src/modules/directory/modules/users/components/the-users.vue index 5be6dfb9d..d36045b91 100644 --- a/src/modules/directory/modules/users/components/the-users.vue +++ b/src/modules/directory/modules/users/components/the-users.vue @@ -18,9 +18,9 @@ @close="closeCSVPopup" /> @@ -45,7 +45,10 @@ v-if="hasDeleteAccess" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -134,17 +140,42 @@ import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/obj import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import UserStatus from './_internals/user-status-chips.vue'; import UploadPopup from './upload-users-popup.vue'; +import DeleteConfirmationPopup +from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'directory/users'; export default { name: 'TheUsers', - components: { UploadPopup, UserStatus, UploadFileIconBtn }, + components: { + UploadPopup, + UserStatus, + UploadFileIconBtn, + DeleteConfirmationPopup + }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, hiddenText: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ isUploadPopup: false, diff --git a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue index 133185cac..689e042de 100644 --- a/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue +++ b/src/modules/directory/modules/users/modules/tokens/components/opened-user-token.vue @@ -10,9 +10,9 @@ @close="closeTokenCreatedPopup" /> @@ -29,7 +29,10 @@ v-if="!disableUserInput" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -88,11 +94,39 @@ import openedObjectTableTabMixin from '../../../../../../../app/mixins/objectPagesMixins/openedObjectTableTabMixin/openedObjectTableTabMixin'; import TokenCreatedPopup from './opened-user-token-created-popup.vue'; import TokenPopup from './opened-user-token-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; export default { name: 'OpenedUserTokens', - components: { TokenPopup, TokenCreatedPopup }, + components: { + TokenPopup, + TokenCreatedPopup, + DeleteConfirmationPopup, + }, mixins: [openedObjectTableTabMixin], + + setup() { + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; + }, + data: () => ({ subNamespace: 'tokens', isPopup: false, diff --git a/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue b/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue index b60f9c3b7..d4c5a30f7 100644 --- a/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue +++ b/src/modules/integrations/modules/cognitive-profiles/components/the-cognitive-profiles.vue @@ -15,9 +15,9 @@ @close="isCognitiveProfilePopup = false" /> @@ -47,7 +47,10 @@ v-if="hasDeleteAccess" :class="{'hidden': anySelected}" :selected-count="selectedRows.length" - @click="callDelete(selectedRows)" + @click="askDeleteConfirmation({ + deleted: selectedRows, + callback: () => deleteData(selectedRows), + })" /> @@ -109,7 +112,10 @@ v-if="hasDeleteAccess" action="delete" class="table-action" - @click="callDelete(item)" + @click="askDeleteConfirmation({ + deleted: [item], + callback: () => deleteData(item), + })" /> @@ -135,6 +141,9 @@ import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/obj import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import dummyPic from '../assets/adm-dummy-cognitive-profiles.svg'; import CreateCognitiveProfilePopup from './create-cognitive-profile-popup.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'integrations/cognitiveProfiles'; @@ -142,6 +151,7 @@ export default { name: 'TheCognitiveProfiles', components: { CreateCognitiveProfilePopup, + DeleteConfirmationPopup, }, mixins: [tableComponentMixin], @@ -152,7 +162,24 @@ export default { dummyPic, dummyText: 'objects.integrations.emptyWorkspace', }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue b/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue index 3647150a3..dd277c691 100644 --- a/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue +++ b/src/modules/integrations/modules/email-profiles/components/the-email-profiles.vue @@ -11,9 +11,9 @@ @@ -121,11 +127,15 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import dummyPic from '../assets/adm-dummy-email-profile.svg'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'integrations/emailProfiles'; export default { name: 'TheEmailProfiles', + components: { DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { @@ -135,7 +145,24 @@ export default { dummyPic, dummyText: 'objects.integrations.emptyWorkspace', }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue index 59cb52532..759ceae6e 100644 --- a/src/modules/integrations/modules/import-csv/components/the-import-csv.vue +++ b/src/modules/integrations/modules/import-csv/components/the-import-csv.vue @@ -11,9 +11,9 @@ @@ -117,17 +123,37 @@ import { useDummy } from '../../../../../app/composables/useDummy'; import tableComponentMixin from '../../../../../app/mixins/objectPagesMixins/objectTableMixin/tableComponentMixin'; import RouteNames from '../../../../../app/router/_internals/RouteNames.enum'; import UploadAction from './import-csv-upload-action.vue'; +import DeleteConfirmationPopup + from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; +import { useDeleteConfirmationPopup } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; const namespace = 'integrations/importCsv'; export default { name: 'TheImportCsv', - components: { UploadAction }, + components: { UploadAction, DeleteConfirmationPopup }, mixins: [tableComponentMixin], setup() { const { dummy } = useDummy({ namespace, showAction: true }); - return { dummy }; + const { + isVisible: isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + } = useDeleteConfirmationPopup(); + + return { + dummy, + isDeleteConfirmationPopup, + deleteCount, + deleteCallback, + + askDeleteConfirmation, + closeDelete, + }; }, data: () => ({ namespace, diff --git a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue index 4e6fec478..6626de41d 100644 --- a/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue +++ b/src/modules/integrations/modules/single-sign-on/components/the-single-sign-on.vue @@ -11,9 +11,9 @@ @@ -100,10 +106,33 @@