Merge branch 'feature-77978/Renew_52546_and_53902'

This commit is contained in:
Harald Bamberger
2026-07-23 08:01:44 +02:00
+17 -3
View File
@@ -4,6 +4,7 @@ import FormInput from '../Form/Input.js';
import ApiUdf from '../../api/udf.js';
export default {
name: 'CoreUdfCmpt',
components: {
CoreFetchCmpt,
FormInput
@@ -26,7 +27,8 @@ export default {
// The values as associative array
modelValue: Object,
// Show only fields with a name that exists in the filter
filter: [String, Array]
filter: [String, Array],
readonly: true
},
data() {
return {
@@ -35,6 +37,13 @@ export default {
};
},
computed: {
isPkValid() {
// If the provided pk is _not_ valid
return !Object.keys(this.pk).every(key => !this.pk[key]);
},
getReadonly() {
return this.readonly;
},
filterArray() {
if (!this.filter || Array.isArray(this.filter))
return this.filter;
@@ -61,6 +70,10 @@ export default {
},
watch: {
pk(n, o) {
// If the provided pk is _not_ valid
if (Object.keys(n).every(key => !n[key])) return;
if (!this.$refs.fetch)
return; // NOTE(chris): no initial load yet
@@ -124,6 +137,7 @@ export default {
template: `
<div class="core-udf row">
<core-fetch-cmpt
v-if="isPkValid"
ref="fetch"
:api-function="loadF"
:api-function-parameters="{ ciModel, pk }"
@@ -138,7 +152,7 @@ export default {
:type="field.type"
:multiple="field.multiple"
:title="field.description"
:disabled="field.disabled"
:disabled="field.disabled || getReadonly"
:clearable="field.clearable"
:auto-apply="field.autoApply"
:enable-time-picker="field.enableTimePicker"
@@ -152,4 +166,4 @@ export default {
</template>
</core-fetch-cmpt>
</div>`
}
}