diff --git a/public/js/components/Udf/Udf.js b/public/js/components/Udf/Udf.js index c765d8a14..cfb5384c8 100644 --- a/public/js/components/Udf/Udf.js +++ b/public/js/components/Udf/Udf.js @@ -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: `
` -} \ No newline at end of file +}