Skip to content

Commit

Permalink
fix(ui): Addressing minor UI issues pre-release (datahub-project#6368)
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 authored and cccs-tom committed Nov 18, 2022
1 parent 8939e91 commit 77712e2
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,19 @@ const RawButton = styled(Button)`
display: flex;
margin-right: 10px;
justify-content: left;
align-items: center;
}
`;

const RawButtonTitleContainer = styled.span`
display: flex;
align-items: center;
`;

const RawButtonTitle = styled(Typography.Text)`
margin-left: 6px;
`;

const KeyButton = styled(Button)<{ $highlighted: boolean }>`
border-radius: 8px 0px 0px 8px;
font-weight: ${(props) => (props.$highlighted ? '600' : '400')};
Expand Down Expand Up @@ -206,15 +216,15 @@ export default function SchemaHeader({
{hasRaw && (
<RawButton type="text" onClick={() => setShowRaw(!showRaw)}>
{showRaw ? (
<>
<TableOutlined />
<Typography.Text>Tabular</Typography.Text>
</>
<RawButtonTitleContainer>
<TableOutlined style={{ padding: 0, margin: 0 }} />
<RawButtonTitle>Tabular</RawButtonTitle>
</RawButtonTitleContainer>
) : (
<>
<FileTextOutlined />
<Typography.Text>Raw</Typography.Text>
</>
<RawButtonTitleContainer>
<FileTextOutlined style={{ padding: 0, margin: 0 }} />
<RawButtonTitle>Raw</RawButtonTitle>
</RawButtonTitleContainer>
)}
</RawButton>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ function EntityDropdown(props: Props) {
};

const pageUrl = window.location.href;
const isGlossaryEntity = entityType === EntityType.GlossaryNode || entityType === EntityType.GlossaryTerm;
const entityHasChildren = !!entityData?.children?.total;
const canManageGlossaryEntity = !!entityData?.privileges?.canManageEntity;
const canCreateGlossaryEntity = !!entityData?.privileges?.canManageChildren;
const canDeleteGlossaryEntity = !entityHasChildren && canManageGlossaryEntity;

/**
* A default path to redirect to if the entity is deleted.
Expand Down Expand Up @@ -192,7 +194,7 @@ function EntityDropdown(props: Props) {
{menuItems.has(EntityMenuItems.DELETE) && (
<StyledMenuItem
key="5"
disabled={entityHasChildren || !canManageGlossaryEntity}
disabled={isGlossaryEntity && !canDeleteGlossaryEntity}
onClick={onDeleteEntity}
>
<Tooltip
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ export default function ColumnsLineageSelect({
allowClear
placeholder="Select column"
>
{entityData?.schemaMetadata?.fields.map((field) => (
<Select.Option value={field.fieldPath}>{downgradeV2FieldPath(field.fieldPath)}</Select.Option>
))}
{entityData?.schemaMetadata?.fields.map((field) => {
const fieldPath = downgradeV2FieldPath(field.fieldPath);
return (
<Select.Option value={field.fieldPath}>
<Tooltip title={fieldPath}>{fieldPath}</Tooltip>
</Select.Option>
);
})}
</StyledSelect>
)}
<Tooltip title={columnButtonTooltip}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function TypeColumn(type: string, record: any) {
export function LastExecutionColumn(time: any) {
const executionDate = time && new Date(time);
const localTime = executionDate && `${executionDate.toLocaleDateString()} at ${executionDate.toLocaleTimeString()}`;
return <Typography.Text>{localTime || 'N/A'}</Typography.Text>;
return <Typography.Text>{localTime || 'None'}</Typography.Text>;
}

export function ScheduleColumn(schedule: any, record: any) {
Expand All @@ -114,10 +114,10 @@ export function LastStatusColumn({ status, record, setFocusExecutionUrn }: LastS
const color = getExecutionRequestStatusDisplayColor(status);
return (
<StatusContainer>
{Icon && <Icon style={{ color }} />}
{Icon && <Icon style={{ color, fontSize: 14 }} />}
<StatusButton type="link" onClick={() => setFocusExecutionUrn(record.lastExecUrn)}>
<Typography.Text strong style={{ color, marginLeft: 8 }}>
{text || 'N/A'}
{text || 'Pending...'}
</Typography.Text>
</StatusButton>
</StatusContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function IngestionExecutionTable({
dataIndex: 'duration',
key: 'duration',
render: (durationMs: number) => {
const seconds = (durationMs && `${durationMs / 1000}s`) || 'N/A';
const seconds = (durationMs && `${durationMs / 1000}s`) || 'None';
return seconds;
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const StatusButton = styled(Button)`
export function TimeColumn(time: string) {
const date = time && new Date(time);
const localTime = date && `${date.toLocaleDateString()} at ${date.toLocaleTimeString()}`;
return <Typography.Text>{localTime || 'N/A'}</Typography.Text>;
return <Typography.Text>{localTime || 'None'}</Typography.Text>;
}

interface StatusColumnProps {
Expand All @@ -42,10 +42,10 @@ export function StatusColumn({ status, record, setFocusExecutionUrn }: StatusCol
const color = getExecutionRequestStatusDisplayColor(status);
return (
<StatusContainer>
{Icon && <Icon style={{ color }} />}
{Icon && <Icon style={{ color, fontSize: 14 }} />}
<StatusButton type="link" onClick={() => setFocusExecutionUrn(record.urn)}>
<Typography.Text strong style={{ color, marginLeft: 8 }}>
{text || 'N/A'}
{text || 'Pending...'}
</Typography.Text>
</StatusButton>
</StatusContainer>
Expand Down
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/ingest/source/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const getExecutionRequestStatusIcon = (status: string) => {
(status === ROLLED_BACK && WarningOutlined) ||
(status === ROLLING_BACK && LoadingOutlined) ||
(status === ROLLBACK_FAILED && CloseCircleOutlined) ||
undefined
ClockCircleOutlined
);
};

Expand Down
31 changes: 20 additions & 11 deletions datahub-web-react/src/app/permissions/roles/ManageRoles.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { Button, Empty, message, Pagination, Tooltip } from 'antd';
import { Button, Empty, message, Pagination, Tooltip, Typography } from 'antd';
import styled from 'styled-components';
import * as QueryString from 'query-string';
import { useLocation } from 'react-router';
Expand All @@ -16,6 +16,7 @@ import { useBatchAssignRoleMutation } from '../../../graphql/mutations.generated
import { CorpUser, DataHubRole, DataHubPolicy } from '../../../types.generated';
import RoleDetailsModal from './RoleDetailsModal';
import analytics, { EventType } from '../../analytics';
import { ANTD_GRAY } from '../../entity/shared/constants';

const SourceContainer = styled.div``;

Expand All @@ -33,6 +34,12 @@ const PageContainer = styled.span`
width: 100%;
`;

const ActionsContainer = styled.div`
width: 100%;
display: flex;
justify-content: right;
`;

const AddUsersButton = styled(Button)`
margin-right: 16px;
`;
Expand Down Expand Up @@ -137,7 +144,7 @@ export const ManageRoles = () => {
<>
<RoleName
onClick={() => onViewRole(record.role)}
style={{ color: record?.editable ? '#000000' : '#8C8C8C' }}
style={{ color: record?.editable ? '#000000' : ANTD_GRAY[8] }}
>
{record?.name}
</RoleName>
Expand All @@ -158,13 +165,15 @@ export const ManageRoles = () => {
render: (_: any, record: any) => {
return (
<>
<AvatarsGroup
users={record?.users}
groups={record?.resolvedGroups}
entityRegistry={entityRegistry}
maxCount={3}
size={28}
/>
{(record?.users.length && (
<AvatarsGroup
users={record?.users}
groups={record?.resolvedGroups}
entityRegistry={entityRegistry}
maxCount={3}
size={28}
/>
)) || <Typography.Text type="secondary">No assigned users</Typography.Text>}
</>
);
},
Expand All @@ -174,7 +183,7 @@ export const ManageRoles = () => {
key: 'actions',
render: (_: any, record: any) => {
return (
<>
<ActionsContainer>
<Tooltip title={`Assign the ${record.name} role to users`}>
<AddUsersButton
onClick={() => {
Expand All @@ -185,7 +194,7 @@ export const ManageRoles = () => {
ADD USERS
</AddUsersButton>
</Tooltip>
</>
</ActionsContainer>
);
},
},
Expand Down
2 changes: 1 addition & 1 deletion datahub-web-react/src/app/search/SearchFiltersSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const FiltersHeader = styled.div`
font-weight: 600;
padding-left: 20px;
padding-right: 20px;
padding-right: 4px;
padding-bottom: 8px;
width: 100%;
Expand Down
51 changes: 45 additions & 6 deletions datahub-web-react/src/app/shared/admin/HeaderLinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import {
DownOutlined,
} from '@ant-design/icons';
import { Link } from 'react-router-dom';
import { Button, Dropdown, Menu } from 'antd';
import { Button, Dropdown, Menu, Tooltip } from 'antd';
import { useAppConfig } from '../../useAppConfig';
import { useGetAuthenticatedUser } from '../../useGetAuthenticatedUser';
import { ANTD_GRAY } from '../../entity/shared/constants';

const LinkWrapper = styled.span`
margin-right: 0px;
Expand All @@ -34,6 +35,24 @@ const LinksWrapper = styled.div<{ areLinksHidden?: boolean }>`
const MenuItem = styled(Menu.Item)`
font-size: 12px;
font-weight: bold;
max-width: 240px;
`;

const NavTitleContainer = styled.span`
display: flex;
align-items: center;
justify-content: left;
padding: 2px;
`;

const NavTitleText = styled.span`
margin-left: 6px;
`;

const NavTitleDescription = styled.div`
font-size: 12px;
font-weight: normal;
color: ${ANTD_GRAY[7]};
`;

interface Props {
Expand All @@ -60,7 +79,12 @@ export function HeaderLinks(props: Props) {
<LinkWrapper>
<Link to="/analytics">
<Button type="text">
<BarChartOutlined /> Analytics
<Tooltip title="View DataHub usage analytics">
<NavTitleContainer>
<BarChartOutlined />
<NavTitleText>Analytics</NavTitleText>
</NavTitleContainer>
</Tooltip>
</Button>
</Link>
</LinkWrapper>
Expand All @@ -69,7 +93,12 @@ export function HeaderLinks(props: Props) {
<LinkWrapper>
<Link to="/ingestion">
<Button type="text">
<ApiOutlined /> Ingestion
<Tooltip title="Connect DataHub to your organization's data sources">
<NavTitleContainer>
<ApiOutlined />
<NavTitleText>Ingestion</NavTitleText>
</NavTitleContainer>
</Tooltip>
</Button>
</Link>
</LinkWrapper>
Expand All @@ -80,13 +109,21 @@ export function HeaderLinks(props: Props) {
<Menu>
<MenuItem key="0">
<Link to="/glossary">
<BookOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Glossary
<NavTitleContainer>
<BookOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} />
<NavTitleText>Glossary</NavTitleText>
</NavTitleContainer>
<NavTitleDescription>View and modify your data dictionary</NavTitleDescription>
</Link>
</MenuItem>
{showDomains && (
<MenuItem key="1">
<Link to="/domains">
<FolderOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} /> Domains
<NavTitleContainer>
<FolderOutlined style={{ fontSize: '14px', fontWeight: 'bold' }} />
<NavTitleText>Domains</NavTitleText>
</NavTitleContainer>
<NavTitleDescription>Manage related groups of data assets</NavTitleDescription>
</Link>
</MenuItem>
)}
Expand All @@ -103,7 +140,9 @@ export function HeaderLinks(props: Props) {
<LinkWrapper style={{ marginRight: 12 }}>
<Link to="/settings">
<Button type="text">
<SettingOutlined />
<Tooltip title="Manage your DataHub settings">
<SettingOutlined />
</Tooltip>
</Button>
</Link>
</LinkWrapper>
Expand Down

0 comments on commit 77712e2

Please sign in to comment.