Commit 58521424 authored by Florent Poittevin's avatar Florent Poittevin
Browse files

fix: update refresh status polling for all package

parent 775e098f
...@@ -995,6 +995,7 @@ export namespace Enums { ...@@ -995,6 +995,7 @@ export namespace Enums {
| "READY" | "READY"
| "CHECKING" | "CHECKING"
| "CHECKED" | "CHECKED"
| "RESUBMITTING"
| "STORED" | "STORED"
| "INDEXING" | "INDEXING"
| "REINDEXING" | "REINDEXING"
...@@ -1018,6 +1019,7 @@ export namespace Enums { ...@@ -1018,6 +1019,7 @@ export namespace Enums {
READY: "READY" as StatusEnum, READY: "READY" as StatusEnum,
CHECKING: "CHECKING" as StatusEnum, CHECKING: "CHECKING" as StatusEnum,
CHECKED: "CHECKED" as StatusEnum, CHECKED: "CHECKED" as StatusEnum,
RESUBMITTING: "RESUBMITTING" as StatusEnum,
STORED: "STORED" as StatusEnum, STORED: "STORED" as StatusEnum,
INDEXING: "INDEXING" as StatusEnum, INDEXING: "INDEXING" as StatusEnum,
REINDEXING: "REINDEXING" as StatusEnum, REINDEXING: "REINDEXING" as StatusEnum,
...@@ -1065,6 +1067,10 @@ export namespace Enums { ...@@ -1065,6 +1067,10 @@ export namespace Enums {
key: StatusEnum.CHECKED, key: StatusEnum.CHECKED,
value: MARK_AS_TRANSLATABLE("enum.packageStatus.checked"), value: MARK_AS_TRANSLATABLE("enum.packageStatus.checked"),
}, },
{
key: StatusEnum.RESUBMITTING,
value: MARK_AS_TRANSLATABLE("enum.packageStatus.resubmitting"),
},
{ {
key: StatusEnum.STORED, key: StatusEnum.STORED,
value: MARK_AS_TRANSLATABLE("enum.packageStatus.stored"), value: MARK_AS_TRANSLATABLE("enum.packageStatus.stored"),
......
...@@ -61,6 +61,14 @@ import { ...@@ -61,6 +61,14 @@ import {
export class PreservationPlanningDipDetailEditRoutable export class PreservationPlanningDipDetailEditRoutable
extends AbstractDetailEditRoutable<Dip, PreservationPlanningDipStateModel> extends AbstractDetailEditRoutable<Dip, PreservationPlanningDipStateModel>
implements OnInit, OnDestroy { implements OnInit, OnDestroy {
private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [
Enums.Package.StatusEnum.IN_ERROR,
Enums.Package.StatusEnum.COMPLETED,
Enums.Package.StatusEnum.PRESERVATION_ERROR,
Enums.Package.StatusEnum.CLEANED,
Enums.Package.StatusEnum.DISPOSED,
];
historyObs: Observable<StatusHistory[]> = MemoizedUtil.select(this._store, PreservationPlanningDipStatusHistoryState, (state) => state.history); historyObs: Observable<StatusHistory[]> = MemoizedUtil.select(this._store, PreservationPlanningDipStatusHistoryState, (state) => state.history);
isLoadingHistoryObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningDipStatusHistoryState); isLoadingHistoryObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningDipStatusHistoryState);
queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select( queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(
...@@ -233,25 +241,8 @@ export class PreservationPlanningDipDetailEditRoutable ...@@ -233,25 +241,8 @@ export class PreservationPlanningDipDetailEditRoutable
} }
private _shouldContinuePollingWaitCompletedStatus(): boolean { private _shouldContinuePollingWaitCompletedStatus(): boolean {
const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningDipState, state => state.current?.info?.status); const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningDipState, state => state.current?.info?.status) as Enums.Package.StatusEnum;
return isNotNullNorUndefined(status) && ( return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1;
status === Enums.Package.StatusEnum.IN_PROGRESS
|| status === Enums.Package.StatusEnum.IN_PREPARATION
|| status === Enums.Package.StatusEnum.CHECKING
|| status === Enums.Package.StatusEnum.CHECKED
|| status === Enums.Package.StatusEnum.STORED
|| status === Enums.Package.StatusEnum.INDEXING
|| status === Enums.Package.StatusEnum.REINDEXING
|| status === Enums.Package.StatusEnum.DOWNLOADING
|| status === Enums.Package.StatusEnum.RELOADED
|| status === Enums.Package.StatusEnum.CLEANING
|| status === Enums.Package.StatusEnum.DISPOSABLE
|| status === Enums.Package.StatusEnum.DISPOSAL_APPROVED_BY_ORGUNIT
|| status === Enums.Package.StatusEnum.DISPOSAL_APPROVED
|| status === Enums.Package.StatusEnum.REPLICATING_TOMBSTONE
|| status === Enums.Package.StatusEnum.REPLICATING_PACKAGE
|| status === Enums.Package.StatusEnum.UPDATING_RETENTION
);
} }
} }
......
...@@ -62,6 +62,14 @@ import { ...@@ -62,6 +62,14 @@ import {
styleUrls: ["./preservation-planning-sip-detail-edit.routable.scss"], styleUrls: ["./preservation-planning-sip-detail-edit.routable.scss"],
}) })
export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEditRoutable<Sip, PreservationPlanningSipStateModel> implements OnInit, OnDestroy { export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEditRoutable<Sip, PreservationPlanningSipStateModel> implements OnInit, OnDestroy {
private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [
Enums.Package.StatusEnum.IN_ERROR,
Enums.Package.StatusEnum.COMPLETED,
Enums.Package.StatusEnum.PRESERVATION_ERROR,
Enums.Package.StatusEnum.CLEANED,
Enums.Package.StatusEnum.DISPOSED,
];
historyObs: Observable<StatusHistory[]> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.history); historyObs: Observable<StatusHistory[]> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.history);
isLoadingHistoryObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningSipStatusHistoryState); isLoadingHistoryObs: Observable<boolean> = MemoizedUtil.isLoading(this._store, PreservationPlanningSipStatusHistoryState);
queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.queryParameters); queryParametersObs: Observable<QueryParameters> = MemoizedUtil.select(this._store, PreservationPlanningSipStatusHistoryState, state => state.queryParameters);
...@@ -246,25 +254,8 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi ...@@ -246,25 +254,8 @@ export class PreservationPlanningSipDetailEditRoutable extends AbstractDetailEdi
} }
private _shouldContinuePollingWaitCompletedStatus(): boolean { private _shouldContinuePollingWaitCompletedStatus(): boolean {
const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningSipState, state => state.current?.info?.status); const status = MemoizedUtil.selectSnapshot(this._store, PreservationPlanningSipState, state => state.current?.info?.status) as Enums.Package.StatusEnum;
return isNotNullNorUndefined(status) && ( return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1;
status === Enums.Package.StatusEnum.IN_PROGRESS
|| status === Enums.Package.StatusEnum.IN_PREPARATION
|| status === Enums.Package.StatusEnum.CHECKING
|| status === Enums.Package.StatusEnum.CHECKED
|| status === Enums.Package.StatusEnum.STORED
|| status === Enums.Package.StatusEnum.INDEXING
|| status === Enums.Package.StatusEnum.REINDEXING
|| status === Enums.Package.StatusEnum.DOWNLOADING
|| status === Enums.Package.StatusEnum.RELOADED
|| status === Enums.Package.StatusEnum.CLEANING
|| status === Enums.Package.StatusEnum.DISPOSABLE
|| status === Enums.Package.StatusEnum.DISPOSAL_APPROVED_BY_ORGUNIT
|| status === Enums.Package.StatusEnum.DISPOSAL_APPROVED
|| status === Enums.Package.StatusEnum.REPLICATING_TOMBSTONE
|| status === Enums.Package.StatusEnum.REPLICATING_PACKAGE
|| status === Enums.Package.StatusEnum.UPDATING_RETENTION
);
} }
} }
......
...@@ -85,6 +85,17 @@ import { ...@@ -85,6 +85,17 @@ import {
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutable<Aip, SharedAipStateModel> implements OnInit { export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutable<Aip, SharedAipStateModel> implements OnInit {
private readonly STATUS_TO_STOP_POLLING_REFRESH_STATUS: Enums.Package.StatusEnum[] = [
Enums.Package.StatusEnum.IN_ERROR,
Enums.Package.StatusEnum.COMPLETED,
Enums.Package.StatusEnum.PRESERVATION_ERROR,
Enums.Package.StatusEnum.CLEANED,
Enums.Package.StatusEnum.DISPOSED,
Enums.Package.StatusEnum.DISPOSABLE,
Enums.Package.StatusEnum.DISPOSAL_APPROVED,
Enums.Package.StatusEnum.DISPOSAL_APPROVED_BY_ORGUNIT,
];
@Select(SharedAipState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>; @Select(SharedAipState.isLoadingWithDependency) isLoadingWithDependencyObs: Observable<boolean>;
@Select(SharedAipState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>; @Select(SharedAipState.isReadyToBeDisplayed) isReadyToBeDisplayedObs: Observable<boolean>;
...@@ -467,22 +478,8 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl ...@@ -467,22 +478,8 @@ export class SharedAipDetailEditRoutable extends AbstractDetailEditCommonRoutabl
} }
private _shouldContinuePollingWaitCompletedStatus(): boolean { private _shouldContinuePollingWaitCompletedStatus(): boolean {
const status = MemoizedUtil.selectSnapshot(this._store, SharedAipState, state => state.current?.info?.status); const status = MemoizedUtil.selectSnapshot(this._store, SharedAipState, state => state.current?.info?.status) as Enums.Package.StatusEnum;
return isNotNullNorUndefined(status) && ( return isNotNullNorUndefined(status) && this.STATUS_TO_STOP_POLLING_REFRESH_STATUS.indexOf(status) === -1;
status === Enums.Package.StatusEnum.IN_PROGRESS
|| status === Enums.Package.StatusEnum.IN_PREPARATION
|| status === Enums.Package.StatusEnum.CHECKING
|| status === Enums.Package.StatusEnum.CHECKED
|| status === Enums.Package.StatusEnum.STORED
|| status === Enums.Package.StatusEnum.INDEXING
|| status === Enums.Package.StatusEnum.REINDEXING
|| status === Enums.Package.StatusEnum.DOWNLOADING
|| status === Enums.Package.StatusEnum.RELOADED
|| status === Enums.Package.StatusEnum.CLEANING
|| status === Enums.Package.StatusEnum.REPLICATING_TOMBSTONE
|| status === Enums.Package.StatusEnum.REPLICATING_PACKAGE
|| status === Enums.Package.StatusEnum.UPDATING_RETENTION
);
} }
} }
......
...@@ -920,6 +920,7 @@ ...@@ -920,6 +920,7 @@
"reloaded": "Neu geladen", "reloaded": "Neu geladen",
"replicatingPackage": "Paket replizieren", "replicatingPackage": "Paket replizieren",
"replicatingTombstone": "Eintrag replizieren", "replicatingTombstone": "Eintrag replizieren",
"resubmitting": "Wiedervorlage",
"stored": "Gespeichert", "stored": "Gespeichert",
"updatingRetention": "Aktualisierung der Aufbewahrungsfrist" "updatingRetention": "Aktualisierung der Aufbewahrungsfrist"
}, },
...@@ -1849,6 +1850,7 @@ ...@@ -1849,6 +1850,7 @@
"archiveCheck": "Archivprüfung", "archiveCheck": "Archivprüfung",
"archivePreloadBig": "Archive Preloading [big size]", "archivePreloadBig": "Archive Preloading [big size]",
"archivePreloadSmall": "Archive Preloading [small size]", "archivePreloadSmall": "Archive Preloading [small size]",
"checkComplianceLevel": "Konformitätsstufe prüfen",
"cleanSubmission": "Bereinigung der Einreichung", "cleanSubmission": "Bereinigung der Einreichung",
"disposal": "Löschvorgang auslösen", "disposal": "Löschvorgang auslösen",
"fixity": "Beständigkeit", "fixity": "Beständigkeit",
...@@ -1858,8 +1860,7 @@ ...@@ -1858,8 +1860,7 @@
"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": {
......
...@@ -920,6 +920,7 @@ ...@@ -920,6 +920,7 @@
"reloaded": "Reloaded", "reloaded": "Reloaded",
"replicatingPackage": "Replicating package", "replicatingPackage": "Replicating package",
"replicatingTombstone": "Replicating tombstone", "replicatingTombstone": "Replicating tombstone",
"resubmitting": "Resubmitting",
"stored": "Stored", "stored": "Stored",
"updatingRetention": "Updating the retention" "updatingRetention": "Updating the retention"
}, },
...@@ -1849,6 +1850,7 @@ ...@@ -1849,6 +1850,7 @@
"archiveCheck": "Archive Check", "archiveCheck": "Archive Check",
"archivePreloadBig": "Archive Preloading [big size]", "archivePreloadBig": "Archive Preloading [big size]",
"archivePreloadSmall": "Archive Preloading [small size]", "archivePreloadSmall": "Archive Preloading [small size]",
"checkComplianceLevel": "Check Compliance Level",
"cleanSubmission": "Clean Submission", "cleanSubmission": "Clean Submission",
"disposal": "Trigger Disposal Processes", "disposal": "Trigger Disposal Processes",
"fixity": "Fixity", "fixity": "Fixity",
...@@ -1858,8 +1860,7 @@ ...@@ -1858,8 +1860,7 @@
"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": {
......
...@@ -920,6 +920,7 @@ ...@@ -920,6 +920,7 @@
"reloaded": "Rechargement", "reloaded": "Rechargement",
"replicatingPackage": "En cours de réplication de l'archive", "replicatingPackage": "En cours de réplication de l'archive",
"replicatingTombstone": "En cours de réplication du record", "replicatingTombstone": "En cours de réplication du record",
"resubmitting": "Resoumission",
"stored": "Stocké", "stored": "Stocké",
"updatingRetention": "Mise à jour de la duréee de conservation" "updatingRetention": "Mise à jour de la duréee de conservation"
}, },
...@@ -1849,6 +1850,7 @@ ...@@ -1849,6 +1850,7 @@
"archiveCheck": "Vérification des archives", "archiveCheck": "Vérification des archives",
"archivePreloadBig": "Pré-chargement des archives [grande taille]", "archivePreloadBig": "Pré-chargement des archives [grande taille]",
"archivePreloadSmall": "Pré-chargement des archives [petite taille]", "archivePreloadSmall": "Pré-chargement des archives [petite taille]",
"checkComplianceLevel": "Vérifier le niveau de conformité",
"cleanSubmission": "Nettoyage de la soumission", "cleanSubmission": "Nettoyage de la soumission",
"disposal": "Déclenchement de l'application des sorts finaux", "disposal": "Déclenchement de l'application des sorts finaux",
"fixity": "Fixité", "fixity": "Fixité",
...@@ -1858,8 +1860,7 @@ ...@@ -1858,8 +1860,7 @@
"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": {
......
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