do not use optional chaining in vue template

This commit is contained in:
Simon Bray
2022-03-29 11:01:02 +02:00
parent 61a43603ac
commit e449930d72
@@ -10,13 +10,13 @@
<span>{{ workflow.name }}</span>
</b-link>
<font-awesome-icon
v-if="workflow.source_metadata?.trs_tool_id"
v-if="sourceType.includes('trs')"
v-b-tooltip.hover
:title="`Imported from TRS ID (version ${workflow.source_metadata.trs_version_id})`"
icon="check"
style="color: green" />
<font-awesome-icon
v-if="workflow.source_metadata?.url"
v-if="sourceType == 'url'"
v-b-tooltip.hover
:title="`Imported from ${workflow.source_metadata.url}`"
icon="link" />
@@ -124,6 +124,15 @@ export default {
return null;
}
},
sourceType() {
if (this.workflow.source_metadata?.url) {
return "url";
} else if (this.workflow.source_metadata?.trs_server) {
return `trs_${this.workflow.source_metadata?.trs_server}`;
} else {
return "";
}
},
},
created() {
this.root = getAppRoot();