From 51e6813e8e1375c660a904189a7ed74711ac52f4 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 26 Apr 2022 11:34:46 -0400 Subject: [PATCH] Allow users to view invocations for a particular workflow. --- .../components/Workflow/Invocations.test.js | 34 ++++++++++++++++++- .../src/components/Workflow/Invocations.vue | 23 +++++++++++-- .../Workflow/StoredWorkflowInvocations.vue | 30 ++++++++++++++++ .../components/Workflow/WorkflowDropdown.vue | 7 ++++ .../providers/StoredWorkflowsProvider.js | 15 ++++++++ client/src/entry/analysis/AnalysisRouter.js | 6 ++++ lib/galaxy/webapps/galaxy/buildapp.py | 1 + 7 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 client/src/components/Workflow/StoredWorkflowInvocations.vue diff --git a/client/src/components/Workflow/Invocations.test.js b/client/src/components/Workflow/Invocations.test.js index a5c0371b43e..35ad7eb1285 100644 --- a/client/src/components/Workflow/Invocations.test.js +++ b/client/src/components/Workflow/Invocations.test.js @@ -8,7 +8,7 @@ import { parseISO, formatDistanceToNow } from "date-fns"; const localVue = getLocalVue(); -describe("Invocations.vue without invocation", () => { +describe("Invocations.vue without invocations", () => { let axiosMock; let wrapper; let propsData; @@ -38,6 +38,38 @@ describe("Invocations.vue without invocation", () => { }); }); +describe("Invocations.vue for a workflow invocations", () => { + let axiosMock; + let wrapper; + let propsData; + + beforeEach(async () => { + axiosMock = new MockAdapter(axios); + axiosMock.onAny().reply(200, [], { total_matches: "0" }); + propsData = { + ownerGrid: false, + storedWorkflowName: "My Workflow", + storedWorkflowId: "abcde145678", + }; + wrapper = mount(Invocations, { + propsData, + localVue, + }); + }); + + afterEach(() => { + axiosMock.restore(); + }); + + it("title should be shown", async () => { + expect(wrapper.find("#invocations-title").text()).toBe("Workflow Invocations for My Workflow"); + }); + + it("no invocations message should be shown when not loading", async () => { + expect(wrapper.find("#no-invocations").exists()).toBe(true); + }); +}); + describe("Invocations.vue with invocation", () => { let wrapper; let propsData; diff --git a/client/src/components/Workflow/Invocations.vue b/client/src/components/Workflow/Invocations.vue index e3d21c0d0d1..5f35603d978 100644 --- a/client/src/components/Workflow/Invocations.vue +++ b/client/src/components/Workflow/Invocations.vue @@ -1,7 +1,7 @@