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

feat: [DLCM-1987] adapt preservation job report for deposits

parent 6f35763d
...@@ -1215,6 +1215,10 @@ export namespace Enums { ...@@ -1215,6 +1215,10 @@ export namespace Enums {
key: TypeEnum.ARCHIVE_PRELOAD_BIG, key: TypeEnum.ARCHIVE_PRELOAD_BIG,
value: MARK_AS_TRANSLATABLE("preservation.job.jobTypeEnum.archivePreloadBig"), value: MARK_AS_TRANSLATABLE("preservation.job.jobTypeEnum.archivePreloadBig"),
}, },
{
key: TypeEnum.CHECK_COMPLIANCE_LEVEL,
value: MARK_AS_TRANSLATABLE("preservation.job.jobTypeEnum.checkComplianceLevel"),
},
]; ];
export type ExecutionReportStatusEnum = export type ExecutionReportStatusEnum =
......
...@@ -5,6 +5,7 @@ import {NgxsModule} from "@ngxs/store"; ...@@ -5,6 +5,7 @@ import {NgxsModule} from "@ngxs/store";
import {PreservationPlanningDepositListRoutable} from "@preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable"; import {PreservationPlanningDepositListRoutable} from "@preservation-planning/deposit/components/routables/deposit-list/preservation-planning-deposit-list.routable";
import {PreservationPlanningDepositRoutingModule} from "@preservation-planning/deposit/preservation-planning-deposit-routing.module"; import {PreservationPlanningDepositRoutingModule} from "@preservation-planning/deposit/preservation-planning-deposit-routing.module";
import {PreservationPlanningDepositState} from "@preservation-planning/deposit/stores/preservation-planning-deposit.state"; import {PreservationPlanningDepositState} from "@preservation-planning/deposit/stores/preservation-planning-deposit.state";
import {PreservationPlanningDepositStatusHistoryState} from "@preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state";
const routables = [ const routables = [
PreservationPlanningDepositListRoutable, PreservationPlanningDepositListRoutable,
...@@ -27,6 +28,7 @@ const presentationals = [ ...@@ -27,6 +28,7 @@ const presentationals = [
TranslateModule.forChild({}), TranslateModule.forChild({}),
NgxsModule.forFeature([ NgxsModule.forFeature([
PreservationPlanningDepositState, PreservationPlanningDepositState,
PreservationPlanningDepositStatusHistoryState,
]), ]),
], ],
entryComponents: [ entryComponents: [
......
...@@ -15,6 +15,7 @@ import { ...@@ -15,6 +15,7 @@ import {
preservationPlanningDepositActionNameSpace, preservationPlanningDepositActionNameSpace,
} from "@preservation-planning/deposit/stores/preservation-planning-deposit.action"; } from "@preservation-planning/deposit/stores/preservation-planning-deposit.action";
import {StateEnum} from "@shared/enums/state.enum"; import {StateEnum} from "@shared/enums/state.enum";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import { import {
ApiService, ApiService,
defaultResourceStateInitValue, defaultResourceStateInitValue,
...@@ -27,8 +28,13 @@ import { ...@@ -27,8 +28,13 @@ import {
StoreUtil, StoreUtil,
} from "solidify-frontend"; } from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum"; import {ApiActionNameEnum} from "../../../../shared/enums/api-action-name.enum";
import {
PreservationPlanningDepositStatusHistoryState,
PreservationPlanningDepositStatusHistoryStateModel,
} from "./status-history/preservation-planning-deposit-status-history.state";
export interface PreservationPlanningDepositStateModel extends ResourceStateModel<Deposit> { export interface PreservationPlanningDepositStateModel extends ResourceStateModel<Deposit> {
[StateEnum.preservationPlanning_deposit_statusHistory]: PreservationPlanningDepositStatusHistoryStateModel;
isLoadingDataFile: boolean; isLoadingDataFile: boolean;
} }
...@@ -37,8 +43,12 @@ export interface PreservationPlanningDepositStateModel extends ResourceStateMode ...@@ -37,8 +43,12 @@ export interface PreservationPlanningDepositStateModel extends ResourceStateMode
name: StateEnum.preservationPlanning_deposit, name: StateEnum.preservationPlanning_deposit,
defaults: { defaults: {
...defaultResourceStateInitValue(), ...defaultResourceStateInitValue(),
[StateEnum.preservationPlanning_deposit_statusHistory]: {...defaultStatusHistoryInitValue()},
isLoadingDataFile: false, isLoadingDataFile: false,
}, },
children: [
PreservationPlanningDepositStatusHistoryState,
],
}) })
export class PreservationPlanningDepositState extends ResourceState<PreservationPlanningDepositStateModel, Deposit> { export class PreservationPlanningDepositState extends ResourceState<PreservationPlanningDepositStateModel, Deposit> {
private readonly _DEPOSIT_FILE_DOWNLOAD_PREFIX: string = "deposit_"; private readonly _DEPOSIT_FILE_DOWNLOAD_PREFIX: string = "deposit_";
......
import {StateEnum} from "@shared/enums/state.enum";
import {StatusHistoryNamespace} from "@shared/stores/status-history/status-history-namespace.model";
import {StatusHistoryAction} from "@shared/stores/status-history/status-history.action";
import {TypeDefaultAction} from "solidify-frontend";
const state = StateEnum.preservationPlanning_deposit_statusHistory;
export namespace PreservationPlanningDepositStatusHistoryAction {
@TypeDefaultAction(state)
export class History extends StatusHistoryAction.History {
}
@TypeDefaultAction(state)
export class HistorySuccess extends StatusHistoryAction.HistorySuccess {
}
@TypeDefaultAction(state)
export class HistoryFail extends StatusHistoryAction.HistoryFail {
}
@TypeDefaultAction(state)
export class ChangeQueryParameters extends StatusHistoryAction.ChangeQueryParameters {
}
}
export const preservationPlanningDepositStatusHistoryNamespace: StatusHistoryNamespace = PreservationPlanningDepositStatusHistoryAction;
import {Injectable} from "@angular/core";
import {ApiEnum} from "@app/shared/enums/api.enum";
import {Sip} from "@models";
import {
Actions,
State,
Store,
} from "@ngxs/store";
import {StateEnum} from "@shared/enums/state.enum";
import {
defaultStatusHistoryInitValue,
StatusHistoryState,
StatusHistoryStateModel,
} from "@shared/stores/status-history/status-history.state";
import {
ApiService,
NotificationService,
} from "solidify-frontend";
import {preservationPlanningDepositStatusHistoryNamespace} from "@preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.action";
export interface PreservationPlanningDepositStatusHistoryStateModel extends StatusHistoryStateModel<Sip> {
}
@Injectable()
@State<PreservationPlanningDepositStatusHistoryStateModel>({
name: StateEnum.preservationPlanning_deposit_statusHistory,
defaults: {
...defaultStatusHistoryInitValue(),
},
})
export class PreservationPlanningDepositStatusHistoryState extends StatusHistoryState<PreservationPlanningDepositStatusHistoryStateModel, Sip> {
constructor(protected apiService: ApiService,
protected store: Store,
protected notificationService: NotificationService,
protected actions$: Actions) {
super(apiService, store, notificationService, actions$, {
nameSpace: preservationPlanningDepositStatusHistoryNamespace,
});
}
protected get _urlResource(): string {
return ApiEnum.preIngestDeposits;
}
}
...@@ -44,6 +44,8 @@ import { ...@@ -44,6 +44,8 @@ import {
StatusHistoryDialogData, StatusHistoryDialogData,
StringUtil, StringUtil,
} from "solidify-frontend"; } from "solidify-frontend";
import {PreservationPlanningDepositStatusHistoryState} from "@app/features/preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state";
import {PreservationPlanningDepositStatusHistoryAction} from "@preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.action";
@Component({ @Component({
selector: "dlcm-preservation-planning-job-report-detail-dialog", selector: "dlcm-preservation-planning-job-report-detail-dialog",
...@@ -63,6 +65,10 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia ...@@ -63,6 +65,10 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia
isLoadingHistorySipObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningSipStatusHistoryState); isLoadingHistorySipObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningSipStatusHistoryState);
queryParametersHistorySipObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.queryParameters); queryParametersHistorySipObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.queryParameters);
historyDepositObs: Observable<StatusHistory[]> = MemoizedUtil.select(this._store, PreservationPlanningDepositStatusHistoryState, state => state.history);
isLoadingHistoryDepositObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningDepositStatusHistoryState);
queryParametersHistoryDepositObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, PreservationPlanningDepositStatusHistoryState, state => state.queryParameters);
paramMessage: { resId: string } = {resId: StringUtil.stringEmpty}; paramMessage: { resId: string } = {resId: StringUtil.stringEmpty};
columns: DataTableColumns<JobExecutionReportLine>[]; columns: DataTableColumns<JobExecutionReportLine>[];
...@@ -174,6 +180,17 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia ...@@ -174,6 +180,17 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia
state: PreservationPlanningSipStatusHistoryAction, state: PreservationPlanningSipStatusHistoryAction,
statusEnums: Enums.Package.StatusEnumTranslate, statusEnums: Enums.Package.StatusEnumTranslate,
}; };
} else if (this.data.jobType === Enums.PreservationJob.TypeEnum.CHECK_COMPLIANCE_LEVEL) {
dataForDialog = {
parentId: null,
resourceResId: jobExecutionReportLine.resId,
name: StateEnum.preservationPlanning_deposit,
statusHistory: this.historyDepositObs,
isLoading: this.isLoadingHistoryDepositObs,
queryParametersObs: this.queryParametersHistoryDepositObs,
state: PreservationPlanningDepositStatusHistoryAction,
statusEnums: Enums.Package.StatusEnumTranslate,
};
} else { } else {
dataForDialog = { dataForDialog = {
parentId: null, parentId: null,
......
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
StateContext, StateContext,
Store, Store,
} from "@ngxs/store"; } from "@ngxs/store";
import {PreservationPlanningDepositAction} from "@preservation-planning/deposit/stores/preservation-planning-deposit.action";
import {ReportNamespace} from "@preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report-namespace.model"; import {ReportNamespace} from "@preservation-planning/job/stores/job-execution/job-execution-report/preservation-planning-job-execution-report-namespace.model";
import { import {
PreservationPlanningJobExecutionReportAction, PreservationPlanningJobExecutionReportAction,
...@@ -18,6 +19,7 @@ import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum"; ...@@ -18,6 +19,7 @@ import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {ApiEnum} from "@shared/enums/api.enum"; import {ApiEnum} from "@shared/enums/api.enum";
import { import {
AppRoutesEnum, AppRoutesEnum,
DepositRoutesEnum,
PreservationPlanningRoutesEnum, PreservationPlanningRoutesEnum,
RoutesEnum, RoutesEnum,
SharedAipRoutesEnum, SharedAipRoutesEnum,
...@@ -42,6 +44,7 @@ import { ...@@ -42,6 +44,7 @@ import {
QueryParameters, QueryParameters,
SolidifyHttpErrorResponseModel, SolidifyHttpErrorResponseModel,
SolidifyStateError, SolidifyStateError,
StoreUtil,
} from "solidify-frontend"; } from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../../shared/enums/api-action-name.enum"; import {ApiActionNameEnum} from "../../../../../../shared/enums/api-action-name.enum";
...@@ -226,8 +229,12 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese ...@@ -226,8 +229,12 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese
@Action(PreservationPlanningJobExecutionReportAction.GoToDeposit) @Action(PreservationPlanningJobExecutionReportAction.GoToDeposit)
goToDeposit(ctx: StateContext<PreservationPlanningJobExecutionStateModel>, action: PreservationPlanningJobExecutionReportAction.GoToDeposit): void { goToDeposit(ctx: StateContext<PreservationPlanningJobExecutionStateModel>, action: PreservationPlanningJobExecutionReportAction.GoToDeposit): void {
const pathDepositDetail = RoutesEnum.preservationPlanningDeposit + urlSeparator + PreservationPlanningRoutesEnum.depositDetail + AppRoutesEnum.separator; this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx as StateContext<any>, this.actions$,
const path = [pathDepositDetail, action.depositId]; new PreservationPlanningDepositAction.GetById(action.depositId),
ctx.dispatch(new Navigate(path)); PreservationPlanningDepositAction.GetByIdSuccess,
resultAction => {
ctx.dispatch(new Navigate([RoutesEnum.deposit, resultAction.model.organizationalUnitId, DepositRoutesEnum.detail, action.depositId]));
}));
} }
} }
...@@ -24,6 +24,7 @@ import {PreservationPlanningSipState} from "@preservation-planning/sip/stores/pr ...@@ -24,6 +24,7 @@ import {PreservationPlanningSipState} from "@preservation-planning/sip/stores/pr
import {PreservationPlanningSipStatusHistoryState} from "@preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state"; import {PreservationPlanningSipStatusHistoryState} from "@preservation-planning/sip/stores/status-history/preservation-planning-sip-status-history.state";
import {PreservationPlanningState} from "@preservation-planning/stores/preservation-planning.state"; import {PreservationPlanningState} from "@preservation-planning/stores/preservation-planning.state";
import {ModuleLoadedEnum} from "@shared/enums/module-loaded.enum"; import {ModuleLoadedEnum} from "@shared/enums/module-loaded.enum";
import {PreservationPlanningDepositStatusHistoryState} from "@preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state";
const routables = [ const routables = [
PreservationPlanningHomeRoutable, PreservationPlanningHomeRoutable,
...@@ -63,6 +64,7 @@ const presentationals = []; ...@@ -63,6 +64,7 @@ const presentationals = [];
PreservationPlanningDipDataFileStatusHistoryState, PreservationPlanningDipDataFileStatusHistoryState,
PreservationPlanningDipAipState, PreservationPlanningDipAipState,
PreservationPlanningDepositState, PreservationPlanningDepositState,
PreservationPlanningDepositStatusHistoryState,
]), ]),
], ],
entryComponents: [ entryComponents: [
......
...@@ -155,7 +155,9 @@ enum StateExtendEnum { ...@@ -155,7 +155,9 @@ enum StateExtendEnum {
preservationPlanning_dip_dataFile = "preservationPlanning_dip_dataFile", preservationPlanning_dip_dataFile = "preservationPlanning_dip_dataFile",
preservationPlanning_dip_dataFile_statusHistory = "preservationPlanning_dip_dataFile_statusHistory", preservationPlanning_dip_dataFile_statusHistory = "preservationPlanning_dip_dataFile_statusHistory",
preservationPlanning_dip_aip = "preservationPlanning_dip_aip", preservationPlanning_dip_aip = "preservationPlanning_dip_aip",
preservationPlanning_deposit = "preservationPlanning_deposit", preservationPlanning_deposit = "preservationPlanning_deposit",
preservationPlanning_deposit_statusHistory = "preservationPlanning_deposit_statusHistory",
} }
export const StateEnum = {...StatePartialEnum, ...StateExtendEnum} as Omit<typeof StatePartialEnum, keyof typeof StateExtendEnum> & typeof StateExtendEnum; export const StateEnum = {...StatePartialEnum, ...StateExtendEnum} as Omit<typeof StatePartialEnum, keyof typeof StateExtendEnum> & typeof StateExtendEnum;
......
...@@ -1858,7 +1858,8 @@ ...@@ -1858,7 +1858,8 @@
"reindex": "Neu indizieren", "reindex": "Neu indizieren",
"reload": "neu laden", "reload": "neu laden",
"replication": "Replikation", "replication": "Replikation",
"replicationCheck": "Replikationsprüfung" "replicationCheck": "Replikationsprüfung",
"checkComplianceLevel": "Konformitätsstufe prüfen"
}, },
"notification": { "notification": {
"init": { "init": {
...@@ -2191,4 +2192,4 @@ ...@@ -2191,4 +2192,4 @@
"title": "Benutzerhandbuch", "title": "Benutzerhandbuch",
"tooltipClose": "Benutzerhandbuch schliessen" "tooltipClose": "Benutzerhandbuch schliessen"
} }
} }
\ No newline at end of file
...@@ -1858,7 +1858,8 @@ ...@@ -1858,7 +1858,8 @@
"reindex": "Reindex", "reindex": "Reindex",
"reload": "Reload", "reload": "Reload",
"replication": "Replication", "replication": "Replication",
"replicationCheck": "Replication Check" "replicationCheck": "Replication Check",
"checkComplianceLevel": "Check Compliance Level"
}, },
"notification": { "notification": {
"init": { "init": {
......
...@@ -1858,7 +1858,8 @@ ...@@ -1858,7 +1858,8 @@
"reindex": "Réindexation", "reindex": "Réindexation",
"reload": "Rechargement", "reload": "Rechargement",
"replication": "Réplication", "replication": "Réplication",
"replicationCheck": "Vérification de la réplication" "replicationCheck": "Vérification de la réplication",
"checkComplianceLevel": "Vérifier le niveau de conformité"
}, },
"notification": { "notification": {
"init": { "init": {
......
This diff is collapsed.
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