Browse Source

UI: make 'Not' option in relation queries optional

pull/10306/head
rusikv 2 years ago
parent
commit
e32634f501
  1. 1
      ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html
  2. 4
      ui-ngx/src/app/modules/home/components/relation/relation-filters.component.html
  3. 5
      ui-ngx/src/app/modules/home/components/relation/relation-filters.component.ts

1
ui-ngx/src/app/modules/home/components/entity/entity-filter.component.html

@ -176,6 +176,7 @@
<div class="tb-form-panel stroked">
<div class="tb-form-panel-title" translate>relation.relation-filters</div>
<tb-relation-filters
enableNotOption
[allowedEntityTypes]="allowedEntityTypes"
formControlName="filters">
</tb-relation-filters>

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

@ -18,7 +18,7 @@
<div class="tb-form-panel no-border no-padding">
<div class="tb-form-table" [formGroup]="relationFiltersFormGroup">
<div class="tb-form-table-header">
<div class="tb-form-table-header-cell flex-18"></div>
<div *ngIf="enableNotOption" class="tb-form-table-header-cell flex-18"></div>
<div class="tb-form-table-header-cell flex-50">{{ 'relation.relation-type' | translate }}</div>
<div class="tb-form-table-header-cell flex-50">{{ 'entity.entity-types' | translate }}</div>
<div class="tb-form-table-header-cell actions-header"></div>
@ -26,7 +26,7 @@
<div class="tb-form-table-body" formArrayName="relationFilters">
<div class="tb-form-table-row align-start"
*ngFor="let relationFilterControl of relationFiltersFormArray.controls; let $index = index">
<mat-chip-listbox class="flex-18 center-stretch" [formControl]="relationFilterControl.get('negate')">
<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-listbox>
<tb-relation-type-autocomplete subscriptSizing="dynamic"

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

@ -30,6 +30,7 @@ import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { coerceBoolean } from '@shared/decorators/coercion';
@Component({
selector: 'tb-relation-filters',
@ -49,6 +50,10 @@ export class RelationFiltersComponent extends PageComponent implements ControlVa
@Input() allowedEntityTypes: Array<EntityType | AliasEntityType>;
@Input()
@coerceBoolean()
enableNotOption = false;
relationFiltersFormGroup: UntypedFormGroup;
private destroy$ = new Subject<void>();

Loading…
Cancel
Save