Aniket Katkar 34b0d01e98
fix 10883: quick filter dropdown improvements and bug fixes (#10898)
* Changed fields to fetch initial suggestions for quick dropdowns for charts and tasks
Fixed schema field dropdown not returning correct options

* Added debouncing logic for search in quick dropdown

* fixed typescript error

* Fixed failing unit test

* fixed advanced search modal owner field initial suggestion not showing

* Code optimization for ExploreQuickFilters

* fixed cypress tests

* fixed typescript error

* Added unit tests for newly added advanced search util functions

* Added dataModel filter for dashboard entity

* enabled the advanced search cypress test for testing the changes in PR

* worked on comments to remove unnecessary util function and used existing one

* fixed cypress for searchFlow

* Reverted the changes for reindex in SearchFlow spec

* updated owner addition logic to eliminate search

* Updated user name in test data

* skipped the searchFlow specs

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
2023-04-12 19:01:37 +05:30

92 lines
2.6 KiB
TypeScript

/*
* Copyright 2022 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ReactNode } from 'react';
import { EntityReference } from '../../generated/entity/type';
import { TagLabel } from '../../generated/type/tagLabel';
import {
DashboardSearchSource,
ExploreSearchSource,
GlossarySearchSource,
MlmodelSearchSource,
QuerySearchSource,
SearchHitBody,
TableSearchSource,
TagClassSearchSource,
TeamSearchSource,
UserSearchSource,
} from '../../interface/search.interface';
import { ExploreSearchIndex } from '../Explore/explore.interface';
type Fields =
| 'name'
| 'fullyQualifiedName'
| 'description'
| 'serviceType'
| 'displayName'
| 'deleted';
export type SourceType = (
| Pick<
TableSearchSource,
Fields | 'usageSummary' | 'database' | 'databaseSchema' | 'tableType'
>
| Pick<DashboardSearchSource | MlmodelSearchSource, Fields | 'usageSummary'>
| Pick<
Exclude<
ExploreSearchSource,
| TableSearchSource
| DashboardSearchSource
| MlmodelSearchSource
| GlossarySearchSource
| TagClassSearchSource
| QuerySearchSource
| UserSearchSource
| TeamSearchSource
>,
Fields
>
) & {
id: string;
tier?: string | Pick<TagLabel, 'tagFQN'>;
tags?: string[] | TagLabel[];
entityType?: string;
owner?: Partial<
Pick<
EntityReference,
'name' | 'displayName' | 'id' | 'type' | 'fullyQualifiedName' | 'deleted'
>
>;
};
export interface SearchedDataProps {
children?: ReactNode;
selectedEntityId: string;
data: SearchHitBody<ExploreSearchIndex, SourceType>[];
currentPage: number;
isLoading?: boolean;
paginate: (value: string | number) => void;
totalValue: number;
fetchLeftPanel?: () => ReactNode;
isSummaryPanelVisible: boolean;
showResultCount?: boolean;
searchText?: string;
showOnboardingTemplate?: boolean;
showOnlyChildren?: boolean;
isFilterSelected: boolean;
handleSummaryPanelDisplay?: (
details: SearchedDataProps['data'][number]['_source'],
entityType: string
) => void;
}