diff --git a/client/src/components/ConfigTemplates/useConfigurationTesting.ts b/client/src/components/ConfigTemplates/useConfigurationTesting.ts index 26ec1389cf8..3f4307b246b 100644 --- a/client/src/components/ConfigTemplates/useConfigurationTesting.ts +++ b/client/src/components/ConfigTemplates/useConfigurationTesting.ts @@ -157,7 +157,12 @@ export function useConfigurationTemplateEdit, testUpdateUrl: TestUpdateUrl, updateUrl: UpdateUrl, - useRouting: InstanceRoutingComposableType + useRouting: InstanceRoutingComposableType, + /** + * Callback to be called when the object store is updated. + * By default, no action is taken. + */ + onUpdated: (result: R) => void = (__: R) => {} ) { const { testRunning, testResults } = useConfigurationTesting(); const showForceActionButton = ref(false); @@ -165,6 +170,7 @@ export function useConfigurationTemplateEdit import { computed } from "vue"; +import { useObjectStoreStore } from "@/stores/objectStoreStore"; import { useObjectStoreTemplatesStore } from "@/stores/objectStoreTemplatesStore"; import { useInstanceRouting } from "./routing"; @@ -12,6 +13,9 @@ import LoadingSpan from "@/components/LoadingSpan.vue"; interface Props { templateId: string; } + +const { addOrUpdateObjectStore } = useObjectStoreStore(); + const objectStoreTemplatesStore = useObjectStoreTemplatesStore(); objectStoreTemplatesStore.fetchTemplates(); @@ -21,6 +25,7 @@ const props = defineProps(); const template = computed(() => objectStoreTemplatesStore.getLatestTemplate(props.templateId)); async function onCreated(objectStore: UserConcreteObjectStore) { + addOrUpdateObjectStore(objectStore); const message = `Created storage location ${objectStore.name}`; goToIndex({ message }); } diff --git a/client/src/components/ObjectStore/Instances/EditInstance.vue b/client/src/components/ObjectStore/Instances/EditInstance.vue index 57c4a211bf8..28c3705f565 100644 --- a/client/src/components/ObjectStore/Instances/EditInstance.vue +++ b/client/src/components/ObjectStore/Instances/EditInstance.vue @@ -3,6 +3,7 @@ import { BTab, BTabs } from "bootstrap-vue"; import { computed, ref } from "vue"; import { useConfigurationTemplateEdit } from "@/components/ConfigTemplates/useConfigurationTesting"; +import { useObjectStoreStore } from "@/stores/objectStoreStore"; import { useInstanceAndTemplate } from "./instance"; import { useInstanceRouting } from "./routing"; @@ -16,6 +17,8 @@ interface Props { instanceId: string; } +const { addOrUpdateObjectStore } = useObjectStoreStore(); + const props = defineProps(); const { instance, template } = useInstanceAndTemplate(ref(props.instanceId)); @@ -35,7 +38,15 @@ const { testResults, showForceActionButton, submitTitle, -} = useConfigurationTemplateEdit("storage location", instance, template, editTestUrl, editUrl, useInstanceRouting); +} = useConfigurationTemplateEdit( + "storage location", + instance, + template, + editTestUrl, + editUrl, + useInstanceRouting, + addOrUpdateObjectStore +);