diff --git a/client/src/components/ActivityBar/Items/UploadItem.vue b/client/src/components/ActivityBar/Items/UploadItem.vue index 32f9b0a106e1..e5c2b357d0e7 100644 --- a/client/src/components/ActivityBar/Items/UploadItem.vue +++ b/client/src/components/ActivityBar/Items/UploadItem.vue @@ -1,14 +1,13 @@ diff --git a/client/src/components/History/CurrentHistory/HistoryEmpty.vue b/client/src/components/History/CurrentHistory/HistoryEmpty.vue index addac9563877..f8db2b52cfc3 100644 --- a/client/src/components/History/CurrentHistory/HistoryEmpty.vue +++ b/client/src/components/History/CurrentHistory/HistoryEmpty.vue @@ -1,33 +1,38 @@ + + - {{ message | l }} + {{ localize(message) }} - + You can load your own data or get data from an external source. - - diff --git a/client/src/components/Panels/Common/ToolSection.vue b/client/src/components/Panels/Common/ToolSection.vue index ac087d2bb9ab..0747cc71da3f 100644 --- a/client/src/components/Panels/Common/ToolSection.vue +++ b/client/src/components/Panels/Common/ToolSection.vue @@ -1,7 +1,7 @@ @@ -21,56 +60,3 @@ - - diff --git a/client/src/components/Upload/UploadContainer.vue b/client/src/components/Upload/UploadContainer.vue index 194705b4e57c..ba4fa08dbcc6 100644 --- a/client/src/components/Upload/UploadContainer.vue +++ b/client/src/components/Upload/UploadContainer.vue @@ -9,9 +9,10 @@ import { getUploadDatatypes, getUploadDbKeys, } from "components/Upload/utils"; +import { storeToRefs } from "pinia"; import { computed, onMounted, ref } from "vue"; -import { eventHub } from "@/components/plugins/eventHub.js"; +import { useUploadStore } from "@/stores/uploadStore"; import { uploadPayload } from "@/utils/upload-payload.js"; import CompositeBox from "./CompositeBox"; @@ -79,6 +80,8 @@ const listExtensions = ref([]); const listDbKeys = ref([]); const regular = ref(null); +const { percentage, status } = storeToRefs(useUploadStore()); + const effectiveExtensions = computed(() => { if (props.formats === null || !datatypesMapperReady.value) { return listExtensions.value; @@ -133,12 +136,12 @@ async function loadMappers() { datatypesMapperReady.value = true; } -function progress(percentage, status = null) { - if (percentage !== null) { - eventHub.$emit(`upload:percentage`, percentage); +function progress(newPercentage, newStatus = null) { + if (newPercentage !== null) { + percentage.value = newPercentage; } - if (status !== null) { - eventHub.$emit(`upload:status`, status); + if (newStatus !== null) { + status.value = newStatus; } } diff --git a/client/src/components/plugins/eventHub.js b/client/src/components/plugins/eventHub.js deleted file mode 100644 index 16f137964a46..000000000000 --- a/client/src/components/plugins/eventHub.js +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Mixin provides global event bus other than $root.$emit. Avoids event naming conflicts and makes - * opt-in possible, also works when components aren't part of the same Vue app tree as is often the - * case with our app until backbone is gone. - */ - -import Vue from "vue"; - -export const eventHub = new Vue(); - -export const eventHubMixin = { - created() { - this.eventHub = eventHub; - }, -}; - -export const eventHubPlugin = { - install(Vue) { - Vue.mixin(eventHubMixin); - }, -}; diff --git a/client/src/components/plugins/index.js b/client/src/components/plugins/index.js index fb69bc327c50..47ae8061c664 100644 --- a/client/src/components/plugins/index.js +++ b/client/src/components/plugins/index.js @@ -1,4 +1,3 @@ -export { eventHubMixin, eventHubPlugin } from "./eventHub"; export { iconMixin, iconPlugin } from "./icons"; export { localizationPlugin } from "./localization"; export { vueRxShortcutPlugin, vueRxShortcuts } from "./vueRxShortcuts"; diff --git a/client/src/stores/uploadStore.ts b/client/src/stores/uploadStore.ts new file mode 100644 index 000000000000..e6229b438ca8 --- /dev/null +++ b/client/src/stores/uploadStore.ts @@ -0,0 +1,9 @@ +import { defineStore } from "pinia"; +import { ref } from "vue"; + +export const useUploadStore = defineStore("upload", () => { + const percentage = ref(0); + const status = ref(""); + + return { percentage, status }; +}); diff --git a/client/src/utils/mountVueComponent.js b/client/src/utils/mountVueComponent.js index 222af94a9b5a..62b969b299ab 100644 --- a/client/src/utils/mountVueComponent.js +++ b/client/src/utils/mountVueComponent.js @@ -3,7 +3,7 @@ // the same plugins and events. import BootstrapVue from "bootstrap-vue"; -import { eventHubPlugin, iconPlugin, localizationPlugin, vueRxShortcutPlugin } from "components/plugins"; +import { iconPlugin, localizationPlugin, vueRxShortcutPlugin } from "components/plugins"; import Vue from "vue"; import Vuex from "vuex"; @@ -14,11 +14,6 @@ Vue.use(Vuex); // Bootstrap components Vue.use(BootstrapVue); -// Add a global event bus. We could just use root but I don't think that will -// work right when we have more than one root, which we often will until the -// application has been completely converted to Vue. -Vue.use(eventHubPlugin); - // localization filters and directives Vue.use(localizationPlugin); diff --git a/client/tests/jest/helpers.js b/client/tests/jest/helpers.js index 4c9a75f604e7..0cfdb6648ce0 100644 --- a/client/tests/jest/helpers.js +++ b/client/tests/jest/helpers.js @@ -3,7 +3,6 @@ */ import { createLocalVue, shallowMount } from "@vue/test-utils"; import BootstrapVue from "bootstrap-vue"; -import { eventHubPlugin } from "components/plugins/eventHub"; import { iconPlugin } from "components/plugins/icons"; import { localizationPlugin } from "components/plugins/localization"; import { vueRxShortcutPlugin } from "components/plugins/vueRxShortcuts"; @@ -190,7 +189,6 @@ export function getLocalVue(instrumentLocalization = false) { const l = instrumentLocalization ? testLocalize : _l; localVue.use(localizationPlugin, l); localVue.use(vueRxShortcutPlugin); - localVue.use(eventHubPlugin); localVue.use(iconPlugin); localVue.directive("b-tooltip", mockedDirective); localVue.directive("b-popover", mockedDirective);
+
You can load your own data or get data from an external source.