From 26a4f678568623be67cf4ce5051108ab1f5ffc7f Mon Sep 17 00:00:00 2001 From: bezo97 Date: Mon, 23 Dec 2024 22:41:02 +0100 Subject: [PATCH 01/13] Setup new TemplateWorkflowsContent layout: - Show selection list for custom_nodes that contain workflow templates - Put item cards in carousel - Use getWorkflowTemplates() to fetch items --- .../templates/TemplateWorkflowsContent.vue | 132 +++++++++++++----- src/scripts/api.ts | 11 ++ 2 files changed, 107 insertions(+), 36 deletions(-) diff --git a/src/components/templates/TemplateWorkflowsContent.vue b/src/components/templates/TemplateWorkflowsContent.vue index 75a5af5299..9b404ce1f8 100644 --- a/src/components/templates/TemplateWorkflowsContent.vue +++ b/src/components/templates/TemplateWorkflowsContent.vue @@ -1,57 +1,100 @@ + + diff --git a/src/components/templates/TemplateWorkflowsContent.vue b/src/components/templates/TemplateWorkflowsContent.vue index 8534d25784..695dec60ad 100644 --- a/src/components/templates/TemplateWorkflowsContent.vue +++ b/src/components/templates/TemplateWorkflowsContent.vue @@ -16,39 +16,13 @@ :key="selectedTab.moduleName" > @@ -57,14 +31,13 @@ From 2430d97feb8e83b3d9ccee9c178cf1fa117e3982 Mon Sep 17 00:00:00 2001 From: bezo97 Date: Sun, 29 Dec 2024 16:00:59 +0100 Subject: [PATCH 09/13] show document icon when a workflow thumbnail is not available --- src/components/templates/TemplateWorkflowCard.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/templates/TemplateWorkflowCard.vue b/src/components/templates/TemplateWorkflowCard.vue index 6834c13794..993187b94e 100644 --- a/src/components/templates/TemplateWorkflowCard.vue +++ b/src/components/templates/TemplateWorkflowCard.vue @@ -6,13 +6,18 @@ class="relative overflow-hidden rounded-lg cursor-pointer w-64 h-64" > +
+ +
import Card from 'primevue/card' import ProgressSpinner from 'primevue/progressspinner' +import { ref } from 'vue' const props = defineProps<{ moduleName: string workflowName: string loading: boolean }>() + +const imageError = ref(false) From 5835c4420494715c4214b0ef31353f38b29ccb4b Mon Sep 17 00:00:00 2001 From: bezo97 Date: Sun, 29 Dec 2024 20:08:13 +0100 Subject: [PATCH 12/13] avoid trying to translate custom template names --- .../templates/TemplateWorkflowCard.vue | 17 ++++++++++++++--- .../templates/TemplateWorkflowsContent.vue | 11 +++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/components/templates/TemplateWorkflowCard.vue b/src/components/templates/TemplateWorkflowCard.vue index 993187b94e..518f51b63a 100644 --- a/src/components/templates/TemplateWorkflowCard.vue +++ b/src/components/templates/TemplateWorkflowCard.vue @@ -32,9 +32,20 @@
- + diff --git a/src/components/templates/TemplateWorkflowsContent.vue b/src/components/templates/TemplateWorkflowsContent.vue index 17d66793b1..7141506434 100644 --- a/src/components/templates/TemplateWorkflowsContent.vue +++ b/src/components/templates/TemplateWorkflowsContent.vue @@ -115,12 +115,11 @@ const loadWorkflow = async (id: string) => { ).then((r) => r.json()) } useDialogStore().closeDialog() - await app.loadGraphData( - json, - true, - true, - t(`templateWorkflows.template.${id}`, id) - ) + const workflowName = + selectedTab.value.moduleName === 'default' + ? t(`templateWorkflows.template.${id}`, id) + : id + await app.loadGraphData(json, true, true, workflowName) return false } From 75e058466ec65e464046de126a0522abfc991271 Mon Sep 17 00:00:00 2001 From: bezo97 Date: Sun, 29 Dec 2024 20:25:23 +0100 Subject: [PATCH 13/13] handle listbox deselect --- src/components/templates/TemplateWorkflowsContent.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/templates/TemplateWorkflowsContent.vue b/src/components/templates/TemplateWorkflowsContent.vue index 7141506434..02c1d0f3aa 100644 --- a/src/components/templates/TemplateWorkflowsContent.vue +++ b/src/components/templates/TemplateWorkflowsContent.vue @@ -6,7 +6,8 @@ class="absolute w-8 h-full inset-0" /> { await workflowTemplatesStore.loadWorkflowTemplates() }) +const handleTabSelection = (selection: WorkflowTemplatesTab | null) => { + //Listbox allows deselecting so this special case is ignored here + if (selection !== selectedTab.value && selection !== null) + selectedTab.value = selection +} + const loadWorkflow = async (id: string) => { workflowLoading.value = id let json