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.
|
|
|
|
*/
|
|
|
|
|
2023-05-12 15:26:36 +05:30
|
|
|
import Qs from 'qs';
|
2022-10-26 11:47:49 +01:00
|
|
|
import { ReactNode } from 'react';
|
|
|
|
import { EntityReference } from '../../generated/entity/type';
|
|
|
|
import { TagLabel } from '../../generated/type/tagLabel';
|
|
|
|
import {
|
2023-07-17 13:58:06 +05:30
|
|
|
ContainerSearchSource,
|
2023-09-19 19:42:39 +05:30
|
|
|
DashboardDataModelSearchSource,
|
2022-10-26 11:47:49 +01:00
|
|
|
DashboardSearchSource,
|
|
|
|
ExploreSearchSource,
|
2023-03-24 11:01:06 +05:30
|
|
|
GlossarySearchSource,
|
2022-10-26 11:47:49 +01:00
|
|
|
MlmodelSearchSource,
|
2023-07-17 13:58:06 +05:30
|
|
|
PipelineSearchSource,
|
2023-03-29 16:46:14 +05:30
|
|
|
QuerySearchSource,
|
2022-10-26 11:47:49 +01:00
|
|
|
SearchHitBody,
|
2023-09-20 10:35:08 +05:30
|
|
|
SearchIndexSearchSource,
|
2023-09-19 19:42:39 +05:30
|
|
|
StoredProcedureSearchSource,
|
2022-10-26 11:47:49 +01:00
|
|
|
TableSearchSource,
|
2023-03-24 11:01:06 +05:30
|
|
|
TagClassSearchSource,
|
2023-04-12 19:01:37 +05:30
|
|
|
TeamSearchSource,
|
2023-06-21 12:59:20 +05:30
|
|
|
TestCaseSearchSource,
|
2023-07-17 13:58:06 +05:30
|
|
|
TopicSearchSource,
|
2023-04-12 19:01:37 +05:30
|
|
|
UserSearchSource,
|
2022-10-26 11:47:49 +01:00
|
|
|
} from '../../interface/search.interface';
|
2023-04-12 18:21:34 +05:30
|
|
|
import { ExploreSearchIndex } from '../Explore/explore.interface';
|
2022-10-26 11:47:49 +01:00
|
|
|
|
|
|
|
type Fields =
|
|
|
|
| 'name'
|
|
|
|
| 'fullyQualifiedName'
|
|
|
|
| 'description'
|
|
|
|
| 'serviceType'
|
2023-01-27 10:13:18 +05:30
|
|
|
| 'displayName'
|
2023-05-22 16:25:03 +05:30
|
|
|
| 'deleted'
|
2023-10-14 19:40:01 +05:30
|
|
|
| 'service'
|
|
|
|
| 'domain';
|
2022-10-26 11:47:49 +01:00
|
|
|
|
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'
|
|
|
|
>
|
2023-07-17 13:58:06 +05:30
|
|
|
| Pick<TopicSearchSource, Fields>
|
|
|
|
| Pick<ContainerSearchSource, Fields>
|
|
|
|
| Pick<PipelineSearchSource, Fields>
|
2023-09-19 19:42:39 +05:30
|
|
|
| Pick<DashboardDataModelSearchSource, Fields>
|
|
|
|
| Pick<StoredProcedureSearchSource, Fields | 'storedProcedureCode'>
|
2022-10-26 11:47:49 +01:00
|
|
|
| Pick<DashboardSearchSource | MlmodelSearchSource, Fields | 'usageSummary'>
|
2023-09-20 10:35:08 +05:30
|
|
|
| Pick<SearchIndexSearchSource, Fields>
|
2022-10-26 11:47:49 +01:00
|
|
|
| Pick<
|
|
|
|
Exclude<
|
|
|
|
ExploreSearchSource,
|
2023-03-24 11:01:06 +05:30
|
|
|
| TableSearchSource
|
|
|
|
| DashboardSearchSource
|
|
|
|
| MlmodelSearchSource
|
|
|
|
| GlossarySearchSource
|
|
|
|
| TagClassSearchSource
|
2023-03-29 16:46:14 +05:30
|
|
|
| QuerySearchSource
|
2023-04-12 19:01:37 +05:30
|
|
|
| UserSearchSource
|
|
|
|
| TeamSearchSource
|
2023-06-21 12:59:20 +05:30
|
|
|
| TestCaseSearchSource
|
2023-09-20 10:35:08 +05:30
|
|
|
| SearchIndexSearchSource
|
2023-09-19 19:42:39 +05:30
|
|
|
| StoredProcedureSearchSource
|
|
|
|
| DashboardDataModelSearchSource
|
2022-10-26 11:47:49 +01:00
|
|
|
>,
|
|
|
|
Fields
|
|
|
|
>
|
|
|
|
) & {
|
2023-01-17 14:18:33 +05:30
|
|
|
id: string;
|
2023-10-04 01:26:14 +05:30
|
|
|
tier?: string | TagLabel;
|
|
|
|
tags?: TagLabel[];
|
2023-03-24 11:01:06 +05:30
|
|
|
entityType?: string;
|
2023-09-19 19:42:39 +05:30
|
|
|
service?: EntityReference;
|
2022-10-26 11:47:49 +01:00
|
|
|
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>[];
|
|
|
|
isLoading?: boolean;
|
2023-04-14 16:24:14 +05:30
|
|
|
onPaginationChange: (value: number, pageSize?: number) => void;
|
2022-10-26 11:47:49 +01:00
|
|
|
totalValue: number;
|
|
|
|
fetchLeftPanel?: () => ReactNode;
|
2022-12-16 21:54:30 +05:30
|
|
|
isSummaryPanelVisible: boolean;
|
2022-10-26 11:47:49 +01:00
|
|
|
showResultCount?: boolean;
|
|
|
|
showOnboardingTemplate?: boolean;
|
|
|
|
showOnlyChildren?: boolean;
|
|
|
|
isFilterSelected: boolean;
|
2022-12-16 15:23:17 +05:30
|
|
|
handleSummaryPanelDisplay?: (
|
2023-04-12 18:21:34 +05:30
|
|
|
details: SearchedDataProps['data'][number]['_source'],
|
2022-12-16 15:23:17 +05:30
|
|
|
entityType: string
|
|
|
|
) => void;
|
2023-05-12 15:26:36 +05:30
|
|
|
filter?: Qs.ParsedQs;
|
2022-10-26 11:47:49 +01:00
|
|
|
}
|