From e39050ed97c1277136cde6af9c986acad2a922ac Mon Sep 17 00:00:00 2001 From: hujambo-dunia <“MSavage07@gsb.columbia.edu”> Date: Thu, 26 May 2022 13:14:02 -0400 Subject: [PATCH 1/6] new Vue file with retained SEO performance considerations and test script --- client/src/components/Tour/Tour.test.js | 30 ++++++++ client/src/components/Tour/TourList.vue | 80 +++++++++++++++++++++ client/src/entry/analysis/AnalysisRouter.js | 5 +- client/src/layout/menu.js | 5 ++ 4 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 client/src/components/Tour/Tour.test.js create mode 100644 client/src/components/Tour/TourList.vue diff --git a/client/src/components/Tour/Tour.test.js b/client/src/components/Tour/Tour.test.js new file mode 100644 index 00000000000..b1d6eb74b2d --- /dev/null +++ b/client/src/components/Tour/Tour.test.js @@ -0,0 +1,30 @@ +import { shallowMount } from "@vue/test-utils"; +import { getLocalVue } from "jest/helpers"; +import TourList from "./TourList.vue"; +import MockAdapter from "axios-mock-adapter"; +import axios from "axios"; +import flushPromises from "flush-promises"; + +const localVue = getLocalVue(); +const TEST_TOUR_URI = "/api/tours"; + +jest.mock("app"); + +describe("Tour", () => { + let axiosMock; + let wrapper; + + beforeEach(async () => { + axiosMock = new MockAdapter(axios); + axiosMock.onGet(TEST_TOUR_URI).reply(200, [{ id: "foo", writable: false }]); + wrapper = shallowMount(TourList, { + propsData: {}, + localVue, + }); + await flushPromises(); + }); + + it("test tours", async () => { + expect(wrapper.find("#tourList").exists()).toBeTruthy(); + }); +}); diff --git a/client/src/components/Tour/TourList.vue b/client/src/components/Tour/TourList.vue new file mode 100644 index 00000000000..57442a54172 --- /dev/null +++ b/client/src/components/Tour/TourList.vue @@ -0,0 +1,80 @@ + + + diff --git a/client/src/entry/analysis/AnalysisRouter.js b/client/src/entry/analysis/AnalysisRouter.js index f5ba3e4648a..002d3764135 100644 --- a/client/src/entry/analysis/AnalysisRouter.js +++ b/client/src/entry/analysis/AnalysisRouter.js @@ -23,6 +23,7 @@ import DatasetList from "components/Dataset/DatasetList"; import { getUserPreferencesModel } from "components/User/UserPreferencesModel"; import CustomBuilds from "components/User/CustomBuilds"; import { runTour } from "components/Tour/runTour"; +import TourList from "components/Tour/TourList"; import GridView from "mvc/grid/grid-view"; import GridShared from "mvc/grid/grid-shared"; import JobDetails from "components/JobInformation/JobDetails"; @@ -146,7 +147,9 @@ export const getAnalysisRouter = (Galaxy) => { show_tours: function (tour_id) { this.home(); - if (tour_id) { + if (tour_id === "list" || !tour_id) { + this._display_vue_helper(TourList); + } else { runTour(tour_id); } }, diff --git a/client/src/layout/menu.js b/client/src/layout/menu.js index 0ed3a76019c..4115d2bd69f 100644 --- a/client/src/layout/menu.js +++ b/client/src/layout/menu.js @@ -200,6 +200,11 @@ export function fetchMenu(options = {}) { url: options.citation_url, target: "_blank", }, + { + title: _l("Interactive Tours"), + url: "tours/list", + target: "__use_router__", + }, { title: _l("Introduction to Galaxy"), url: "welcome/new", From c283febcc2d84217d7ab9f6dc0b984ed6a260a97 Mon Sep 17 00:00:00 2001 From: hujambo-dunia <“MSavage07@gsb.columbia.edu”> Date: Mon, 30 May 2022 15:06:06 -0400 Subject: [PATCH 2/6] api method call adjustment for error logging --- client/src/components/Tour/TourList.vue | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/client/src/components/Tour/TourList.vue b/client/src/components/Tour/TourList.vue index 57442a54172..0036993cc44 100644 --- a/client/src/components/Tour/TourList.vue +++ b/client/src/components/Tour/TourList.vue @@ -29,8 +29,7 @@ From 20d4fa4205009c5e2b1c954ffa39e8720a345223 Mon Sep 17 00:00:00 2001 From: hujambo-dunia <“MSavage07@gsb.columbia.edu”> Date: Wed, 1 Jun 2022 16:03:32 -0400 Subject: [PATCH 6/6] route removal to match new standardization --- client/src/entry/analysis/AnalysisRouter.js | 11 +++-------- client/src/layout/menu.js | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/client/src/entry/analysis/AnalysisRouter.js b/client/src/entry/analysis/AnalysisRouter.js index 6a49f3207be..890ed9628e4 100644 --- a/client/src/entry/analysis/AnalysisRouter.js +++ b/client/src/entry/analysis/AnalysisRouter.js @@ -68,7 +68,7 @@ export const getAnalysisRouter = (Galaxy) => { "(/)login/confirm": "show_new_user_confirmation", "(/)tools/view": "show_tools_view", "(/)tools/json": "show_tools_json", - "(/)tours": "show_tours_default", + "(/)tours": "show_tours_list", "(/)tours(/)(:tour_id)": "show_tours", "(/)user(/)": "show_user", "(/)user(/)cloud_auth": "show_cloud_auth", @@ -148,15 +148,10 @@ export const getAnalysisRouter = (Galaxy) => { show_tours: function (tour_id) { this.home(); - - if (tour_id === "list") { - this._display_vue_helper(TourList); - } else { - runTour(tour_id); - } + runTour(tour_id); }, - show_tours_default: function () { + show_tours_list: function () { this.home(); this._display_vue_helper(TourList); }, diff --git a/client/src/layout/menu.js b/client/src/layout/menu.js index 4115d2bd69f..6b847ffa9de 100644 --- a/client/src/layout/menu.js +++ b/client/src/layout/menu.js @@ -202,7 +202,7 @@ export function fetchMenu(options = {}) { }, { title: _l("Interactive Tours"), - url: "tours/list", + url: "tours", target: "__use_router__", }, {