From e3e906bffe151cedce39a7794d8bba5a90a1c86f Mon Sep 17 00:00:00 2001 From: Timo Bejan Date: Fri, 13 Aug 2021 09:40:12 +0300 Subject: [PATCH] minor updates --- .../components/base-screen/base-screen.component.ts | 2 +- .../src/app/models/file/annotation.permissions.ts | 10 +++------- apps/red-ui/src/app/models/file/annotation.wrapper.ts | 5 +++++ .../general-config-screen.component.html | 4 ++-- .../general-config/general-config-screen.component.ts | 6 +++--- .../admin/screens/reports/reports-screen.component.ts | 3 ++- apps/red-ui/src/assets/i18n/en.json | 2 +- .../src/lib/model/generalConfigurationModel.ts | 1 + 8 files changed, 18 insertions(+), 15 deletions(-) diff --git a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts index d296df378..1db7fe6cd 100644 --- a/apps/red-ui/src/app/components/base-screen/base-screen.component.ts +++ b/apps/red-ui/src/app/components/base-screen/base-screen.component.ts @@ -58,7 +58,7 @@ export class BaseScreenComponent { { name: _('top-bar.navigation-items.my-account.children.trash'), routerLink: '/main/admin/trash', - show: this.currentUser.isManager || this.currentUser.isUserAdmin + show: this.currentUser.isManager } ]; diff --git a/apps/red-ui/src/app/models/file/annotation.permissions.ts b/apps/red-ui/src/app/models/file/annotation.permissions.ts index bb341df90..3b4d6e05f 100644 --- a/apps/red-ui/src/app/models/file/annotation.permissions.ts +++ b/apps/red-ui/src/app/models/file/annotation.permissions.ts @@ -40,10 +40,9 @@ export class AnnotationPermissions { for (const annotation of annotations) { const permissions: AnnotationPermissions = new AnnotationPermissions(); - permissions.canUndo = (!isApprover && annotation.isSuggestion) || (isApprover && annotation.isUndoableActionForApprover); - - permissions.canForceRedaction = annotation.isSkipped && !permissions.canUndo; + permissions.canUndo = !isApprover && annotation.isSuggestion; + permissions.canForceRedaction = annotation.isSkipped; permissions.canAcceptRecommendation = annotation.isRecommendation; permissions.canMarkAsFalsePositive = annotation.canBeMarkedAsFalsePositive && !annotation.force; @@ -55,10 +54,7 @@ export class AnnotationPermissions { (annotation.isSkipped && annotation.isModifyDictionary); permissions.canAcceptSuggestion = isApprover && (annotation.isSuggestion || annotation.isDeclinedSuggestion); - permissions.canRejectSuggestion = - isApprover && - (annotation.isSuggestion || - (annotation.isReadyForAnalysis && !permissions.canUndo && annotation.superType !== 'pending-analysis')); + permissions.canRejectSuggestion = isApprover && annotation.isSuggestion; permissions.canChangeLegalBasis = !annotation.isManualRedaction && annotation.isRedacted; diff --git a/apps/red-ui/src/app/models/file/annotation.wrapper.ts b/apps/red-ui/src/app/models/file/annotation.wrapper.ts index 3f4afa121..6ea89801f 100644 --- a/apps/red-ui/src/app/models/file/annotation.wrapper.ts +++ b/apps/red-ui/src/app/models/file/annotation.wrapper.ts @@ -271,6 +271,11 @@ export class AnnotationWrapper { if (redactionLogEntryWrapper.manualRedactionType === 'RECATEGORIZE') { if (redactionLogEntryWrapper.status === 'REQUESTED') { annotationWrapper.superType = 'suggestion-recategorize-image'; + return; + } + if (redactionLogEntryWrapper.status === 'APPROVED') { + annotationWrapper.superType = annotationWrapper.redaction ? 'redaction' : annotationWrapper.hint ? 'hint' : 'skipped'; + return; } } diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html index d2bf4b800..176a84521 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.html @@ -32,8 +32,8 @@
diff --git a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts index d01200f55..942bcb2e6 100644 --- a/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/general-config/general-config-screen.component.ts @@ -43,7 +43,7 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnI this.configForm = this._formBuilder.group({ forgotPasswordFunctionEnabled: [false], - displayName: [undefined] + auxiliaryName: [undefined] }); this.smtpForm = this._formBuilder.group({ @@ -107,10 +107,10 @@ export class GeneralConfigScreenComponent extends AutoUnsubscribe implements OnI this._loadingService.start(); const configFormValues = this.configForm.getRawValue(); - configFormValues.displayName = configFormValues.displayName || 'RedactManager'; await this._generalSettingsControllerService.updateGeneralConfigurations(configFormValues).toPromise(); - this._appConfigService.updateDisplayName(configFormValues.displayName); + this._initialGeneralConfiguration = await this._generalSettingsControllerService.getGeneralConfigurations().toPromise(); + this._appConfigService.updateDisplayName(this._initialGeneralConfiguration.displayName); this._loadingService.stop(); } diff --git a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts index 3a270ea0b..fc8644091 100644 --- a/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts +++ b/apps/red-ui/src/app/modules/admin/screens/reports/reports-screen.component.ts @@ -88,7 +88,8 @@ export class ReportsScreenComponent implements OnInit { if (this._isValidFile(file)) { await this._reportTemplateService.uploadTemplateForm(this._appStateService.activeDossierTemplateId, false, file).toPromise(); if (this._isExcelFile(file)) { - // await this._reportTemplateService.uploadTemplateForm(this._appStateService.activeDossierTemplateId, true, file).toPromise(); + // await this._reportTemplateService. + // uploadTemplateForm(this._appStateService.activeDossierTemplateId, true, file).toPromise(); } this._fileInput.nativeElement.value = null; await this._loadReportTemplates(); diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 69bec7dda..1b5abae00 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -1005,7 +1005,7 @@ "test-connection": "Test Connection" }, "app-name": { - "label": "Application Name", + "label": "Environment", "placeholder": "RedactManager" }, "form": { diff --git a/libs/red-ui-http/src/lib/model/generalConfigurationModel.ts b/libs/red-ui-http/src/lib/model/generalConfigurationModel.ts index 3b5b6d659..03a5ec8a9 100644 --- a/libs/red-ui-http/src/lib/model/generalConfigurationModel.ts +++ b/libs/red-ui-http/src/lib/model/generalConfigurationModel.ts @@ -13,4 +13,5 @@ export interface GeneralConfigurationModel { forgotPasswordFunctionEnabled?: boolean; displayName?: string; + auxiliaryName?: string; }