fix(checkbox): inverse global prep values for apps (#3547)

This commit is contained in:
Lukas Senionis 2025-01-17 15:24:49 +02:00 committed by GitHub
parent fb557df270
commit 1c2d7ec830
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,10 @@ const props = defineProps({
type: String,
default: "missing-prefix"
},
inverseValues: {
type: Boolean,
default: false,
},
default: {
type: undefined,
default: null,
@ -79,7 +83,9 @@ const checkboxValues = (() => {
return ["true", "false"];
})();
return { truthy: mappedValues[0], falsy: mappedValues[1] };
const truthyIndex = props.inverseValues ? 1 : 0;
const falsyIndex = props.inverseValues ? 0 : 1;
return { truthy: mappedValues[truthyIndex], falsy: mappedValues[falsyIndex] };
})();
const parsedDefaultPropValue = (() => {
const boolValues = mapToBoolRepresentation(props.default);

View File

@ -122,6 +122,7 @@
desc="apps.global_prep_desc"
v-model="editForm['exclude-global-prep-cmd']"
default="true"
inverse-values
></Checkbox>
<div class="mb-3">
<label for="appName" class="form-label">{{ $t('apps.cmd_prep_name') }}</label>