From 6eb2977568987b9440b62ae7dbd7183338bfcc9b Mon Sep 17 00:00:00 2001 From: Fabio Di Stasio Date: Mon, 19 Apr 2021 11:07:29 +0200 Subject: [PATCH] fix(UI): data type not listed in selection if not present in global types --- .../WorkspacePropsFunctionOptionsModal.vue | 18 +++++++++++++++++ .../components/WorkspacePropsTableRow.vue | 20 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/WorkspacePropsFunctionOptionsModal.vue b/src/renderer/components/WorkspacePropsFunctionOptionsModal.vue index 484e0b85..97316b97 100644 --- a/src/renderer/components/WorkspacePropsFunctionOptionsModal.vue +++ b/src/renderer/components/WorkspacePropsFunctionOptionsModal.vue @@ -80,6 +80,9 @@ + { + acc.push(curr.name); + return acc; + }, []); + + typeNames = [ + ...groupTypeNames, + ...typeNames + ]; + } + return typeNames.includes(this.localOptions.returns); } }, created () { diff --git a/src/renderer/components/WorkspacePropsTableRow.vue b/src/renderer/components/WorkspacePropsTableRow.vue index 6fe5de69..13be3e2c 100644 --- a/src/renderer/components/WorkspacePropsTableRow.vue +++ b/src/renderer/components/WorkspacePropsTableRow.vue @@ -60,6 +60,9 @@ class="form-select editable-field small-select text-uppercase" @blur="editOFF" > + {{ type.name }} @@ -374,6 +377,21 @@ export default { }, isNullable () { return !this.indexes.some(index => ['PRIMARY'].includes(index.type)); + }, + isInDataTypes () { + let typeNames = []; + for (const group of this.dataTypes) { + const groupTypeNames = group.types.reduce((acc, curr) => { + acc.push(curr.name); + return acc; + }, []); + + typeNames = [ + ...groupTypeNames, + ...typeNames + ]; + } + return typeNames.includes(this.row.type); } }, watch: {