diff --git a/client/src/api/schema/schema.ts b/client/src/api/schema/schema.ts index b8a076a8e0ac..373d5d14556b 100644 --- a/client/src/api/schema/schema.ts +++ b/client/src/api/schema/schema.ts @@ -12568,7 +12568,12 @@ export interface components { * Value * @description The values of the job parameter */ - value?: components["schemas"]["EncodedJobParameterHistoryItem"][] | number | boolean | string | null; + value?: + | (components["schemas"]["EncodedJobParameterHistoryItem"] | null)[] + | number + | boolean + | string + | null; }; /** * JobSourceType diff --git a/client/src/components/Collections/common/CollectionEditView.vue b/client/src/components/Collections/common/CollectionEditView.vue index 5b711d143af6..30992cf83df1 100644 --- a/client/src/components/Collections/common/CollectionEditView.vue +++ b/client/src/components/Collections/common/CollectionEditView.vue @@ -53,9 +53,26 @@ const collectionChangeKey = ref(0); const attributesData = computed(() => { return collectionAttributesStore.getAttributes(props.collectionId); }); +const attributesLoadError = computed(() => + errorMessageAsString(collectionAttributesStore.hasItemLoadError(props.collectionId)) +); + const collection = computed(() => { return collectionStore.getCollectionById(props.collectionId); }); +const collectionLoadError = computed(() => { + if (collection.value) { + return errorMessageAsString(collectionStore.hasLoadingCollectionElementsError(collection.value)); + } + return ""; +}); +watch([attributesLoadError, collectionLoadError], () => { + if (attributesLoadError.value) { + errorMessage.value = attributesLoadError.value; + } else if (collectionLoadError.value) { + errorMessage.value = collectionLoadError.value; + } +}); const databaseKeyFromElements = computed(() => { return attributesData.value?.dbkey; }); @@ -101,7 +118,7 @@ async function clickedSave(attribute: string, newValue: any) { body: { dbkey: dbKey }, }); if (error) { - errorMessage.value = errorMessageAsString(error, "History import failed."); + errorMessage.value = errorMessageAsString(error, `Changing ${attribute} failed.`); } } @@ -119,7 +136,7 @@ async function clickedConvert(selectedConverter: any) { await axios.post(url, data).catch(handleError); successMessage.value = "Conversion started successfully."; } catch (err) { - errorMessage.value = errorMessageAsString(err, "History import failed."); + errorMessage.value = errorMessageAsString(err, "Conversion failed."); } } @@ -148,14 +165,14 @@ async function clickedDatatypeChange(selectedDatatype: any) { }); if (error) { - errorMessage.value = errorMessageAsString(error, "History import failed."); + errorMessage.value = errorMessageAsString(error, "Datatype change failed."); return; } successMessage.value = "Datatype changed successfully."; } function handleError(err: any) { - errorMessage.value = errorMessageAsString(err, "History import failed."); + errorMessage.value = errorMessageAsString(err, "Datatype conversion failed."); if (err?.data?.stderr) { jobError.value = err.data; @@ -198,14 +215,14 @@ async function saveAttrs() { {{ localize(infoMessage) }} - + {{ localize(errorMessage) }} {{ localize(successMessage) }} - +