mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-08 15:30:55 +00:00
refactor(ux): Misc UX Improvements (tutorial copy, caching, filters) (#6743)
This commit is contained in:
parent
f0a371941e
commit
fd6d12f84a
@ -66,7 +66,7 @@ export const GroupList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = (urn: string) => {
|
const handleDelete = (urn: string) => {
|
||||||
removeGroupFromListGroupsCache(urn, client);
|
removeGroupFromListGroupsCache(urn, client, page, pageSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -2,13 +2,13 @@ import { ListGroupsDocument, ListGroupsQuery } from '../../../graphql/group.gene
|
|||||||
|
|
||||||
export const DEFAULT_GROUP_LIST_PAGE_SIZE = 25;
|
export const DEFAULT_GROUP_LIST_PAGE_SIZE = 25;
|
||||||
|
|
||||||
export const removeGroupFromListGroupsCache = (urn, client) => {
|
export const removeGroupFromListGroupsCache = (urn, client, page, pageSize) => {
|
||||||
const currData: ListGroupsQuery | null = client.readQuery({
|
const currData: ListGroupsQuery | null = client.readQuery({
|
||||||
query: ListGroupsDocument,
|
query: ListGroupsDocument,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
start: 0,
|
start: (page - 1) * pageSize,
|
||||||
count: DEFAULT_GROUP_LIST_PAGE_SIZE,
|
count: pageSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -19,8 +19,8 @@ export const removeGroupFromListGroupsCache = (urn, client) => {
|
|||||||
query: ListGroupsDocument,
|
query: ListGroupsDocument,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
start: 0,
|
start: (page - 1) * pageSize,
|
||||||
count: DEFAULT_GROUP_LIST_PAGE_SIZE,
|
count: pageSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -82,7 +82,7 @@ export const UserList = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleDelete = (urn: string) => {
|
const handleDelete = (urn: string) => {
|
||||||
removeUserFromListUsersCache(urn, client);
|
removeUserFromListUsersCache(urn, client, page, pageSize);
|
||||||
};
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -2,13 +2,13 @@ import { ListUsersDocument, ListUsersQuery } from '../../../graphql/user.generat
|
|||||||
|
|
||||||
export const DEFAULT_USER_LIST_PAGE_SIZE = 25;
|
export const DEFAULT_USER_LIST_PAGE_SIZE = 25;
|
||||||
|
|
||||||
export const removeUserFromListUsersCache = (urn, client) => {
|
export const removeUserFromListUsersCache = (urn, client, page, pageSize) => {
|
||||||
const currData: ListUsersQuery | null = client.readQuery({
|
const currData: ListUsersQuery | null = client.readQuery({
|
||||||
query: ListUsersDocument,
|
query: ListUsersDocument,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
start: 0,
|
start: (page - 1) * pageSize,
|
||||||
count: DEFAULT_USER_LIST_PAGE_SIZE,
|
count: pageSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -20,8 +20,8 @@ export const removeUserFromListUsersCache = (urn, client) => {
|
|||||||
query: ListUsersDocument,
|
query: ListUsersDocument,
|
||||||
variables: {
|
variables: {
|
||||||
input: {
|
input: {
|
||||||
start: 0,
|
start: (page - 1) * pageSize,
|
||||||
count: DEFAULT_USER_LIST_PAGE_SIZE,
|
count: pageSize,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -47,8 +47,7 @@ export const BusinessGlossaryOnboardingConfig: OnboardingStep[] = [
|
|||||||
Click here to create a new <strong>Term Group</strong>.
|
Click here to create a new <strong>Term Group</strong>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Term Groups</strong> act as folders, containing Terms and even other Term Groups to allow
|
<strong>Term Groups</strong> act as folders, containing Terms and nested Term Groups.
|
||||||
for nesting.
|
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
For example, there could be a <strong>PII Term Group</strong> containing Terms for different types
|
For example, there could be a <strong>PII Term Group</strong> containing Terms for different types
|
||||||
|
|||||||
@ -35,8 +35,8 @@ export const EntityProfileOnboardingConfig: OnboardingStep[] = [
|
|||||||
content: (
|
content: (
|
||||||
<Typography.Paragraph>
|
<Typography.Paragraph>
|
||||||
<p>
|
<p>
|
||||||
You can view and edit an entity's key-value <strong>Properties</strong> on this tab. These are
|
You can view an entity's key-value <strong>Properties</strong> on this tab. These are sourced
|
||||||
sourced from the original Data Platform.
|
from the original Data Platform.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If this tab is disabled, <strong>Properties</strong> have not been ingested for this entity.
|
If this tab is disabled, <strong>Properties</strong> have not been ingested for this entity.
|
||||||
@ -121,8 +121,8 @@ export const EntityProfileOnboardingConfig: OnboardingStep[] = [
|
|||||||
You can view and add <strong>Tags</strong> to this asset here.
|
You can view and add <strong>Tags</strong> to this asset here.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>Tags</strong> are labels for organizing your data. For example, you can add a Tag marking an
|
<strong>Tags</strong> are labels for organizing your data. For example, you can add a Tag to mark an
|
||||||
asset as <strong>Deprecated</strong>.
|
asset as <strong>Mission Critical</strong>.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Learn more about <strong>Tags</strong>{' '}
|
Learn more about <strong>Tags</strong>{' '}
|
||||||
|
|||||||
@ -13,9 +13,9 @@ export const IngestionOnboardingConfig: OnboardingStep[] = [
|
|||||||
content: (
|
content: (
|
||||||
<Typography.Paragraph>
|
<Typography.Paragraph>
|
||||||
<p>
|
<p>
|
||||||
Click here to configure new Integrations from DataHub to your <strong>Data Platforms</strong>,
|
Configure new Integrations from DataHub to your <strong>Data Platforms</strong>, including
|
||||||
including Transactional Databases like <strong>MySQL</strong>, Data Warehouses like{' '}
|
Transactional Databases like <strong>MySQL</strong>, Data Warehouses such as{' '}
|
||||||
<strong>Snowflake</strong>, Dashboarding tools like <strong>Looker</strong>, and many more!
|
<strong>Snowflake</strong>, Dashboarding tools like <strong>Looker</strong>, and more!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Learn more about ingestion and view the full list of supported Integrations{' '}
|
Learn more about ingestion and view the full list of supported Integrations{' '}
|
||||||
@ -37,8 +37,7 @@ export const IngestionOnboardingConfig: OnboardingStep[] = [
|
|||||||
title: 'Refresh Ingestion Pipelines',
|
title: 'Refresh Ingestion Pipelines',
|
||||||
content: (
|
content: (
|
||||||
<Typography.Paragraph>
|
<Typography.Paragraph>
|
||||||
<p>Click here to refresh and check whether new ingestion pipelines have been set up.</p>
|
<p>Click to force a refresh of running ingestion sources.</p>
|
||||||
<p>You can view both pipelines created on this page and those set up using the DataHub CLI.</p>
|
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -15,11 +15,11 @@ export const PoliciesOnboardingConfig: OnboardingStep[] = [
|
|||||||
Welcome to DataHub <strong>Policies</strong>!
|
Welcome to DataHub <strong>Policies</strong>!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If you need fine-grained access controls, <strong>Policies</strong> will do the trick.
|
In most cases, <strong>Roles</strong> are the best option for granting privileges to DataHub users."
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
For most users, <strong>Roles</strong> are the recommended way to manage permissions on DataHub. If
|
When more fine-grained control over user and group permissions is required, then{' '}
|
||||||
Roles do not fit your use case, then Policies can be used.
|
<strong>Policies</strong> will do the trick.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Learn more about <strong>Policies</strong>{' '}
|
Learn more about <strong>Policies</strong>{' '}
|
||||||
|
|||||||
@ -12,8 +12,8 @@ export const SearchOnboardingConfig: OnboardingStep[] = [
|
|||||||
title: 'Narrow your search ⚡',
|
title: 'Narrow your search ⚡',
|
||||||
content: (
|
content: (
|
||||||
<Typography.Paragraph>
|
<Typography.Paragraph>
|
||||||
Quickly find relevant assets by applying one or more filters. Try filtering by{' '}
|
Quickly find relevant assets by applying one or more filters. Try filtering by <strong>Type</strong>,{' '}
|
||||||
<strong>Entity Type</strong>, <strong>Owner</strong>, and more!
|
<strong>Owner</strong>, and more!
|
||||||
</Typography.Paragraph>
|
</Typography.Paragraph>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -2,7 +2,7 @@ import { DownOutlined, UpOutlined } from '@ant-design/icons';
|
|||||||
import { Button, Checkbox } from 'antd';
|
import { Button, Checkbox } from 'antd';
|
||||||
import { CheckboxChangeEvent } from 'antd/lib/checkbox';
|
import { CheckboxChangeEvent } from 'antd/lib/checkbox';
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import { useState } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
import { FacetFilterInput, FacetMetadata } from '../../types.generated';
|
import { FacetFilterInput, FacetMetadata } from '../../types.generated';
|
||||||
@ -67,6 +67,14 @@ export const SimpleSearchFilter = ({ facet, selectedFilters, onFilterSelect, def
|
|||||||
(agg) => agg.count > 0 || isFacetSelected(facet.field, agg.value) || isGraphDegreeFilter(facet.field),
|
(agg) => agg.count > 0 || isFacetSelected(facet.field, agg.value) || isGraphDegreeFilter(facet.field),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// By default, render a Filter as open if it is selected
|
||||||
|
const isFilterSelected = !!filteredAggregations.find((agg) => isFacetSelected(facet.field, agg.value));
|
||||||
|
useEffect(() => {
|
||||||
|
if (isFilterSelected) {
|
||||||
|
setAreFiltersVisible(true);
|
||||||
|
}
|
||||||
|
}, [isFilterSelected]);
|
||||||
|
|
||||||
const shouldTruncate = filteredAggregations.length > TRUNCATED_FILTER_LENGTH;
|
const shouldTruncate = filteredAggregations.length > TRUNCATED_FILTER_LENGTH;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { FacetFilterInput, FacetMetadata } from '../../types.generated';
|
import { FacetFilterInput, FacetMetadata } from '../../types.generated';
|
||||||
import { SimpleSearchFilter } from './SimpleSearchFilter';
|
import { SimpleSearchFilter } from './SimpleSearchFilter';
|
||||||
|
|
||||||
const TOP_FILTERS = ['degree', 'entity', 'tags', 'glossaryTerms', 'domains', 'owners'];
|
const TOP_FILTERS = ['degree', 'entity', 'platform', 'tags', 'glossaryTerms', 'domains', 'owners'];
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
facets: Array<FacetMetadata>;
|
facets: Array<FacetMetadata>;
|
||||||
|
|||||||
@ -75,11 +75,6 @@ describe('SearchPage', () => {
|
|||||||
const datasetEntityBox = getByTestId('facet-entity-DATASET');
|
const datasetEntityBox = getByTestId('facet-entity-DATASET');
|
||||||
expect(datasetEntityBox).toHaveProperty('checked', true);
|
expect(datasetEntityBox).toHaveProperty('checked', true);
|
||||||
|
|
||||||
const expandButton = getByTestId('expand-facet-platform');
|
|
||||||
act(() => {
|
|
||||||
fireEvent.click(expandButton);
|
|
||||||
});
|
|
||||||
|
|
||||||
await waitFor(() => expect(queryByTestId('facet-platform-hdfs')).toBeInTheDocument());
|
await waitFor(() => expect(queryByTestId('facet-platform-hdfs')).toBeInTheDocument());
|
||||||
const hdfsPlatformBox = getByTestId('facet-platform-hdfs');
|
const hdfsPlatformBox = getByTestId('facet-platform-hdfs');
|
||||||
expect(hdfsPlatformBox).toHaveProperty('checked', true);
|
expect(hdfsPlatformBox).toHaveProperty('checked', true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user