1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix(UI): data type not listed in selection if not present in global types

This commit is contained in:
2021-04-19 11:07:29 +02:00
parent cafb65560a
commit 6eb2977568
2 changed files with 37 additions and 1 deletions

View File

@ -80,6 +80,9 @@
<option v-if="localOptions.returns === 'VOID'">
VOID
</option>
<option v-if="!isInDataTypes">
{{ localOptions.returns }}
</option>
<optgroup
v-for="group in workspace.dataTypes"
:key="group.group"
@ -178,6 +181,21 @@ export default {
},
customizations () {
return this.workspace.customizations;
},
isInDataTypes () {
let typeNames = [];
for (const group of this.workspace.dataTypes) {
const groupTypeNames = group.types.reduce((acc, curr) => {
acc.push(curr.name);
return acc;
}, []);
typeNames = [
...groupTypeNames,
...typeNames
];
}
return typeNames.includes(this.localOptions.returns);
}
},
created () {