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 * speed up console output
* projects autocomplete * projects autocomplete
* ~~add time ago to build list~~ * ~~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: * react says many many times to console:
Warning: setState(...): Can only update a mounted or mounting component. Warning: setState(...): Can only update a mounted or mounting component.
This usually means you called setState() on an unmounted 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 i.fa.fa-fw.fa-clock-o
| finished | finished
DateTime(value=build.endDate) DateTime(value=build.endDate)
| ,
| |
Duration(value=(build.endDate - build.startDate), withSuffix=true) Duration(value=(build.endDate - build.startDate), withSuffix=true)
else else

View File

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

View File

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