[ACS-7584] - Filtering by type, name and content size (range) does not filter the data table (#9736)

This commit is contained in:
jacekpluta
2024-06-03 07:32:35 +02:00
committed by GitHub
parent 8dc1a9bed0
commit 3cd7b514bc
2 changed files with 24 additions and 4 deletions

View File

@@ -32,6 +32,7 @@
[selector]="category?.component?.selector" [selector]="category?.component?.selector"
[settings]="category?.component?.settings" [settings]="category?.component?.settings"
[value]="initialValue" [value]="initialValue"
[useHeaderQueryBuilder]="true"
> >
</adf-search-widget-container> </adf-search-widget-container>
</div> </div>

View File

@@ -15,10 +15,21 @@
* limitations under the License. * limitations under the License.
*/ */
import { Component, Input, ViewChild, ViewContainerRef, OnInit, OnDestroy, ComponentRef, SimpleChanges, OnChanges } from '@angular/core'; import {
Component,
Input,
ViewChild,
ViewContainerRef,
OnInit,
OnDestroy,
ComponentRef,
SimpleChanges,
OnChanges,
Injector
} from '@angular/core';
import { SearchFilterService } from '../../services/search-filter.service'; import { SearchFilterService } from '../../services/search-filter.service';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { SearchQueryBuilderService } from '../../services'; import {SearchHeaderQueryBuilderService, SearchQueryBuilderService} from '../../services';
@Component({ @Component({
selector: 'adf-search-widget-container', selector: 'adf-search-widget-container',
@@ -43,9 +54,13 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
@Input() @Input()
value: any; value: any;
@Input()
useHeaderQueryBuilder: boolean;
componentRef: ComponentRef<any>; componentRef: ComponentRef<any>;
constructor(private searchFilterService: SearchFilterService, private queryBuilder: SearchQueryBuilderService) {} constructor(private searchFilterService: SearchFilterService, private injector: Injector) {
}
ngOnInit() { ngOnInit() {
const componentType = this.searchFilterService.widgets[this.selector]; const componentType = this.searchFilterService.widgets[this.selector];
@@ -67,7 +82,11 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChan
if (ref?.instance) { if (ref?.instance) {
ref.instance.id = this.id; ref.instance.id = this.id;
ref.instance.settings = { ...this.settings }; ref.instance.settings = { ...this.settings };
ref.instance.context = this.queryBuilder; if (this.useHeaderQueryBuilder) {
ref.instance.context = this.injector.get(SearchHeaderQueryBuilderService);
} else {
ref.instance.context = this.injector.get(SearchQueryBuilderService);
}
if (this.value) { if (this.value) {
ref.instance.isActive = true; ref.instance.isActive = true;
ref.instance.startValue = this.value; ref.instance.startValue = this.value;