From e448505b3c9bee81d472a8c6390d729c0546b389 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Fri, 4 Nov 2022 16:51:00 +0000 Subject: [PATCH] Fixes following review - Ensure that the correct threshold if fetched from config (was previously always enabled) - Don't pass additional `namespace` value to `loadDataPage` --- shell/mixins/resource-fetch.js | 2 +- shell/plugins/dashboard-store/actions.js | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/shell/mixins/resource-fetch.js b/shell/mixins/resource-fetch.js index 33041da270..85d8ad7ff9 100644 --- a/shell/mixins/resource-fetch.js +++ b/shell/mixins/resource-fetch.js @@ -45,7 +45,7 @@ export default { // force ns filtering forceNsFilter: { ...perfConfig.forceNsFilter, - threshold: parseInt(this.perfConfig?.incrementalLoading?.threshold || '0', 10) + threshold: parseInt(perfConfig?.forceNsFilter?.threshold || '0', 10) } }; }, diff --git a/shell/plugins/dashboard-store/actions.js b/shell/plugins/dashboard-store/actions.js index 18cf96b554..c36bce2da4 100644 --- a/shell/plugins/dashboard-store/actions.js +++ b/shell/plugins/dashboard-store/actions.js @@ -80,7 +80,7 @@ export default { // Load a page of data for a given type // Used for incremental loading when enabled - async loadDataPage(ctx, { type, opt, namespace }) { + async loadDataPage(ctx, { type, opt }) { const { getters, commit, dispatch } = ctx; type = getters.normalizeType(type); @@ -110,16 +110,15 @@ export default { opt: { ...opt, url: res.pagination?.next - }, - namespace + } }); } else { // We have everything! if (opt.hasManualRefresh) { dispatch('resource-fetch/updateManualRefreshIsLoading', false, { root: true }); } - if (namespace) { - commit('setHaveNamespace', { type, namespace }); + if (opt.namespaced) { + commit('setHaveNamespace', { type, namespace: opt.namespaced }); } else { commit('setHaveAll', { type }); } @@ -213,9 +212,7 @@ export default { commit('forgetType', type); } - dispatch('loadDataPage', { - type, opt: pageFetchOpts, namespace: opt.namespaced - }); + dispatch('loadDataPage', { type, opt: pageFetchOpts }); } let streamStarted = false;