Skip to content

Commit

Permalink
fix: add reset selected value when changing filters[WTEL-5744](https:…
Browse files Browse the repository at this point in the history
  • Loading branch information
Lera24 committed Dec 18, 2024
1 parent b771ae3 commit ff23cd8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</template>

<script setup>
import { computed, onUnmounted } from 'vue';
import { computed, onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useStore } from 'vuex';
Expand Down Expand Up @@ -164,6 +164,7 @@ const {
const {
namespace: filtersNamespace,
filtersValue,
restoreFilters,
subscribe,
Expand Down Expand Up @@ -206,11 +207,18 @@ const {
const refresh = () => {
// https://webitel.atlassian.net/browse/WTEL-5711
// because 'selected' needs to be updated [WTEL-5711]
// because 'selected' value needs cleaned
resetState();
loadData();
};
watch(() => filtersValue.value, () => {
// https://webitel.atlassian.net/browse/WTEL-5744
// because 'selected' value needs cleaned when changing filters
resetState();
});
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import FilterPagination from '@webitel/ui-sdk/src/modules/Filters/components/fil
import { useTableFilters } from '@webitel/ui-sdk/src/modules/Filters/composables/useTableFilters.js';
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 { onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import IconAction from '@webitel/ui-sdk/src/enums/IconAction/IconAction.enum.js';
Expand Down Expand Up @@ -173,6 +173,7 @@ const {
const {
namespace: filtersNamespace,
filtersValue,
restoreFilters,
subscribe,
Expand Down Expand Up @@ -208,12 +209,18 @@ const {
const refresh = () => {
// https://webitel.atlassian.net/browse/WTEL-5711
// because 'selected' needs to be updated [WTEL-5711]
// because 'selected' value needs cleaned
resetState();
loadData();
};
watch(() => filtersValue.value, () => {
// https://webitel.atlassian.net/browse/WTEL-5744
// because 'selected' value needs cleaned when changing filters
resetState();
});
</script>

<style lang="scss" scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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 { computed, onUnmounted } from 'vue';
import { computed, onUnmounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRouter } from 'vue-router';
import { useTableEmpty } from '@webitel/ui-sdk/src/modules/TableComponentModule/composables/useTableEmpty.js';
Expand Down Expand Up @@ -163,6 +163,7 @@ const {
const {
namespace: filtersNamespace,
filtersValue,
restoreFilters,
subscribe,
Expand Down Expand Up @@ -205,11 +206,18 @@ const {
const refresh = () => {
// https://webitel.atlassian.net/browse/WTEL-5711
// because 'selected' needs to be updated [WTEL-5711]
// because 'selected' value needs cleaned
resetState();
loadData();
};
watch(() => filtersValue.value, () => {
// https://webitel.atlassian.net/browse/WTEL-5744
// because 'selected' value needs cleaned when changing filters
resetState();
});
</script>

<style lang="scss" scoped>
Expand Down

0 comments on commit ff23cd8

Please sign in to comment.