From cb9723b15088af77395ec2d6c0ce80ac5f143b6f Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 28 Sep 2022 22:25:16 -0400 Subject: [PATCH] Drop ToolsView, which is be superseded by the advanced search results view. The central panel search result view has a similar display but improved loading/filtering characteristics and we could use it in a 'show all the tools' display like this as well. --- .../ToolsSchemaJson/ToolsJson.test.js | 2 +- .../components/ToolsView/ToolsView.test.js | 77 ------- client/src/components/ToolsView/ToolsView.vue | 211 ------------------ .../ToolsView/testData/citation.json | 1 - client/src/entry/analysis/router.js | 5 - 5 files changed, 1 insertion(+), 295 deletions(-) delete mode 100644 client/src/components/ToolsView/ToolsView.test.js delete mode 100644 client/src/components/ToolsView/ToolsView.vue delete mode 100644 client/src/components/ToolsView/testData/citation.json diff --git a/client/src/components/ToolsView/ToolsSchemaJson/ToolsJson.test.js b/client/src/components/ToolsView/ToolsSchemaJson/ToolsJson.test.js index 7a59d3d70d3..4bd0420d913 100644 --- a/client/src/components/ToolsView/ToolsSchemaJson/ToolsJson.test.js +++ b/client/src/components/ToolsView/ToolsSchemaJson/ToolsJson.test.js @@ -9,7 +9,7 @@ import flushPromises from "flush-promises"; const localVue = getLocalVue(); -describe("ToolsView/ToolsView.vue", () => { +describe("ToolSchemaJson/ToolsView.vue", () => { let wrapper; let axiosMock; const defaultSchemaElementTag = "application/ld+json"; diff --git a/client/src/components/ToolsView/ToolsView.test.js b/client/src/components/ToolsView/ToolsView.test.js deleted file mode 100644 index 69fa6b2fdd6..00000000000 --- a/client/src/components/ToolsView/ToolsView.test.js +++ /dev/null @@ -1,77 +0,0 @@ -import ToolsView from "./ToolsView"; -import { mount } from "@vue/test-utils"; -import { getLocalVue } from "jest/helpers"; -import flushPromises from "flush-promises"; - -// test response -import testToolsListResponse from "./testData/toolsList"; -import testCitation from "./testData/citation"; -import MockAdapter from "axios-mock-adapter"; -import axios from "axios"; - -jest.mock("app"); - -describe("ToolsView/ToolsView.vue", () => { - const localVue = getLocalVue(); - - let wrapper; - let axiosMock; - - beforeEach(async () => { - axiosMock = new MockAdapter(axios); - axiosMock.onGet("/api/tools?tool_help=True").reply(200, testToolsListResponse); - axiosMock.onGet(new RegExp(`./*/citations`)).reply(200, testCitation); - wrapper = mount(ToolsView, { localVue, attachTo: document.body }); - - await flushPromises(); - }); - - afterEach(() => { - axiosMock.restore(); - }); - - it("should render infinite scroll div", async () => { - expect(wrapper.html()).toEqual(expect.stringContaining('
')); - }); - - it("should return defined number of tools", async () => { - expect(wrapper.vm.getToolsNumber() === 5).toBeTruthy(); - }); - - it("should render only specific number of tools, equal to current buffer", async () => { - const buttons = wrapper.findAll('[type="button"]').filter((button) => button.text() === "Info"); - // one 'info' button per tool - expect(wrapper.vm.buffer.length === buttons.length).toBeTruthy(); - }); - - it("should open modal on button click", async () => { - // findAll() returns WrapperArray, thus regular array.find() won't work - const infoButton = wrapper - .findAll('[type="button"]') - .filter((button) => button.text() === "Info") - .at(0); - const modalId = "modal--" + infoButton.attributes().index; - const modal = wrapper.find("#" + modalId); - expect(modal.element).not.toBeVisible(); - await infoButton.trigger("click"); - await flushPromises(); - - expect(modal.element).toBeVisible(); - }); - - it("citation should open on click", async () => { - const infoButton = wrapper - .findAll('[type="button"]') - .filter((button) => button.text() === "Citations") - .at(0); - const citation = wrapper.find("#" + infoButton.attributes("aria-controls").replace(/ /g, "_")); - - expect(citation.element).not.toBeVisible(); - expect(infoButton.attributes("aria-expanded") === "false").toBeTruthy(); - - await infoButton.trigger("click"); - await flushPromises(); - expect(infoButton.attributes("aria-expanded") === "true").toBeTruthy(); - expect(citation.element).toBeVisible(); - }); -}); diff --git a/client/src/components/ToolsView/ToolsView.vue b/client/src/components/ToolsView/ToolsView.vue deleted file mode 100644 index a4db1edeaca..00000000000 --- a/client/src/components/ToolsView/ToolsView.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - diff --git a/client/src/components/ToolsView/testData/citation.json b/client/src/components/ToolsView/testData/citation.json deleted file mode 100644 index 57b0e8214e0..00000000000 --- a/client/src/components/ToolsView/testData/citation.json +++ /dev/null @@ -1 +0,0 @@ -[{"content": " @article{Blankenberg_2011, title={Making whole genome multiple alignments usable for biologists}, volume={27}, ISSN={1367-4803}, url={http://dx.doi.org/10.1093/bioinformatics/btr398}, DOI={10.1093/bioinformatics/btr398}, number={17}, journal={Bioinformatics}, publisher={Oxford University Press (OUP)}, author={Blankenberg, Daniel and Taylor, James and Nekrutenko, Anton}, year={2011}, month={Jul}, pages={2426\u00e2\u0080\u00932428}}\n", "format": "bibtex"}] \ No newline at end of file diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 58b1850d109..307c33f3c57 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -40,7 +40,6 @@ import Sharing from "components/Sharing/Sharing"; import StoredWorkflowInvocations from "components/Workflow/StoredWorkflowInvocations"; import ToolAdvancedSearch from "components/Panels/Common/ToolAdvancedSearch"; import ToolsJson from "components/ToolsView/ToolsSchemaJson/ToolsJson"; -import ToolsView from "components/ToolsView/ToolsView"; import TourList from "components/Tour/TourList"; import TourRunner from "components/Tour/TourRunner"; import TrsImport from "components/Workflow/TrsImport"; @@ -298,10 +297,6 @@ export function getRouter(Galaxy) { }; }, }, - { - path: "tools/view", - component: ToolsView, - }, { path: "tools/json", component: ToolsJson,