From e4898a90842bb972de9f3bef9769a7e7fb58cc30 Mon Sep 17 00:00:00 2001 From: Timo Date: Wed, 21 Apr 2021 08:46:35 +0300 Subject: [PATCH] project edit/add required and dialog translations fixes --- .../add-edit-rule-set-dialog.component.html | 2 +- .../add-edit-rule-set-dialog.component.ts | 5 ++++- .../add-edit-project-dialog.component.html | 6 +++--- .../add-edit-project-dialog.component.ts | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html index 2a2d73098..c9b57b083 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.html @@ -10,7 +10,7 @@ -
+
{{ 'add-edit-project-template.form.download-file-types.label' | translate }} diff --git a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts index ff71f9337..6304692e9 100644 --- a/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts +++ b/apps/red-ui/src/app/modules/admin/dialogs/add-edit-rule-set-dialog/add-edit-rule-set-dialog.component.ts @@ -30,7 +30,10 @@ export class AddEditRuleSetDialogComponent { validTo: [this.ruleSet?.validTo], downloadFileTypes: [this.ruleSet ? this.ruleSet.downloadFileTypes : ['PREVIEW', 'REDACTED']], reportTypes: [ - this.ruleSet ? this.ruleSet.reportTypes : ['WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE', 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE', 'EXCEL_MULTI_FILE'] + this.ruleSet + ? this.ruleSet.reportTypes + : ['WORD_SINGLE_FILE_APPENDIX_A1_TEMPLATE', 'WORD_SINGLE_FILE_APPENDIX_A2_TEMPLATE', 'EXCEL_MULTI_FILE'], + Validators.required ] }); this.hasValidFrom = !!this.ruleSet?.validFrom && !!this.ruleSet?.validTo; diff --git a/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html index 16f159f92..33fcb6313 100644 --- a/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html +++ b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html @@ -32,12 +32,12 @@
-
+
{{ 'project-listing.add-edit-dialog.form.download-file-types.label' | translate }} - {{ humanize(type) }} + {{ 'download-type.' + type | translate }} @@ -48,7 +48,7 @@ {{ 'project-listing.add-edit-dialog.form.report-types.label' | translate }} - {{ humanize(type) }} + {{ 'report-type.' + type | translate }} diff --git a/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts index 689ed4212..a7297c8e1 100644 --- a/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts +++ b/apps/red-ui/src/app/modules/projects/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts @@ -14,7 +14,7 @@ import * as moment from 'moment'; export class AddEditProjectDialogComponent { public projectForm: FormGroup; public hasDueDate: boolean; - public downloadTypesEnum = Object.values(RuleSetModel.DownloadFileTypesEnum); + public downloadTypesEnum = ['ORIGINAL', 'PREVIEW', 'REDACTED']; public reportTypesEnum = Object.values(RuleSetModel.ReportTypesEnum); constructor( @@ -27,7 +27,7 @@ export class AddEditProjectDialogComponent { projectName: [this.project?.projectName, Validators.required], ruleSet: [{ value: this.project?.ruleSetId, disabled: this.project?.hasFiles }, Validators.required], downloadFileTypes: [this.project?.project?.downloadFileTypes], - reportTypes: [this.project?.project?.reportTypes], + reportTypes: [this.project?.project?.reportTypes, Validators.required], description: [this.project?.description], dueDate: [this.project?.dueDate] });