Skip to content

Commit

Permalink
[5.x] Fix save button options not showing (#10633)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean authored Aug 15, 2024
1 parent 0717b25 commit e1629e3
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
12 changes: 8 additions & 4 deletions resources/js/components/fieldtypes/ArrayFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<select class="bg-transparent appearance-none shadow-none outline-none border-0 text-sm" @input="setKey($event.target.value)">
<option
v-for="(element, index) in keyedData"
v-text="meta.keys[element.key] || element.key"
v-text="keys[element.key] || element.key"
:key="element._id"
:value="element.key"
:selected="element.key === selectedKey" />
Expand All @@ -29,7 +29,7 @@
<table class="array-table">
<tbody>
<tr v-if="data" v-for="(element, index) in keyedData" :key="element._id">
<th class="w-1/4"><label :for="fieldId+'__'+element.key">{{ meta.keys[element.key] || element.key }}</label></th>
<th class="w-1/4"><label :for="fieldId+'__'+element.key">{{ keys[element.key] || element.key }}</label></th>
<td>
<input type="text" class="input-text-minimal" :id="fieldId+'__'+element.key" v-model="data[index].value" :readonly="isReadOnly" />
</td>
Expand Down Expand Up @@ -129,8 +129,12 @@ export default {
},
computed: {
keys() {
return this.meta.keys || this.config.keys;
},
isKeyed() {
return Boolean(Object.keys(this.meta.keys).length);
return Boolean(Object.keys(this.keys).length);
},
isDynamic() {
Expand All @@ -142,7 +146,7 @@ export default {
},
keyedData() {
return this.data.filter(element => this.meta.keys.hasOwnProperty(element.key));
return this.data.filter(element => this.keys.hasOwnProperty(element.key));
},
maxItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default {
computed: {
options() {
return this.normalizeInputOptions(this.meta.options);
return this.normalizeInputOptions(this.meta.options || this.config.options);
},
replicatorPreview() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/CheckboxesFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default {
computed: {
options() {
return this.normalizeInputOptions(this.meta.options);
return this.normalizeInputOptions(this.meta.options || this.config.options);
},
replicatorPreview() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/RadioFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default {
computed: {
options() {
return this.normalizeInputOptions(this.meta.options);
return this.normalizeInputOptions(this.meta.options || this.config.options);
},
replicatorPreview() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/SelectFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default {
},
options() {
return this.normalizeInputOptions(this.meta.options);
return this.normalizeInputOptions(this.meta.options || this.config.options);
},
replicatorPreview() {
Expand Down

0 comments on commit e1629e3

Please sign in to comment.