RED-6973: Cleanup

This commit is contained in:
Nicoleta Panaghiu 2023-07-18 18:24:11 +03:00
parent bf83962d05
commit 302b760195

View File

@ -2,7 +2,7 @@ import { Component, computed, effect, HostListener, Input, OnDestroy } from '@an
import { Dossier, File, FileAttributeConfigTypes, IFileAttributeConfig } from '@red/domain';
import { BaseFormComponent, HelpModeService, ListingService, Toaster } from '@iqser/common-ui';
import { PermissionsService } from '@services/permissions.service';
import { FormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { FormBuilder, UntypedFormGroup } from '@angular/forms';
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
import { firstValueFrom, Subscription } from 'rxjs';
import { FilesService } from '@services/files/files.service';
@ -149,11 +149,7 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
});
return this._formBuilder.group(config, {
validators: control =>
control.get(this.fileAttribute.id).value &&
!control.get(this.fileAttribute.id).value.trim().length &&
!this.fileAttributeValue
? { emptyString: true }
: null,
!control.get(this.fileAttribute.id).value?.trim().length && !this.fileAttributeValue ? { emptyString: true } : null,
});
}