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..4db4b20f499 --- /dev/null +++ b/client/src/components/Tour/TourList.vue @@ -0,0 +1,74 @@ + + + Galaxy Tours + + This page presents a list of interactive tours available on this Galaxy server. Select any tour to get + started (and remember, you can click 'End Tour' at any time). + + Tours + {{ error }} + + + + + + {{ tour.name || tour.id }} − + {{ tour.description }} + + {{ tag }} + + + + + + + + + diff --git a/client/src/entry/analysis/AnalysisRouter.js b/client/src/entry/analysis/AnalysisRouter.js index f5ba3e4648a..890ed9628e4 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"; @@ -67,6 +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_list", "(/)tours(/)(:tour_id)": "show_tours", "(/)user(/)": "show_user", "(/)user(/)cloud_auth": "show_cloud_auth", @@ -146,9 +148,12 @@ export const getAnalysisRouter = (Galaxy) => { show_tours: function (tour_id) { this.home(); - if (tour_id) { - runTour(tour_id); - } + runTour(tour_id); + }, + + show_tours_list: function () { + this.home(); + this._display_vue_helper(TourList); }, show_new_user_confirmation: function () { diff --git a/client/src/layout/menu.js b/client/src/layout/menu.js index c186a6b8eb8..fae361fe787 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", + target: "__use_router__", + }, { title: _l("Introduction to Galaxy"), url: "welcome/new",
+ This page presents a list of interactive tours available on this Galaxy server. Select any tour to get + started (and remember, you can click 'End Tour' at any time). +