From fff7bb7273252a780f22251a2519492d3fb1472c Mon Sep 17 00:00:00 2001 From: Igor Kulikov Date: Mon, 8 May 2023 19:02:29 +0300 Subject: [PATCH] UI Version Control: Fix remove other entities popover. --- .../vc/entity-types-version-load.component.html | 2 +- .../vc/entity-types-version-load.component.ts | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.html b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.html index ec1d7707b1..8a3b23ea5e 100644 --- a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.html +++ b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.html @@ -55,7 +55,7 @@
+ (change)="onRemoveOtherEntities(removeOtherEntitiesCheckbox, entityTypeFormGroup)"> {{ 'version-control.remove-other-entities' | translate }} diff --git a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.ts b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.ts index 16d84af0c6..d4f28e3a7b 100644 --- a/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.ts +++ b/ui-ngx/src/app/modules/home/components/vc/entity-types-version-load.component.ts @@ -33,7 +33,7 @@ import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { TranslateService } from '@ngx-translate/core'; import { EntityType, entityTypeTranslations } from '@shared/models/entity-type.models'; -import { MatCheckbox } from '@angular/material/checkbox'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { TbPopoverService } from '@shared/components/popover.service'; import { RemoveOtherEntitiesConfirmComponent } from '@home/components/vc/remove-other-entities-confirm.component'; @@ -210,12 +210,11 @@ export class EntityTypesVersionLoadComponent extends PageComponent implements On return res; } - onRemoveOtherEntities(removeOtherEntitiesCheckbox: MatCheckbox, entityTypeControl: AbstractControl, $event: Event) { + onRemoveOtherEntities(removeOtherEntitiesCheckbox: MatCheckbox, entityTypeControl: AbstractControl) { const removeOtherEntities: boolean = entityTypeControl.get('config.removeOtherEntities').value; - if (!removeOtherEntities) { - $event.preventDefault(); - $event.stopPropagation(); - const trigger = $('.mat-checkbox-frame', removeOtherEntitiesCheckbox._elementRef.nativeElement)[0]; + if (removeOtherEntities) { + entityTypeControl.get('config').get('removeOtherEntities').patchValue(false, {emitEvent: false}); + const trigger = $('.mdc-checkbox__background', removeOtherEntitiesCheckbox._elementRef.nativeElement)[0]; if (this.popoverService.hasPopover(trigger)) { this.popoverService.hidePopover(trigger); } else {