refactor coloring styles and work on trigger build workflow

This commit is contained in:
Lisa P 2015-09-17 15:51:58 +02:00
parent ac8765f0f1
commit 5a35f0c1b7
5 changed files with 120 additions and 102 deletions

View File

@ -51,6 +51,10 @@ BranchRowComponent = Ember.Component.extend
lastBuilds
).property()
canTrigger: (->
@get('auth.signedIn')
).property()
triggerBuild: (->
apiEndpoint = config.apiEndpoint
repoId = @get('build.repository.id')
@ -71,7 +75,6 @@ BranchRowComponent = Ember.Component.extend
actions:
tiggerBuild: (branch) ->
console.log('trigger build')
@.set('isTriggering', true)
@triggerBuild()

View File

@ -94,7 +94,7 @@
.two-line
@extend %row-element
padding: .6em 0
padding: .4em 0
margin-left: 2em
text-align: left
@ -269,7 +269,8 @@
.is-relative
position: relative
.nobuilds-tigger
span.nobuilds-tigger,
a.nobuilds-tigger
position: absolute
top: 0
left: 0
@ -284,11 +285,14 @@
border: 1px solid #E4E6E6
border-radius: 2px
background-color: #fff
.icon-trigger
height: 1.4em !important
a.nobuilds-tigger
&:hover
background: #A6ADAD
color: white
.icon-trigger svg path
fill: #fff
.icon-trigger
height: 1.4em !important

View File

@ -1,11 +1,6 @@
$sb-grey: #f2f2f2
$sb-font-size: 14px
@mixin colorSidebarTiles($color)
border-color: $color
a
color: $color
.tile--sidebar
height: auto
padding: 0.6em 0.5em
@ -16,17 +11,6 @@ $sb-font-size: 14px
li:last-child &
margin-bottom: 0
&.failed,
&.errored
@include colorSidebarTiles($fail-color)
&.passed
@include colorSidebarTiles($pass-color)
&.started,
&.created,
&.received,
&.queued
@include colorSidebarTiles($created-color)
h2, p
margin: 0
font-size: $sb-font-size
@ -55,10 +39,6 @@ $sb-font-size: 14px
width: 1.3em
height: 1.4em
margin-right: .1em
// .icon--hash
// width: 1.1em
// height: 1.3em
.tabnav--sidebar
font-size: $sb-font-size

View File

@ -5,14 +5,17 @@
@mixin colorTiles($color, $status, $extra-bg: $color)
&.#{$status}
border-color: $extra-bg
.tile-status
background-color: $color
.repo-header-title a,
.repo-build-status a,
.build-status a,
.tile-header,
.tile-header a
.tile-header a,
a
color: $color
@include colorStatusIcons($color, $status)
.tile

View File

@ -1,6 +1,7 @@
<div class="two-line">
<div class="branch-name">
<h2 class="row-item">{{status-icon status=build.last_build.state}}{{build.name}}</h2>
<h2 class="row-item">{{status-icon status=build.last_build.state}}
<span class="label-align">{{build.name}}</span></h2>
</div>
<div class="branch-builds">
<div class="row-item">
@ -123,6 +124,8 @@
</div>
<div class="one-line is-relative">
{{#unless inactive}}
{{#if canTrigger}}
{{#if build.last_build}}
<div class="branch-nav dropup-trigger">
<div class="row-item">
@ -190,6 +193,8 @@
</ul>
</div>
{{/if}}
{{/if}}
{{/unless}}
</div>
<div class="one-line is-relative">
@ -203,6 +208,25 @@
{{/if}}
</ul>
{{#unless build.last_build}}
{{#unless inactive}}
{{#if canTrigger}}
{{#if hasTriggered}}
<span class="nobuilds-tigger">
<span class="icon icon-trigger">
<svg version="1.1" id="Layer_1" x="0px" y="0px"
viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
<g id="Passed">
<path fill="#A7AEAE" d="M9.6,14.4c-0.1,0-0.3-0.1-0.4-0.1l-4-3.3c-0.3-0.2-0.3-0.6-0.1-0.9S5.8,9.8,6.1,10l3.4,2.8l4.9-7.5
C14.6,5,15,4.9,15.3,5.1c0.3,0.2,0.4,0.6,0.2,0.9l-5.3,8.1C10.1,14.3,9.9,14.4,9.6,14.4C9.7,14.4,9.7,14.4,9.6,14.4z"/>
</g>
</svg>
</span>
Build triggered</span>
{{else}}
{{#if isTriggering}}
<span class="nobuilds-tigger">{{loading-indicator inline=true}}</span>
{{else}}
<a {{action 'tiggerBuild'}} class="nobuilds-tigger">
<span class="icon icon-trigger">
<svg x="0px" y="0px" viewBox="0 0 20 20" xml:space="preserve">
@ -215,5 +239,9 @@
</svg>
</span>
Trigger a build</a>
{{/if}}
{{/if}}
{{/if}}
{{/unless}}
{{/unless}}
</div>