diff --git a/meta_configurator/src/components/panels/schema-diagram/SchemaObjectAttribute.vue b/meta_configurator/src/components/panels/schema-diagram/SchemaObjectAttribute.vue index cafb568b5..68f5c0274 100644 --- a/meta_configurator/src/components/panels/schema-diagram/SchemaObjectAttribute.vue +++ b/meta_configurator/src/components/panels/schema-diagram/SchemaObjectAttribute.vue @@ -15,6 +15,7 @@ import { import Button from 'primevue/button'; import {FontAwesomeIcon} from '@fortawesome/vue-fontawesome'; import {useSettings} from '@/settings/useSettings'; +import {doesSchemaAllowNull} from '@/schema/schemaReadingUtils'; const settings = useSettings(); @@ -42,6 +43,11 @@ const emit = defineEmits<{ attributeData: SchemaObjectAttributeData, required: boolean ): void; + ( + e: 'update_attribute_nullable', + attributeData: SchemaObjectAttributeData, + nullable: boolean + ): void; (e: 'delete_element', objectData: SchemaElementData): void; }>(); @@ -49,6 +55,10 @@ function updateRequired() { emit('update_attribute_required', props.data, props.data.required); } +function updateNullable(event: Event) { + emit('update_attribute_nullable', props.data, (event.target as HTMLInputElement).checked); +} + const attrName = ref(props.data.name); const selectedType: Ref = ref( determineTypeChoiceBySchema(props.typeChoices, props.data.schema) @@ -83,6 +93,10 @@ function isHighlighted() { return props.selectedData && props.selectedData == props.data; } +function isNullable() { + return doesSchemaAllowNull(props.data.schema); +} + function getHandleId() { return `source-${props.data.name}`; } @@ -122,9 +136,11 @@ function getHandleTop() {
+ +