Fixes following review

- Ensure that the correct threshold if fetched from config (was previously always enabled)
- Don't pass additional `namespace` value to `loadDataPage`
This commit is contained in:
Richard Cox 2022-11-04 16:51:00 +00:00
parent 75aa51fab9
commit e448505b3c
2 changed files with 6 additions and 9 deletions

View File

@ -45,7 +45,7 @@ export default {
// force ns filtering // force ns filtering
forceNsFilter: { forceNsFilter: {
...perfConfig.forceNsFilter, ...perfConfig.forceNsFilter,
threshold: parseInt(this.perfConfig?.incrementalLoading?.threshold || '0', 10) threshold: parseInt(perfConfig?.forceNsFilter?.threshold || '0', 10)
} }
}; };
}, },

View File

@ -80,7 +80,7 @@ export default {
// Load a page of data for a given type // Load a page of data for a given type
// Used for incremental loading when enabled // Used for incremental loading when enabled
async loadDataPage(ctx, { type, opt, namespace }) { async loadDataPage(ctx, { type, opt }) {
const { getters, commit, dispatch } = ctx; const { getters, commit, dispatch } = ctx;
type = getters.normalizeType(type); type = getters.normalizeType(type);
@ -110,16 +110,15 @@ export default {
opt: { opt: {
...opt, ...opt,
url: res.pagination?.next url: res.pagination?.next
}, }
namespace
}); });
} else { } else {
// We have everything! // We have everything!
if (opt.hasManualRefresh) { if (opt.hasManualRefresh) {
dispatch('resource-fetch/updateManualRefreshIsLoading', false, { root: true }); dispatch('resource-fetch/updateManualRefreshIsLoading', false, { root: true });
} }
if (namespace) { if (opt.namespaced) {
commit('setHaveNamespace', { type, namespace }); commit('setHaveNamespace', { type, namespace: opt.namespaced });
} else { } else {
commit('setHaveAll', { type }); commit('setHaveAll', { type });
} }
@ -213,9 +212,7 @@ export default {
commit('forgetType', type); commit('forgetType', type);
} }
dispatch('loadDataPage', { dispatch('loadDataPage', { type, opt: pageFetchOpts });
type, opt: pageFetchOpts, namespace: opt.namespaced
});
} }
let streamStarted = false; let streamStarted = false;