2022-10-26 11:47:49 +01:00
|
|
|
/*
|
2022-12-27 12:37:58 +05:30
|
|
|
* Copyright 2022 Collate.
|
2022-10-26 11:47:49 +01:00
|
|
|
* 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,
|
|
|
|
MlmodelSearchSource,
|
|
|
|
SearchHitBody,
|
|
|
|
TableSearchSource,
|
|
|
|
} from '../../interface/search.interface';
|
2022-12-16 15:23:17 +05:30
|
|
|
import {
|
|
|
|
EntityDetailsType,
|
|
|
|
ExploreSearchIndex,
|
|
|
|
} from '../Explore/explore.interface';
|
2022-10-26 11:47:49 +01:00
|
|
|
|
|
|
|
type Fields =
|
|
|
|
| 'name'
|
|
|
|
| 'fullyQualifiedName'
|
|
|
|
| 'description'
|
|
|
|
| 'serviceType'
|
|
|
|
| 'deleted';
|
|
|
|
|
2022-11-07 19:21:12 +05:30
|
|
|
export type SourceType = (
|
2022-10-26 11:47:49 +01:00
|
|
|
| Pick<
|
|
|
|
TableSearchSource,
|
|
|
|
Fields | 'usageSummary' | 'database' | 'databaseSchema' | 'tableType'
|
|
|
|
>
|
|
|
|
| Pick<DashboardSearchSource | MlmodelSearchSource, Fields | 'usageSummary'>
|
|
|
|
| Pick<
|
|
|
|
Exclude<
|
|
|
|
ExploreSearchSource,
|
|
|
|
TableSearchSource | DashboardSearchSource | MlmodelSearchSource
|
|
|
|
>,
|
|
|
|
Fields
|
|
|
|
>
|
|
|
|
) & {
|
2023-01-17 14:18:33 +05:30
|
|
|
id: string;
|
2022-10-26 11:47:49 +01:00
|
|
|
tier?: string | Pick<TagLabel, 'tagFQN'>;
|
|
|
|
tags?: string[] | TagLabel[];
|
|
|
|
owner?: Partial<
|
|
|
|
Pick<
|
|
|
|
EntityReference,
|
|
|
|
'name' | 'displayName' | 'id' | 'type' | 'fullyQualifiedName' | 'deleted'
|
|
|
|
>
|
|
|
|
>;
|
|
|
|
};
|
|
|
|
|
|
|
|
export interface SearchedDataProps {
|
|
|
|
children?: ReactNode;
|
2023-01-17 14:18:33 +05:30
|
|
|
selectedEntityId: string;
|
2022-10-26 11:47:49 +01:00
|
|
|
data: SearchHitBody<ExploreSearchIndex, SourceType>[];
|
|
|
|
currentPage: number;
|
|
|
|
isLoading?: boolean;
|
|
|
|
paginate: (value: string | number) => void;
|
|
|
|
totalValue: number;
|
|
|
|
fetchLeftPanel?: () => ReactNode;
|
2022-12-16 21:54:30 +05:30
|
|
|
isSummaryPanelVisible: boolean;
|
2022-10-26 11:47:49 +01:00
|
|
|
showResultCount?: boolean;
|
|
|
|
searchText?: string;
|
|
|
|
showOnboardingTemplate?: boolean;
|
|
|
|
showOnlyChildren?: boolean;
|
|
|
|
isFilterSelected: boolean;
|
2022-12-16 15:23:17 +05:30
|
|
|
handleSummaryPanelDisplay?: (
|
|
|
|
details: EntityDetailsType,
|
|
|
|
entityType: string
|
|
|
|
) => void;
|
2022-10-26 11:47:49 +01:00
|
|
|
}
|