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

Changes "Hide" button on Pipeline summary to fully hide the paper card #305

Merged
merged 2 commits into from
Nov 21, 2018
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
1 change: 1 addition & 0 deletions frontend/src/Css.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const color = {
graphBg: '#f5f5f5',
hoverBg: '#eee',
inactive: '#5F6368',
lowContrast: '#80868b', // Google grey 600
secondaryText: 'rgba(0, 0, 0, .88)',
separator: '#e8e8e8',
strong: '#212121',
Expand Down
49 changes: 34 additions & 15 deletions frontend/src/pages/PipelineDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import AddIcon from '@material-ui/icons/Add';
import Button from '@material-ui/core/Button';
import CircularProgress from '@material-ui/core/CircularProgress';
import CloseIcon from '@material-ui/icons/Close';
import Collapse from '@material-ui/core/Collapse';
import DetailsTable from '../components/DetailsTable';
import Graph from '../components/Graph';
import InfoIcon from '@material-ui/icons/InfoOutlined';
import MD2Tabs from '../atoms/MD2Tabs';
import Paper from '@material-ui/core/Paper';
import Resizable from 're-resizable';
Expand Down Expand Up @@ -78,6 +78,17 @@ const css = stylesheet({
fontSizeTitle: {
fontSize: fontsize.title,
},
footer: {
background: color.graphBg,
display: 'flex',
padding: '0 0 20px 20px',
},
infoSpan: {
color: color.lowContrast,
fontSize: fontsize.small,
lineHeight: '24px',
paddingLeft: 6,
},
nodeName: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to shake down the summaryCard class, it has unneeded rules now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can remove backgroundColor, maxHeight, and overflow. Was there anything else you were thinking?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine.

flexGrow: 1,
textAlign: 'center',
Expand All @@ -94,11 +105,8 @@ const css = stylesheet({
zIndex: 2,
},
summaryCard: {
backgroundColor: color.background,
bottom: 20,
left: 20,
maxHeight: 350,
overflow: 'auto',
padding: 10,
position: 'absolute',
width: 500,
Expand Down Expand Up @@ -192,23 +200,25 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {
<div className={commonCss.page}>
{selectedTab === 0 && <div className={commonCss.page}>
{this.state.graph && <div className={commonCss.page} style={{ position: 'relative', overflow: 'hidden' }}>
<Paper className={css.summaryCard}>
<div style={{ alignItems: 'baseline', display: 'flex', justifyContent: 'space-between' }}>
<div className={commonCss.header}>
Summary
{summaryShown && (
<Paper className={css.summaryCard}>
<div style={{ alignItems: 'baseline', display: 'flex', justifyContent: 'space-between' }}>
<div className={commonCss.header}>
Summary
</div>
<Button onClick={() => this.setState({ summaryShown: false })} color='secondary'>
Hide
</Button>
</div>
<Button onClick={() => this.setState({ summaryShown: !summaryShown })} color='secondary'>
{summaryShown ? 'Hide' : 'Show'}
</Button>
</div>
<Collapse in={summaryShown}>
<div className={css.summaryKey}>Uploaded on</div>
<div>{new Date(pipeline.created_at!).toLocaleString()}</div>
<div className={css.summaryKey}>Description</div>
<div>{pipeline.description}</div>
</Collapse>
</Paper>
</Paper>
)}

<Graph graph={this.state.graph} selectedNodeId={selectedNodeId} onClick={(id) => this._selectNode(id)} />

<Slide in={!!selectedNodeId} direction='left'>
<Resizable className={css.sidepane} defaultSize={{ width: '40%' }} maxWidth='90%'
minWidth={100} enable={{
Expand Down Expand Up @@ -244,6 +254,15 @@ class PipelineDetails extends Page<{}, PipelineDetailsState> {
</Resizable>
</Slide>
</div>}
<div className={css.footer}>
{!summaryShown && (
<Button onClick={() => this.setState({ summaryShown: !summaryShown })} color='secondary'>
Show summary
</Button>
)}
<InfoIcon style={{ color: color.lowContrast, height: 24, width: 13 }} />
<span className={css.infoSpan}>Static pipeline graph</span>
</div>
{!this.state.graph && <span style={{ margin: '40px auto' }}>No graph to show</span>}
</div>}
{selectedTab === 1 &&
Expand Down