diff --git a/src/modals/metaData/AddMetaDataPropertyModal.vue b/src/modals/metaData/AddMetaDataPropertyModal.vue index 76422f44..9bd083e0 100644 --- a/src/modals/metaData/AddMetaDataPropertyModal.vue +++ b/src/modals/metaData/AddMetaDataPropertyModal.vue @@ -18,15 +18,13 @@ import { navigationStore, metadataStore } from '../../store/store.js'
- + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + Default waarde + + + + @@ -161,6 +267,8 @@ import { NcInputField, NcNoteCard, NcLoadingIcon, + NcDateTimePicker, + NcTextArea, } from '@nextcloud/vue' // icons @@ -177,6 +285,8 @@ export default { NcButton, NcNoteCard, NcLoadingIcon, + NcDateTimePicker, + NcTextArea, }, data() { return { @@ -203,7 +313,7 @@ export default { maxItems: 0, }, typeOptions: { - inputLabel: 'Type', + inputLabel: 'Type*', multiple: false, options: ['string', 'number', 'integer', 'object', 'array', 'boolean', 'dictionary'], }, @@ -218,6 +328,22 @@ export default { hasUpdated: false, } }, + computed: { + metadataProperty() { + return Object.assign({}, this.properties) + }, + }, + watch: { + metadataProperty: { + deep: true, + handler(newVal, oldVal) { + if (newVal.type !== oldVal.type) { + if (newVal.type === 'boolean') this.properties.default = false + if (newVal.type !== 'boolean' && oldVal.type === 'boolean') this.properties.default = '' + } + }, + }, + }, methods: { addMetadata() { this.loading = true diff --git a/src/modals/metaData/EditMetaDataPropertyModal.vue b/src/modals/metaData/EditMetaDataPropertyModal.vue index 0236d4cc..754b48ed 100644 --- a/src/modals/metaData/EditMetaDataPropertyModal.vue +++ b/src/modals/metaData/EditMetaDataPropertyModal.vue @@ -23,7 +23,7 @@ import { navigationStore, metadataStore } from '../../store/store.js'
@@ -43,7 +43,115 @@ import { navigationStore, metadataStore } from '../../store/store.js' label="Patroon (regex)" :value.sync="metadata.properties[metadataStore.metadataDataKey].pattern" /> - + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + Default waarde + + + + @@ -122,8 +230,8 @@ import { navigationStore, metadataStore } from '../../store/store.js'
-