From c2bd9df6218a6e7fe45a9b11cd3d4d0570854192 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Wed, 25 Jan 2023 14:43:01 +0100
Subject: [PATCH 1/4] Disable Switch histories for anonymous users
---
.../components/History/CurrentHistory/HistoryNavigation.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.vue b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
index 9d73f41cf6a..1e4cfba5873 100644
--- a/client/src/components/History/CurrentHistory/HistoryNavigation.vue
+++ b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
@@ -23,7 +23,8 @@
data-description="switch to another history"
size="sm"
variant="link"
- title="Switch to history">
+ :disabled="currentUser.isAnonymous"
+ :title="userTitle('Switch to history')">
From ba4907cb897530c2629c3862fd46ae0db4ce9761 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Wed, 25 Jan 2023 14:43:31 +0100
Subject: [PATCH 2/4] Disable creating histories for anonymous users
---
.../components/History/CurrentHistory/HistoryNavigation.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.vue b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
index 1e4cfba5873..adc4d45a35e 100644
--- a/client/src/components/History/CurrentHistory/HistoryNavigation.vue
+++ b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
@@ -12,7 +12,8 @@
data-description="create new history"
size="sm"
variant="link"
- title="Create new history"
+ :disabled="currentUser.isAnonymous"
+ :title="userTitle('Create new history')"
@click="$emit('createNewHistory')">
From 66464d201c9454db75821f500d007d8bd1bb7ce1 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Wed, 25 Jan 2023 17:06:55 +0100
Subject: [PATCH 3/4] Add tests for buttons availability
---
.../History/CurrentHistory/HistoryNavigation.test.js | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.test.js b/client/src/components/History/CurrentHistory/HistoryNavigation.test.js
index e0486579328..3fffa8e50ec 100644
--- a/client/src/components/History/CurrentHistory/HistoryNavigation.test.js
+++ b/client/src/components/History/CurrentHistory/HistoryNavigation.test.js
@@ -56,6 +56,11 @@ describe("History Navigation", () => {
provide: { store },
});
+ const createButton = wrapper.find("*[data-description='create new history']");
+ expect(createButton.attributes().disabled).toBeFalsy();
+ const switchButton = wrapper.find("*[data-description='switch to another history']");
+ expect(switchButton.attributes().disabled).toBeFalsy();
+
const dropDown = wrapper.find("*[data-description='history options']");
const optionElements = dropDown.findAll("b-dropdown-item-stub");
const optionTexts = optionElements.wrappers.map((el) => el.text());
@@ -76,8 +81,12 @@ describe("History Navigation", () => {
provide: { store },
});
- const dropDown = wrapper.find("*[data-description='history options']");
+ const createButton = wrapper.find("*[data-description='create new history']");
+ expect(createButton.attributes().disabled).toBeTruthy();
+ const switchButton = wrapper.find("*[data-description='switch to another history']");
+ expect(switchButton.attributes().disabled).toBeTruthy();
+ const dropDown = wrapper.find("*[data-description='history options']");
const enabledOptionElements = dropDown.findAll("b-dropdown-item-stub:not([disabled])");
const enabledOptionTexts = enabledOptionElements.wrappers.map((el) => el.text());
expect(enabledOptionTexts).toStrictEqual(anonymousOptions);
From 4d57cd820bbd99ccb32deeebc6f7db589fd750c2 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Thu, 26 Jan 2023 16:18:03 +0100
Subject: [PATCH 4/4] Adapt Window Manager tour
Instead of auto-creating a new history, make it a requirement.
---
config/plugins/tours/core.windows.yaml | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/config/plugins/tours/core.windows.yaml b/config/plugins/tours/core.windows.yaml
index 226150dadf6..d2318ce3c5d 100644
--- a/config/plugins/tours/core.windows.yaml
+++ b/config/plugins/tours/core.windows.yaml
@@ -6,15 +6,14 @@ tags:
- "UI"
- "visualization"
+requirements:
+ - new_history
+
steps:
- content: "This short tour will walk you through Galaxy's Window Manager feature"
- - element: "#current-history-panel .create-hist-btn"
- intro: "Before using the Window Manager, we will create a new history for this tour."
- postclick: true
-
- element: "#tool-panel-upload-button"
- intro: "Now, we will upload some tabular data into our new history."
+ intro: "First, we will upload some tabular data into our new history."
postclick: true
- element: "#btn-new"
@@ -78,7 +77,7 @@ steps:
- element: "#right"
intro: "This is your history. It contains our two tables being uploaded."
-
+
- component: history_panel.item(hid=1,state=ok).display_button
intro: "Clicking the eye-icon usually displays a dataset in the center panel."
postclick: true