show scm changes on build page

This commit is contained in:
oleg 2015-08-26 22:16:06 +03:00
parent 1eb22678e7
commit 2d99641b7d
4 changed files with 41 additions and 30 deletions

View File

@ -29,7 +29,7 @@ Ui fixes
* speed up console output
* projects autocomplete
* ~~add time ago to build list~~
* show scm changes on build page
* ~~show scm changes on build page~~
* react says many many times to console:
Warning: setState(...): Can only update a mounted or mounting component.
This usually means you called setState() on an unmounted component.

View File

@ -52,7 +52,6 @@ mixin statusText(build)
i.fa.fa-fw.fa-clock-o
| finished
DateTime(value=build.endDate)
| ,
|
Duration(value=(build.endDate - build.startDate), withSuffix=true)
else

View File

@ -47,15 +47,17 @@ div.row
div= this.state.build.error.message
if this.state.build.error.stderr
pre= this.state.build.error.stderr
.row
.col-md-6
.col-md-12
p
Scm(scm=this.state.build.project.scm.type)
|
| Project
Link(to="project", params={name: this.state.build.project.name})
span= this.state.build.project.name
.row
.col-md-12
p
i.fa.fa-fw.fa-clock-o
span
@ -66,36 +68,45 @@ div.row
span Queued
DateTime(value=this.state.build.createDate)
if this.state.build.status !== 'in-progress'
p
i.fa.fa-fw.fa-circle
if this.state.build.endDate
| , finished
|
| Finished
if this.state.build.endDate
DateTime(value=this.state.build.endDate)
else
| -
- var rev = this.state.build.scm && this.state.build.scm.rev || {};
.col-md-6
p
i.fa.fa-fw.fa-user
|
| Commit author
|
span= rev.author || '-'
DateTime(value=this.state.build.endDate)
|
Duration(value=(this.state.build.endDate - this.state.build.startDate), withSuffix=true)
mixin rev(rev, prefix)
- prefix = prefix || '';
span(title= 'Revision: ' + rev.id + ' by ' + rev.author)= prefix + rev.comment
- var scm = this.state.build.scm;
- var rev = scm && scm.rev;
- var changes = scm.changes;
.row
.col-md-12
p
i.fa.fa-fw.fa-code-fork
|
| Revision
|
span= rev.id || '-'
if changes
if changes.length
| Scm changes:
else
| No scm changes, current revision:
|
else
| -
p
i.fa.fa-fw.fa-comment-o
|
| Comment
|
span= rev.comment || '-'
if changes.length
each change, index in changes
- var number = index + 1;
.row(key= 'scm-change-' + number)
.col-md-offset-4.col-md-8
p
mixin rev(change, String(number) + '. ')
else
.row
.col-md-offset-4.col-md-8
p
mixin rev(rev)
h2
i.fa.fa-fw.fa-terminal

View File

@ -15,6 +15,7 @@ define([
) {
template = template.locals({
DateTime: CommonComponents.DateTime,
Duration: CommonComponents.Duration,
Scm: CommonComponents.Scm,
Terminal: TerminalComponent,
Link: Router.Link