Skip to content

Commit

Permalink
Use items instead of children in Tabs and Collapse antd
Browse files Browse the repository at this point in the history
Signed-off-by: Dinika Saxena <dinikasaxenas@gmail.com>
  • Loading branch information
Dinika committed Oct 3, 2023
1 parent 1fab158 commit 450651b
Show file tree
Hide file tree
Showing 16 changed files with 647 additions and 537 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ cypress.env.json
.idea
*.sops*
.sops-*.*
*.key
*.key
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fusion</title>
<title>Vite + React + TS</title>
<!--app-head-->
</head>

Expand Down
269 changes: 145 additions & 124 deletions src/pages/ProjectPage/ProjectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ const ProjectView: React.FunctionComponent = () => {
const location = useLocation();
const history = useHistory();
const subapp = useOrganisationsSubappContext();
const { TabPane } = Tabs;

const match = useRouteMatch<{
orgLabel: string;
Expand Down Expand Up @@ -264,132 +263,154 @@ const ProjectView: React.FunctionComponent = () => {
/>
)}
<div className="tabs-container">
<Tabs onChange={handleTabChange} activeKey={activeKey}>
<TabPane tab="Browse" key="browse">
<div className="list-board">
<div className="wrapper">
<ResourceListBoardContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
refreshLists={refreshLists}
<Tabs
onChange={handleTabChange}
activeKey={activeKey}
items={[
{
key: 'browse',
label: 'Browse',
children: (
<div className="list-board">
<div className="wrapper">
<ResourceListBoardContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
refreshLists={refreshLists}
/>
</div>
</div>
),
},
{
key: 'query',
label: 'Query',
children: (
<div style={{ flexGrow: 1 }}>
<QueryEditor
orgLabel={orgLabel}
projectLabel={projectLabel}
onUpdate={() => {
setRefreshLists(!refreshLists);
// Statistics aren't immediately updated so pause polling briefly
pauseStatisticsPolling(5000);
}}
/>
</div>
),
},
{
key: 'create_upload',
label: 'Create and Upload',
children: (
<AccessControl
path={`/${orgLabel}/${projectLabel}`}
permissions={['files/write']}
noAccessComponent={() => (
<Empty>
You don't have the access to create/upload. Please
contact the Administrator for access.
</Empty>
)}
>
<ResourceCreateUploadContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</AccessControl>
),
},
{
key: 'stats',
label: 'Statistics',
children: (
<AccessControl
key="quotas-access-control"
path={`/${orgLabel}/${projectLabel}`}
permissions={['test']}
noAccessComponent={() => (
<Empty>
You don't have read access to quotas. Please contact
the Administrator for access.
</Empty>
)}
>
<QuotasContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
<StoragesContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</AccessControl>
),
},
{
key: 'settings',
label: 'Settings',
children: (
<SettingsContainer
project={{
_label: project._label,
_rev: project._rev,
description: project.description || '',
base: project.base,
vocab: project.vocab,
_deprecated: project._deprecated,
}}
apiMappings={project.apiMappings}
mode="edit"
/>
</div>
</div>
</TabPane>
<TabPane tab="Query" key="query">
<div style={{ flexGrow: 1 }}>
<QueryEditor
orgLabel={orgLabel}
projectLabel={projectLabel}
onUpdate={() => {
setRefreshLists(!refreshLists);
// Statistics aren't immediately updated so pause polling briefly
pauseStatisticsPolling(5000);
}}
/>
</div>
</TabPane>
<TabPane tab="Create and Upload" key="create_upload">
<AccessControl
path={`/${orgLabel}/${projectLabel}`}
permissions={['files/write']}
noAccessComponent={() => (
<Empty>
You don't have the access to create/upload. Please contact
the Administrator for access.
</Empty>
)}
>
<ResourceCreateUploadContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</AccessControl>
</TabPane>
<TabPane tab="Statistics" key="stats">
<AccessControl
key="quotas-access-control"
path={`/${orgLabel}/${projectLabel}`}
permissions={['test']}
noAccessComponent={() => (
<Empty>
You don't have read access to quotas. Please contact the
Administrator for access.
</Empty>
)}
>
<QuotasContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
<StoragesContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</AccessControl>
</TabPane>
<TabPane tab="Settings" key="settings">
<SettingsContainer
project={{
_label: project._label,
_rev: project._rev,
description: project.description || '',
base: project.base,
vocab: project.vocab,
_deprecated: project._deprecated,
}}
apiMappings={project.apiMappings}
mode="edit"
/>
</TabPane>
{deltaPlugins &&
),
},
...(deltaPlugins &&
'jira' in deltaPlugins &&
isUserInSupportedJiraRealm &&
!jiraInaccessibleBecauseOfVPN && (
<TabPane tab="Jira" key="jira">
<JiraPluginProjectContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</TabPane>
)}
{deltaPlugins && 'graph-analytics' in deltaPlugins && (
<TabPane tab="Graph Analytics" key="graph-analytics">
<ProjectStatsContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
</TabPane>
)}
<TabPane
tab={
<span>
<Link
target="_blank"
rel="noopener noreferrer"
to={`/studios/${orgLabel}/${projectLabel}/studios`}
>
<SelectOutlined /> Studios
</Link>
</span>
}
key="studios"
></TabPane>
{/* <TabPane
tab={
<span>
<Link
target="_blank"
rel="noopener noreferrer"
to={`/workflow/${orgLabel}/${projectLabel}`}
>
<SelectOutlined /> Workflows
</Link>
</span>
}
key="workflows"
></TabPane> */}
</Tabs>
!jiraInaccessibleBecauseOfVPN
? [
{
key: 'jira',
label: 'Jira',
children: (
<JiraPluginProjectContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
),
},
]
: []),
...(deltaPlugins && 'graph-analytics' in deltaPlugins
? [
{
key: 'graph-analytics',
label: 'Graph Analytics',
children: (
<ProjectStatsContainer
orgLabel={orgLabel}
projectLabel={projectLabel}
/>
),
},
]
: []),
{
key: 'studios',
label: (
<span>
<Link
target="_blank"
rel="noopener noreferrer"
to={`/studios/${orgLabel}/${projectLabel}/studios`}
>
<SelectOutlined /> Studios
</Link>
</span>
),
},
]}
/>
</div>
</>
)}
Expand Down
1 change: 1 addition & 0 deletions src/shared/components/Graph/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as React from 'react';
import cytoscape from 'cytoscape';
import cola from 'cytoscape-cola';

Expand Down
Loading

0 comments on commit 450651b

Please sign in to comment.