diff --git a/client/src/components/DatasetInformation/DatasetAttributes.vue b/client/src/components/DatasetInformation/DatasetAttributes.vue
index dd942966dd0..73874c5f601 100644
--- a/client/src/components/DatasetInformation/DatasetAttributes.vue
+++ b/client/src/components/DatasetInformation/DatasetAttributes.vue
@@ -20,12 +20,16 @@
@click="submit('attribute', 'attributes')">
{{ "Save" | l }}
-
+
{{ "Auto-detect" | l }}
-
+
{{ "Convert" | l }}
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);
diff --git a/client/src/components/History/CurrentHistory/HistoryNavigation.vue b/client/src/components/History/CurrentHistory/HistoryNavigation.vue
index 9d73f41cf6a..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')">
@@ -23,7 +24,8 @@
data-description="switch to another history"
size="sm"
variant="link"
- title="Switch to history">
+ :disabled="currentUser.isAnonymous"
+ :title="userTitle('Switch to history')">
diff --git a/client/src/components/History/Modals/SelectorModal.test.js b/client/src/components/History/Modals/SelectorModal.test.js
index bc026247c84..121e911f63b 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,8 @@ const PROPS_WITH_10_HISTORY_MULTIPLE_SELECT = {
multiple: true,
};
+const CURRENT_HISTORY_INDICATION_TEXT = "(Current)";
+
describe("History SelectorModal.vue", () => {
let wrapper;
@@ -38,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(".table-info");
- expect(selectedRows.length).toBe(1);
- expect(selectedRows.at(0).attributes("data-pk")).toBe(SELECTED_HISTORY_ID);
+ const currentHistoryRow = wrapper.find(`[data-pk="${CURRENT_HISTORY_ID}"]`);
+ expect(currentHistoryRow.html()).toContain(CURRENT_HISTORY_INDICATION_TEXT);
});
it("paginates the histories", async () => {
@@ -67,25 +68,29 @@ 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());
+ });
});
});
diff --git a/client/src/components/History/Modals/SelectorModal.vue b/client/src/components/History/Modals/SelectorModal.vue
index 76dded0a196..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)
+
@@ -31,7 +34,9 @@
- Add Selected
+
+ Add Selected
+
@@ -69,13 +74,8 @@ export default {
};
},
computed: {
- formattedItems() {
- return this.histories.map((item) => {
- if (item.id === this.currentHistoryId) {
- item._rowVariant = "info";
- }
- return item;
- });
+ isEmptySelection() {
+ return this.selectedHistories.length === 0;
},
},
watch: {
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 }}...