Fix dupe inStore

- remove from resource list, put in resource-fetch (used also by pag res table)
This commit is contained in:
Richard Cox 2024-12-03 10:14:56 +00:00
parent f1858b6f02
commit 96b6b9abd7
3 changed files with 10 additions and 7 deletions

View File

@ -96,11 +96,9 @@ export default {
const showMasthead = getters[`type-map/optionsFor`](resource).showListMasthead;
return {
inStore,
schema,
hasListComponent,
showMasthead: showMasthead === undefined ? true : showMasthead,
resource,
extensionType: ExtensionPoint.PANEL,
extensionLocation: PanelLocation.RESOURCE_LIST,
loadResources: [resource], // List of resources that will be loaded, this could be many (`Workloads`)

View File

@ -213,10 +213,6 @@ export default {
showDynamicRancherNamespaces() {
return this.$store.getters['prefs/get'](ALL_NAMESPACES);
},
inStore() {
return this.$store.getters['currentStore'](this.resource) || this.currentProduct?.inStore;
}
},
watch: {

View File

@ -31,11 +31,18 @@ export default {
perfConfig = DEFAULT_PERF_SETTING;
}
// Normally owner components supply `resource` and `inStore` as part of their data, however these are needed here before parent data runs
// So set up both here
const params = { ...this.$route.params };
const resource = params.resource || this.schema.id; // Resource can either be on a page showing single list, or a page of a resource showing a list of another resource
const inStore = this.$store.getters['currentStore'](resource);
return {
inStore,
perfConfig,
init: false,
multipleResources: [],
loadResources: [this.resource],
loadResources: [resource],
// manual refresh vars
hasManualRefresh: false,
watch: true,
@ -72,6 +79,7 @@ export default {
computed: {
...mapGetters({ refreshFlag: 'resource-fetch/refreshFlag' }),
rows() {
const currResource = this.fetchedResourceType.find((item) => item.type === this.resource);
@ -92,6 +100,7 @@ export default {
return [];
},
loading() {
if (this.canPaginate) {
return this.paginating;