From 861ac14ad2b8f1639579132eb0f07afba80f89ad Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Mon, 28 Aug 2023 13:44:42 +1000 Subject: [PATCH 001/104] create AdvancedFilteringHelpModal generic component --- .../Common/AdvancedFilteringHelpModal.vue | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 client/src/components/Common/AdvancedFilteringHelpModal.vue diff --git a/client/src/components/Common/AdvancedFilteringHelpModal.vue b/client/src/components/Common/AdvancedFilteringHelpModal.vue new file mode 100644 index 000000000000..e9c971679d0d --- /dev/null +++ b/client/src/components/Common/AdvancedFilteringHelpModal.vue @@ -0,0 +1,53 @@ + + + From a13e84c5bf4c2dc3a172234f155e2d26c990b520 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Mon, 28 Aug 2023 14:39:04 +1000 Subject: [PATCH 002/104] update AsyncButton: add loading title prop, support object icons and create Props interface --- client/src/components/Common/AsyncButton.vue | 48 +++++++------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/client/src/components/Common/AsyncButton.vue b/client/src/components/Common/AsyncButton.vue index 2d6ccd4881e7..9487e2ddb781 100644 --- a/client/src/components/Common/AsyncButton.vue +++ b/client/src/components/Common/AsyncButton.vue @@ -3,39 +3,25 @@ import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"; import { BButton } from "bootstrap-vue"; import { ref } from "vue"; -const loading = ref(false); +interface Props { + icon: string | object; + title?: string; + disabled?: boolean; + loadingTitle?: string; + size?: "sm" | "md" | "lg"; + action: () => Promise; + variant?: "primary" | "secondary" | "success" | "danger" | "warning" | "info" | "light" | "dark" | "link"; +} -const props = defineProps({ - icon: { - type: String, - required: true, - }, - title: { - type: String, - required: false, - default: "", - }, - action: { - type: Function, - required: true, - }, - size: { - type: String, - required: false, - default: "md", - }, - variant: { - type: String, - required: false, - default: "link", - }, - disabled: { - type: Boolean, - required: false, - default: false, - }, +const props = withDefaults(defineProps(), { + title: "", + size: "md", + variant: "link", + loadingTitle: "Loading...", }); +const loading = ref(false); + async function onClick() { loading.value = true; await props.action(); @@ -51,7 +37,7 @@ async function onClick() { :variant="variant" :disabled="loading || disabled" @click="onClick"> - + From ebd01a0ceb263ac7ce8c02382fc06cc76fe4bc6b Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Mon, 28 Aug 2023 17:36:34 +1000 Subject: [PATCH 003/104] update AdvancedFilteringHelpModal hide --- .../src/components/Common/AdvancedFilteringHelpModal.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/Common/AdvancedFilteringHelpModal.vue b/client/src/components/Common/AdvancedFilteringHelpModal.vue index e9c971679d0d..156239691cfa 100644 --- a/client/src/components/Common/AdvancedFilteringHelpModal.vue +++ b/client/src/components/Common/AdvancedFilteringHelpModal.vue @@ -25,7 +25,12 @@ defineEmits<{ From 14473bf0f661ef6a9c19098f2905a55e6c2d6182 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:08:32 +1000 Subject: [PATCH 011/104] create WorkflowQuickView component --- .../components/Workflow/WorkflowQuickView.vue | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 client/src/components/Workflow/WorkflowQuickView.vue diff --git a/client/src/components/Workflow/WorkflowQuickView.vue b/client/src/components/Workflow/WorkflowQuickView.vue new file mode 100644 index 000000000000..85cf9efee588 --- /dev/null +++ b/client/src/components/Workflow/WorkflowQuickView.vue @@ -0,0 +1,166 @@ + + + + + From 8dc97887f309913d7952f8d4322ab2105b0c8fb5 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:09:00 +1000 Subject: [PATCH 012/104] create WorkflowActions component --- .../components/Workflow/WorkflowActions.vue | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 client/src/components/Workflow/WorkflowActions.vue diff --git a/client/src/components/Workflow/WorkflowActions.vue b/client/src/components/Workflow/WorkflowActions.vue new file mode 100644 index 000000000000..47ee6f99f4bb --- /dev/null +++ b/client/src/components/Workflow/WorkflowActions.vue @@ -0,0 +1,190 @@ + + + + + From 3037d44aaf5c2823937fefa7d542a40d34d25084 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:10:05 +1000 Subject: [PATCH 013/104] create WorkflowInvocationsCount component --- .../Workflow/WorkflowInvocationsCount.vue | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 client/src/components/Workflow/WorkflowInvocationsCount.vue diff --git a/client/src/components/Workflow/WorkflowInvocationsCount.vue b/client/src/components/Workflow/WorkflowInvocationsCount.vue new file mode 100644 index 000000000000..76462b922d7d --- /dev/null +++ b/client/src/components/Workflow/WorkflowInvocationsCount.vue @@ -0,0 +1,48 @@ + + + From fc022d6d5df6bf46f6e009a14fe291a52dd0db12 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:10:25 +1000 Subject: [PATCH 014/104] create WorkflowIndicators component --- .../Workflow/WorkflowIndicators.vue | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 client/src/components/Workflow/WorkflowIndicators.vue diff --git a/client/src/components/Workflow/WorkflowIndicators.vue b/client/src/components/Workflow/WorkflowIndicators.vue new file mode 100644 index 000000000000..86b84faed643 --- /dev/null +++ b/client/src/components/Workflow/WorkflowIndicators.vue @@ -0,0 +1,146 @@ + + + + + From 898d7eeb32ec638c35e5711ba4cf84d59ed2cbf1 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:11:51 +1000 Subject: [PATCH 015/104] create WorkflowCard component --- .../src/components/Workflow/WorkflowCard.vue | 220 ++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 client/src/components/Workflow/WorkflowCard.vue diff --git a/client/src/components/Workflow/WorkflowCard.vue b/client/src/components/Workflow/WorkflowCard.vue new file mode 100644 index 000000000000..b68ddcf19980 --- /dev/null +++ b/client/src/components/Workflow/WorkflowCard.vue @@ -0,0 +1,220 @@ + + + + + From adad5feee52513bde8c65ef5f8a0f5aa776bcb23 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:12:34 +1000 Subject: [PATCH 016/104] create workflows.services --- .../components/Workflow/workflows.services.ts | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 client/src/components/Workflow/workflows.services.ts diff --git a/client/src/components/Workflow/workflows.services.ts b/client/src/components/Workflow/workflows.services.ts new file mode 100644 index 000000000000..b70a62646a3e --- /dev/null +++ b/client/src/components/Workflow/workflows.services.ts @@ -0,0 +1,85 @@ +import axios from "axios"; + +import { fetcher } from "@/schema"; +import { useUserStore } from "@/stores/userStore"; +import { withPrefix } from "@/utils/redirect"; + +type SortBy = "create_time" | "update_time" | "name"; + +type Workflow = Record; + +interface LoadWorkflowsOptions { + sortBy: SortBy; + sortDesc: boolean; + limit: number; + offset: number; + filterText: string; + showPublished: boolean; + skipStepCounts: boolean; +} + +const getWorkflows = fetcher.path("/api/workflows").method("get").create(); +export async function loadWorkflows({ + sortBy = "update_time", + sortDesc = true, + limit = 20, + offset = 0, + filterText = "", + showPublished = false, + skipStepCounts = true, +}: LoadWorkflowsOptions): Promise { + const { data } = await getWorkflows({ + sort_by: sortBy, + sort_desc: sortDesc, + limit, + offset, + search: filterText, + show_published: showPublished, + skip_step_counts: skipStepCounts, + }); + return data; +} + +export async function updateWorkflow(id: string, changes: object): Promise { + const { data } = await axios.put(`/api/workflows/${id}`, changes); + return data; +} + +export async function copyWorkflow(id: string, currentOwner: string): Promise { + const { data: workflowData } = await axios.get(withPrefix(`/api/workflows/${id}/download`)); + + workflowData.name = `Copy of ${workflowData.name}`; + const currentUsername = useUserStore().currentUser?.username; + + if (currentUsername !== currentOwner) { + workflowData.name += ` shared by user ${currentOwner}`; + } + + const { data } = await axios.post(withPrefix("/api/workflows"), { workflow: workflowData }); + return data; +} + +export async function deleteWorkflow(id: string): Promise { + const { data } = await axios.delete(withPrefix(`/api/workflows/${id}`)); + return data; +} + +export async function createWorkflow(workflowName: string, workflowAnnotation: string) { + const { data } = await axios.post(withPrefix("/api/workflows"), { + workflow: { + name: workflowName, + annotation: [workflowAnnotation], + }, + }); + return data; +} + +export async function getWorkflowFull(workflowId: string) { + const { data } = await axios.get(withPrefix(`/workflow/load_workflow?_=true&id=${workflowId}`)); + return data; +} + +export async function getWorkflowInfo(workflowId: string) { + const { data } = await axios.get(withPrefix(`/api/workflows/${workflowId}`)); + return data; +} From 79a93dd5fff5d8835d27cf39f347c32b1a56c6c5 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Tue, 29 Aug 2023 14:21:38 +1000 Subject: [PATCH 017/104] temporary use old workflow create component until the API is migrated --- .../src/components/Workflow/WorkflowListActions.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client/src/components/Workflow/WorkflowListActions.vue b/client/src/components/Workflow/WorkflowListActions.vue index aa6ada4ff5ab..5e4932d92fff 100644 --- a/client/src/components/Workflow/WorkflowListActions.vue +++ b/client/src/components/Workflow/WorkflowListActions.vue @@ -17,6 +17,10 @@ const showCreateModal = ref(false); function navigateToImport() { router.push("/workflows/import"); } + +function navigateToOldCreate() { + router.push("/workflows/create_old"); +}