Browse Source

UI: fixed error on save relation qeury alias with empty relation filter, not option disabled if relation type is empty

pull/10959/head
rusikv 2 years ago
parent
commit
0968de8881
  1. 2
      ui-ngx/src/app/modules/home/components/alias/entity-alias-dialog.component.ts
  2. 5
      ui-ngx/src/app/modules/home/components/relation/relation-filters.component.html

2
ui-ngx/src/app/modules/home/components/alias/entity-alias-dialog.component.ts

@ -145,7 +145,7 @@ export class EntityAliasDialogComponent extends DialogComponent<EntityAliasDialo
if (!isEmpty(this.alias.filter?.filters)) {
this.alias.filter.filters = this.alias.filter.filters.filter((value, index, self) =>
self.findIndex(v => v.relationType === value.relationType && isEqual(v.entityTypes, value.entityTypes)) === index &&
(value.relationType || value.entityTypes.length)
(value.relationType || value.entityTypes?.length)
);
}
if (this.alias.filter.type) {

5
ui-ngx/src/app/modules/home/components/relation/relation-filters.component.html

@ -27,7 +27,10 @@
<div class="tb-form-table-row align-start"
*ngFor="let relationFilterControl of relationFiltersFormArray.controls; let $index = index">
<mat-chip-listbox *ngIf="enableNotOption" class="flex-18 center-stretch" [formControl]="relationFilterControl.get('negate')">
<mat-chip-option color="primary" [value]="true">{{ 'relation.not' | translate}}</mat-chip-option>
<mat-chip-option color="primary" [value]="true"
[disabled]="!relationFilterControl.get('relationType').value">
{{ 'relation.not' | translate}}
</mat-chip-option>
</mat-chip-listbox>
<tb-relation-type-autocomplete subscriptSizing="dynamic"
class="flex-50" showLabel="false"

Loading…
Cancel
Save