RED-6973: Fixed click issue.

This commit is contained in:
Nicoleta Panaghiu 2023-08-10 16:09:03 +03:00
parent bc28a75cf2
commit 487ca31c83
2 changed files with 14 additions and 2 deletions

View File

@ -1,5 +1,10 @@
<ng-container *ngIf="configService.listingMode$ | async as mode">
<div (click)="editFileAttribute($event)" [ngClass]="{ 'workflow-attribute': mode === 'workflow' }" class="file-attribute">
<div
(mousedown)="handleClick($event)"
(click)="editFileAttribute($event)"
[ngClass]="{ 'workflow-attribute': mode === 'workflow' }"
class="file-attribute"
>
<div [ngClass]="{ 'workflow-value': mode === 'workflow' }" class="value">
<b *ngIf="mode === 'workflow' && !isInEditMode"> {{ fileAttribute.label }}: </b>
<span

View File

@ -78,6 +78,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
}
}
handleClick($event: MouseEvent) {
$event.stopPropagation();
}
ngOnDestroy() {
this.#subscriptions.unsubscribe();
}
@ -157,7 +161,10 @@ export class FileAttributeComponent extends BaseFormComponent implements OnDestr
});
return this._formBuilder.group(config, {
validators: control =>
!control.get(this.fileAttribute.id).value?.trim().length && !this.fileAttributeValue ? { emptyString: true } : null,
(!control.get(this.fileAttribute.id)?.value?.trim().length && !this.fileAttributeValue) ||
control.get(this.fileAttribute.id)?.value === this.fileAttributeValue
? { emptyString: true }
: null,
});
}