Skip to content

Commit

Permalink
fix: BooleanGroup options changed
Browse files Browse the repository at this point in the history
  • Loading branch information
staylorwr committed Oct 19, 2021
1 parent 5701784 commit 189027e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions assets/src/components/Detail/BooleanGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
:class="{ 'bg-success': option.checked, 'bg-danger': !option.checked }"
class="inline-block rounded-full w-2 h-2 mr-1"
/>
<span>{{ option.key }}</span>
<span>{{ option.value }}</span>
</li>
</ul>
<span v-else>{{ field.options.no_value || "No Data" }}</span>
Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
return {
key: option.key,
value: option.value,
checked: this.field.value[option.value] || false
checked: this.field.value[option.key] || false
};
});
},
Expand Down
6 changes: 3 additions & 3 deletions assets/src/components/Form/BooleanGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:checked="option.checked"
@change="toggle($event, option)"
>
{{ option.key }}
{{ option.value }}
</checkbox-with-label>
</template>
</default-field>
Expand All @@ -34,7 +34,7 @@ export default {
*/
finalPayload () {
return _(this.value)
.map((o) => [ o.value, o.checked ])
.map((o) => [ o.key, o.checked ])
.fromPairs()
.value();
},
Expand All @@ -51,7 +51,7 @@ export default {
return {
key: option.key,
value: option.value,
checked: this.field.value[option.value] || false,
checked: this.field.value[option.key] || false,
};
});
},
Expand Down
5 changes: 2 additions & 3 deletions assets/src/components/Form/DefaultField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,15 @@ export default {
props: {
field: { type: Object, required: true },
fieldName: { type: String, default: '' },
showHelpText: { type: Boolean, default: true }
fieldName: { type: String, default: '' }
},
computed: {
helpText () {
return this.field.options.help_text;
},
canShowHelpText () {
return this.showHelpText && this.helpText;
return this.helpText != null;
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions assets/src/components/Index/BooleanGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
width="20"
height="20"
/>
<span class="ml-1">{{ option.key }}</span>
<span class="ml-1">{{ option.value }}</span>
</span>
</li>
</ul>
Expand Down Expand Up @@ -58,7 +58,7 @@ export default {
return {
key: option.key,
value: option.value,
checked: this.field.value[option.value] || false
checked: this.field.value[option.key] || false
};
});
}
Expand Down

0 comments on commit 189027e

Please sign in to comment.