From 81c9f22548fbfb7313bf4febda98c89a4522f857 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 4 Dec 2024 14:34:15 +0100 Subject: [PATCH 1/9] Updates LicenseSelector props type Changes licenseId and inputLicense to optional types Updates event emission to handle optional license (no license) --- client/src/components/License/LicenseSelector.vue | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/components/License/LicenseSelector.vue b/client/src/components/License/LicenseSelector.vue index a9f55d621e1c..a18810c3b4a2 100644 --- a/client/src/components/License/LicenseSelector.vue +++ b/client/src/components/License/LicenseSelector.vue @@ -12,24 +12,23 @@ import License from "@/components/License/License.vue"; import LoadingSpan from "@/components/LoadingSpan.vue"; const defaultLicense: LicenseType = { - licenseId: null, name: "*Do not specify a license.*", }; type LicenseMetadataModel = components["schemas"]["LicenseMetadataModel"]; type LicenseType = { - licenseId: string | null; + licenseId?: string; name: string; }; interface Props { - inputLicense: string; + inputLicense?: string; } const props = defineProps(); const emit = defineEmits<{ - (e: "onLicense", license: string | null): void; + (e: "onLicense", license?: string): void; }>(); const licensesLoading = ref(false); From 19600e7709e3cc1e7a8af1816cd78358b527f4d3 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 4 Dec 2024 14:35:01 +0100 Subject: [PATCH 2/9] Updates defaultPosition function parameter type Changes the type of the 'transform' parameter in the defaultPosition function to use a more specific type, improving type safety and clarity. --- .../Workflow/Editor/composables/useDefaultStepPosition.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Workflow/Editor/composables/useDefaultStepPosition.ts b/client/src/components/Workflow/Editor/composables/useDefaultStepPosition.ts index 18d3f2dff8a5..d4e68838a16c 100644 --- a/client/src/components/Workflow/Editor/composables/useDefaultStepPosition.ts +++ b/client/src/components/Workflow/Editor/composables/useDefaultStepPosition.ts @@ -15,7 +15,7 @@ const MAX_OFFSET_SHIFT_X = MAX_OFFSET - NODE_WIDTH / 2; const MIN_OFFSET_SHIFT_Y = MIN_OFFSET - NODE_HEIGHT / 2; const MAX_OFFSET_SHIFT_Y = MAX_OFFSET - NODE_HEIGHT / 2; -export function defaultPosition(rootOffset: ElementBounding, transform: ZoomTransform) { +export function defaultPosition(rootOffset: ElementBounding, transform: Pick) { const left = (-transform.x + rootOffset.width / 2 + randomInteger(MIN_OFFSET_SHIFT_X, MAX_OFFSET_SHIFT_X)) / transform.k; const top = From 3d3d37a561fc783bdedfd7551d4c873f1092bb00 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 4 Dec 2024 14:36:04 +0100 Subject: [PATCH 3/9] Migrates WorkflowEditor to typescript Refactors WorkflowEditor component to use Vue 3's script setup syntax Improves route query handling and editor configuration loading --- .../entry/analysis/modules/WorkflowEditor.vue | 134 ++++++++++-------- 1 file changed, 73 insertions(+), 61 deletions(-) diff --git a/client/src/entry/analysis/modules/WorkflowEditor.vue b/client/src/entry/analysis/modules/WorkflowEditor.vue index fb8ed6eea9d5..56a8dd718182 100644 --- a/client/src/entry/analysis/modules/WorkflowEditor.vue +++ b/client/src/entry/analysis/modules/WorkflowEditor.vue @@ -1,5 +1,76 @@ + + - From 92315b0da45cc6c7657111c9211a7975427a3d90 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 4 Dec 2024 14:36:38 +0100 Subject: [PATCH 4/9] Adds utility function to retrieve query parameter value Introduces a function to fetch query parameter values from the route. Utilizes Vue Router's useRoute composable for accessing query parameters. --- client/src/utils/route.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 client/src/utils/route.ts diff --git a/client/src/utils/route.ts b/client/src/utils/route.ts new file mode 100644 index 000000000000..7bfba0975626 --- /dev/null +++ b/client/src/utils/route.ts @@ -0,0 +1,7 @@ +import { useRoute } from "vue-router/composables"; + +export function getQueryValue(key: string): string | undefined { + const route = useRoute(); + + return (Array.isArray(route.query[key]) ? route.query[key]?.[0] : route.query[key])?.toString(); +} From 5d005f74a63a28f2919eb13a6e3acb4163afff39 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Wed, 4 Dec 2024 14:46:14 +0100 Subject: [PATCH 5/9] Refactors Workflow Editor component to use typescript setup Migrates the Workflow Editor component to use the script setup and typescript syntax for improved maintainability, readability and performance. Replaces BootstrapVue components with their corresponding B-prefixed versions. --- .../src/components/Workflow/Editor/Index.vue | 1808 +++++++++-------- 1 file changed, 920 insertions(+), 888 deletions(-) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index 9506a25386af..3952ffc21969 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -1,32 +1,887 @@ + +