View | Details | Raw Unified | Return to bug 41063
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/AdditionalFieldsEntry.vue (-7 / +6 lines)
Lines 125-131 Link Here
125
</template>
125
</template>
126
126
127
<script>
127
<script>
128
import { onBeforeMount, watch, ref } from "vue";
128
import { onBeforeMount, watch, ref, reactive } from "vue";
129
import { APIClient } from "../fetch/api-client.js";
129
import { APIClient } from "../fetch/api-client.js";
130
130
131
export default {
131
export default {
Lines 133-139 export default { Link Here
133
        const initialized = ref(false);
133
        const initialized = ref(false);
134
        const available_fields = ref([]);
134
        const available_fields = ref([]);
135
        const av_options = ref([]);
135
        const av_options = ref([]);
136
        const current_additional_fields_values = ref({});
136
        const current_additional_fields_values = reactive({});
137
137
138
        onBeforeMount(() => {
138
        onBeforeMount(() => {
139
            const client = APIClient.additional_fields;
139
            const client = APIClient.additional_fields;
Lines 154-160 export default { Link Here
154
        };
154
        };
155
        const cloneField = (available_field, current, event) => {
155
        const cloneField = (available_field, current, event) => {
156
            event.preventDefault();
156
            event.preventDefault();
157
            current_additional_fields_values.value[
157
            current_additional_fields_values[
158
                available_field.extended_attribute_type_id
158
                available_field.extended_attribute_type_id
159
            ].push({
159
            ].push({
160
                value: current.value,
160
                value: current.value,
Lines 231-237 export default { Link Here
231
                        // Iterate on available fields
231
                        // Iterate on available fields
232
                        newValue.forEach(available_field => {
232
                        newValue.forEach(available_field => {
233
                            // Initialize current field as empty array
233
                            // Initialize current field as empty array
234
                            current_additional_fields_values.value[
234
                            current_additional_fields_values[
235
                                available_field.extended_attribute_type_id
235
                                available_field.extended_attribute_type_id
236
                            ] = [];
236
                            ] = [];
237
237
Lines 264-270 export default { Link Here
264
                                                ? av_value[0].label
264
                                                ? av_value[0].label
265
                                                : "";
265
                                                : "";
266
                                        }
266
                                        }
267
                                        current_additional_fields_values.value[
267
                                        current_additional_fields_values[
268
                                            existing_field_value.field_id
268
                                            existing_field_value.field_id
269
                                        ].push({
269
                                        ].push({
270
                                            value: existing_field_value.value,
270
                                            value: existing_field_value.value,
Lines 278-284 export default { Link Here
278
                                if (
278
                                if (
279
                                    !available_field.authorised_value_category_name
279
                                    !available_field.authorised_value_category_name
280
                                ) {
280
                                ) {
281
                                    current_additional_fields_values.value[
281
                                    current_additional_fields_values[
282
                                        available_field.extended_attribute_type_id
282
                                        available_field.extended_attribute_type_id
283
                                    ] = [
283
                                    ] = [
284
                                        {
284
                                        {
285
- 

Return to bug 41063