From 8443a978aa7bf3b2f645978a86548b091b328a0e Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 28 Feb 2024 12:10:41 -0500 Subject: [PATCH 1/2] Drop plugin-based new user welcome -- this didn't work out. --- client/src/components/Login/RegisterForm.vue | 2 +- .../NewUserWelcome/NewUserWelcome.test.js | 56 ----- .../NewUserWelcome/NewUserWelcome.vue | 198 ------------------ .../NewUserWelcome/__mocks__/testing.json | 28 --- .../NewUserWelcome/components/Slides.vue | 50 ----- .../NewUserWelcome/components/Subtopics.vue | 56 ----- .../NewUserWelcome/components/Topics.vue | 66 ------ .../components/NewUserWelcome/getResource.js | 4 - .../components/NewUserWelcome/testData.json | 55 ----- client/src/entry/analysis/menu.js | 4 - client/src/entry/analysis/router.js | 5 - .../welcome_page/new_user/package.json | 24 --- .../welcome_page/new_user/src/index.js | 2 - .../welcome_page/new_user/webpack.config.js | 20 -- 14 files changed, 1 insertion(+), 569 deletions(-) delete mode 100644 client/src/components/NewUserWelcome/NewUserWelcome.test.js delete mode 100644 client/src/components/NewUserWelcome/NewUserWelcome.vue delete mode 100644 client/src/components/NewUserWelcome/__mocks__/testing.json delete mode 100644 client/src/components/NewUserWelcome/components/Slides.vue delete mode 100644 client/src/components/NewUserWelcome/components/Subtopics.vue delete mode 100644 client/src/components/NewUserWelcome/components/Topics.vue delete mode 100644 client/src/components/NewUserWelcome/getResource.js delete mode 100644 client/src/components/NewUserWelcome/testData.json delete mode 100644 config/plugins/welcome_page/new_user/package.json delete mode 100644 config/plugins/welcome_page/new_user/src/index.js delete mode 100644 config/plugins/welcome_page/new_user/webpack.config.js diff --git a/client/src/components/Login/RegisterForm.vue b/client/src/components/Login/RegisterForm.vue index 478917fc269e..0a8e9d31a3f2 100644 --- a/client/src/components/Login/RegisterForm.vue +++ b/client/src/components/Login/RegisterForm.vue @@ -193,7 +193,7 @@ export default { if (response.data.message && response.data.status) { alert(response.data.message); } - window.location = this.redirect || withPrefix("/welcome/new"); + window.location = this.redirect || withPrefix("/"); }) .catch((error) => { this.disableCreate = false; diff --git a/client/src/components/NewUserWelcome/NewUserWelcome.test.js b/client/src/components/NewUserWelcome/NewUserWelcome.test.js deleted file mode 100644 index d030776dc7b8..000000000000 --- a/client/src/components/NewUserWelcome/NewUserWelcome.test.js +++ /dev/null @@ -1,56 +0,0 @@ -import { mount } from "@vue/test-utils"; -import { createPinia } from "pinia"; -import { getLocalVue } from "tests/jest/helpers"; - -import { mockFetcher } from "@/api/schema/__mocks__"; - -import { getResource } from "./getResource"; -import testData from "./testData.json"; - -import NewUserWelcome from "./NewUserWelcome.vue"; - -const localVue = getLocalVue(); - -jest.mock("@/api/schema"); -jest.mock("./getResource"); - -// mock resource connector -getResource.mockImplementation(() => null); - -describe("New user first view", () => { - let wrapper; - - beforeEach(async () => { - mockFetcher.path("/api/configuration").method("get").mock({ data: {} }); - const pinia = createPinia(); - wrapper = mount(NewUserWelcome, { - localVue, - pinia, - }); - wrapper.setData({ loaded: true, newUser: testData }); - }); - - it("Contains standard header", async () => { - expect(wrapper.find(".main-header").text()).toContain("Welcome to Galaxy"); - }); - - it("Starts on overall topics", async () => { - wrapper.setData({ position: [] }); - expect(wrapper.vm.depth).toBe(0); - expect(wrapper.vm.currentNode.topics).toHaveLength(1); - }); - - it("Displays second tier of topics", async () => { - wrapper.setData({ position: [0] }); - expect(wrapper.vm.depth).toBe(1); - expect(wrapper.vm.currentNode.topics).toHaveLength(2); - expect(wrapper.vm.currentNode.title).toBe("testTopic"); - }); - - it("Goes into subtopic", async () => { - wrapper.setData({ position: [0, 0] }); - expect(wrapper.vm.depth).toBe(2); - expect(wrapper.vm.currentNode.title).toBe("subtopicTitle"); - expect(wrapper.vm.currentNode.slides).toHaveLength(3); - }); -}); diff --git a/client/src/components/NewUserWelcome/NewUserWelcome.vue b/client/src/components/NewUserWelcome/NewUserWelcome.vue deleted file mode 100644 index f58650698aa3..000000000000 --- a/client/src/components/NewUserWelcome/NewUserWelcome.vue +++ /dev/null @@ -1,198 +0,0 @@ - - - - diff --git a/client/src/components/NewUserWelcome/__mocks__/testing.json b/client/src/components/NewUserWelcome/__mocks__/testing.json deleted file mode 100644 index 360cd3748f24..000000000000 --- a/client/src/components/NewUserWelcome/__mocks__/testing.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "topics": [ - { - "title": "testTopic", - "image": "testTopicImage", - "alt": "testTopic", - "blurb": "topicBlurb", - "intro": "testTopicIntro", - "topics": [ - { - "title": "subtopicTitle", - "header": "subtopicHeader", - "image": "subtopicImage", - "alt": "subtopicAlt", - "intro": "subtopicIntro", - "slides": [ - { - "file": "slideImage", - "size": "small-img", - "alt": "slideAlt", - "text": "slideText" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/client/src/components/NewUserWelcome/components/Slides.vue b/client/src/components/NewUserWelcome/components/Slides.vue deleted file mode 100644 index d8ad5024b50f..000000000000 --- a/client/src/components/NewUserWelcome/components/Slides.vue +++ /dev/null @@ -1,50 +0,0 @@ - - diff --git a/client/src/components/NewUserWelcome/components/Subtopics.vue b/client/src/components/NewUserWelcome/components/Subtopics.vue deleted file mode 100644 index caf3f1127078..000000000000 --- a/client/src/components/NewUserWelcome/components/Subtopics.vue +++ /dev/null @@ -1,56 +0,0 @@ - - - diff --git a/client/src/components/NewUserWelcome/components/Topics.vue b/client/src/components/NewUserWelcome/components/Topics.vue deleted file mode 100644 index 2c2fcfc9ca38..000000000000 --- a/client/src/components/NewUserWelcome/components/Topics.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - diff --git a/client/src/components/NewUserWelcome/getResource.js b/client/src/components/NewUserWelcome/getResource.js deleted file mode 100644 index bd2464afbc35..000000000000 --- a/client/src/components/NewUserWelcome/getResource.js +++ /dev/null @@ -1,4 +0,0 @@ -export async function getResource() { - const resourceBundle = await import("../../../../static/plugins/welcome_page/new_user/dist/static/topics/index.js"); - return resourceBundle; -} diff --git a/client/src/components/NewUserWelcome/testData.json b/client/src/components/NewUserWelcome/testData.json deleted file mode 100644 index 046274a4538b..000000000000 --- a/client/src/components/NewUserWelcome/testData.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "topics": [ - { - "title": "testTopic", - "image": "testTopicImage", - "alt": "testTopic", - "blurb": "topicBlurb", - "intro": "testTopicIntro", - "topics": [ - { - "title": "subtopicTitle", - "header": "subtopicHeader", - "image": "subtopicImage", - "alt": "subtopicAlt", - "intro": "subtopicIntro", - "slides": [ - { - "file": "slideImage", - "size": "small-img", - "alt": "slideAlt", - "text": "slideText" - }, - { - "file": "slideImage2", - "size": "small-img2", - "alt": "slideAlt2", - "text": "slideText2" - }, - { - "file": "slideImage3", - "size": "small-img3", - "alt": "slideAlt3", - "text": "slideText3" - } - ] - }, - { - "title": "subtopicTitle2", - "header": "subtopicHeader2", - "image": "subtopicImage2", - "alt": "subtopicAlt2", - "intro": "subtopicIntro2", - "slides": [ - { - "file": "slideImage4", - "size": "small-img4", - "alt": "slideAlt4", - "text": "slideText4" - } - ] - } - ] - } - ] -} \ No newline at end of file diff --git a/client/src/entry/analysis/menu.js b/client/src/entry/analysis/menu.js index 46238fd1b020..b870446bbd3f 100644 --- a/client/src/entry/analysis/menu.js +++ b/client/src/entry/analysis/menu.js @@ -182,10 +182,6 @@ export function fetchMenu(options = {}) { title: _l("Interactive Tours"), url: "/tours", }, - { - title: _l("Introduction to Galaxy"), - url: "/welcome/new", - }, { title: _l("About"), url: "/about", diff --git a/client/src/entry/analysis/router.js b/client/src/entry/analysis/router.js index 8714d6fa4da9..de818e3d34a5 100644 --- a/client/src/entry/analysis/router.js +++ b/client/src/entry/analysis/router.js @@ -16,7 +16,6 @@ import HistoryImport from "components/HistoryImport"; import InteractiveTools from "components/InteractiveTools/InteractiveTools"; import JobDetails from "components/JobInformation/JobDetails"; import CarbonEmissionsCalculations from "components/JobMetrics/CarbonEmissions/CarbonEmissionsCalculations"; -import NewUserWelcome from "components/NewUserWelcome/NewUserWelcome"; import PageDisplay from "components/PageDisplay/PageDisplay"; import PageEditor from "components/PageEditor/PageEditor"; import ToolSuccess from "components/Tool/ToolSuccess"; @@ -501,10 +500,6 @@ export function getRouter(Galaxy) { activeList: "published", }, }, - { - path: "welcome/new", - component: NewUserWelcome, - }, { path: "workflows/create", component: WorkflowCreate, diff --git a/config/plugins/welcome_page/new_user/package.json b/config/plugins/welcome_page/new_user/package.json deleted file mode 100644 index 29dbbdd7a4b7..000000000000 --- a/config/plugins/welcome_page/new_user/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "galaxy_new_user", - "version": "1.0.0", - "description": "Set of image files and json used to generate Galaxy new user page", - "main": "index.js", - "scripts": { - "build": "webpack --mode production" - }, - "dependencies": { - "@galaxyproject/new_user_welcome": "^1.0.6" - }, - "devDependencies": { - "copy-webpack-plugin": "^11.0.0", - "file-loader": "^6.2.0", - "webpack": "^5.75.0", - "webpack-cli": "^4.10.0" - }, - "keywords": [ - "galaxy", - "new_user" - ], - "author": "Alex Ostrovsky", - "license": "AFL-3.0" -} diff --git a/config/plugins/welcome_page/new_user/src/index.js b/config/plugins/welcome_page/new_user/src/index.js deleted file mode 100644 index 86f99908d09e..000000000000 --- a/config/plugins/welcome_page/new_user/src/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import { newUserDict } from '@galaxyproject/new_user_welcome'; -export default newUserDict; \ No newline at end of file diff --git a/config/plugins/welcome_page/new_user/webpack.config.js b/config/plugins/welcome_page/new_user/webpack.config.js deleted file mode 100644 index e8d59455ce0c..000000000000 --- a/config/plugins/welcome_page/new_user/webpack.config.js +++ /dev/null @@ -1,20 +0,0 @@ -const webpack = require("webpack"); -const path = require("path"); -const CopyPlugin = require("copy-webpack-plugin"); - -module.exports = { - mode: "production", - entry: path.resolve(__dirname, "src/index.js"), - output: { - filename: "topics.js", - path: path.resolve(__dirname, "dist"), - }, - plugins: [ - new CopyPlugin({ - patterns: [{ from: "node_modules/@galaxyproject/new_user_welcome", to: "static/topics" }], - }), - ], - resolve: { - modules: ["node_modules"], - }, -}; From 1bbd0959dc839590c30a6d331ca2b1c95ad0ad51 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Thu, 29 Feb 2024 08:48:18 -0500 Subject: [PATCH 2/2] Drop new-user-welcome selenium test --- .../selenium/test_new_user_welcome.py | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/galaxy_test/selenium/test_new_user_welcome.py diff --git a/lib/galaxy_test/selenium/test_new_user_welcome.py b/lib/galaxy_test/selenium/test_new_user_welcome.py deleted file mode 100644 index 13bec2462cf2..000000000000 --- a/lib/galaxy_test/selenium/test_new_user_welcome.py +++ /dev/null @@ -1,50 +0,0 @@ -from .framework import ( - selenium_test, - SeleniumTestCase, -) - -EXPECTED__NEW_USER_WELCOME_AXE_IMPACT = "moderate" - - -class TestNewUserWelcome(SeleniumTestCase): - @selenium_test - def test_new_user_welcome_landing(self): - self.home() - # assert valid (the default) causes a refresh and then you lose the new - # user welcome. - self.register(assert_valid=None) - new_user_welcome = self.components.new_user_welcome - new_user_welcome._.wait_for_present() - new_user_welcome._.assert_no_axe_violations_with_impact_of_at_least(EXPECTED__NEW_USER_WELCOME_AXE_IMPACT) - - new_user_welcome.topics.wait_for_element_count_of_at_least(3) - - topic_titles = [] - for topic in new_user_welcome.topics.all(): - topic_titles.append(topic.get_attribute("data-new-user-welcome-topic-title")) - assert "Data in Galaxy" in topic_titles - self.screenshot("new_user_welcome_landing") - - new_user_welcome._.assert_no_axe_violations_with_impact_of_at_least(EXPECTED__NEW_USER_WELCOME_AXE_IMPACT) - new_user_welcome.topic_button(title="Data in Galaxy").wait_for_and_click() - new_user_welcome.subtopics.wait_for_element_count_of_at_least(3) - - self.screenshot("new_user_welcome_data_subtopic") - subtopic_titles = [] - for topic in new_user_welcome.subtopics.all(): - subtopic_titles.append(topic.get_attribute("data-new-user-welcome-subtopic-title")) - assert "Importing via Data Uploader" in subtopic_titles - new_user_welcome._.assert_no_axe_violations_with_impact_of_at_least(EXPECTED__NEW_USER_WELCOME_AXE_IMPACT) - new_user_welcome.subtopic_button(title="Importing via Data Uploader").wait_for_and_click() - - new_user_welcome.slides.wait_for_present() - # slides violate AXE accessibility test violation found [list] with impact serious: Ensures that lists are structured correctly. - # probably a vue bootstrap issue - new_user_welcome._.assert_no_axe_violations_with_impact_of_at_least("critical") - self.screenshot("new_user_welcome_import_slides_data_0") - - # test back button brings you back... - new_user_welcome.back.wait_for_and_click() - new_user_welcome.subtopics.wait_for_element_count_of_at_least(4) - new_user_welcome.back.wait_for_and_click() - new_user_welcome.topics.wait_for_element_count_of_at_least(3)