Skip to content

Commit

Permalink
Merge pull request #92 from ConductionNL/development
Browse files Browse the repository at this point in the history
Dev to main
  • Loading branch information
bbrands02 authored Dec 5, 2024
2 parents 2332739 + a83b851 commit 63edc7d
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/modals/schema/EditSchemaProperty.vue
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,19 @@ import { navigationStore, schemaStore } from '../../store/store.js'
type: array
</h5>

<div class="ASP-selectContainer">
<NcSelect v-bind="itemsTypeOptions"
v-model="properties.items.type" />
</div>

<!-- type array and sub type object only -->
<div v-if="properties.items.type === 'object'">
<NcInputField :disabled="loading"
type="string"
label="Schema reference of object ($ref)"
:value.sync="properties.items.$ref" />
</div>

<NcInputField :disabled="loading"
type="number"
label="Minimum number of items"
Expand Down Expand Up @@ -313,11 +326,21 @@ export default {
exclusiveMax: false,
minItems: 0,
maxItems: 0,
$ref: '',
items: {
$ref: '',
type: '',
},
},
typeOptions: {
inputLabel: 'Type*',
multiple: false,
options: ['string', 'number', 'integer', 'object', 'array', 'boolean', 'dictionary'],
options: ['string', 'number', 'integer', 'object', 'array', 'boolean', 'dictionary', 'file'],
},
itemsTypeOptions: {
inputLabel: 'Sub type',
multiple: false,
options: ['string', 'number', 'integer', 'object', 'boolean', 'dictionary', 'file'],
},
formatOptions: {
inputLabel: 'Format',
Expand Down Expand Up @@ -421,6 +444,10 @@ export default {
},
}
if (!newSchemaItem.properties[this.propertyTitle].items.$ref && !newSchemaItem[this.propertyTitle].items.type) {
delete newSchemaItem.properties[this.propertyTitle].items
}
if (!newSchemaItem?.id) {
this.success = false
this.error = 'Schema item could not be created, missing schema id'
Expand Down

0 comments on commit 63edc7d

Please sign in to comment.