Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react): update platform text in dataset profile header #2771

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions datahub-web-react/src/app/entity/dataset/profile/DatasetHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Badge, Popover, Space, Typography } from 'antd';
import { Badge, Image, Popover, Space, Typography } from 'antd';
import { FetchResult, MutationFunctionOptions } from '@apollo/client';
import styled from 'styled-components';
import React from 'react';
Expand Down Expand Up @@ -28,6 +28,12 @@ const HeaderInfoItems = styled.div`
margin-top: -16px;
vertical-align: top;
`;
const PreviewImage = styled(Image)`
max-height: 20px;
padding-top: 3px;
width: auto;
object-fit: contain;
`;

export default function DatasetHeader({
dataset: { urn, type, description: originalDesc, ownership, deprecation, platform, editableProperties, usageStats },
Expand All @@ -36,6 +42,7 @@ export default function DatasetHeader({
const entityRegistry = useEntityRegistry();
const isCompact = React.useContext(CompactContext);
const platformName = capitalizeFirstLetter(platform.name);
const platformLogoUrl = platform.info?.logoUrl;

return (
<>
Expand All @@ -47,7 +54,12 @@ export default function DatasetHeader({
Platform
</Typography.Text>
</div>
<Typography.Text style={{ fontSize: 16 }}>{platformName}</Typography.Text>
<Space direction="horizontal">
{platformLogoUrl && (
<PreviewImage preview={false} src={platformLogoUrl} placeholder alt={platformName} />
)}
<Typography.Text style={{ fontSize: 16 }}>{platformName}</Typography.Text>
</Space>
</HeaderInfoItem>
{usageStats?.aggregations?.totalSqlQueries && (
<HeaderInfoItem>
Expand Down