Skip to content

Commit 29a6f91

Browse files
authored
refactor(ui); update input display for dashboards (#5841)
1 parent 055dd27 commit 29a6f91

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

datahub-web-react/src/app/entity/chart/ChartSnippet.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import { getMatchPrioritizingPrimary } from '../shared/utils';
99
type Props = {
1010
matchedFields: MatchedField[];
1111
inputFields: Maybe<InputFields> | undefined;
12+
isMatchingDashboard?: boolean;
1213
};
1314

1415
const LABEL_INDEX_NAME = 'fieldLabels';
1516
const TYPE_PROPERTY_KEY_NAME = 'type';
1617

17-
export const ChartSnippet = ({ matchedFields, inputFields }: Props) => {
18+
export const ChartSnippet = ({ matchedFields, inputFields, isMatchingDashboard = false }: Props) => {
1819
const matchedField = getMatchPrioritizingPrimary(matchedFields, 'fieldLabels');
1920

2021
if (matchedField?.name === LABEL_INDEX_NAME) {
@@ -36,15 +37,17 @@ export const ChartSnippet = ({ matchedFields, inputFields }: Props) => {
3637

3738
return (
3839
<Typography.Text>
39-
Matches {termType} <TagTermGroup uneditableGlossaryTerms={{ terms: [matchedGlossaryTerm] }} />
40+
Matches {termType} <TagTermGroup uneditableGlossaryTerms={{ terms: [matchedGlossaryTerm] }} />{' '}
41+
{isMatchingDashboard && 'on a contained Chart'}
4042
</Typography.Text>
4143
);
4244
}
4345
}
4446

4547
return matchedField ? (
4648
<Typography.Text>
47-
Matches {FIELDS_TO_HIGHLIGHT.get(matchedField.name)} <b>{matchedField.value}</b>
49+
Matches {FIELDS_TO_HIGHLIGHT.get(matchedField.name)} <b>{matchedField.value}</b>{' '}
50+
{isMatchingDashboard && 'on a contained Chart'}
4851
</Typography.Text>
4952
) : null;
5053
};

datahub-web-react/src/app/entity/dashboard/DashboardEntity.tsx

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import { SidebarDomainSection } from '../shared/containers/profile/sidebar/Domai
2323
import { EntityMenuItems } from '../shared/EntityDropdown/EntityDropdown';
2424
import { LineageTab } from '../shared/tabs/Lineage/LineageTab';
2525
import { DashboardStatsSummarySubHeader } from './profile/DashboardStatsSummarySubHeader';
26-
import { InputFieldsTab } from '../shared/tabs/Entity/InputFieldsTab';
2726
import { ChartSnippet } from '../chart/ChartSnippet';
2827

2928
/**
@@ -87,16 +86,6 @@ export class DashboardEntity implements Entity<Dashboard> {
8786
name: 'Documentation',
8887
component: DocumentationTab,
8988
},
90-
{
91-
name: 'Fields',
92-
component: InputFieldsTab,
93-
display: {
94-
visible: (_, dashboard: GetDashboardQuery) =>
95-
(dashboard?.dashboard?.inputFields?.fields?.length || 0) > 0,
96-
enabled: (_, dashboard: GetDashboardQuery) =>
97-
(dashboard?.dashboard?.inputFields?.fields?.length || 0) > 0,
98-
},
99-
},
10089
{
10190
name: 'Properties',
10291
component: PropertiesTab,
@@ -215,7 +204,13 @@ export class DashboardEntity implements Entity<Dashboard> {
215204
statsSummary={data.statsSummary}
216205
lastUpdatedMs={data.properties?.lastModified?.time}
217206
createdMs={data.properties?.created?.time}
218-
snippet={<ChartSnippet matchedFields={result.matchedFields} inputFields={data.inputFields} />}
207+
snippet={
208+
<ChartSnippet
209+
isMatchingDashboard
210+
matchedFields={result.matchedFields}
211+
inputFields={data.inputFields}
212+
/>
213+
}
219214
/>
220215
);
221216
};

0 commit comments

Comments
 (0)