From 3742d6ebef4d755ad1054c9593d6e43d86f077ff Mon Sep 17 00:00:00 2001 From: John Chilton Date: Tue, 21 Feb 2023 13:24:43 -0500 Subject: [PATCH] Cleanup object store selection client. --- .../History/CurrentHistory/HistoryCounter.vue | 17 +++++++---------- ...orePopover.vue => PreferredStorePopover.vue} | 1 + ...ore.test.js => SelectPreferredStore.test.js} | 9 ++++----- ...ObjectStore.vue => SelectPreferredStore.vue} | 9 +++------ .../ObjectStore/SelectObjectStore.vue | 10 ++++------ client/src/components/User/UserPreferences.vue | 6 ------ .../User/UserPreferredObjectStore.test.js | 3 +-- .../User/UserPreferredObjectStore.vue | 17 +++++++---------- .../Workflow/Run/WorkflowRunFormSimple.vue | 3 --- .../Run/WorkflowSelectPreferredObjectStore.vue | 5 ----- .../Run/WorkflowStorageConfiguration.test.js | 1 - .../Run/WorkflowStorageConfiguration.vue | 6 ------ ...orkflowTargetPreferredObjectStorePopover.vue | 2 +- 13 files changed, 28 insertions(+), 61 deletions(-) rename client/src/components/History/CurrentHistory/{HistoryTargetPreferredObjectStorePopover.vue => PreferredStorePopover.vue} (98%) rename client/src/components/History/CurrentHistory/{HistorySelectPreferredObjectStore.test.js => SelectPreferredStore.test.js} (88%) rename client/src/components/History/CurrentHistory/{HistorySelectPreferredObjectStore.vue => SelectPreferredStore.vue} (92%) diff --git a/client/src/components/History/CurrentHistory/HistoryCounter.vue b/client/src/components/History/CurrentHistory/HistoryCounter.vue index 5c3a4d8a22c5..30ef239cf236 100644 --- a/client/src/components/History/CurrentHistory/HistoryCounter.vue +++ b/client/src/components/History/CurrentHistory/HistoryCounter.vue @@ -20,11 +20,11 @@ @click="showPreferredObjectStoreModal = true"> - - + - @@ -91,15 +90,14 @@ import prettyBytes from "pretty-bytes"; import { formatDistanceToNowStrict } from "date-fns"; import { usesDetailedHistoryMixin } from "./usesDetailedHistoryMixin.js"; import CurrentUser from "components/providers/CurrentUser"; -import HistoryTargetPreferredObjectStorePopover from "./HistoryTargetPreferredObjectStorePopover"; -import HistorySelectPreferredObjectStore from "./HistorySelectPreferredObjectStore"; -import { getAppRoot } from "onload/loadConfig"; +import PreferredStorePopover from "./PreferredStorePopover"; +import SelectPreferredStore from "./SelectPreferredStore"; export default { components: { CurrentUser, - HistoryTargetPreferredObjectStorePopover, - HistorySelectPreferredObjectStore, + PreferredStorePopover, + SelectPreferredStore, }, filters: { niceFileSize(rawSize = 0) { @@ -119,7 +117,6 @@ export default { reloadButtonVariant: "link", showPreferredObjectStoreModal: false, historyPreferredObjectStoreId: this.history.preferred_object_store_id, - root: getAppRoot(), }; }, mounted() { diff --git a/client/src/components/History/CurrentHistory/HistoryTargetPreferredObjectStorePopover.vue b/client/src/components/History/CurrentHistory/PreferredStorePopover.vue similarity index 98% rename from client/src/components/History/CurrentHistory/HistoryTargetPreferredObjectStorePopover.vue rename to client/src/components/History/CurrentHistory/PreferredStorePopover.vue index a3f047f539d7..45374721179c 100644 --- a/client/src/components/History/CurrentHistory/HistoryTargetPreferredObjectStorePopover.vue +++ b/client/src/components/History/CurrentHistory/PreferredStorePopover.vue @@ -32,6 +32,7 @@ export default { }, historyPreferredObjectStoreId: { type: String, + default: null, }, user: { type: Object, required: true }, }, diff --git a/client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.test.js b/client/src/components/History/CurrentHistory/SelectPreferredStore.test.js similarity index 88% rename from client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.test.js rename to client/src/components/History/CurrentHistory/SelectPreferredStore.test.js index a02300ce0d50..14f50f81ba67 100644 --- a/client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.test.js +++ b/client/src/components/History/CurrentHistory/SelectPreferredStore.test.js @@ -1,13 +1,12 @@ import { mount } from "@vue/test-utils"; import { getLocalVue } from "tests/jest/helpers"; -import HistorySelectPreferredObjectStore from "./HistorySelectPreferredObjectStore"; +import SelectPreferredStore from "./SelectPreferredStore"; import axios from "axios"; import MockAdapter from "axios-mock-adapter"; import flushPromises from "flush-promises"; const localVue = getLocalVue(true); -const TEST_ROOT = "/"; const TEST_HISTORY_ID = "myTestHistoryId"; const TEST_HISTORY = { @@ -16,8 +15,8 @@ const TEST_HISTORY = { }; function mountComponent() { - const wrapper = mount(HistorySelectPreferredObjectStore, { - propsData: { userPreferredObjectStoreId: null, history: TEST_HISTORY, root: TEST_ROOT }, + const wrapper = mount(SelectPreferredStore, { + propsData: { userPreferredObjectStoreId: null, history: TEST_HISTORY }, localVue, }); return wrapper; @@ -30,7 +29,7 @@ const OBJECT_STORES = [ { object_store_id: "object_store_2", badges: [], quota: { enabled: false } }, ]; -describe("HistorySelectPreferredObjectStore.vue", () => { +describe("SelectPreferredStore.vue", () => { let axiosMock; beforeEach(async () => { diff --git a/client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.vue b/client/src/components/History/CurrentHistory/SelectPreferredStore.vue similarity index 92% rename from client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.vue rename to client/src/components/History/CurrentHistory/SelectPreferredStore.vue index 622329363faf..6cf49f4f0801 100644 --- a/client/src/components/History/CurrentHistory/HistorySelectPreferredObjectStore.vue +++ b/client/src/components/History/CurrentHistory/SelectPreferredStore.vue @@ -1,6 +1,5 @@