project edit/add required and dialog translations fixes

This commit is contained in:
Timo 2021-04-21 08:46:35 +03:00
parent 73c3f5cd95
commit e4898a9084
4 changed files with 10 additions and 7 deletions

View File

@ -10,7 +10,7 @@
<input formControlName="name" name="name" type="text" placeholder="{{ 'add-edit-project-template.form.name-placeholder' | translate }}" />
</div>
<div class="red-input-group required w-400">
<div class="red-input-group w-400">
<mat-form-field floatLabel="always">
<mat-label>{{ 'add-edit-project-template.form.download-file-types.label' | translate }}</mat-label>
<mat-select formControlName="downloadFileTypes" style="width: 100%;" multiple>

View File

@ -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;

View File

@ -32,12 +32,12 @@
</mat-form-field>
</div>
<div class="red-input-group required w-400">
<div class="red-input-group w-400">
<mat-form-field floatLabel="always">
<mat-label>{{ 'project-listing.add-edit-dialog.form.download-file-types.label' | translate }}</mat-label>
<mat-select formControlName="downloadFileTypes" style="width: 100%;" multiple>
<mat-option *ngFor="let type of downloadTypesEnum" [value]="type">
{{ humanize(type) }}
{{ 'download-type.' + type | translate }}
</mat-option>
</mat-select>
</mat-form-field>
@ -48,7 +48,7 @@
<mat-label>{{ 'project-listing.add-edit-dialog.form.report-types.label' | translate }}</mat-label>
<mat-select formControlName="reportTypes" style="width: 100%;" multiple>
<mat-option *ngFor="let type of reportTypesEnum" [value]="type">
{{ humanize(type) }}
{{ 'report-type.' + type | translate }}
</mat-option>
</mat-select>
</mat-form-field>

View File

@ -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]
});