Skip to content

Commit

Permalink
refactor: fixed bug with store, deleted deleteConfirmation mixin, ref…
Browse files Browse the repository at this point in the history
…actored few cpmponents [WTEL-3606]
  • Loading branch information
lizacoma committed Oct 26, 2023
1 parent 2e6a88a commit 55cf49c
Show file tree
Hide file tree
Showing 13 changed files with 316 additions and 93 deletions.
2 changes: 1 addition & 1 deletion src/app/mixins/baseMixins/baseTableMixin/baseTableMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import tableActionsHandlerMixin from './tableActionsMixin';
*/
export default {
mixins: [
// deleteMixin,
deleteMixin,
itemLinkMixin,
tableActionsHandlerMixin,
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import deleteConfirmationMixin from './deleteConfirmationMixin';
// import deleteConfirmationMixin from './deleteConfirmationMixin';

export default {
// mixins: [deleteConfirmationMixin],
Expand All @@ -11,7 +11,7 @@ export default {
// });
// } else this.makeDelete(deleted);
// },
makeDelete(deleted) {
deleteData(deleted) {
return this.dispatchDelete(deleted);
},
dispatchDelete() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<template #main>
<delete-confirmation-popup
v-show="deleteConfirmation.isDeleteConfirmationPopup"
:delete-count="deleteConfirmation.deleteCount"
:callback="deleteConfirmation.callback"
v-show="isDeleteConfirmationPopup"
:delete-count="deleteCount"
:callback="deleteCallback"
@close="closeDelete"
/>

Expand Down Expand Up @@ -43,7 +43,10 @@
v-if="hasDeleteAccess"
:class="{'hidden': anySelected}"
:selected-count="selectedRows.length"
@click="callDelete(selectedRows)"
@click="askDeleteConfirmation({
deleted: selectedRows,
callback: () => deleteData(selectedRows),
})"
/>
</wt-table-actions>
</div>
Expand Down Expand Up @@ -106,7 +109,10 @@
v-if="hasDeleteAccess"
action="delete"
class="table-action"
@click="callDelete(item)"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
Expand Down Expand Up @@ -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: () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@
:class="{'hidden': anySelected}"
:selected-count="selectedRows.length"
@click="askDeleteConfirmation({
deleted: [selectedRows],
deleted: selectedRows,
callback: () => deleteData(selectedRows),
})"
/>

</wt-table-actions>
</div>
</header>
Expand Down Expand Up @@ -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';
Expand All @@ -178,8 +178,6 @@ export default {
closeDelete,
} = useDeleteConfirmationPopup();
const { deleteData } = useTableStore(namespace);
return {
dummy,
isDeleteConfirmationPopup,
Expand All @@ -188,9 +186,9 @@ export default {
askDeleteConfirmation,
closeDelete,
deleteData,
};
},
data: () => ({
namespace,
isQueueSelectPopup: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/>

<delete-confirmation-popup
v-show="deleteConfirmation.isDeleteConfirmationPopup"
:delete-count="deleteConfirmation.deleteCount"
:callback="deleteConfirmation.callback"
v-show="isDeleteConfirmationPopup"
:delete-count="deleteCount"
:callback="deleteCallback"
@close="closeDelete"
/>

Expand All @@ -25,7 +25,10 @@
v-if="!disableUserInput"
:class="{'hidden': anySelected}"
:selected-count="selectedRows.length"
@click="callDelete(selectedRows)"
@click="askDeleteConfirmation({
deleted: selectedRows,
callback: () => deleteData(selectedRows),
})"
/>
<wt-icon-btn
v-if="!disableUserInput"
Expand Down Expand Up @@ -65,7 +68,10 @@
<wt-icon-action
action="delete"
class="table-action"
@click="callDelete(item)"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
Expand All @@ -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: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
/>

<delete-confirmation-popup
v-show="deleteConfirmation.isDeleteConfirmationPopup"
:delete-count="deleteConfirmation.deleteCount"
:callback="deleteConfirmation.callback"
v-show="isDeleteConfirmationPopup"
:delete-count="deleteCount"
:callback="deleteCallback"
@close="closeDelete"
/>

Expand Down Expand Up @@ -172,7 +172,10 @@
<wt-icon-action
action="delete"
class="table-action"
@click="callDelete(item)"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
Expand Down Expand Up @@ -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',
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

<template #main>
<delete-confirmation-popup
v-show="deleteConfirmation.isDeleteConfirmationPopup"
:delete-count="deleteConfirmation.deleteCount"
:callback="deleteConfirmation.callback"
v-show="isDeleteConfirmationPopup"
:delete-count="deleteCount"
:callback="deleteCallback"
@close="closeDelete"
/>

Expand All @@ -38,7 +38,10 @@
v-if="hasDeleteAccess"
:class="{'hidden': anySelected}"
:selected-count="selectedRows.length"
@click="callDelete(selectedRows)"
@click="askDeleteConfirmation({
deleted: selectedRows,
callback: () => deleteData(selectedRows),
})"
/>
</wt-table-actions>
</div>
Expand Down Expand Up @@ -90,7 +93,10 @@
v-if="hasDeleteAccess"
action="delete"
class="table-action"
@click="callDelete(item)"
@click="askDeleteConfirmation({
deleted: [item],
callback: () => deleteData(item),
})"
/>
</template>
</wt-table>
Expand All @@ -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,
Expand Down
Loading

0 comments on commit 55cf49c

Please sign in to comment.