mirror of
https://github.com/datahub-project/datahub.git
synced 2025-12-26 17:37:33 +00:00
fix(search): enable search on business glossary terms (#2790)
8480 | fixed glossary term search issue (#2790)
This commit is contained in:
parent
be39037b10
commit
dbf3a8fd83
@ -8,6 +8,7 @@ import com.linkedin.datahub.graphql.generated.Dashboard;
|
||||
import com.linkedin.datahub.graphql.generated.DataFlow;
|
||||
import com.linkedin.datahub.graphql.generated.DataJob;
|
||||
import com.linkedin.datahub.graphql.generated.Dataset;
|
||||
import com.linkedin.datahub.graphql.generated.GlossaryTerm;
|
||||
import com.linkedin.datahub.graphql.generated.Entity;
|
||||
import com.linkedin.datahub.graphql.generated.Tag;
|
||||
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;
|
||||
@ -28,6 +29,10 @@ public class UrnToEntityMapper implements ModelMapper<com.linkedin.common.urn.Ur
|
||||
partialEntity = new Dataset();
|
||||
((Dataset) partialEntity).setUrn(input.toString());
|
||||
}
|
||||
if (input.getEntityType().equals("glossaryTerm")) {
|
||||
partialEntity = new GlossaryTerm();
|
||||
((GlossaryTerm) partialEntity).setUrn(input.toString());
|
||||
}
|
||||
if (input.getEntityType().equals("chart")) {
|
||||
partialEntity = new Chart();
|
||||
((Chart) partialEntity).setUrn(input.toString());
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { BookFilled, BookOutlined } from '@ant-design/icons';
|
||||
import { EntityType, GlossaryTerm } from '../../../types.generated';
|
||||
import { EntityType, GlossaryTerm, SearchResult } from '../../../types.generated';
|
||||
import { Entity, IconStyleType, PreviewType } from '../Entity';
|
||||
import { Preview } from './preview/Preview';
|
||||
import GlossaryTermProfile from './profile/GlossaryTermProfile';
|
||||
@ -44,7 +44,9 @@ export class GlossaryTermEntity implements Entity<GlossaryTerm> {
|
||||
|
||||
renderProfile: (urn: string) => JSX.Element = (_) => <GlossaryTermProfile />;
|
||||
|
||||
renderSearch = () => <div />;
|
||||
renderSearch = (result: SearchResult) => {
|
||||
return this.renderPreview(PreviewType.SEARCH, result.entity as GlossaryTerm);
|
||||
};
|
||||
|
||||
renderPreview = (_: PreviewType, data: GlossaryTerm) => {
|
||||
return (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user