diff --git a/src/app/features/preservation/aip/helpers/aip.helper.ts b/src/app/features/preservation/aip/helpers/aip.helper.ts index 2d496386ffff8df04001614d55e2867f8aab3da4..1b8a6edb700486df6200b481e278b7eafa903a4f 100644 --- a/src/app/features/preservation/aip/helpers/aip.helper.ts +++ b/src/app/features/preservation/aip/helpers/aip.helper.ts @@ -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; diff --git a/src/app/features/preservation/job/components/dialogs/job-report-detail/job-report-detail.dialog.ts b/src/app/features/preservation/job/components/dialogs/job-report-detail/job-report-detail.dialog.ts index 5566647d76f7f4748b00ec11de9e4646bd5f6dc1..d61b15ecb06cbae140eaea16d68bde4db156194a 100644 --- a/src/app/features/preservation/job/components/dialogs/job-report-detail/job-report-detail.dialog.ts +++ b/src/app/features/preservation/job/components/dialogs/job-report-detail/job-report-detail.dialog.ts @@ -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, }, ];