Fix custom component loading

This commit is contained in:
Vincent Fiduccia 2020-03-13 15:29:47 -07:00
parent e67c77dcc6
commit ebed7576d8
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582
4 changed files with 26 additions and 18 deletions

View File

@ -128,7 +128,11 @@ export default {
},
data() {
return { currentValue: this.value };
return {
currentValue: this.value,
detailComponent: this.$store.getters['type-map/importDetail'](this.resource),
editComponent: this.$store.getters['type-map/importEdit'](this.resource),
};
},
computed: {
@ -164,9 +168,9 @@ export default {
showComponent() {
if ( this.isView && this.hasCustomDetail ) {
return this.$store.getters['type-map/importDetail'](this.resource);
return this.detailComponent;
} else if ( !this.isView && this.hasCustomEdit ) {
return this.$store.getters['type-map/importEdit'](this.resource);
return this.editComponent;
}
return null;

View File

@ -228,11 +228,13 @@ export default {
availableActions() {
return this.$store.getters[`${ this.storeName }/forTable`];
},
...mapState({
tableSelected(state) {
return state[this.storeName].tableSelected;
}
}),
classObject() {
return {
'top-divider': this.topDivider, 'emphasized-body': this.emphasizedBody, 'body-dividers': this.bodyDividers

View File

@ -81,16 +81,17 @@ export default {
<hr />
</li>
<li v-else-if="child[childrenKey]" :key="child.name">
<Group
:key="child.name"
:depth="depth + 1"
:is-expanded="isExpanded"
:toggle-group="toggleGroup"
:children-key="childrenKey"
:can-collapse="canCollapse"
:id-prefix="id+'_'"
:group="child"
/>
<ul class="list-unstyled m-0">
<Group
:key="child.name"
:depth="depth + 1"
:is-expanded="isExpanded"
:children-key="childrenKey"
:can-collapse="canCollapse"
:id-prefix="id+'_'"
:group="child"
/>
</ul>
</li>
<Type
v-else

View File

@ -3,6 +3,11 @@ import ResourceTable from '@/components/ResourceTable';
export default {
components: { ResourceTable },
data() {
return { listComponent: this.$store.getters['type-map/importList'](this.resource) };
},
computed: {
schema() {
return this.$store.getters['cluster/schemaFor'](this.resource);
@ -16,10 +21,6 @@ export default {
return this.$store.getters['type-map/hasCustomList'](this.resource);
},
showComponent() {
return this.$store.getters['type-map/importList'](this.resource);
},
typeDisplay() {
return this.$store.getters['type-map/pluralLabelFor'](this.schema);
},
@ -53,7 +54,7 @@ export default {
</header>
<div v-if="hasComponent">
<component
:is="showComponent"
:is="listComponent"
:schema="schema"
:rows="rows"
:headers="headers"