From c6e700b7c5d7ec3cfa548984406bf4341ce4619c Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Tue, 24 Jan 2023 14:35:25 +0100
Subject: [PATCH 01/40] Disable add button when nothing is selected
---
client/src/components/History/Modals/SelectorModal.vue | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue
index 76dded0a196..60771b6d37a 100644
--- a/client/src/components/History/Modals/SelectorModal.vue
+++ b/client/src/components/History/Modals/SelectorModal.vue
@@ -31,7 +31,9 @@
- Add Selected
+
+ Add Selected
+
@@ -77,6 +79,9 @@ export default {
return item;
});
},
+ isEmptySelection() {
+ return this.selectedHistories.length === 0;
+ },
},
watch: {
histories(newVal) {
From a30beb4da541d6160037ad67855961d5a999bdc9 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Tue, 24 Jan 2023 14:43:52 +0100
Subject: [PATCH 02/40] Update row variant conditionally
The current history will be still highlighted differently when is not explicitly selected.
---
client/src/components/History/Modals/SelectorModal.vue | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue
index 60771b6d37a..4776ed30dd5 100644
--- a/client/src/components/History/Modals/SelectorModal.vue
+++ b/client/src/components/History/Modals/SelectorModal.vue
@@ -74,7 +74,10 @@ export default {
formattedItems() {
return this.histories.map((item) => {
if (item.id === this.currentHistoryId) {
- item._rowVariant = "info";
+ const isCurrentSelected = this.selectedHistories.some(
+ (history) => history.id === this.currentHistoryId
+ );
+ item._rowVariant = isCurrentSelected ? "success" : "info";
}
return item;
});
From 67a5e81d51fcf2e04207733bf6e6c328b1b123cc Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Tue, 24 Jan 2023 15:16:55 +0100
Subject: [PATCH 03/40] Add jest test for current history highlight
---
.../History/Modals/SelectorModal.test.js | 62 +++++++++++++------
1 file changed, 44 insertions(+), 18 deletions(-)
diff --git a/client/src/components/History/Modals/SelectorModal.test.js b/client/src/components/History/Modals/SelectorModal.test.js
index bc026247c84..8aa8b281aed 100644
--- a/client/src/components/History/Modals/SelectorModal.test.js
+++ b/client/src/components/History/Modals/SelectorModal.test.js
@@ -5,7 +5,7 @@ import SelectorModal from "./SelectorModal";
const localVue = getLocalVue();
-const SELECTED_HISTORY_ID = "COOL_ID";
+const CURRENT_HISTORY_ID = "COOL_ID";
const getFakeHistorySummaries = (num, selectedIndex = 0) => {
const result = Array.from({ length: num }, (_, index) => ({
id: `ID-${index}`,
@@ -13,11 +13,11 @@ const getFakeHistorySummaries = (num, selectedIndex = 0) => {
tags: [],
update_time: new Date().toISOString(),
}));
- result[selectedIndex].id = SELECTED_HISTORY_ID;
+ result[selectedIndex].id = CURRENT_HISTORY_ID;
return result;
};
const PROPS_WITH_10_HISTORIES = {
- currentHistoryId: SELECTED_HISTORY_ID,
+ currentHistoryId: CURRENT_HISTORY_ID,
histories: getFakeHistorySummaries(10),
perPage: 3,
static: true, // Force the modal visible for testing
@@ -27,6 +27,9 @@ const PROPS_WITH_10_HISTORY_MULTIPLE_SELECT = {
multiple: true,
};
+const CURRENT_HISTORY_HIGHLIGHT_CLASS = ".table-info";
+const SELECTED_HISTORY_HIGHLIGHT_CLASS = ".table-success";
+
describe("History SelectorModal.vue", () => {
let wrapper;
@@ -41,9 +44,9 @@ describe("History SelectorModal.vue", () => {
it("should highlight the currently selected history", async () => {
await mountWith(PROPS_WITH_10_HISTORIES);
- const selectedRows = wrapper.findAll(".table-info");
+ const selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
expect(selectedRows.length).toBe(1);
- expect(selectedRows.at(0).attributes("data-pk")).toBe(SELECTED_HISTORY_ID);
+ expect(selectedRows.at(0).attributes("data-pk")).toBe(CURRENT_HISTORY_ID);
});
it("paginates the histories", async () => {
@@ -67,25 +70,48 @@ describe("History SelectorModal.vue", () => {
expect(wrapper.emitted()["selectHistory"][0][0].id).toBe(targetHistoryId);
});
- it("select multiple histories", async () => {
- await mountWith(PROPS_WITH_10_HISTORY_MULTIPLE_SELECT);
+ describe("Multi-selection Mode", () => {
+ it("should select multiple histories", async () => {
+ await mountWith(PROPS_WITH_10_HISTORY_MULTIPLE_SELECT);
- expect(wrapper.emitted()["selectHistories"]).toBeUndefined();
+ expect(wrapper.emitted()["selectHistories"]).toBeUndefined();
- const targetHistoryId1 = "ID-1";
- const targetRow1 = wrapper.find(`[data-pk="${targetHistoryId1}"]`);
- await targetRow1.trigger("click");
+ const targetHistoryId1 = "ID-1";
+ const targetRow1 = wrapper.find(`[data-pk="${targetHistoryId1}"]`);
+ await targetRow1.trigger("click");
- const targetHistoryId2 = "ID-2";
- const targetRow2 = wrapper.find(`[data-pk="${targetHistoryId2}"]`);
- await targetRow2.trigger("click");
+ const targetHistoryId2 = "ID-2";
+ const targetRow2 = wrapper.find(`[data-pk="${targetHistoryId2}"]`);
+ await targetRow2.trigger("click");
- expect(wrapper.vm.selectedHistories.length).toBe(2);
+ expect(wrapper.vm.selectedHistories.length).toBe(2);
- const button = wrapper.find(".btn-primary");
+ const button = wrapper.find(".btn-primary");
- await button.trigger("click");
+ await button.trigger("click");
- expect(wrapper.emitted()["selectHistories"][0][0][0].id).toBe(targetHistoryId1);
+ expect(wrapper.emitted()["selectHistories"][0][0][0].id).toBe(targetHistoryId1);
+
+ console.debug(wrapper.html());
+ });
+
+ it("should highlight the current history differently by default but equally when selected", async () => {
+ await mountWith(PROPS_WITH_10_HISTORY_MULTIPLE_SELECT);
+
+ let selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
+ expect(selectedRows.length).toBe(1);
+ expect(selectedRows.at(0).attributes("data-pk")).toBe(CURRENT_HISTORY_ID);
+
+ const targetRow = wrapper.find(`[data-pk="${CURRENT_HISTORY_ID}"]`);
+ await targetRow.trigger("click");
+
+ // No longer highlighted as current
+ selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
+ expect(selectedRows.length).toBe(0);
+
+ // Highlighted as normal selection
+ selectedRows = wrapper.findAll(SELECTED_HISTORY_HIGHLIGHT_CLASS);
+ expect(selectedRows.length).toBe(1);
+ });
});
});
From 6f99f8aa281c6f2caf6002c4597030e7b6ee9936 Mon Sep 17 00:00:00 2001
From: davelopez <46503462+davelopez@users.noreply.github.com>
Date: Tue, 24 Jan 2023 19:12:25 +0100
Subject: [PATCH 04/40] Indicate current history without color highlight
---
.../History/Modals/SelectorModal.test.js | 29 +++----------------
.../History/Modals/SelectorModal.vue | 16 +++-------
2 files changed, 8 insertions(+), 37 deletions(-)
diff --git a/client/src/components/History/Modals/SelectorModal.test.js b/client/src/components/History/Modals/SelectorModal.test.js
index 8aa8b281aed..121e911f63b 100644
--- a/client/src/components/History/Modals/SelectorModal.test.js
+++ b/client/src/components/History/Modals/SelectorModal.test.js
@@ -27,8 +27,7 @@ const PROPS_WITH_10_HISTORY_MULTIPLE_SELECT = {
multiple: true,
};
-const CURRENT_HISTORY_HIGHLIGHT_CLASS = ".table-info";
-const SELECTED_HISTORY_HIGHLIGHT_CLASS = ".table-success";
+const CURRENT_HISTORY_INDICATION_TEXT = "(Current)";
describe("History SelectorModal.vue", () => {
let wrapper;
@@ -41,12 +40,11 @@ describe("History SelectorModal.vue", () => {
await flushPromises();
}
- it("should highlight the currently selected history", async () => {
+ it("should indicate the currently selected history", async () => {
await mountWith(PROPS_WITH_10_HISTORIES);
- const selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
- expect(selectedRows.length).toBe(1);
- expect(selectedRows.at(0).attributes("data-pk")).toBe(CURRENT_HISTORY_ID);
+ const currentHistoryRow = wrapper.find(`[data-pk="${CURRENT_HISTORY_ID}"]`);
+ expect(currentHistoryRow.html()).toContain(CURRENT_HISTORY_INDICATION_TEXT);
});
it("paginates the histories", async () => {
@@ -94,24 +92,5 @@ describe("History SelectorModal.vue", () => {
console.debug(wrapper.html());
});
-
- it("should highlight the current history differently by default but equally when selected", async () => {
- await mountWith(PROPS_WITH_10_HISTORY_MULTIPLE_SELECT);
-
- let selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
- expect(selectedRows.length).toBe(1);
- expect(selectedRows.at(0).attributes("data-pk")).toBe(CURRENT_HISTORY_ID);
-
- const targetRow = wrapper.find(`[data-pk="${CURRENT_HISTORY_ID}"]`);
- await targetRow.trigger("click");
-
- // No longer highlighted as current
- selectedRows = wrapper.findAll(CURRENT_HISTORY_HIGHLIGHT_CLASS);
- expect(selectedRows.length).toBe(0);
-
- // Highlighted as normal selection
- selectedRows = wrapper.findAll(SELECTED_HISTORY_HIGHLIGHT_CLASS);
- expect(selectedRows.length).toBe(1);
- });
});
});
diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue
index 4776ed30dd5..5fdd0440798 100644
--- a/client/src/components/History/Modals/SelectorModal.vue
+++ b/client/src/components/History/Modals/SelectorModal.vue
@@ -11,7 +11,7 @@
primary-key="id"
:fields="fields"
:filter="filter"
- :items="formattedItems"
+ :items="histories"
:per-page="perPage"
:current-page="currentPage"
:selectable="true"
@@ -22,6 +22,9 @@
selected-variant="success"
@row-selected="rowSelected"
@filtered="onFiltered">
+
+ {{ row.item.name }} (Current)
+
@@ -71,17 +74,6 @@ export default {
};
},
computed: {
- formattedItems() {
- return this.histories.map((item) => {
- if (item.id === this.currentHistoryId) {
- const isCurrentSelected = this.selectedHistories.some(
- (history) => history.id === this.currentHistoryId
- );
- item._rowVariant = isCurrentSelected ? "success" : "info";
- }
- return item;
- });
- },
isEmptySelection() {
return this.selectedHistories.length === 0;
},
From bf1938b1075633b2827aded350a5199a621a0289 Mon Sep 17 00:00:00 2001
From: guerler
Date: Thu, 26 Jan 2023 15:03:07 -0500
Subject: [PATCH 05/40] Hide metadata auto-detection option if dataset is in
improper state
---
.../src/components/DatasetInformation/DatasetAttributes.vue | 4 ++--
lib/galaxy/webapps/galaxy/controllers/dataset.py | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/client/src/components/DatasetInformation/DatasetAttributes.vue b/client/src/components/DatasetInformation/DatasetAttributes.vue
index dd942966dd0..fbb1aa44e52 100644
--- a/client/src/components/DatasetInformation/DatasetAttributes.vue
+++ b/client/src/components/DatasetInformation/DatasetAttributes.vue
@@ -20,12 +20,12 @@
@click="submit('attribute', 'attributes')">
{{ "Save" | l }}
-
+
{{ "Auto-detect" | l }}
-
+
{{ "Convert" | l }}
diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py
index 0473f7d2a1f..c496a8aedeb 100644
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -291,6 +291,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if data.missing_meta():
message = 'Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.'
status = "warning"
+ metadata_disable = data.state not in [trans.model.Dataset.states.OK, trans.model.Dataset.states.FAILED_METADATA]
# datatype conversion
conversion_options = [
(f"{convert_id} (using '{convert_name}')", convert_id)
@@ -369,6 +370,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
"message": message,
"status": status,
"dataset_id": dataset_id,
+ "metadata_disable": metadata_disable,
"attribute_inputs": attribute_inputs,
"conversion_inputs": conversion_inputs,
"conversion_disable": conversion_disable,
From ec7b8b01401e2eb3b4cfb74d4120e95efca8ddbd Mon Sep 17 00:00:00 2001
From: guerler
Date: Thu, 26 Jan 2023 15:09:09 -0500
Subject: [PATCH 06/40] Fix linting
---
.../src/components/DatasetInformation/DatasetAttributes.vue | 6 +++++-
client/src/components/Workflow/Editor/modules/terminals.ts | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/client/src/components/DatasetInformation/DatasetAttributes.vue b/client/src/components/DatasetInformation/DatasetAttributes.vue
index fbb1aa44e52..73874c5f601 100644
--- a/client/src/components/DatasetInformation/DatasetAttributes.vue
+++ b/client/src/components/DatasetInformation/DatasetAttributes.vue
@@ -25,7 +25,11 @@
-
+
{{ "Convert" | l }}
diff --git a/client/src/components/Workflow/Editor/modules/terminals.ts b/client/src/components/Workflow/Editor/modules/terminals.ts
index 1e354149ffa..9b145699bed 100644
--- a/client/src/components/Workflow/Editor/modules/terminals.ts
+++ b/client/src/components/Workflow/Editor/modules/terminals.ts
@@ -490,10 +490,10 @@ export class InputParameterTerminal extends BaseInputTerminal {
const effectiveThisType = this.effectiveType(this.type);
const otherType = ("type" in other && other.type) || "data";
const effectiveOtherType = this.effectiveType(otherType);
- const canAccept = effectiveThisType === effectiveOtherType
+ const canAccept = effectiveThisType === effectiveOtherType;
return new ConnectionAcceptable(
canAccept,
- canAccept ? null: `Cannot attach a ${effectiveOtherType} parameter to a ${effectiveThisType} input`
+ canAccept ? null : `Cannot attach a ${effectiveOtherType} parameter to a ${effectiveThisType} input`
);
}
}
From d71472f07143b712c85ca1005c129ebca4007b55 Mon Sep 17 00:00:00 2001
From: guerler
Date: Thu, 26 Jan 2023 15:49:27 -0500
Subject: [PATCH 07/40] Fix python linting
---
lib/galaxy/webapps/galaxy/controllers/dataset.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/galaxy/webapps/galaxy/controllers/dataset.py b/lib/galaxy/webapps/galaxy/controllers/dataset.py
index c496a8aedeb..95bdbb1632d 100644
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -291,6 +291,10 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
if data.missing_meta():
message = 'Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.'
status = "warning"
+ metadata_disable = data.state not in [
+ trans.model.Dataset.states.OK,
+ trans.model.Dataset.states.FAILED_METADATA,
+ ]
metadata_disable = data.state not in [trans.model.Dataset.states.OK, trans.model.Dataset.states.FAILED_METADATA]
# datatype conversion
conversion_options = [
From 4ed173a0fc38675c916166a4eeafb2dd76121d13 Mon Sep 17 00:00:00 2001
From: Martin Cech
Date: Thu, 26 Jan 2023 15:34:24 -0800
Subject: [PATCH 08/40] move loading indicator and supress it for non-initial
load
---
client/src/components/LoadingSpan.vue | 9 +++++++--
client/src/components/Workflow/Editor/Node.vue | 6 ++++--
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/client/src/components/LoadingSpan.vue b/client/src/components/LoadingSpan.vue
index 85e79a25c7e..c4c3b9d26b5 100644
--- a/client/src/components/LoadingSpan.vue
+++ b/client/src/components/LoadingSpan.vue
@@ -1,7 +1,7 @@
-
- {{ message }}...
+
+ {{ message }}...