Skip to content

Commit

Permalink
Style worker status and separate from linked BAMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaclynperrone committed Sep 14, 2015
1 parent 40db63e commit bbe4f93
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 22 deletions.
42 changes: 36 additions & 6 deletions cycledash/static/js/runs/components/RunsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ var RunsTable = React.createClass({
<th className='caller-name'>Caller Name</th>
<th className='date'>Submitted</th>
<th className='num-variants'>Variants</th>
<th className='bam-info'>Linked BAMs</th>
<th className='linked-bams'>Linked BAMs</th>
<th className='run-labels'></th>
<th className='num-comments'></th>
<th className='examine-col'></th>
</tr>
Expand Down Expand Up @@ -279,6 +280,7 @@ var RunRow = React.createClass({
<td className='caller-name'>{run.caller_name}</td>
<td className='date' title={run.created_at}>{moment(new Date(run.created_at)).format('YYYY-MM-DD')}</td>
<td className='num-variants' title={run.genotype_count}>{run.genotype_count}</td>
<RunBAMs run={run} />
<RunLabels run={run} />
<RunComments run={run} />
<td className='run-id'>
Expand Down Expand Up @@ -320,7 +322,7 @@ var RunDescriptionRow = React.createClass({
});
return (
<tr className='info'>
<td colSpan='6'>
<td colSpan='7'>
<dl className='dl-horizontal'>
{descriptions}
{tasks}
Expand Down Expand Up @@ -362,17 +364,15 @@ var RunLabels = React.createClass({
.object()
.value();
var labelSpecs = [
{path: ['tumor_bam' , 'name'], usePathValue: true, title: 'Tumor BAM'},
{path: ['normal_bam', 'name'], usePathValue: true, title: 'Normal BAM'},
{path: ['run'], title: 'Has a running worker task', cssClass: 'run'},
{path: ['fail'], title: 'Has a failed worker task', cssClass: 'fail'}
];
var labels = labelSpecs.map(
function({path, usePathValue, title, cssClass}) {
var value = utils.getIn(run, path) || utils.getIn(taskStates, path);
var value = utils.getIn(taskStates, path);
if (value) {
return (
<span className={`linked-bam ${cssClass}`} title={title} key={path.join('-')}>
<span className={`${cssClass}`} title={title} key={path.join('-')}>
{usePathValue ? value : ''}
</span>
);
Expand All @@ -386,6 +386,36 @@ var RunLabels = React.createClass({
}
});

var RunBAMs = React.createClass({
propTypes: {
run: React.PropTypes.object.isRequired
},
render: function() {
var run = this.props.run;

var labelSpecs = [
{path: ['tumor_bam' , 'name'], usePathValue: true, title: 'Tumor BAM', cssClass: 'linked-bam'},
{path: ['normal_bam', 'name'], usePathValue: true, title: 'Normal BAM', cssClass: 'linked-bam'},
];
var run_bams = labelSpecs.map(
function({path, usePathValue, title, cssClass}) {
var value = utils.getIn(run, path);
if (value) {
return (
<span className={`${cssClass}`} title={title} key={path.join('-')}>
{usePathValue ? value : ''}
</span>
);
}
});
return (
<td className='bam-labels'>
{run_bams}
</td>
);
}
});

var RunComments = React.createClass({
propTypes: {
run: React.PropTypes.object.isRequired
Expand Down
41 changes: 25 additions & 16 deletions cycledash/static/scss/runs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ div.project a {
table-layout: fixed;
margin: 0;
}
main#runs .runs-table tr.info > td {
main#runs .runs-table tr.info > td, main#runs .bams-table tr.info > td {
background-color: $color-bg-expanded;
}
input.selector {
Expand All @@ -152,19 +152,25 @@ input.selector {
td .label {
margin: 0 3px 0 3px;
}
.runs-table .label.fail, .runs-table .label.run {
background: none;
display: inline-block;
width: 16px;
height: 16px;
.runs-table .labels .fail, .runs-table .labels .run {
font-size: 0.875em;
}
.runs-table .labels .fail {
@extend .glyphicon-remove;
}
.runs-table .labels .fail::before{
@extend .glyphicon;
color: $color-status-error;
padding-right: 0.25em;
font-size: 10px;
}
.runs-table .label.fail::after {
.runs-table .labels .fail::after {
color: $color-status-error;
content: 'x';
content: 'Failed';
}
.runs-table .label.run::after {
.runs-table .labels .run::after {
color: $color-blue-sinai;
content: '';
content: 'Uploading...';
}
span.comment-bubble {
@extend .glyphicon, .glyphicon-comment;
Expand All @@ -182,25 +188,28 @@ td.comments {
text-align: right;
}
.runs-table .caller-name {
width: 30%;
width: 27%;
}
.runs-table .date {
width: 15%;
width: 13%;
}
.runs-table .num-variants {
width: 15%;
width: 13%;
}
.runs-table .bam-info {
.runs-table .linked-bams {
width: 20%;
}
.runs-table .num-comments {
.runs-table .run-labels {
width: 10%;
}
.runs-table .num-comments {
width: 7%;
}
.runs-table .examine-col {
width: 10%;
}
.bams-table .bam-name {
width: 30%
width: 30%;
}
.bams-table .resection-date {
width: 21%;
Expand Down

0 comments on commit bbe4f93

Please sign in to comment.