diff --git a/package-lock.json b/package-lock.json index d07bfc74..01dff006 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@vuelidate/core": "^2.0.3", "@vuelidate/validators": "^2.0.4", "@vueuse/core": "^11.0.3", - "@webitel/ui-sdk": "^24.12.20", + "@webitel/ui-sdk": "^24.12.22", "axios": "^1.7.7", "deep-equal": "^2.2.1", "dompurify": "^3.1.2", @@ -2073,9 +2073,9 @@ } }, "node_modules/@webitel/ui-sdk": { - "version": "24.12.20", - "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.12.20.tgz", - "integrity": "sha512-fG3dL65yS2/EY9NUw/6VhiUWqj3bEg1Aq7KU3rfEowVlYRA/wLiA7ak02kfZciWhItpVhd9WNJ119z8rrb73BQ==", + "version": "24.12.22", + "resolved": "https://registry.npmjs.org/@webitel/ui-sdk/-/ui-sdk-24.12.22.tgz", + "integrity": "sha512-wtkvXL+Qi0rHGpI8VI07BnE8JkaFRQscnE3/kBd9m+DNuoyb46br7ogh0VmtOt+2OHcWMYDIycr4XpbJ3/mpyg==", "dependencies": { "@floating-ui/vue": "^1.1.5", "@morev/vue-transitions": "^3.0.5", diff --git a/package.json b/package.json index 2fa2d5dc..a052a61b 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@vuelidate/core": "^2.0.3", "@vuelidate/validators": "^2.0.4", "@vueuse/core": "^11.0.3", - "@webitel/ui-sdk": "^24.12.20", + "@webitel/ui-sdk": "^24.12.22", "axios": "^1.7.7", "deep-equal": "^2.2.1", "dompurify": "^3.1.2", diff --git a/src/modules/configuration/modules/lookups/modules/slas/components/the-slas.vue b/src/modules/configuration/modules/lookups/modules/slas/components/the-slas.vue index 1751b58c..78313222 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/components/the-slas.vue +++ b/src/modules/configuration/modules/lookups/modules/slas/components/the-slas.vue @@ -122,7 +122,7 @@ import FilterPagination from '@webitel/ui-sdk/src/modules/Filters/components/fil import DeleteConfirmationPopup from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; import { useTableFilters } from '@webitel/ui-sdk/src/modules/Filters/composables/useTableFilters.js'; -import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore.js'; +import { useTableStore } from '@webitel/ui-sdk/src/store/new/modules/tableStoreModule/useTableStore.js'; import { useTableEmpty } from '@webitel/ui-sdk/src/modules/TableComponentModule/composables/useTableEmpty.js'; import filters from '../modules/filters/store/filters.js'; @@ -159,6 +159,7 @@ const { sort, setSelected, onFilterEvent, + resetState, } = useTableStore(baseNamespace); const { @@ -178,6 +179,7 @@ restoreFilters(); onUnmounted(() => { flushSubscribers(); + resetState(); }); const path = computed(() => [ diff --git a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-conditions.vue b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-conditions.vue index a4122f2e..408444b8 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-conditions.vue +++ b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/components/opened-sla-conditions.vue @@ -121,7 +121,8 @@ import { } from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/composables/useDeleteConfirmationPopup'; import FilterPagination from '@webitel/ui-sdk/src/modules/Filters/components/filter-pagination.vue'; import { useTableFilters } from '@webitel/ui-sdk/src/modules/Filters/composables/useTableFilters.js'; -import { useCardStore, useTableStore } from '@webitel/ui-sdk/store'; +import { useCardStore } from '@webitel/ui-sdk/store'; +import { useTableStore } from '@webitel/ui-sdk/src/store/new/modules/tableStoreModule/useTableStore.js'; import { onUnmounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute, useRouter } from 'vue-router'; @@ -166,6 +167,7 @@ const { sort, setSelected, onFilterEvent, + resetState, } = useTableStore(namespace); const { @@ -185,6 +187,7 @@ restoreFilters(); onUnmounted(() => { flushSubscribers(); + resetState(); }); const { diff --git a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js index d9c82f03..ddfe6b16 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js +++ b/src/modules/configuration/modules/lookups/modules/slas/modules/conditions/store/conditions.js @@ -8,7 +8,16 @@ import ConditionsAPI from '../api/conditions.js'; import filters from '../modules/filters/store/filters.js'; import headers from './_internals/headers.js'; -const resettableItemState = { +const resetTableState = { + dataList: [], + selected: [], + error: {}, + isLoading: false, + isNextPage: false, +}; + +const resetCardState = { + itemId: '', itemInstance: { }, }; @@ -26,6 +35,7 @@ const api = createApiStoreModule({ const table = createTableStoreModule({ state: { headers, + _resettable: resetTableState, }, getters, modules: { @@ -35,7 +45,7 @@ const table = createTableStoreModule({ }); const card = createCardStoreModule({ - state: { _resettable: resettableItemState }, + state: { _resettable: resetCardState }, getters, modules: { api, diff --git a/src/modules/configuration/modules/lookups/modules/slas/store/slas.js b/src/modules/configuration/modules/lookups/modules/slas/store/slas.js index 160041a4..5f270436 100644 --- a/src/modules/configuration/modules/lookups/modules/slas/store/slas.js +++ b/src/modules/configuration/modules/lookups/modules/slas/store/slas.js @@ -9,7 +9,16 @@ import headers from './_internals/headers'; import filters from '../modules/filters/store/filters'; import conditions from '../modules/conditions/store/conditions'; -const resettableState = { +const resetTableState = { + dataList: [], + selected: [], + error: {}, + isLoading: false, + isNextPage: false, +}; + +const resetCardState = { + itemId: '', itemInstance: { name: '', description: '', @@ -28,9 +37,7 @@ const api = createApiStoreModule({ }); const table = createTableStoreModule({ - state: { - headers, - }, + state: { _resettable: resetTableState, headers }, modules: { filters, api, @@ -38,7 +45,7 @@ const table = createTableStoreModule({ }); const card = createCardStoreModule({ - state: { _resettable: resettableState }, + state: { _resettable: resetCardState }, modules: { api, conditions, diff --git a/src/modules/configuration/modules/lookups/modules/sources/components/the-sources.vue b/src/modules/configuration/modules/lookups/modules/sources/components/the-sources.vue index 60b0ce71..e2e10300 100644 --- a/src/modules/configuration/modules/lookups/modules/sources/components/the-sources.vue +++ b/src/modules/configuration/modules/lookups/modules/sources/components/the-sources.vue @@ -120,11 +120,11 @@ import FilterPagination from '@webitel/ui-sdk/src/modules/Filters/components/fil import DeleteConfirmationPopup from '@webitel/ui-sdk/src/modules/DeleteConfirmationPopup/components/delete-confirmation-popup.vue'; import { useTableFilters } from '@webitel/ui-sdk/src/modules/Filters/composables/useTableFilters.js'; -import { useTableStore } from '@webitel/ui-sdk/src/modules/TableStoreModule/composables/useTableStore.js'; import { computed, onUnmounted } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRouter } from 'vue-router'; import { useTableEmpty } from '@webitel/ui-sdk/src/modules/TableComponentModule/composables/useTableEmpty.js'; +import { useTableStore } from '@webitel/ui-sdk/src/store/new/modules/tableStoreModule/useTableStore.js'; import filters from '../modules/filters/store/filters.js'; const baseNamespace = 'configuration/lookups/sources'; @@ -158,6 +158,7 @@ const { sort, setSelected, onFilterEvent, + resetState, } = useTableStore(baseNamespace); const { @@ -177,6 +178,7 @@ restoreFilters(); onUnmounted(() => { flushSubscribers(); + resetState(); }); const path = computed(() => [ diff --git a/src/modules/configuration/modules/lookups/modules/sources/store/sources.js b/src/modules/configuration/modules/lookups/modules/sources/store/sources.js index 790d650d..ae284ca4 100644 --- a/src/modules/configuration/modules/lookups/modules/sources/store/sources.js +++ b/src/modules/configuration/modules/lookups/modules/sources/store/sources.js @@ -8,7 +8,15 @@ import SourcesAPI from '../api/sources.js'; import headers from './_internals/headers'; import filters from '../modules/filters/store/filters'; -const resettableState = { +const resetTableState = { + dataList: [], + selected: [], + error: {}, + isLoading: false, + isNextPage: false, +}; + +const resetCardState = { itemInstance: { name: '', description: '', @@ -25,6 +33,7 @@ const api = createApiStoreModule({ const table = createTableStoreModule({ state: { headers, + _resettable: resetTableState, }, modules: { filters, @@ -33,7 +42,7 @@ const table = createTableStoreModule({ }); const card = createCardStoreModule({ - state: { _resettable: resettableState }, + state: { _resettable: resetCardState }, modules: { api, },