diff --git a/src/frontend/app/process/process.component.html b/src/frontend/app/process/process.component.html index be29e9dbc1227e3c7d5a8dab9114a044c828b018..9a1a97939bc72b7a97e57adc2a9564c3aeb7899c 100644 --- a/src/frontend/app/process/process.component.html +++ b/src/frontend/app/process/process.component.html @@ -192,6 +192,10 @@ <mat-icon class="followIcon {{this.resourceFollowed ? 'fas':'far'}} fa-star" style="font-size: 20px;"></mat-icon> </button> + <button mat-icon-button [title]="this.translate.instant('lang.freezeRetentionRule')" + class="categoryLabel" (click)="toggleFreezing()"> + <mat-icon class="freezeThawIcon {{this.freezeThawResource ? 'fas':'far'}} fa-pause-circle" style="font-size: 20px;"></mat-icon> + </button> <div class="content-item" *ngIf="this.currentResourceInformations.priority !== undefined"> <b><i class="fas fa-flag" [style.color]="this.currentResourceInformations.priorityColor" style="font-size: 25px;padding-right: 20px;"></i> diff --git a/src/frontend/app/process/process.component.scss b/src/frontend/app/process/process.component.scss index 3923fa49ec32813c0efb8b7bdc7bdcc734d884c2..e87c9d93239789047e894c3091ff2b6b4e7c53c0 100644 --- a/src/frontend/app/process/process.component.scss +++ b/src/frontend/app/process/process.component.scss @@ -410,6 +410,10 @@ color: $secondary; } +.freezeThawIcon { + color: $secondary; +} + .tool-disabled { cursor: not-allowed; opacity: 0.3; diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index da9e3ed8d2dcc020649406856106b38686cbf29d..668b5ebe2026e68c7b68a6062d544801151c272d 100755 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -154,6 +154,7 @@ export class ProcessComponent implements OnInit, OnDestroy { hasContact: boolean = false; resourceFollowed: boolean = false; + freezeThawResource: boolean = false; constructor( public translate: TranslateService, @@ -238,7 +239,7 @@ export class ProcessComponent implements OnInit, OnDestroy { this.currentResourceInformations = { resId: params['resId'], - mailtracking: false + mailtracking: false, }; this.headerService.sideBarButton = { @@ -291,7 +292,8 @@ export class ProcessComponent implements OnInit, OnDestroy { this.detailMode = true; this.currentResourceInformations = { resId: params['detailResId'], - mailtracking: false + mailtracking: false, + retentionFrozen : false }; this.headerService.sideBarButton = { icon: 'fas fa-arrow-left', @@ -320,6 +322,7 @@ export class ProcessComponent implements OnInit, OnDestroy { tap((data: any) => { this.currentResourceInformations = data; this.resourceFollowed = data.followed; + this.freezeThawResource = data.retentionFrozen; if (this.currentResourceInformations.categoryId !== 'outgoing') { this.loadSenders(); } else { @@ -833,6 +836,24 @@ export class ProcessComponent implements OnInit, OnDestroy { } } + toggleFreezing() { + this.freezeThawResource = !this.freezeThawResource; + this.http.put('../rest/archival/freezeRetentionRule', { resources: [this.currentResourceInformations.resId], freeze : this.freezeThawResource }).pipe( + tap(() => { + if (this.freezeThawResource) { + this.notify.success(this.translate.instant('lang.retentionRuleFrozen')); + } else { + this.notify.success(this.translate.instant('lang.retentionRuleThawed')); + } + } + ), + catchError((err: any) => { + this.notify.handleErrors(err); + return of(false); + }) + ).subscribe(); + } + isToolEnabled(id: string) { if (id === 'history') { if (!this.privilegeService.hasCurrentUserPrivilege('view_full_history') && !this.privilegeService.hasCurrentUserPrivilege('view_doc_history')) { diff --git a/src/lang/lang-fr.json b/src/lang/lang-fr.json index 225b6bf1d56b174ce2ea5f0fa37658ea3626232b..14d98763987b52eb143f7a91ff77a349d789772d 100644 --- a/src/lang/lang-fr.json +++ b/src/lang/lang-fr.json @@ -2116,5 +2116,6 @@ "ssoUrl": "Url du portail SSO", "ssoUrlDesc": "Permet d'activer le bouton de déconnexion de l'application afin de retourner sur le portail de connexion SSO.", "warning": "Attention", - "fieldUserIdDescSso": "Permet faire le lien entre l'identifiant utilisateur maarch et l'identifiant SSO" + "fieldUserIdDescSso": "Permet faire le lien entre l'identifiant utilisateur maarch et l'identifiant SSO", + "retentionRuleThawed" : "Durée d'utilité courante dégelée" }