Skip to content

Commit

Permalink
Addressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jjoyce0510 committed Jul 1, 2022
1 parent 04ca8ba commit 1ebffb2
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 119 deletions.
24 changes: 11 additions & 13 deletions datahub-web-react/src/app/domain/ManageDomainsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ const ListContainer = styled.div``;

export const ManageDomainsPage = () => {
return (
<>
<PageContainer>
<PageHeaderContainer>
<PageTitle level={3}>Domains</PageTitle>
<Typography.Paragraph type="secondary">
View your DataHub Domains. Take administrative actions.
</Typography.Paragraph>
</PageHeaderContainer>
<ListContainer>
<DomainsList />
</ListContainer>
</PageContainer>
</>
<PageContainer>
<PageHeaderContainer>
<PageTitle level={3}>Domains</PageTitle>
<Typography.Paragraph type="secondary">
View your DataHub Domains. Take administrative actions.
</Typography.Paragraph>
</PageHeaderContainer>
<ListContainer>
<DomainsList />
</ListContainer>
</PageContainer>
);
};
64 changes: 31 additions & 33 deletions datahub-web-react/src/app/glossary/BusinessGlossaryPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,39 +54,37 @@ function BusinessGlossaryPage() {

return (
<>
<>
<GlossaryWrapper>
<BrowserWrapper width={browserWidth}>
<GlossarySearch />
<GlossaryBrowser rootNodes={nodes} rootTerms={terms} />
</BrowserWrapper>
<ProfileSidebarResizer
setSidePanelWidth={(width) =>
setBrowserWidth(Math.min(Math.max(width, MIN_BROWSWER_WIDTH), MAX_BROWSER_WIDTH))
}
initialSize={browserWidth}
isSidebarOnLeft
/>
<MainContentWrapper>
<GlossaryEntitiesPath />
<HeaderWrapper>
<Typography.Title level={3}>Glossary</Typography.Title>
<div>
<Button type="text" onClick={() => setIsCreateTermModalVisible(true)}>
<PlusOutlined /> Add Term
</Button>
<Button type="text" onClick={() => setIsCreateNodeModalVisible(true)}>
<PlusOutlined /> Add Term Group
</Button>
</div>
</HeaderWrapper>
{hasTermsOrNodes && <GlossaryEntitiesList nodes={nodes || []} terms={terms || []} />}
{!hasTermsOrNodes && (
<EmptyGlossarySection refetchForTerms={refetchForTerms} refetchForNodes={refetchForNodes} />
)}
</MainContentWrapper>
</GlossaryWrapper>
</>
<GlossaryWrapper>
<BrowserWrapper width={browserWidth}>
<GlossarySearch />
<GlossaryBrowser rootNodes={nodes} rootTerms={terms} />
</BrowserWrapper>
<ProfileSidebarResizer
setSidePanelWidth={(width) =>
setBrowserWidth(Math.min(Math.max(width, MIN_BROWSWER_WIDTH), MAX_BROWSER_WIDTH))
}
initialSize={browserWidth}
isSidebarOnLeft
/>
<MainContentWrapper>
<GlossaryEntitiesPath />
<HeaderWrapper>
<Typography.Title level={3}>Glossary</Typography.Title>
<div>
<Button type="text" onClick={() => setIsCreateTermModalVisible(true)}>
<PlusOutlined /> Add Term
</Button>
<Button type="text" onClick={() => setIsCreateNodeModalVisible(true)}>
<PlusOutlined /> Add Term Group
</Button>
</div>
</HeaderWrapper>
{hasTermsOrNodes && <GlossaryEntitiesList nodes={nodes || []} terms={terms || []} />}
{!hasTermsOrNodes && (
<EmptyGlossarySection refetchForTerms={refetchForTerms} refetchForNodes={refetchForNodes} />
)}
</MainContentWrapper>
</GlossaryWrapper>
{isCreateTermModalVisible && (
<CreateGlossaryEntityModal
entityType={EntityType.GlossaryTerm}
Expand Down
30 changes: 13 additions & 17 deletions datahub-web-react/src/app/ingest/ManageIngestionPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,18 @@ export const ManageIngestionPage = () => {
};

return (
<>
<PageContainer>
<PageHeaderContainer>
<PageTitle level={3}>Manage Ingestion</PageTitle>
<Typography.Paragraph type="secondary">
Create, schedule, and run DataHub ingestion pipelines.
</Typography.Paragraph>
</PageHeaderContainer>
<StyledTabs activeKey={selectedTab} size="large" onTabClick={(tab: string) => onClickTab(tab)}>
<Tab key={TabType.Sources} tab={TabType.Sources} />
<Tab key={TabType.Secrets} tab={TabType.Secrets} />
</StyledTabs>
<ListContainer>
{selectedTab === TabType.Sources ? <IngestionSourceList /> : <SecretsList />}
</ListContainer>
</PageContainer>
</>
<PageContainer>
<PageHeaderContainer>
<PageTitle level={3}>Manage Ingestion</PageTitle>
<Typography.Paragraph type="secondary">
Create, schedule, and run DataHub ingestion pipelines.
</Typography.Paragraph>
</PageHeaderContainer>
<StyledTabs activeKey={selectedTab} size="large" onTabClick={(tab: string) => onClickTab(tab)}>
<Tab key={TabType.Sources} tab={TabType.Sources} />
<Tab key={TabType.Secrets} tab={TabType.Secrets} />
</StyledTabs>
<ListContainer>{selectedTab === TabType.Sources ? <IngestionSourceList /> : <SecretsList />}</ListContainer>
</PageContainer>
);
};
10 changes: 4 additions & 6 deletions datahub-web-react/src/app/search/SearchablePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,19 @@ const styles = {
};

interface Props extends React.PropsWithChildren<any> {
initialQuery?: string;
onSearch?: (query: string, type?: EntityType) => void;
onAutoComplete?: (query: string) => void;
}

const defaultProps = {
initialQuery: '',
onSearch: undefined,
onAutoComplete: undefined,
};

/**
* A page that includes a sticky search header (nav bar)
*/
export const SearchablePage = ({ initialQuery, onSearch, onAutoComplete, children }: Props) => {
export const SearchablePage = ({ onSearch, onAutoComplete, children }: Props) => {
const location = useLocation();
const params = QueryString.parse(location.search, { arrayFormat: 'comma' });
const currentQuery: string = decodeURIComponent(params.query ? (params.query as string) : '');
Expand Down Expand Up @@ -79,16 +77,16 @@ export const SearchablePage = ({ initialQuery, onSearch, onAutoComplete, childre

// Load correct autocomplete results on initial page load.
useEffect(() => {
if (initialQuery && initialQuery.trim() !== '') {
if (currentQuery && currentQuery.trim() !== '') {
getAutoCompleteResults({
variables: {
input: {
query: initialQuery,
query: currentQuery,
},
},
});
}
}, [initialQuery, getAutoCompleteResults]);
}, [currentQuery, getAutoCompleteResults]);

return (
<>
Expand Down
98 changes: 48 additions & 50 deletions datahub-web-react/src/app/settings/SettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,56 +77,54 @@ export const SettingsPage = () => {
const showUsersGroups = (isIdentityManagementEnabled && me && me.platformPrivileges.manageIdentities) || false;

return (
<>
<PageContainer>
<SettingsBarContainer>
<SettingsBarHeader>
<PageTitle level={3}>Settings</PageTitle>
<Typography.Paragraph type="secondary">Manage your DataHub settings.</Typography.Paragraph>
</SettingsBarHeader>
<ThinDivider />
<Menu
selectable={false}
mode="inline"
style={{ width: 256, marginTop: 8 }}
selectedKeys={[activePath]}
onClick={(newPath) => {
history.push(`${url}/${newPath.key}`);
}}
>
<Menu.ItemGroup title="Developer">
<Menu.Item key="tokens">
<SafetyCertificateOutlined />
<ItemTitle>Access Tokens</ItemTitle>
</Menu.Item>
<PageContainer>
<SettingsBarContainer>
<SettingsBarHeader>
<PageTitle level={3}>Settings</PageTitle>
<Typography.Paragraph type="secondary">Manage your DataHub settings.</Typography.Paragraph>
</SettingsBarHeader>
<ThinDivider />
<Menu
selectable={false}
mode="inline"
style={{ width: 256, marginTop: 8 }}
selectedKeys={[activePath]}
onClick={(newPath) => {
history.push(`${url}/${newPath.key}`);
}}
>
<Menu.ItemGroup title="Developer">
<Menu.Item key="tokens">
<SafetyCertificateOutlined />
<ItemTitle>Access Tokens</ItemTitle>
</Menu.Item>
</Menu.ItemGroup>
{(showPolicies || showUsersGroups) && (
<Menu.ItemGroup title="Access">
{showPolicies && (
<Menu.Item key="identities">
<UsergroupAddOutlined />
<ItemTitle>Users & Groups</ItemTitle>
</Menu.Item>
)}
{showUsersGroups && (
<Menu.Item key="policies">
<BankOutlined />
<ItemTitle>Privileges</ItemTitle>
</Menu.Item>
)}
</Menu.ItemGroup>
{(showPolicies || showUsersGroups) && (
<Menu.ItemGroup title="Access">
{showPolicies && (
<Menu.Item key="identities">
<UsergroupAddOutlined />
<ItemTitle>Users & Groups</ItemTitle>
</Menu.Item>
)}
{showUsersGroups && (
<Menu.Item key="policies">
<BankOutlined />
<ItemTitle>Privileges</ItemTitle>
</Menu.Item>
)}
</Menu.ItemGroup>
)}
</Menu>
</SettingsBarContainer>
<Switch>
<Route exact path={path}>
<Redirect to={`${pathname}${pathname.endsWith('/') ? '' : '/'}${DEFAULT_PATH.path}`} />
</Route>
{PATHS.map((p) => (
<Route path={`${path}/${p.path.replace('/', '')}`} render={() => p.content} key={p.path} />
))}
</Switch>
</PageContainer>
</>
)}
</Menu>
</SettingsBarContainer>
<Switch>
<Route exact path={path}>
<Redirect to={`${pathname}${pathname.endsWith('/') ? '' : '/'}${DEFAULT_PATH.path}`} />
</Route>
{PATHS.map((p) => (
<Route path={`${path}/${p.path.replace('/', '')}`} render={() => p.content} key={p.path} />
))}
</Switch>
</PageContainer>
);
};

0 comments on commit 1ebffb2

Please sign in to comment.