Merge branch 'master' into table-component
This commit is contained in:
commit
31dff7aad5
@ -72,23 +72,6 @@
|
||||
|
||||
<p class="download-includes">{{ 'download-includes' | translate }}</p>
|
||||
<div class="d-flex">
|
||||
<!-- only in edit mode-->
|
||||
<!-- Temporary Disabled since backend doesn't support this -->
|
||||
<!-- <redaction-select-->
|
||||
<!-- *ngIf="dossierTemplate?.dossierTemplateId"-->
|
||||
<!-- [label]="-->
|
||||
<!-- 'report-type.label'-->
|
||||
<!-- | translate-->
|
||||
<!-- : {-->
|
||||
<!-- length: dossierTemplateForm.controls['reportTemplateIds'].value.length-->
|
||||
<!-- }-->
|
||||
<!-- "-->
|
||||
<!-- [optionTemplate]="reportTemplateOptionTemplate"-->
|
||||
<!-- [options]="availableReportTypes"-->
|
||||
<!-- [valueMapper]="reportTemplateValueMapper"-->
|
||||
<!-- class="mr-16"-->
|
||||
<!-- formControlName="reportTemplateIds"-->
|
||||
<!-- ></redaction-select>-->
|
||||
<redaction-select
|
||||
[label]="
|
||||
'download-type.label'
|
||||
|
||||
@ -52,8 +52,7 @@ export class AddEditDossierTemplateDialogComponent implements OnInit {
|
||||
this.dossierTemplate?.validTo ? moment(this.dossierTemplate?.validTo) : null,
|
||||
this._requiredIfValidator(() => this.hasValidTo)
|
||||
],
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']],
|
||||
reportTemplateIds: [this.dossierTemplate?.reportTemplateIds || [], Validators.required]
|
||||
downloadFileTypes: [this.dossierTemplate?.downloadFileTypes || ['PREVIEW', 'REDACTED']]
|
||||
});
|
||||
this.hasValidFrom = !!this.dossierTemplate?.validFrom;
|
||||
this.hasValidTo = !!this.dossierTemplate?.validTo;
|
||||
@ -72,27 +71,26 @@ export class AddEditDossierTemplateDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
for (const key of Object.keys(this.dossierTemplateForm.getRawValue())) {
|
||||
const formValue = this.dossierTemplateForm.get(key).value;
|
||||
const objectValue = this.dossierTemplate[key];
|
||||
if (key === 'validFrom') {
|
||||
if (this.hasValidFrom !== !!this.dossierTemplate.validFrom) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidFrom &&
|
||||
!moment(this.dossierTemplate.validFrom).isSame(moment(this.dossierTemplateForm.get('validFrom').value))
|
||||
) {
|
||||
if (this.hasValidFrom !== !!objectValue || (this.hasValidFrom && !moment(objectValue).isSame(moment(formValue)))) {
|
||||
return true;
|
||||
}
|
||||
} else if (key === 'validTo') {
|
||||
if (this.hasValidTo !== !!this.dossierTemplate.validTo) {
|
||||
if (this.hasValidTo !== !!objectValue || (this.hasValidTo && !moment(objectValue).isSame(moment(formValue)))) {
|
||||
return true;
|
||||
}
|
||||
if (
|
||||
this.hasValidTo &&
|
||||
!moment(this.dossierTemplate.validTo).isSame(moment(this.dossierTemplateForm.get('validTo').value))
|
||||
) {
|
||||
} else if (formValue instanceof Array) {
|
||||
if (objectValue.length !== formValue.length) {
|
||||
return true;
|
||||
}
|
||||
} else if (this.dossierTemplate[key] !== this.dossierTemplateForm.get(key).value) {
|
||||
for (const item of objectValue) {
|
||||
if (!formValue.includes(item)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (objectValue !== formValue) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit a659dcecd7115eda1320d9d7188788e1e00ccb18
|
||||
Subproject commit b1e1bc3f1a95ae53c30485a3f2ac044d71255c00
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "redaction",
|
||||
"version": "2.211.0",
|
||||
"version": "2.214.0",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user