Merge branch 'RED-10498' into 'master'
RED-10498: included RED_ADMIN permission requirement. See merge request redactmanager/red-ui!719
This commit is contained in:
commit
db90ae538e
@ -37,9 +37,13 @@
|
||||
<div *ngIf="areRulesLocked()">
|
||||
<mat-icon
|
||||
(click)="resetRules()"
|
||||
[matTooltip]="'dossier-template-info-screen.rules-reset.tooltip' | translate"
|
||||
[matTooltip]="
|
||||
currentUser.isAdmin
|
||||
? ('dossier-template-info-screen.rules-reset.tooltip' | translate)
|
||||
: ('dossier-template-info-screen.rules-reset.disabled-action' | translate)
|
||||
"
|
||||
[class.action-icon]="currentUser.isAdmin"
|
||||
svgIcon="iqser:alert-circle"
|
||||
class="action-icon"
|
||||
></mat-icon>
|
||||
<span class="error">{{ 'dossier-template-info-screen.rules-reset.label' | translate }}</span>
|
||||
</div>
|
||||
|
||||
@ -14,6 +14,7 @@ import { Toaster } from '@iqser/common-ui';
|
||||
import { MatTooltip } from '@angular/material/tooltip';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { getCurrentUser } from '@users/user.service';
|
||||
|
||||
interface Context {
|
||||
readonly dossierTemplate: DossierTemplate;
|
||||
@ -33,6 +34,7 @@ export class DossierTemplateDetailsComponent extends ContextComponent<Context> i
|
||||
readonly areRulesLocked = computed(() => {
|
||||
return this._rulesService.currentTemplateRules().timeoutDetected;
|
||||
});
|
||||
readonly currentUser = getCurrentUser();
|
||||
|
||||
constructor(
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
@ -51,6 +53,7 @@ export class DossierTemplateDetailsComponent extends ContextComponent<Context> i
|
||||
}
|
||||
|
||||
async resetRules() {
|
||||
if (!this.currentUser.isAdmin) return;
|
||||
try {
|
||||
await firstValueFrom(this._rulesService.reset(this.dossierTemplateId));
|
||||
this._toaster.success(_('dossier-template-info-screen.rules-reset.success'));
|
||||
|
||||
@ -1088,6 +1088,7 @@
|
||||
"entries": "{count} {count, plural, one{Eintrag} other{Einträge}}",
|
||||
"modified-on": "Geändert am: {date}",
|
||||
"rules-reset": {
|
||||
"disabled-action": "Bitte wenden Sie sich an Ihren Administrator, um die Regeln freizuschalten.",
|
||||
"label": "Regeln gesperrt",
|
||||
"success": "Die Regeln der Dossier-Vorlage wurden erfolgreich zurückgesetzt.",
|
||||
"tooltip": "Klicken Sie hier, um die Regeln zurückzusetzen"
|
||||
|
||||
@ -1088,6 +1088,7 @@
|
||||
"entries": "{count} {count, plural, one{entry} other{entries}}",
|
||||
"modified-on": "Modified on: {date}",
|
||||
"rules-reset": {
|
||||
"disabled-action": "Please contact your administrator to unlock the rules.",
|
||||
"label": "Rules locked",
|
||||
"success": "Dossier template rules successfully reset.",
|
||||
"tooltip": "Click to reset rules"
|
||||
|
||||
@ -1088,6 +1088,7 @@
|
||||
"entries": "{count} {count, plural, one{Eintrag} other{Einträge}}",
|
||||
"modified-on": "Geändert am {date}",
|
||||
"rules-reset": {
|
||||
"disabled-action": "Bitte wenden Sie sich an Ihren Administrator, um die Regeln freizuschalten.",
|
||||
"label": "Regeln gesperrt",
|
||||
"success": "Die Regeln der Dossier-Vorlage wurden erfolgreich zurückgesetzt.",
|
||||
"tooltip": "Klicken Sie hier, um die Regeln zurückzusetzen"
|
||||
|
||||
@ -1088,6 +1088,7 @@
|
||||
"entries": "{count} {count, plural, one{entry} other{entries}}",
|
||||
"modified-on": "Modified on: {date}",
|
||||
"rules-reset": {
|
||||
"disabled-action": "Please contact your administrator to unlock the rules.",
|
||||
"label": "Rules locked",
|
||||
"success": "Dossier template rules successfully reset.",
|
||||
"tooltip": "Click to reset rules"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user