From 5a35f0c1b7e7d865b8ab40732926b0f0e11b5332 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 15:51:58 +0200 Subject: [PATCH] refactor coloring styles and work on trigger build workflow --- app/components/branch-row.coffee | 5 +- app/styles/app/layouts/branches.sass | 12 +- app/styles/app/layouts/sidebar.sass | 20 --- app/styles/app/modules/tiles.sass | 5 +- app/templates/components/branch-row.hbs | 180 ++++++++++++++---------- 5 files changed, 120 insertions(+), 102 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 1066723f..46ee17a0 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -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() diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index b8809ff4..3cea43a5 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -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 + diff --git a/app/styles/app/layouts/sidebar.sass b/app/styles/app/layouts/sidebar.sass index 2cf87020..1b77a76e 100644 --- a/app/styles/app/layouts/sidebar.sass +++ b/app/styles/app/layouts/sidebar.sass @@ -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 diff --git a/app/styles/app/modules/tiles.sass b/app/styles/app/modules/tiles.sass index 47bd5af9..e6e1207c 100644 --- a/app/styles/app/modules/tiles.sass +++ b/app/styles/app/modules/tiles.sass @@ -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 diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 2a90f88d..44ca0036 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -1,6 +1,7 @@
-

{{status-icon status=build.last_build.state}}{{build.name}}

+

{{status-icon status=build.last_build.state}} + {{build.name}}

@@ -123,72 +124,76 @@
{{#unless inactive}} - {{#if build.last_build}} - -
- +
+ {{/if}} + {{/if}} {{/unless}}
@@ -203,17 +208,40 @@ {{/if}} {{#unless build.last_build}} - - - - - - - - - Trigger a build + {{#unless inactive}} + {{#if canTrigger}} + + {{#if hasTriggered}} + + + + + + + + + Build triggered + {{else}} + {{#if isTriggering}} + {{loading-indicator inline=true}} + {{else}} + + + + + + + + + Trigger a build + {{/if}} + {{/if}} + {{/if}} + {{/unless}} {{/unless}}