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 {
key: TypeEnum.ARCHIVE_PRELOAD_BIG,
value: MARK_AS_TRANSLATABLE("preservation.job.jobTypeEnum.archivePreloadBig"),
},
{
key: TypeEnum.CHECK_COMPLIANCE_LEVEL,
value: MARK_AS_TRANSLATABLE("preservation.job.jobTypeEnum.checkComplianceLevel"),
},
];
export type ExecutionReportStatusEnum =
......
......@@ -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 {PreservationPlanningDepositRoutingModule} from "@preservation-planning/deposit/preservation-planning-deposit-routing.module";
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 = [
PreservationPlanningDepositListRoutable,
......@@ -27,6 +28,7 @@ const presentationals = [
TranslateModule.forChild({}),
NgxsModule.forFeature([
PreservationPlanningDepositState,
PreservationPlanningDepositStatusHistoryState,
]),
],
entryComponents: [
......
......@@ -15,6 +15,7 @@ import {
preservationPlanningDepositActionNameSpace,
} from "@preservation-planning/deposit/stores/preservation-planning-deposit.action";
import {StateEnum} from "@shared/enums/state.enum";
import {defaultStatusHistoryInitValue} from "@shared/stores/status-history/status-history.state";
import {
ApiService,
defaultResourceStateInitValue,
......@@ -27,8 +28,13 @@ import {
StoreUtil,
} from "solidify-frontend";
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> {
[StateEnum.preservationPlanning_deposit_statusHistory]: PreservationPlanningDepositStatusHistoryStateModel;
isLoadingDataFile: boolean;
}
......@@ -37,8 +43,12 @@ export interface PreservationPlanningDepositStateModel extends ResourceStateMode
name: StateEnum.preservationPlanning_deposit,
defaults: {
...defaultResourceStateInitValue(),
[StateEnum.preservationPlanning_deposit_statusHistory]: {...defaultStatusHistoryInitValue()},
isLoadingDataFile: false,
},
children: [
PreservationPlanningDepositStatusHistoryState,
],
})
export class PreservationPlanningDepositState extends ResourceState<PreservationPlanningDepositStateModel, 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 {
StatusHistoryDialogData,
StringUtil,
} 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({
selector: "dlcm-preservation-planning-job-report-detail-dialog",
......@@ -63,6 +65,10 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia
isLoadingHistorySipObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningSipStatusHistoryState);
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};
columns: DataTableColumns<JobExecutionReportLine>[];
......@@ -174,6 +180,17 @@ export class PreservationPlanningJobReportDetailDialog extends SharedAbstractDia
state: PreservationPlanningSipStatusHistoryAction,
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 {
dataForDialog = {
parentId: null,
......
......@@ -8,6 +8,7 @@ import {
StateContext,
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 {
PreservationPlanningJobExecutionReportAction,
......@@ -18,6 +19,7 @@ import {ApiResourceNameEnum} from "@shared/enums/api-resource-name.enum";
import {ApiEnum} from "@shared/enums/api.enum";
import {
AppRoutesEnum,
DepositRoutesEnum,
PreservationPlanningRoutesEnum,
RoutesEnum,
SharedAipRoutesEnum,
......@@ -42,6 +44,7 @@ import {
QueryParameters,
SolidifyHttpErrorResponseModel,
SolidifyStateError,
StoreUtil,
} from "solidify-frontend";
import {ApiActionNameEnum} from "../../../../../../shared/enums/api-action-name.enum";
......@@ -226,8 +229,12 @@ export class PreservationPlanningJobExecutionReportState extends BaseState<Prese
@Action(PreservationPlanningJobExecutionReportAction.GoToDeposit)
goToDeposit(ctx: StateContext<PreservationPlanningJobExecutionStateModel>, action: PreservationPlanningJobExecutionReportAction.GoToDeposit): void {
const pathDepositDetail = RoutesEnum.preservationPlanningDeposit + urlSeparator + PreservationPlanningRoutesEnum.depositDetail + AppRoutesEnum.separator;
const path = [pathDepositDetail, action.depositId];
ctx.dispatch(new Navigate(path));
this.subscribe(StoreUtil.dispatchActionAndWaitForSubActionCompletion(ctx as StateContext<any>, this.actions$,
new PreservationPlanningDepositAction.GetById(action.depositId),
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
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 {ModuleLoadedEnum} from "@shared/enums/module-loaded.enum";
import {PreservationPlanningDepositStatusHistoryState} from "@preservation-planning/deposit/stores/status-history/preservation-planning-deposit-status-history.state";
const routables = [
PreservationPlanningHomeRoutable,
......@@ -63,6 +64,7 @@ const presentationals = [];
PreservationPlanningDipDataFileStatusHistoryState,
PreservationPlanningDipAipState,
PreservationPlanningDepositState,
PreservationPlanningDepositStatusHistoryState,
]),
],
entryComponents: [
......
......@@ -155,7 +155,9 @@ enum StateExtendEnum {
preservationPlanning_dip_dataFile = "preservationPlanning_dip_dataFile",
preservationPlanning_dip_dataFile_statusHistory = "preservationPlanning_dip_dataFile_statusHistory",
preservationPlanning_dip_aip = "preservationPlanning_dip_aip",
preservationPlanning_deposit = "preservationPlanning_deposit",
preservationPlanning_deposit_statusHistory = "preservationPlanning_deposit_statusHistory",
}
export const StateEnum = {...StatePartialEnum, ...StateExtendEnum} as Omit<typeof StatePartialEnum, keyof typeof StateExtendEnum> & typeof StateExtendEnum;
......
......@@ -1858,7 +1858,8 @@
"reindex": "Neu indizieren",
"reload": "neu laden",
"replication": "Replikation",
"replicationCheck": "Replikationsprüfung"
"replicationCheck": "Replikationsprüfung",
"checkComplianceLevel": "Konformitätsstufe prüfen"
},
"notification": {
"init": {
......@@ -2191,4 +2192,4 @@
"title": "Benutzerhandbuch",
"tooltipClose": "Benutzerhandbuch schliessen"
}
}
\ No newline at end of file
}
......@@ -1858,7 +1858,8 @@
"reindex": "Reindex",
"reload": "Reload",
"replication": "Replication",
"replicationCheck": "Replication Check"
"replicationCheck": "Replication Check",
"checkComplianceLevel": "Check Compliance Level"
},
"notification": {
"init": {
......
......@@ -1858,7 +1858,8 @@
"reindex": "Réindexation",
"reload": "Rechargement",
"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": {
"init": {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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