Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BIOMAGE-1024] - Fix long project name hiding project controls #284

Merged
merged 4 commits into from
May 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/EditableField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ const EditableField = (props) => {
return (
<>
<Space direction='vertical'>
<Space>
<Space align='start'>
{renderEditState()}
{
deleteEnabled
Expand Down
130 changes: 70 additions & 60 deletions src/components/data-management/ProjectDetails.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from 'react';
import {
Table, Typography, Space, Tooltip, PageHeader, Button, Input, Progress,
Table, Typography, Space, Tooltip, PageHeader, Button, Input, Progress, Row, Col,
} from 'antd';
import { useRouter } from 'next/router';
import { useSelector, useDispatch } from 'react-redux';
Expand Down Expand Up @@ -47,7 +47,7 @@ import '../../utils/css/hover.css';
import runGem2s from '../../redux/actions/pipeline/runGem2s';
import loadBackendStatus from '../../redux/actions/experimentSettings/loadBackendStatus';

const { Text, Paragraph } = Typography;
const { Title, Text, Paragraph } = Typography;

const ProjectDetails = ({ width, height }) => {
const defaultNA = 'N.A.';
Expand Down Expand Up @@ -646,69 +646,79 @@ const ProjectDetails = ({ width, height }) => {
onCancel={() => setUploadDetailsModalVisible(false)}
/>
<div width={width} height={height}>
<PageHeader
title={activeProject.name}
extra={[
<Button
disabled={projects.ids.length === 0}
onClick={() => setUploadModalVisible(true)}
>
Add samples
</Button>,
<Button
disabled={
projects.ids.length === 0
<Space direction='vertical' style={{ width: '100%', padding: '8px 4px' }}>
<Row style={{ display: 'flex', justifyContent: 'space-between' }}>
<Title level={3}>{activeProject.name}</Title>
<Space>
<Button
disabled={projects.ids.length === 0}
onClick={() => setUploadModalVisible(true)}
>
Add samples
</Button>
<Button
disabled={
projects.ids.length === 0
|| activeProject?.samples?.length === 0
|| isAddingMetadata
}
onClick={() => {
setIsAddingMetadata(true);
createMetadataColumn();
}}
>
Add metadata
</Button>,
<Button
type='primary'
disabled={
projects.ids.length === 0
}
onClick={() => {
setIsAddingMetadata(true);
createMetadataColumn();
}}
>
Add metadata
</Button>
<Button
type='primary'
disabled={
projects.ids.length === 0
|| activeProject?.samples?.length === 0
|| !canLaunchAnalysis
}
onClick={() => openAnalysisModal()}
>
Launch analysis
</Button>
</Space>
</Row>

<Row>
<Col>
{
activeProjectUuid && (
<Space direction='vertical' size='small'>
<Text type='secondary'>{`ID : ${activeProjectUuid}`}</Text>
<Text strong>Description:</Text>
<Paragraph
editable={{ onChange: changeDescription }}
>
{activeProject.description}

</Paragraph>
</Space>
)
}
onClick={() => openAnalysisModal()}
>
Launch analysis
</Button>,
]}
>
{
activeProjectUuid && (
<Space direction='vertical' size='small'>
<Text type='secondary'>{`ID : ${activeProjectUuid}`}</Text>
<Text strong>Description:</Text>
<Paragraph
editable={{ onChange: changeDescription }}
>
{activeProject.description}

</Paragraph>
</Space>
)
}
</PageHeader>

<Table
size='small'
scroll={{
x: 'max-content',
y: height - 250,
}}
bordered
columns={tableColumns}
dataSource={tableData}
sticky
pagination={false}
/>
</Col>
</Row>

<Row>
<Col>
<Table
size='small'
scroll={{
x: 'max-content',
y: height - 250,
}}
bordered
columns={tableColumns}
dataSource={tableData}
sticky
pagination={false}
/>
</Col>
</Row>
</Space>
</div>
</>
);
Expand Down
7 changes: 3 additions & 4 deletions src/components/data-management/ProjectsListContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ const ProjectsListContainer = (props) => {
layout='horizontal'
size='small'
column={1}
colon=''
title={(
>
<Descriptions.Item contentStyle={{ fontWeight: 700, fontSize: 16 }}>
<EditableField
value={projects[uuid].name}
onAfterSubmit={(name) => {
Expand All @@ -110,8 +110,7 @@ const ProjectsListContainer = (props) => {
).isValid
}
/>
)}
>
</Descriptions.Item>
<Descriptions.Item
labelStyle={{ fontWeight: 'bold' }}
label='Samples'
Expand Down
9 changes: 7 additions & 2 deletions src/pages/data-management/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,16 @@ const DataManagementPage = ({ route }) => {
'Projects List': {
toolbarControls: [],
component: (width, height) => (
<Space direction='vertical' style={{ width: '100%', overflowY: 'scroll' }}>
<Space
direction='vertical'
style={{ width: '100%' }}
>
<Button type='primary' block onClick={() => setNewProjectModalVisible(true)}>
Create New Project
</Button>
<ProjectsListContainer height={height} />
<Space direction='vertical' style={{ width: '100%', overflowY: 'scroll' }}>
<ProjectsListContainer height={height} />
</Space>
</Space>
),
},
Expand Down