Bug 38201: Radio FormElement follow-up

(cherry picked from commit 7e645f19fc3567bcbc2476ad1b4d21205282c4b6)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-04-10 08:49:20 +00:00 committed by Lucas Gass
parent 759fe80c76
commit 80da5e3d8a
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 22 additions and 32 deletions

View File

@ -42,14 +42,21 @@
/>
</template>
<template v-else-if="attr.type == 'radio'">
<input
type="radio"
:name="attr.name"
:id="getElementId"
:value="attr.value"
v-model="resource[attr.name]"
@change="attr.onChange && attr.onChange(resource)"
/>
<template v-for="option in attr.options">
<label
v-if="option.description"
:for="attr.name + '_' + option.value"
>{{ option.description }}:</label
>
<input
type="radio"
:name="option.description"
:id="attr.name + '_' + option.value"
:value="option.value"
v-model="resource[attr.name]"
@change="attr.onChange && attr.onChange(resource)"
/>
</template>
</template>
<template v-else-if="attr.type == 'boolean'">
<label class="radio" :for="getElementId + '_yes'"

View File

@ -238,32 +238,15 @@ export default {
getTableFilters() {
return [
{
id: "all_status_filter",
id: "status_filter",
name: "status_filter",
type: "radio",
label: __("All"),
value: "",
},
{
id: "closed_status_filter",
name: "status_filter",
type: "radio",
label: __("Closed"),
value: "closed",
},
{
id: "sent_status_filter",
name: "status_filter",
type: "radio",
label: __("Sent"),
value: "sent",
},
{
id: "received_status_filter",
name: "status_filter",
type: "radio",
label: __("Received"),
value: "received",
options: [
{ value: "all", description: __("All") },
{ value: "closed", description: _("Closed") },
{ value: "sent", description: __("Sent") },
{ value: "received", description: __("Received") },
],
},
];
},