diff --git a/shell/components/nav/NamespaceFilter.vue b/shell/components/nav/NamespaceFilter.vue index ac104ed178..06be688dee 100644 --- a/shell/components/nav/NamespaceFilter.vue +++ b/shell/components/nav/NamespaceFilter.vue @@ -63,6 +63,9 @@ export default { return this.$store.getters[`${ this.currentProduct.inStore }/paginationEnabled`](this.$route.params?.resource) ? paginationUtils.validNsProjectFilters : null; }, + /** + * Create visible options (filtered version of `options`) + */ filtered() { let out = this.options; @@ -142,6 +145,9 @@ export default { return createNamespaceFilterKey(this.$store.getters['clusterId'], this.currentProduct); }, + /** + * Create options (see `filtered` for visible collection) + */ options() { const t = this.$store.getters['i18n/t']; let out = []; @@ -341,6 +347,11 @@ export default { }) .filter((x) => !!x); + if (filters.length !== values.length) { + // filter has changed, ensure we persist these to store + this.value = filters; + } + return filters; }, @@ -401,7 +412,7 @@ export default { * * This is caused by churn of the filtered and options computed properties causing multiple renders for each action. * - * To break this multiple-render per cycle behaviour detatch `filtered` from the value used in `v-for`. + * To break this multiple-render per cycle behaviour detach `filtered` from the value used in `v-for`. * */ filtered(neu) { diff --git a/shell/plugins/dashboard-store/actions.js b/shell/plugins/dashboard-store/actions.js index 051108a7dd..0a96b02faa 100644 --- a/shell/plugins/dashboard-store/actions.js +++ b/shell/plugins/dashboard-store/actions.js @@ -413,6 +413,7 @@ export default { async findPage(ctx, { type, opt }) { const { getters, commit, dispatch } = ctx; + // of type @ActionFindPageArgs opt = opt || {}; if (!opt.pagination) { @@ -444,7 +445,7 @@ export default { return findAllGetter(getters, type, opt); } - console.log(`Find Page: [${ ctx.state.config.namespace }] ${ type }. Page: ${ opt.pagination.page }. Size: ${ opt.pagination.pageSize }`); // eslint-disable-line no-console + console.log(`Find Page: [${ ctx.state.config.namespace }] ${ type }. Page: ${ opt.pagination.page }. Size: ${ opt.pagination.pageSize }. Sort: ${ opt.pagination.sort.map((s) => s.field).join(', ') }`); // eslint-disable-line no-console opt = opt || {}; opt.url = getters.urlFor(type, null, opt); diff --git a/shell/plugins/steve/subscribe.js b/shell/plugins/steve/subscribe.js index 50b8f9407a..11b3f07ad2 100644 --- a/shell/plugins/steve/subscribe.js +++ b/shell/plugins/steve/subscribe.js @@ -755,6 +755,7 @@ const defaultActions = { if (mode === STEVE_WATCH_MODE.RESOURCE_CHANGES) { // Other findX use options (id/ns/selector) from the messages received over socket. // However paginated requests have more complex params so grab them from store from the store. + // of type @StorePagination const storePagination = getters['havePage'](resourceType); if (!!storePagination) {