consolidate tool id shortening methods

This commit is contained in:
Laila Los
2024-03-26 12:14:08 +01:00
parent 17b6fb3779
commit 92bfdb20ff
2 changed files with 5 additions and 11 deletions
+3 -6
View File
@@ -22,6 +22,8 @@ import { getCompatibleRecommendations } from "components/Workflow/Editor/modules
import * as d3 from "d3";
import { getAppRoot } from "onload/loadConfig";
import { getShortToolId } from "@/utils/tool";
export default {
props: {
toolId: {
@@ -38,12 +40,7 @@ export default {
},
computed: {
getToolId() {
let toolId = this.toolId || "";
if (toolId.indexOf("/") > 0) {
const toolIdSlash = toolId.split("/");
toolId = toolIdSlash[toolIdSlash.length - 2];
}
return toolId;
return getShortToolId(this.toolId ?? "");
},
},
created() {
@@ -22,6 +22,7 @@ import LoadingSpan from "components/LoadingSpan";
import _l from "utils/localization";
import { useWorkflowStores } from "@/composables/workflowStores";
import { getShortToolId } from "@/utils/tool";
import { getToolPredictions } from "./modules/services";
import { getCompatibleRecommendations } from "./modules/utilities";
@@ -59,11 +60,7 @@ export default {
},
methods: {
getToolId(toolId) {
if (toolId !== undefined && toolId !== null && toolId.indexOf("/") > -1) {
const toolIdSlash = toolId.split("/");
toolId = toolIdSlash[toolIdSlash.length - 2];
}
return toolId;
return getShortToolId(toolId ?? "");
},
getWorkflowPath(currentNodeId) {
const steps = {};