import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core'; import { SkinOptions } from '../../form-controls/drop-down/enums/skin-options.enum'; import { QueryCollectionModel } from '../../../services/query-collection/models/query-collection.model'; import { FreeTextFieldType } from './list-components/filter-free-text/models/free-Text-field-type.interface'; import { DropDownItem } from '../../../modules/form-controls/drop-down/public-api'; import { FilterService } from './services/filter-service/filter.service'; import { ToastNotificationService } from '../../../modules/popups/toast-notification/services/toast-notification.service'; import { SavedFiltersListService } from './saved-filters/saved-filters-list/saved-filters-list.service'; import { FilterFreeTextService } from './list-components/filter-free-text/filter-free-text.service'; import { FilterFreeTextItem } from './list-components/models/filter-free-text-item.model'; import { SelectedTimeChangedPayload } from './list-components/filter-tab-time/model/selected-time-changed-payload'; import { QueryCollectionActions } from '../../../services/query-collection/core/actions/query-collection-actions'; import { SavedFilter } from './models/saved-filter.interface'; import { FilterConfiguration } from './models/filter.configuration'; import { Observable, Subject, Subscription } from 'rxjs'; import { FilterCommunicationService } from './services/filter-communication.service'; import { FilterPanelService } from './services/filter-panel/filter-panel.service'; import { ManageFilterActionsService } from './services/manage-actions/manage-filter-actions.service'; import { SaveSetPayload } from './models/save-set-payload.interface'; import { QueryRegister } from '../../../services/query-collection/core/register/query-register'; import { SingDialogService } from '../../../modules/popups/dialog/services/dialog.service'; import { FilterItemModel } from './models/filter-item.model'; import { SingHttpErrorResponse } from '../../../services/http-call/models/sing-http-response'; import { FullFilterModel } from './models/full-filter.interface'; import { DependencyResponse } from '../filter-panel/services/manage-actions/models/DependencyResponse.interface'; import { FilterPanelEventsService } from './services/filter-panel-events.service'; import { SingFilterPreferences } from './models/filter-preferences.interface'; import { FilterPreferencesService } from './services/filter-preferences.service'; import { FilterPanelState } from './models/filter-panel-state'; import * as i0 from "@angular/core"; export declare class FilterPanelComponent implements OnInit, OnDestroy { private filterService; private toastMessageService; private singDialogService; private filterCommunicationService; private filterFreeTextService; private filterPanelService; private savedFiltersListService; private changeDetectionRef; private filterDependenciesService; private queryRegister; private cdRef; private filterEventsService; private filterPreferencesService; selectedSavedFilterName: string; queryCollectionModels: QueryCollectionModel[]; userPreferencesFirstInit: boolean; freeTextFields: FreeTextFieldType[]; selectedSetName: string; skinOptions: typeof SkinOptions; queryActions: QueryCollectionActions; selectedCustomDropdownItem: DropDownItem; customDropdownTitle: string; popOverStateWidth: string; get loadedSet(): SavedFilter; get savedSets(): SavedFilter[]; get filterList(): FilterItemModel[]; get filterAdditionalSelectedSavedFilterNameParams(): any; set startOpen(startOpen: boolean); allowDynamicConfigurationChange: boolean; /**************************************************************************************************************************** * @description when the filterConfig object is set - we need to initialize the selected * time range object if the filter includes time range, and the * os selection when the filter includes os selection (currently only on firewall control) * the value can be initialized either from timeConfig field of filerConfig explicitly or from user preferences. * The reason we wait 100 ms is for the componentId to be set. * @param filterConfiguration - filter configuration- include defaults, free text and more *****************************************************************************************************************************/ set filterConfig(filterConfiguration: FilterConfiguration); get filterConfig(): FilterConfiguration; set additionalQuery(_additionalQuery: Record); /**************************************************************************************************** * @description In order for a way to tell this component to refresh the * filters count (for example if an item on the table was deleted) - * we added a filterCommunicationService that sends events. Here we listen to it, * and if the filterMessage is of type FETCH_FILTER_COUNT - * we call fetch. * We only listen to this service events if a componentId is set, because we have to * know the event is sent to this filter component * * @param componentId - current component id *****************************************************************************************************/ set componentId(componentId: string); constructor(filterService: FilterService, toastMessageService: ToastNotificationService, singDialogService: SingDialogService, filterCommunicationService: FilterCommunicationService, filterFreeTextService: FilterFreeTextService, filterPanelService: FilterPanelService, savedFiltersListService: SavedFiltersListService, changeDetectionRef: ChangeDetectorRef, filterDependenciesService: ManageFilterActionsService, queryRegister: QueryRegister, cdRef: ChangeDetectorRef, filterEventsService: FilterPanelEventsService, filterPreferencesService: FilterPreferencesService); userPreferencesService: any; preferencesCategory: string; editSetsDisabled: boolean; timeOptions: DropDownItem[]; saveNewSetFilter: any; outerQueryParams: any; /***************************************************************************** @description filter saved set emitter events @event saveNewSet - emit after new filter set is saved @event editSetPopup - emit after existing set name is updated @event updateSet - emit after existing set filter is updated @event loadedSetChange - emit after selecting saved set from existing list @event deleteSet - emit after existing set name is deleted @event loadedSetCleared - on clear search bar ****************************************************************************/ saveNewSet: EventEmitter; editSetPopup: EventEmitter>; updateSet: EventEmitter; loadedSetChange: EventEmitter; deleteSet: EventEmitter; selectedFilterChange: EventEmitter; loadedSetCleared: EventEmitter; timeRangeChange: EventEmitter; customDropdownValueChanged: EventEmitter; filterChanged: EventEmitter>; freeTextButtonClick: EventEmitter; changeFilterPreferences: EventEmitter; panelState: FilterPanelState; customLeftDropdownResultObject: Record; freeTextItems: FilterFreeTextItem[]; selectedKeys: string[]; fetchSuccess: boolean; _additionalFilterObject: any; freeTextKeysHash: Record; selectedTimeTitleAndTimeRange: SelectedTimeChangedPayload; filterComponentId: string; ngUnSubscribe: Subject; hasValues: boolean; updateSetEnabled: boolean; selectedOsType: string; additionalQueryParameters: Record; errorResponse: SingHttpErrorResponse | string; savedFilter: SavedFilter; _loadedSet: SavedFilter; private _filterConfig; _tagsData: { [key: string]: string[]; }; private _filterList; private scopesFilter; private _savedSets; private _filterAdditionalParams; private _queryParams; private _fetchFilterCountSubject; private _fetchFilterCount$; initialScopeFilters: any; private useCurrentAdditionalParams; private _queryActionsChangeAndFiltersCountSubscription; private _completeAllDependenciesSubscription; /************************************************************************************************************************************* * @description When we finish setting the additionalQueryParams - we still need to calculate them in order to make the API call: * 1) First we need ot filter out table specific query params - like page and limit * 2) Then we need to separate free text items to save them in order to pass them to the list and search bar. * @param _value **************************************************************************************************************************************/ private setAdditionalParams; private _listenToCommunicationService; setInitialCustomDropdown(filterConfig: FilterConfiguration, dependenciesActionResponse: DependencyResponse, queryActions: QueryCollectionActions): void; /************************************************************************************** @description - register filter panel to query collection with unique collection id *************************************************************************************/ setQueryCollection(): void; /*********************************************************************************** * @description init, besides initializing the component state, * we listen to fetch filters subject and query collection changed and * auditTime of 100, we call the fetch method. ***********************************************************************************/ ngOnInit(): void; combineCalls(observables: Array>): Subscription; /*************************************************************************************************************** * @description - update query information according to filter count response data or free text response data * @param filterCountResponseData ***************************************************************************************************************/ updateQueryInfo(filterCountResponseData: FilterItemModel[]): QueryCollectionModel[]; /*********************************************************************************** @description - after succeed fetch filter count trigger update user preferences **********************************************************************************/ handleFetchFilterCountsSuccess(data: FilterItemModel[]): void; /************************************************************************************************** * @description Handler to save Set event fired. We send the current filter, the new set name, * and the selected site ID along with the saveURL to the service. * Upon success - we toast a message, update the loaded set, emit an event about it, * disable the update set button and call fetch saved sets, to add it * to the set list * @param {string} val **************************************************************************************************/ onSaveSet(val: string): void; /*********************************************************************** * @description An event handler to be fired when delete set is clicked * @param {string} savedSetId - current saved set id ************************************************************************/ onDeleteSet(savedSetId: string): void; /******************************************************************************************** * @description When user clicks edit set - we open an edit set name popup. * I he closes it by saving - we collect the name and run the api to update it. * When the update succeed - we again fetch the saved sets. * @param {SavedFilter} val **********************************************************************************************/ onEditSetPopup(val: DropDownItem): void; onUpdateSet(val: DropDownItem): void; clearSelectedSet(): void; onLoadSetChange(val: SavedFilter): void; /****************************************************************************************************************** * @description - When filter is changed from the list of filters * (meaning - clicking a filter item to toggle it) - we update the filter state, call fetch filters count * and emit the event up. * @param selectedFilterItems - list of current selected filter *****************************************************************************************************************/ onSelectedFilterChange(selectedFilterItems: FilterItemModel[]): void; freeTextHashFetched(hash: Record): void; toggleState(): void; /********************************************************************************************** * @description when date picker is open there is cdk-overlay-backdrop so we should not close in this case the search * @param event - the mouse event when triggered on clickAway, null otherwise * @param newState ***********************************************************************************************/ setState(event: MouseEvent | null, newState: FilterPanelState): void; private closePanel; private shouldCloseFilterOnClick; private doesOverlayExist; private wasFreeTextAutocompletePanelClicked; /*************************************************************************************************************************************** * @description The function that is responsible for initiating a call to the service to bring filter counts form the server. * It also subscribes to the results and update the filter counts in the child components. * @param queryParams - query collection * @param additionalQueryParameters - additional queries for example scope query **************************************************************************************************************************************/ private fetchFilterCounts; /****************************************************************************************************************** @description - an ugly way to get over the propagation issue that makes the free text dropdown not closed when clicking the minimize button *****************************************************************************************************************/ filterListClicked(event: any): void; /********************************************************************************************************** * @description The selected filters to present are changed * @param keys - the selected keys. If null - reset to default (probably reset to default was clicked) **********************************************************************************************************/ selectedFieldsChanged(keys: string[]): void; /****************************************************** * @description: trigger on user selected saved filters * @param setName: saved filter name ******************************************************/ selectedSavedFilter(setName: string): void; setInitialScopeFilters(dependenciesActionResponse: DependencyResponse): void; setSelectedCustomDropdownOption(optionValue: string): void; setSelectedCustomDropDown(): void; /****************************************************** * @description when user change left dropdown option * @param event - dropdown selection event ******************************************************/ customLeftDropDownChanged(event: any): void; setDefaultSelectedFields(filterConfiguration: FilterConfiguration): void; setDefaultQueries(filterConfiguration: FilterConfiguration): void; ngOnDestroy(): void; /** * @description register a new event listener for free text button click * @private */ private _listenToFreeTextButtonClicked; private isDynamicConfigurationChangeAllowed; private updateQueryCollection; private canUpdateQueryCollection; private getQueryManagementConfiguration; private fetchFreeTextFilters; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } //# sourceMappingURL=filter-panel.component.d.ts.map