mirror of https://github.com/buster-so/buster.git
start user dataset lineage
Co-Authored-By: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
parent
165a0e0bad
commit
7408b72f0c
|
@ -1 +1,3 @@
|
||||||
export * from './PermissionLineageBreadcrumb';
|
export * from './PermissionLineageBreadcrumb';
|
||||||
|
export * from './HeaderExplanation';
|
||||||
|
export * from './PermissionSearch';
|
||||||
|
|
|
@ -4,8 +4,7 @@ import { useDatasetListDatasetGroups } from '@/api/buster-rest';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useDebounceSearch } from '@/hooks';
|
import { useDebounceSearch } from '@/hooks';
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { HeaderExplanation } from '../../HeaderExplanation';
|
import { PermissionSearch, HeaderExplanation } from '@/app/app/_components/PermissionComponents';
|
||||||
import { PermissionSearch } from '../../PermissionSearch';
|
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
import { AppMaterialIcons } from '@/components';
|
import { AppMaterialIcons } from '@/components';
|
||||||
import { PermissionListDatasetGroupContainer } from './PermissionListDatasetGroupContainer';
|
import { PermissionListDatasetGroupContainer } from './PermissionListDatasetGroupContainer';
|
||||||
|
|
|
@ -71,7 +71,7 @@ export const PermissionListUserContainer: React.FC<{
|
||||||
return result;
|
return result;
|
||||||
}, [filteredUsers]);
|
}, [filteredUsers]);
|
||||||
|
|
||||||
const rows = useMemo(
|
const rows: BusterListRowItem[] = useMemo(
|
||||||
() =>
|
() =>
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
|
|
||||||
import { useGetDatasetPermissionsOverview } from '@/api/buster-rest/datasets';
|
import { useGetDatasetPermissionsOverview } from '@/api/buster-rest/datasets';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { HeaderExplanation } from '../../HeaderExplanation';
|
import { PermissionSearch, HeaderExplanation } from '@/app/app/_components/PermissionComponents';
|
||||||
import { PermissionSearch } from '../../PermissionSearch';
|
|
||||||
import { PermissionListUserContainer } from './PermissionListUserContainer';
|
import { PermissionListUserContainer } from './PermissionListUserContainer';
|
||||||
import { useDebounceSearch } from '@/hooks';
|
import { useDebounceSearch } from '@/hooks';
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { HeaderExplanation } from '../../HeaderExplanation';
|
import { PermissionSearch, HeaderExplanation } from '@/app/app/_components/PermissionComponents';
|
||||||
import { PermissionSearch } from '../../PermissionSearch';
|
|
||||||
import { useMemoizedFn } from 'ahooks';
|
import { useMemoizedFn } from 'ahooks';
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
import { AppMaterialIcons } from '@/components';
|
import { AppMaterialIcons } from '@/components';
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { HeaderExplanation } from '../../HeaderExplanation';
|
import { PermissionSearch, HeaderExplanation } from '@/app/app/_components/PermissionComponents';
|
||||||
import { PermissionSearch } from '../../PermissionSearch';
|
|
||||||
import { useDatasetListPermissionUsers } from '@/api/buster-rest';
|
import { useDatasetListPermissionUsers } from '@/api/buster-rest';
|
||||||
import { useDebounceSearch } from '@/hooks';
|
import { useDebounceSearch } from '@/hooks';
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
|
|
|
@ -21,8 +21,8 @@ export const UserController = React.memo(({ userId }: { userId: string }) => {
|
||||||
<UserHeader user={user} />
|
<UserHeader user={user} />
|
||||||
<UserSegments user={user} selectedApp={selectedApp} onSelectApp={setSelectedApp} />
|
<UserSegments user={user} selectedApp={selectedApp} onSelectApp={setSelectedApp} />
|
||||||
<UserDefaultAccess user={user} isAdmin={isAdmin} />
|
<UserDefaultAccess user={user} isAdmin={isAdmin} />
|
||||||
<UserLineageHeader className="!mt-[48px]" />
|
<UserLineageHeader className="!mt-[48px]" user={user} />
|
||||||
<UserDatasetSearch />
|
<UserDatasetSearch user={user} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
import React, { useMemo } from 'react';
|
||||||
|
import {
|
||||||
|
BusterInfiniteList,
|
||||||
|
BusterListColumn,
|
||||||
|
BusterListRowItem,
|
||||||
|
InfiniteListContainer
|
||||||
|
} from '@/components/list';
|
||||||
|
import { PermissionLineageBreadcrumb } from '@/app/app/_components/PermissionComponents';
|
||||||
|
import { DatasetPermissionOverviewUser } from '@/api/buster-rest';
|
||||||
|
import { Text } from '@/components/text';
|
||||||
|
|
||||||
|
export const UserDatasetListContainer = React.memo(
|
||||||
|
({ filteredDatasets }: { filteredDatasets: any[] }) => {
|
||||||
|
const columns: BusterListColumn[] = useMemo(() => [], []);
|
||||||
|
|
||||||
|
const rows: BusterListRowItem[] = useMemo(() => [], []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<InfiniteListContainer>
|
||||||
|
<BusterInfiniteList
|
||||||
|
columns={columns}
|
||||||
|
rows={rows}
|
||||||
|
showHeader={false}
|
||||||
|
showSelectAll={false}
|
||||||
|
emptyState={<EmptyState />}
|
||||||
|
/>
|
||||||
|
</InfiniteListContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
UserDatasetListContainer.displayName = 'UserDatasetListContainer';
|
||||||
|
|
||||||
|
const DatasetLineageCell = React.memo(({ user }: { user: DatasetPermissionOverviewUser }) => {
|
||||||
|
return (
|
||||||
|
<div className="flex items-center justify-end">
|
||||||
|
{/* <PermissionLineageBreadcrumb lineage={user.lineage} canQuery={user.can_query} /> */}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
DatasetLineageCell.displayName = 'DatasetLineageCell';
|
||||||
|
|
||||||
|
const EmptyState = React.memo(() => {
|
||||||
|
return (
|
||||||
|
<div className="py-12">
|
||||||
|
<Text type="tertiary">No datasets found</Text>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
});
|
||||||
|
EmptyState.displayName = 'EmptyState';
|
|
@ -1,22 +1,19 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Input } from 'antd';
|
|
||||||
import { useDebounceSearch } from '@/hooks';
|
import { useDebounceSearch } from '@/hooks';
|
||||||
import { InfiniteListContainer } from '@/components/list';
|
import { OrganizationUser } from '@/api';
|
||||||
|
import { PermissionSearch } from '@/app/app/_components/PermissionComponents';
|
||||||
|
import { UserDatasetListContainer } from './UserDatasetListContainer';
|
||||||
|
|
||||||
export const UserDatasetSearch = React.memo(() => {
|
export const UserDatasetSearch = React.memo(({ user }: { user: OrganizationUser }) => {
|
||||||
const { filteredItems, searchText, handleSearchChange, isPending } = useDebounceSearch({
|
const { filteredItems, searchText, handleSearchChange, isPending } = useDebounceSearch({
|
||||||
items: [],
|
items: [],
|
||||||
searchPredicate: (item, searchText) => true,
|
searchPredicate: (item, searchText) => true
|
||||||
debounceTime: 500
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col space-y-3">
|
<div className="flex h-full flex-col space-y-3 pb-12">
|
||||||
<Input className="w-full max-w-[280px]" placeholder="Search datasets..." />
|
<PermissionSearch searchText={searchText} setSearchText={handleSearchChange} />
|
||||||
|
<UserDatasetListContainer filteredDatasets={filteredItems} />
|
||||||
<InfiniteListContainer>
|
|
||||||
<div>TEST</div>
|
|
||||||
</InfiniteListContainer>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { BusterUserAvatar, Text, Title, AppMaterialIcons } from '@/components';
|
import { BusterUserAvatar, Text, Title, AppMaterialIcons } from '@/components';
|
||||||
import { BusterUserResponse, OrganizationUser } from '@/api';
|
import { OrganizationUser } from '@/api';
|
||||||
import { Button } from 'antd';
|
import { Button } from 'antd';
|
||||||
|
|
||||||
export const UserHeader = React.memo(({ user }: { user: OrganizationUser }) => {
|
export const UserHeader = React.memo(({ user }: { user: OrganizationUser }) => {
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Text, Title } from '@/components/text';
|
import { HeaderExplanation } from '@/app/app/_components/PermissionComponents';
|
||||||
|
import type { OrganizationUser } from '@/api/buster-rest';
|
||||||
|
|
||||||
export const UserLineageHeader = React.memo(({ className = '' }: { className?: string }) => {
|
export const UserLineageHeader = React.memo(
|
||||||
return (
|
({ className = '', user }: { className?: string; user: OrganizationUser }) => {
|
||||||
<div className={`flex flex-col space-y-1.5 ${className}`}>
|
return (
|
||||||
<Title level={4}>{`Dataset access & lineage`}</Title>
|
<HeaderExplanation
|
||||||
<Text type="secondary">{`View Blake Rouse’s access to all available datasets. Lineage is provided to show where access originates from.`}</Text>
|
className={className}
|
||||||
</div>
|
title={`Dataset access & lineage`}
|
||||||
);
|
description={`View ${user.name}’s access to all available datasets. Lineage is provided to show where access originates from.`}
|
||||||
});
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
UserLineageHeader.displayName = 'UserLineageHeader';
|
UserLineageHeader.displayName = 'UserLineageHeader';
|
||||||
|
|
Loading…
Reference in New Issue