Skip to content

Commit

Permalink
styling & bugfix for failed realignments
Browse files Browse the repository at this point in the history
  • Loading branch information
romgrk committed Dec 17, 2018
1 parent dc5cf3e commit 69c0cb5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ class App extends Component {

downloadAllRealignments = () => {
this.state.realignments.forEach(realignment => {
download(realignment.id, realignment.data)
if (realignment.success)
download(realignment.id, realignment.data)
})
}

Expand Down Expand Up @@ -390,6 +391,7 @@ class App extends Component {

const hasUnsuccessfulRealignments = realignments.some(r => r.success === false)
const hasSuccessfulRealignments = realignments.some(r => r.success === true)
const successfulRealignments = realignments.filter(r => r.success).length

return (
<div className={cx('Step', { active: isActive })}>
Expand Down Expand Up @@ -423,9 +425,9 @@ class App extends Component {
<Icon name='exclamation-triangle' error />
}
</div>
<div className='Entry__id' ref={onRefEllipsis}>
<div className={cx('Entry__id', { 'text-muted': !realignment.success })} ref={onRefEllipsis}>
<div className='Entry__id__content'>
{realignment.id}
{realignment.success ? realignment.id : realignment.entry.id}
</div>
</div>
<div className='Entry__button'>
Expand Down Expand Up @@ -461,7 +463,7 @@ class App extends Component {
disabled={!hasSuccessfulRealignments}
onClick={this.downloadAllRealignments}
>
Download
Download ({successfulRealignments})
</Button>
<button className='link' onClick={this.reset}>
Reset
Expand Down

0 comments on commit 69c0cb5

Please sign in to comment.