Commit 5dd80c71 authored by Alicia.DeDiosFuente's avatar Alicia.DeDiosFuente Committed by Florent Poittevin
Browse files

fix: return archival storage principal node when requesting show status...

fix: return archival storage principal node when requesting show status history in preservation job report
parent 4bb8f3af
......@@ -3,7 +3,7 @@ import {Store} from "@ngxs/store";
import {AipTabEnum} from "@preservation/aip/enums/aip-tab.enum";
import {
AccessResourceApiEnum,
ArchivalStorageResourceApiEnum,
ArchivalStorageResourceApiEnum, BaseResourceApiEnum,
} from "@shared/enums/api.enum";
import {
AppRoutesEnum,
......@@ -11,6 +11,7 @@ import {
} from "@shared/enums/routes.enum";
import {
isNullOrUndefined,
isNumber,
StringUtil,
} from "solidify-frontend";
......@@ -62,8 +63,13 @@ export class AipHelper {
storagionNumber = store.selectSnapshot(state => state.router.state.root.children[0].children[0].children[0].params[PreservationPlanningRoutesEnum.storagionNumberWithoutPrefixParam]);
}
}
const storagion = ArchivalStorageResourceApiEnum.aipStorages.find(aip => aip.index === +storagionNumber);
if (isNullOrUndefined(storagion)) {
if (String(storagionNumber) === PreservationPlanningRoutesEnum.job) {
//in case the request comes from preservation job to show the history status, return the principal storagion url
return ArchivalStorageResourceApiEnum.aip;
}
throw new Error(`The storagion index '${storagionNumber}' is not find in setting`);
}
return storagion.url;
......
......@@ -70,7 +70,7 @@ export class JobReportDetailDialog extends SharedAbstractContainer implements On
logo: "history",
callback: (jobExecutionReportLine: JobExecutionReportLine) => this.historyDataFile(jobExecutionReportLine),
placeholder: TRANSLATE("crud.list.action.history"),
displayOnCondition: (jobExecutionReportLine: JobExecutionReportLine) => jobExecutionReportLine.status === JobReportAipStatusEnum.ERROR,
displayOnCondition: (jobExecutionReportLine: JobExecutionReportLine) => jobExecutionReportLine.status !== JobReportAipStatusEnum.ERROR,
},
];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment