mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3506] - Fixed refresh for filters on ADF (#5993)
* Fixed refresh for filters on ADF * Update search-widget-container.component.ts Co-authored-by: Vito Albano <vitoalbano@Vitos-MacBook-Pro.local> Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, ViewChild, ViewContainerRef, OnInit, OnDestroy, ComponentRef, ComponentFactoryResolver, Inject } from '@angular/core';
|
||||
import { Component, Input, ViewChild, ViewContainerRef, OnInit, OnDestroy, ComponentRef, ComponentFactoryResolver, Inject, SimpleChanges, OnChanges } from '@angular/core';
|
||||
import { SearchFilterService } from '../search-filter/search-filter.service';
|
||||
import { BaseQueryBuilderService } from '../../base-query-builder.service';
|
||||
import { SEARCH_QUERY_SERVICE_TOKEN } from '../../search-query-service.token';
|
||||
@@ -24,7 +24,7 @@ import { SEARCH_QUERY_SERVICE_TOKEN } from '../../search-query-service.token';
|
||||
selector: 'adf-search-widget-container',
|
||||
template: '<div #content></div>'
|
||||
})
|
||||
export class SearchWidgetContainerComponent implements OnInit, OnDestroy {
|
||||
export class SearchWidgetContainerComponent implements OnInit, OnDestroy, OnChanges {
|
||||
|
||||
@ViewChild('content', { read: ViewContainerRef, static: true })
|
||||
content: ViewContainerRef;
|
||||
@@ -64,6 +64,13 @@ export class SearchWidgetContainerComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
if (changes['value']?.currentValue && this.componentRef?.instance) {
|
||||
this.componentRef.instance.isActive = true;
|
||||
this.componentRef.instance.setValue(changes['value'].currentValue);
|
||||
}
|
||||
}
|
||||
|
||||
private setupWidget(ref: ComponentRef<any>) {
|
||||
if (ref && ref.instance) {
|
||||
ref.instance.id = this.id;
|
||||
|
Reference in New Issue
Block a user