Loading client/src/components/Collections/common/CollectionEditView.vue +13 −5 Original line number Diff line number Diff line Loading @@ -55,18 +55,26 @@ const collectionChangeKey = ref(0); const attributesData = computed(() => { return collectionAttributesStore.getAttributes(props.collectionId); }); const attributesLoadError = computed(() => errorMessageAsString(collectionAttributesStore.hasItemLoadError(props.collectionId)) ); const attributesLoadError = computed(() => { const itemLoadError = collectionAttributesStore.getItemLoadError(props.collectionId); if (itemLoadError) { return errorMessageAsString(itemLoadError); } return undefined; }); const collection = computed(() => { return collectionStore.getCollectionById(props.collectionId); }); const collectionLoadError = computed(() => { if (collection.value) { return errorMessageAsString(collectionStore.hasLoadingCollectionElementsError(collection.value)); const collectionElementLoadError = collectionStore.getLoadingCollectionElementsError(collection.value); if (collectionElementLoadError) { return errorMessageAsString(collectionElementLoadError); } } return ""; return undefined; }); watch([attributesLoadError, collectionLoadError], () => { if (attributesLoadError.value) { Loading client/src/components/History/CurrentCollection/CollectionPanel.vue +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ watch( const collectionElements = computed(() => collectionElementsStore.getCollectionElements(dsc.value) ?? []); const loading = computed(() => collectionElementsStore.isLoadingCollectionElements(dsc.value)); const error = computed(() => collectionElementsStore.hasLoadingCollectionElementsError(dsc.value)); const error = computed(() => collectionElementsStore.getLoadingCollectionElementsError(dsc.value)); const jobState = computed(() => ("job_state_summary" in dsc.value ? dsc.value.job_state_summary : undefined)); const populatedStateMsg = computed(() => "populated_state_message" in dsc.value ? dsc.value.populated_state_message : undefined Loading client/src/composables/keyedCache.ts +4 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ export function useKeyedCache<T>( }; }); const hasItemLoadError = computed(() => { const getItemLoadError = computed(() => { return (id: string) => { return loadingErrors.value[id] ?? null; }; Loading Loading @@ -108,11 +108,11 @@ export function useKeyedCache<T>( */ getItemById, /** * A computed function that returns true if the item with the given id is currently being fetched. * A computed function holding errors */ hasItemLoadError, getItemLoadError, /** * A computed function holding errors * A computed function that returns true if the item with the given id is currently being fetched. */ isLoadingItem, /** Loading client/src/stores/collectionAttributesStore.ts +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { fetchCollectionAttributes } from "@/api/datasetCollections"; import { useKeyedCache } from "@/composables/keyedCache"; export const useCollectionAttributesStore = defineStore("collectionAttributesStore", () => { const { storedItems, getItemById, isLoadingItem, hasItemLoadError } = useKeyedCache<DatasetCollectionAttributes>( const { storedItems, getItemById, isLoadingItem, getItemLoadError } = useKeyedCache<DatasetCollectionAttributes>( (params) => fetchCollectionAttributes({ id: params.id, instance_type: "history" }) ); Loading @@ -13,6 +13,6 @@ export const useCollectionAttributesStore = defineStore("collectionAttributesSto storedAttributes: storedItems, getAttributes: getItemById, isLoadingAttributes: isLoadingItem, hasItemLoadError: hasItemLoadError, getItemLoadError: getItemLoadError, }; }); client/src/stores/collectionElementsStore.ts +2 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ export const useCollectionElementsStore = defineStore("collectionElementsStore", }; }); const hasLoadingCollectionElementsError = computed(() => { const getLoadingCollectionElementsError = computed(() => { return (collection: CollectionEntry) => { return loadingCollectionElementsErrors.value[getCollectionKey(collection)] ?? false; }; Loading Loading @@ -214,7 +214,7 @@ export const useCollectionElementsStore = defineStore("collectionElementsStore", storedCollectionElements, getCollectionElements, isLoadingCollectionElements, hasLoadingCollectionElementsError, getLoadingCollectionElementsError, loadingCollectionElementsErrors, getCollectionById, fetchCollection, Loading Loading
client/src/components/Collections/common/CollectionEditView.vue +13 −5 Original line number Diff line number Diff line Loading @@ -55,18 +55,26 @@ const collectionChangeKey = ref(0); const attributesData = computed(() => { return collectionAttributesStore.getAttributes(props.collectionId); }); const attributesLoadError = computed(() => errorMessageAsString(collectionAttributesStore.hasItemLoadError(props.collectionId)) ); const attributesLoadError = computed(() => { const itemLoadError = collectionAttributesStore.getItemLoadError(props.collectionId); if (itemLoadError) { return errorMessageAsString(itemLoadError); } return undefined; }); const collection = computed(() => { return collectionStore.getCollectionById(props.collectionId); }); const collectionLoadError = computed(() => { if (collection.value) { return errorMessageAsString(collectionStore.hasLoadingCollectionElementsError(collection.value)); const collectionElementLoadError = collectionStore.getLoadingCollectionElementsError(collection.value); if (collectionElementLoadError) { return errorMessageAsString(collectionElementLoadError); } } return ""; return undefined; }); watch([attributesLoadError, collectionLoadError], () => { if (attributesLoadError.value) { Loading
client/src/components/History/CurrentCollection/CollectionPanel.vue +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ watch( const collectionElements = computed(() => collectionElementsStore.getCollectionElements(dsc.value) ?? []); const loading = computed(() => collectionElementsStore.isLoadingCollectionElements(dsc.value)); const error = computed(() => collectionElementsStore.hasLoadingCollectionElementsError(dsc.value)); const error = computed(() => collectionElementsStore.getLoadingCollectionElementsError(dsc.value)); const jobState = computed(() => ("job_state_summary" in dsc.value ? dsc.value.job_state_summary : undefined)); const populatedStateMsg = computed(() => "populated_state_message" in dsc.value ? dsc.value.populated_state_message : undefined Loading
client/src/composables/keyedCache.ts +4 −4 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ export function useKeyedCache<T>( }; }); const hasItemLoadError = computed(() => { const getItemLoadError = computed(() => { return (id: string) => { return loadingErrors.value[id] ?? null; }; Loading Loading @@ -108,11 +108,11 @@ export function useKeyedCache<T>( */ getItemById, /** * A computed function that returns true if the item with the given id is currently being fetched. * A computed function holding errors */ hasItemLoadError, getItemLoadError, /** * A computed function holding errors * A computed function that returns true if the item with the given id is currently being fetched. */ isLoadingItem, /** Loading
client/src/stores/collectionAttributesStore.ts +2 −2 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ import { fetchCollectionAttributes } from "@/api/datasetCollections"; import { useKeyedCache } from "@/composables/keyedCache"; export const useCollectionAttributesStore = defineStore("collectionAttributesStore", () => { const { storedItems, getItemById, isLoadingItem, hasItemLoadError } = useKeyedCache<DatasetCollectionAttributes>( const { storedItems, getItemById, isLoadingItem, getItemLoadError } = useKeyedCache<DatasetCollectionAttributes>( (params) => fetchCollectionAttributes({ id: params.id, instance_type: "history" }) ); Loading @@ -13,6 +13,6 @@ export const useCollectionAttributesStore = defineStore("collectionAttributesSto storedAttributes: storedItems, getAttributes: getItemById, isLoadingAttributes: isLoadingItem, hasItemLoadError: hasItemLoadError, getItemLoadError: getItemLoadError, }; });
client/src/stores/collectionElementsStore.ts +2 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,7 @@ export const useCollectionElementsStore = defineStore("collectionElementsStore", }; }); const hasLoadingCollectionElementsError = computed(() => { const getLoadingCollectionElementsError = computed(() => { return (collection: CollectionEntry) => { return loadingCollectionElementsErrors.value[getCollectionKey(collection)] ?? false; }; Loading Loading @@ -214,7 +214,7 @@ export const useCollectionElementsStore = defineStore("collectionElementsStore", storedCollectionElements, getCollectionElements, isLoadingCollectionElements, hasLoadingCollectionElementsError, getLoadingCollectionElementsError, loadingCollectionElementsErrors, getCollectionById, fetchCollection, Loading