From 05b22c40e0a4bd83bca04aa96f6b05dd5c833b65 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 27 Aug 2015 17:42:45 -0400 Subject: [PATCH 01/52] start implementing new branches --- app/components/branch-row.coffee | 5 + app/controllers/builds.coffee | 4 + app/styles/app.scss | 1 + app/styles/app/layouts/branches.sass | 171 ++++++++++++++++++++++++ app/templates/builds.hbs | 8 +- app/templates/components/branch-row.hbs | 68 ++++++++++ 6 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 app/components/branch-row.coffee create mode 100644 app/styles/app/layouts/branches.sass create mode 100644 app/templates/components/branch-row.hbs diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee new file mode 100644 index 00000000..d6759804 --- /dev/null +++ b/app/components/branch-row.coffee @@ -0,0 +1,5 @@ +`import Ember from 'ember'` + +BranchRowComponent = Ember.Component.extend() + +`export default BranchRowComponent` diff --git a/app/controllers/builds.coffee b/app/controllers/builds.coffee index 956c9dbb..f89bba63 100644 --- a/app/controllers/builds.coffee +++ b/app/controllers/builds.coffee @@ -41,6 +41,10 @@ Controller = Ember.ArrayController.extend false ).property('tab', 'repo.builds', 'repo.branches') + displayNewBranchRows: (-> + true if @get('tab') == 'branches' + ).property('tab', 'repo.builds', 'repo.branches') + noticeData: (-> return { repo: @get('repo'), diff --git a/app/styles/app.scss b/app/styles/app.scss index 9ebba52f..175173ce 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -51,6 +51,7 @@ @import "app/layouts/profile"; @import "app/layouts/top"; @import "app/layouts/owner"; +@import "app/layouts/branches"; @import "app/landing"; @import "app/layouts/requests"; diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass new file mode 100644 index 00000000..b71b2afd --- /dev/null +++ b/app/styles/app/layouts/branches.sass @@ -0,0 +1,171 @@ + +.branch-row + border: 1px solid $cream-dark + font-size: 16px + text-align: right + + span + width: 1em + height: 1em + margin-right: .5em + background-color: #666 + display: inline-block + vertical-align: middle + + .avatar + border-radius: 50% + margin-right: .5em + vertical-align: middle + + .row-item + margin: .2em + font-size: 16px + font-weight: 400 + a + color: $grey-dark + text-decoration: none + &:hover + text-decoration: underline + + @media #{$medium-up} + & > div:first-of-type + width: 25% + & > div:nth-of-type(2) + width: 20% + & > div:nth-of-type(3) + width: 20% + & > div:nth-of-type(4) + width: 5% + & > div:nth-of-type(5) + width: 26% + + +%row-element + vertical-align: middle + @media #{$medium-up} + display: inline-block + .row-item + vertical-align: middle + +.two-line + @extend %row-element + padding: .6em 0 + text-align: left + +.one-line + @extend %row-element + .row-item + display: inline-block + .branch-nav + display: none + @media #{$medium-up} + display: block + +// @todo refactor into dropup +%dropup + @media #{$medium-up} + position: absolute + display: none + z-index: 5 + background-color: $white + border-radius: 2px + + &:after, + &:before + content: "" + position: absolute + display: block + width: .6em + height: .6em + left: 46% + transform: rotate(45deg) + &:before + bottom: -0.4em + &:after + bottom: -0.3em; + background-color: $white + .dropup-trigger:hover ~ &, + .dropup-trigger:hover &, + &:hover + display: block + +.dropup--blue + @extend %dropup + ul + margin: 0 + padding: 0 + list-style-type: none + text-align: center + li + display: inline-block + margin: 2em 0 + background: $teal-dark + border-radius: 2px + a + display: inline-block + padding: 0.3em 0.5em + color: $white + text-decoration: none + + @media #{$medium-up} + padding: .4em + transform: translate(-2.7em, -8.2em) + border: 1px solid $teal-dark + li + display: block + margin: 0 + background-color: $white + a + display: block + padding: 0.2em 0.5em + text-decoration: none + color: $grey-dark + &:hover + background-color: $teal-dark + color: $white + + &:before + background-color: $teal-dark + +.dropup--status + @extend %dropup + display: none + @media #{$medium-up} + top: -3em + padding: .2em .3em + transform: translate(-1em, 0em); + white-space: nowrap + font-size: 14px; + border: 1px solid $red-dark + &:before + background-color: $red-dark + +.dropup-trigger + padding: 1em 0 + +.build-tiles + height: 4.8rem + margin: 0 + padding: 0 + list-style: none + li + position: relative + display: inline-block + height: 100% + width: 18.8% + background-color: #999 + .icon-status + position: absolute + top: 0 + right: 0 + bottom: 0 + left: 0 + width: 1.3rem + height: 1.3rem + margin: auto + a + display: block + height: 100% + text-align: center + + diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index 86b77799..95670fc6 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,6 +1,12 @@ {{#if content.isLoaded}} {{#each controller as |build|}} - {{builds-item build=build}} + + {{#if displayNewBranchRows}} + {{branch-row build=build}} + {{else}} + {{builds-item build=build}} + {{/if}} + {{else}} {{no-builds repo=noticeData isPR=displayPullRequests isBranch=displayBranches}} {{/each}} diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs new file mode 100644 index 00000000..669b6ab8 --- /dev/null +++ b/app/templates/components/branch-row.hbs @@ -0,0 +1,68 @@ +
  • +
    +
    +

    master

    +
    +
    + +
    +
    +
    + + +
    +
    +
    + +
    +
    +
    Mr. T
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
  • From cecd09fa994902909e46e52f1cfdd8af1937e3ac Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 27 Aug 2015 20:35:26 -0400 Subject: [PATCH 02/52] work on branch coloring and things --- app/components/branch-row.coffee | 16 ++- app/styles/app/layouts/branches.sass | 54 +++++++++- app/templates/builds.hbs | 20 ++-- app/templates/components/branch-row.hbs | 131 +++++++++++++----------- 4 files changed, 146 insertions(+), 75 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index d6759804..fc702671 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -1,5 +1,19 @@ `import Ember from 'ember'` +`import { gravatarImage } from 'travis/utils/urls'` +`import { githubCommit as githubCommitUrl } from 'travis/utils/urls'` -BranchRowComponent = Ember.Component.extend() +BranchRowComponent = Ember.Component.extend + + tagName: 'li' + classNameBindings: ['build.state'] + classNames: ['branch-row'] + + urlAuthorGravatarImage: (-> + gravatarImage(@get('build.commit.authorEmail'), 15) + ).property('build.commit.authorEmail') + + urlGithubCommit: (-> + githubCommitUrl(@get('build.repo.slug'), @get('build.commit.sha')) + ).property('build.commit.sha') `export default BranchRowComponent` diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index b71b2afd..63dfdda9 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -1,8 +1,35 @@ +@mixin statusColors($color, $status) + &.#{$status} + background: linear-gradient(to right, $color 0%, $color 9px, transparent 10px, transparent 100%) no-repeat + .branch-name, + .branch-request a + color: $color + &:hover + border-color: $color + +@mixin buildTileColors($color, $bg, $status) + .#{$status} + background-color: $bg + a + color: $color + @media #{$medium-up} + .dropup--status + border-color: $color + &:before + background-color: $bg + +.tabbody + ul + padding: 0 + margin: 0 + list-style: none .branch-row border: 1px solid $cream-dark font-size: 16px text-align: right + margin-bottom: .3rem + color: $grey-dark span width: 1em @@ -13,14 +40,16 @@ vertical-align: middle .avatar - border-radius: 50% + width: 15px margin-right: .5em + border-radius: 50% vertical-align: middle .row-item margin: .2em font-size: 16px font-weight: 400 + white-space: nowrap a color: $grey-dark text-decoration: none @@ -39,6 +68,16 @@ & > div:nth-of-type(5) width: 26% + @include statusColors($green-dark, 'passed') + @include statusColors($red-dark, 'failed') + @include statusColors($red-dark, 'errored') + @include statusColors($grey-medium, 'canceled') + @include statusColors(#ECCE4B, 'started') + @include statusColors(#ECCE4B, 'queued') + @include statusColors(#ECCE4B, 'booting') + @include statusColors(#ECCE4B, 'received') + @include statusColors(#ECCE4B, 'created') + %row-element vertical-align: middle @@ -144,7 +183,7 @@ padding: 1em 0 .build-tiles - height: 4.8rem + height: 5.6rem margin: 0 padding: 0 list-style: none @@ -153,7 +192,6 @@ display: inline-block height: 100% width: 18.8% - background-color: #999 .icon-status position: absolute top: 0 @@ -168,4 +206,14 @@ height: 100% text-align: center + @include buildTileColors(#44A662, #F5FBF6, 'passed') + @include buildTileColors(#D94341, #FFF7F5, 'failed') + @include buildTileColors(#D94341, #FFF7F5, 'errored') + @include buildTileColors(#A1A0A0, #F5F5F5, 'canceled') + @include buildTileColors(#ECCE4B, #eeeeee, 'started') + @include buildTileColors(#ECCE4B, #eeeeee, 'queued') + @include buildTileColors(#ECCE4B, #eeeeee, 'booting') + @include buildTileColors(#ECCE4B, #eeeeee, 'received') + @include buildTileColors(#ECCE4B, #eeeeee, 'created') + diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index 95670fc6..6c2d69de 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,15 +1,17 @@ {{#if content.isLoaded}} - {{#each controller as |build|}} + {{#if displayShowMoreButton}}

    {{show-more-button isLoading=isLoading showMore=(action 'showMoreBuilds')}} diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 669b6ab8..b6d176ea 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -1,68 +1,75 @@ -

  • -
    -
    -

    master

    -
    -
    - -
    +
    +
    +

    {{build.commit.branch}}

    -
    - - + -
    -
    - -
    -
    -
    Mr. T
    -
    +
    +
    +
    +
    + {{#link-to "build" build.repo build}} + {{build.number}} {{build.state}} + {{/link-to}} +
    -
    -
    -
    -
    - +
    +
    {{format-time build.finishedAt}}
    -
    -
    +
    + +
    +
    avatar{{build.commit.committerName}}
    +
    +
    +
  • + +
    +
      +
    • + + +
      + #23872 +
      +
      +
    • +
    • + +
      + #23872 +
      +
    • +
    • + +
      + #23872 +
      +
    • +
    • + +
      + #23872 +
      +
    • +
    • + +
      + #23872 +
      +
    • +
    +
    From c5fa70776ba2fe42a47b5f018e643a4d09554acc Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 28 Aug 2015 16:28:47 -0400 Subject: [PATCH 03/52] add the branches things --- app/components/build-tile.coffee | 8 + app/components/request-icon.coffee | 23 +++ app/components/status-icon.coffee | 25 +++ app/styles/app/layouts/branches.sass | 56 +++++-- app/styles/app/modules/icons.sass | 12 +- app/templates/components/branch-row.hbs | 152 ++++++++++++++----- app/templates/components/build-tile.hbs | 6 + app/templates/components/request-icon.hbs | 41 +++++ app/templates/components/status-icon.hbs | 44 ++++++ public/images/line-icons/icon-api.svg | 10 ++ public/images/line-icons/icon-build.svg | 14 ++ public/images/line-icons/icon-cal.svg | 14 ++ public/images/line-icons/icon-cancelled.svg | 8 + public/images/line-icons/icon-commit.svg | 24 +++ public/images/line-icons/icon-errored.svg | 8 + public/images/line-icons/icon-failed.svg | 8 + public/images/line-icons/icon-no-builds.svg | 11 ++ public/images/line-icons/icon-passed.svg | 9 ++ public/images/line-icons/icon-pull.svg | 15 ++ public/images/line-icons/icon-push.svg | 8 + public/images/line-icons/icon-tofuburger.svg | 10 ++ public/images/line-icons/icon-trigger.svg | 8 + public/images/line-icons/icon-view.svg | 9 ++ 23 files changed, 467 insertions(+), 56 deletions(-) create mode 100644 app/components/build-tile.coffee create mode 100644 app/components/request-icon.coffee create mode 100644 app/components/status-icon.coffee create mode 100644 app/templates/components/build-tile.hbs create mode 100644 app/templates/components/request-icon.hbs create mode 100644 app/templates/components/status-icon.hbs create mode 100644 public/images/line-icons/icon-api.svg create mode 100644 public/images/line-icons/icon-build.svg create mode 100644 public/images/line-icons/icon-cal.svg create mode 100644 public/images/line-icons/icon-cancelled.svg create mode 100644 public/images/line-icons/icon-commit.svg create mode 100644 public/images/line-icons/icon-errored.svg create mode 100644 public/images/line-icons/icon-failed.svg create mode 100644 public/images/line-icons/icon-no-builds.svg create mode 100644 public/images/line-icons/icon-passed.svg create mode 100644 public/images/line-icons/icon-pull.svg create mode 100644 public/images/line-icons/icon-push.svg create mode 100644 public/images/line-icons/icon-tofuburger.svg create mode 100644 public/images/line-icons/icon-trigger.svg create mode 100644 public/images/line-icons/icon-view.svg diff --git a/app/components/build-tile.coffee b/app/components/build-tile.coffee new file mode 100644 index 00000000..cd2d79ae --- /dev/null +++ b/app/components/build-tile.coffee @@ -0,0 +1,8 @@ +`import Ember from 'ember'` + +BuildTileComponent = Ember.Component.extend + + tagName: 'li' + classNameBindings: ['build.state'] + +`export default BuildTileComponent` diff --git a/app/components/request-icon.coffee b/app/components/request-icon.coffee new file mode 100644 index 00000000..031a47a1 --- /dev/null +++ b/app/components/request-icon.coffee @@ -0,0 +1,23 @@ +`import Ember from 'ember'` + +RequestIconComponent = Ember.Component.extend + + tagName: 'span' + classNames: ['icon-request'] + classNameBindings: ['build.state'] + + isPush: (-> + @get('build.eventType') == 'push' + ).property('build.eventType') + + isPR: (-> + @get('build.eventType') == 'pull_request' + ).property('build.eventType') + + isAPI: (-> + @get('build.eventType') == 'api' + ).property('build.eventType') + + + +`export default RequestIconComponent` diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee new file mode 100644 index 00000000..c17a356a --- /dev/null +++ b/app/components/status-icon.coffee @@ -0,0 +1,25 @@ +`import Ember from 'ember'` + +StatusIconComponent = Ember.Component.extend + + tagName: 'span' + classNames: ['status-icon'] + classNameBindings: ['build.state'] + + hasPassed: (-> + @get('build.state') == 'passed' + ).property('build.state') + + hasFailed: (-> + @get('build.state') == 'failed' + ).property('build.state') + + hasErrored: (-> + @get('build.state') == 'errored' + ).property('build.state') + + wasCanceled: (-> + @get('build.state') == 'canceled' + ).property('build.state') + +`export default StatusIconComponent` diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 63dfdda9..d652b46a 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -6,17 +6,26 @@ color: $color &:hover border-color: $color + .status-icon g > *, + .icon-request g > * + fill: $color @mixin buildTileColors($color, $bg, $status) - .#{$status} + > .#{$status} background-color: $bg - a - color: $color + .icon-request g > * + fill: $color + &:hover + background-color: $color + .status-icon g > * + fill: $white + @media #{$medium-up} .dropup--status border-color: $color + color: $color &:before - background-color: $bg + background-color: $color .tabbody ul @@ -32,16 +41,15 @@ color: $grey-dark span - width: 1em - height: 1em - margin-right: .5em - background-color: #666 + width: 1.3em + height: 1.3em + margin-right: .2em display: inline-block vertical-align: middle .avatar - width: 15px - margin-right: .5em + width: 16px + margin-right: .7em border-radius: 50% vertical-align: middle @@ -89,7 +97,11 @@ .two-line @extend %row-element padding: .6em 0 - text-align: left + margin-left: 2em + text-align: left + + @media #{$medium-up} + margin-left: 0 .one-line @extend %row-element @@ -100,7 +112,7 @@ @media #{$medium-up} display: block -// @todo refactor into dropup +// @todo refactor into dropup module %dropup @media #{$medium-up} position: absolute @@ -145,6 +157,9 @@ padding: 0.3em 0.5em color: $white text-decoration: none + .icon-trigger path, + .icon-eye path + fill: $white @media #{$medium-up} padding: .4em @@ -154,6 +169,9 @@ display: block margin: 0 background-color: $white + .icon-trigger path, + .icon-eye path + fill: $grey-medium a display: block padding: 0.2em 0.5em @@ -162,6 +180,9 @@ &:hover background-color: $teal-dark color: $white + .icon-trigger path, + .icon-eye path + fill: $white &:before background-color: $teal-dark @@ -181,7 +202,11 @@ .dropup-trigger padding: 1em 0 + path + fill: $teal-dark + +// @todo refactor to build-tiles module .build-tiles height: 5.6rem margin: 0 @@ -192,15 +217,16 @@ display: inline-block height: 100% width: 18.8% - .icon-status + .status-icon position: absolute top: 0 right: 0 bottom: 0 left: 0 - width: 1.3rem - height: 1.3rem + width: 2rem + height: 2rem margin: auto + background-color: transparent a display: block height: 100% diff --git a/app/styles/app/modules/icons.sass b/app/styles/app/modules/icons.sass index 6534f042..a31b007c 100644 --- a/app/styles/app/modules/icons.sass +++ b/app/styles/app/modules/icons.sass @@ -192,6 +192,17 @@ .icon-fingerprint background-image: inline-image('svg/fingerprint.svg') + +.icon-line-cal + @extend %icon + background-image: inline-image('line-icons/icon-cal.svg') +.icon-line-build + @extend %icon + background-image: inline-image('line-icons/icon-build.svg') +.icon-line-commit + @extend %icon + background-image: inline-image('line-icons/icon-commit.svg') + .icon--plus &:after content: "+" @@ -211,7 +222,6 @@ .icon-flag background-image: inline-image('svg/notice-flag.svg') - .icon-receiving margin: 0.3rem 0.5rem; display: inline-block; diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index b6d176ea..f337f0a7 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -1,26 +1,88 @@
    -

    {{build.commit.branch}}

    +

    {{status-icon build=build}}{{build.commit.branch}}

    {{#link-to "build" build.repo build}} - {{build.number}} {{build.state}} + {{request-icon build=build}} + #{{build.number}} {{build.state}} {{/link-to}}
    -
    {{format-time build.finishedAt}}
    +
    + + + + + + + + + + {{format-time build.finishedAt}}
    avatar{{build.commit.committerName}}
    @@ -28,48 +90,58 @@
      -
    • - - -
      - #23872 -
      -
      -
    • -
    • - -
      - #23872 -
      -
    • -
    • - -
      - #23872 -
      -
    • -
    • - -
      - #23872 -
      -
    • -
    • - -
      - #23872 -
      -
    • + {{build-tile build=build}} + {{build-tile build=build}} + {{build-tile build=build}} + {{build-tile build=build}} + {{build-tile build=build}}
    diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs new file mode 100644 index 00000000..d2c640b1 --- /dev/null +++ b/app/templates/components/build-tile.hbs @@ -0,0 +1,6 @@ + + {{status-icon build=build}} +
    + {{request-icon build=build}} #{{build.number}} +
    +
    diff --git a/app/templates/components/request-icon.hbs b/app/templates/components/request-icon.hbs new file mode 100644 index 00000000..051ed431 --- /dev/null +++ b/app/templates/components/request-icon.hbs @@ -0,0 +1,41 @@ +{{#if isPush}} + + + + + +{{/if}} + +{{#if isPR}} + + + + + + +{{/if}} + +{{#if isAPI}} + + + + + +{{/if}} diff --git a/app/templates/components/status-icon.hbs b/app/templates/components/status-icon.hbs new file mode 100644 index 00000000..fe6b5c9c --- /dev/null +++ b/app/templates/components/status-icon.hbs @@ -0,0 +1,44 @@ + +{{#if hasPassed}} + + + + + +{{/if}} + +{{#if hasFailed}} + + + + + +{{/if}} + +{{#if wasCanceled}} + + + + + +{{/if}} + +{{#if hasErrored}} + + + + + + +{{/if}} + diff --git a/public/images/line-icons/icon-api.svg b/public/images/line-icons/icon-api.svg new file mode 100644 index 00000000..b626ff8c --- /dev/null +++ b/public/images/line-icons/icon-api.svg @@ -0,0 +1,10 @@ + + + + + diff --git a/public/images/line-icons/icon-build.svg b/public/images/line-icons/icon-build.svg new file mode 100644 index 00000000..86ca24e4 --- /dev/null +++ b/public/images/line-icons/icon-build.svg @@ -0,0 +1,14 @@ + + + + + + diff --git a/public/images/line-icons/icon-cal.svg b/public/images/line-icons/icon-cal.svg new file mode 100644 index 00000000..7b6846b1 --- /dev/null +++ b/public/images/line-icons/icon-cal.svg @@ -0,0 +1,14 @@ + + + + + + + diff --git a/public/images/line-icons/icon-cancelled.svg b/public/images/line-icons/icon-cancelled.svg new file mode 100644 index 00000000..eaddd71c --- /dev/null +++ b/public/images/line-icons/icon-cancelled.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/public/images/line-icons/icon-commit.svg b/public/images/line-icons/icon-commit.svg new file mode 100644 index 00000000..0e73d9cf --- /dev/null +++ b/public/images/line-icons/icon-commit.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/public/images/line-icons/icon-errored.svg b/public/images/line-icons/icon-errored.svg new file mode 100644 index 00000000..470f2f88 --- /dev/null +++ b/public/images/line-icons/icon-errored.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/public/images/line-icons/icon-failed.svg b/public/images/line-icons/icon-failed.svg new file mode 100644 index 00000000..f8321d14 --- /dev/null +++ b/public/images/line-icons/icon-failed.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/public/images/line-icons/icon-no-builds.svg b/public/images/line-icons/icon-no-builds.svg new file mode 100644 index 00000000..3a9f2ee9 --- /dev/null +++ b/public/images/line-icons/icon-no-builds.svg @@ -0,0 +1,11 @@ + + + + + + + + + diff --git a/public/images/line-icons/icon-passed.svg b/public/images/line-icons/icon-passed.svg new file mode 100644 index 00000000..03886858 --- /dev/null +++ b/public/images/line-icons/icon-passed.svg @@ -0,0 +1,9 @@ + + + + + + + diff --git a/public/images/line-icons/icon-pull.svg b/public/images/line-icons/icon-pull.svg new file mode 100644 index 00000000..b89de964 --- /dev/null +++ b/public/images/line-icons/icon-pull.svg @@ -0,0 +1,15 @@ + + + + + + diff --git a/public/images/line-icons/icon-push.svg b/public/images/line-icons/icon-push.svg new file mode 100644 index 00000000..0b41fc5b --- /dev/null +++ b/public/images/line-icons/icon-push.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/public/images/line-icons/icon-tofuburger.svg b/public/images/line-icons/icon-tofuburger.svg new file mode 100644 index 00000000..ea96c076 --- /dev/null +++ b/public/images/line-icons/icon-tofuburger.svg @@ -0,0 +1,10 @@ + + + + + + + diff --git a/public/images/line-icons/icon-trigger.svg b/public/images/line-icons/icon-trigger.svg new file mode 100644 index 00000000..92930768 --- /dev/null +++ b/public/images/line-icons/icon-trigger.svg @@ -0,0 +1,8 @@ + + + + + diff --git a/public/images/line-icons/icon-view.svg b/public/images/line-icons/icon-view.svg new file mode 100644 index 00000000..198c0ab6 --- /dev/null +++ b/public/images/line-icons/icon-view.svg @@ -0,0 +1,9 @@ + + + + + + From 9370b4b7be2a74fd959684de4f51545427b0ec4a Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 28 Aug 2015 17:00:51 -0400 Subject: [PATCH 04/52] fix some display bugs --- app/styles/app/layouts/branches.sass | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index d652b46a..bac54ca9 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -1,6 +1,6 @@ @mixin statusColors($color, $status) &.#{$status} - background: linear-gradient(to right, $color 0%, $color 9px, transparent 10px, transparent 100%) no-repeat + background: linear-gradient(to right, $color 0%, $color 9px, white 10px, white 100%) no-repeat .branch-name, .branch-request a color: $color @@ -58,6 +58,7 @@ font-size: 16px font-weight: 400 white-space: nowrap + overflow: hidden a color: $grey-dark text-decoration: none @@ -67,6 +68,10 @@ @media #{$medium-up} & > div:first-of-type width: 25% + position: relative + &:after + content: "" + @include fadeOut(right, -90deg, $white) & > div:nth-of-type(2) width: 20% & > div:nth-of-type(3) @@ -131,9 +136,9 @@ left: 46% transform: rotate(45deg) &:before - bottom: -0.4em + bottom: -0.3em &:after - bottom: -0.3em; + bottom: -0.2em; background-color: $white .dropup-trigger:hover ~ &, .dropup-trigger:hover &, @@ -171,7 +176,7 @@ background-color: $white .icon-trigger path, .icon-eye path - fill: $grey-medium + fill: #A7AEAE a display: block padding: 0.2em 0.5em @@ -236,10 +241,10 @@ @include buildTileColors(#D94341, #FFF7F5, 'failed') @include buildTileColors(#D94341, #FFF7F5, 'errored') @include buildTileColors(#A1A0A0, #F5F5F5, 'canceled') - @include buildTileColors(#ECCE4B, #eeeeee, 'started') - @include buildTileColors(#ECCE4B, #eeeeee, 'queued') - @include buildTileColors(#ECCE4B, #eeeeee, 'booting') - @include buildTileColors(#ECCE4B, #eeeeee, 'received') - @include buildTileColors(#ECCE4B, #eeeeee, 'created') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'started') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'queued') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'booting') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'received') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'created') From e8af1e010930c9a5c69b4b3ab8d15bd05a10f293 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 28 Aug 2015 17:06:06 -0400 Subject: [PATCH 05/52] pixel fun with dropup position indicator --- app/styles/app/layouts/branches.sass | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index bac54ca9..19e64956 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -131,14 +131,14 @@ content: "" position: absolute display: block - width: .6em - height: .6em + width: 10px + height: 10px left: 46% transform: rotate(45deg) &:before - bottom: -0.3em + bottom: -6px &:after - bottom: -0.2em; + bottom: -4px; background-color: $white .dropup-trigger:hover ~ &, .dropup-trigger:hover &, From dda2051d57b6ee455417bd059b041949b83e2470 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 7 Sep 2015 15:53:14 +0200 Subject: [PATCH 06/52] commit current status --- app/controllers/branches.coffee | 17 ++++++++++++++ app/controllers/builds.coffee | 4 ---- app/router.coffee | 2 +- app/routes/branches.coffee | 24 ++++++++++++++++++-- app/routes/settings/index.coffee | 23 ------------------- app/templates/branches.hbs | 25 +++++++++++++++++++++ app/templates/builds.hbs | 8 +------ tests/unit/controllers/branches-test.coffee | 12 ++++++++++ 8 files changed, 78 insertions(+), 37 deletions(-) create mode 100644 app/controllers/branches.coffee create mode 100644 app/templates/branches.hbs create mode 100644 tests/unit/controllers/branches-test.coffee diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee new file mode 100644 index 00000000..9b0549c7 --- /dev/null +++ b/app/controllers/branches.coffee @@ -0,0 +1,17 @@ +`import Ember from 'ember'` +`import { gravatarImage } from 'travis/utils/urls'` +`import GithubUrlPropertievs from 'travis/mixins/github-url-properties'` + +BranchesController = Ember.Controller.extend + + actions: + tiggerBuild: (branch) -> + console.log('trigger build') + + viewAllBuilds: (branch) -> + console.log('view all builds') + # updateFilter: (value) -> + # @set('_lastFilterValue', value) + # Ember.run.throttle this, @updateFilter, [], 200, false + +`export default BranchesController` diff --git a/app/controllers/builds.coffee b/app/controllers/builds.coffee index f89bba63..956c9dbb 100644 --- a/app/controllers/builds.coffee +++ b/app/controllers/builds.coffee @@ -41,10 +41,6 @@ Controller = Ember.ArrayController.extend false ).property('tab', 'repo.builds', 'repo.branches') - displayNewBranchRows: (-> - true if @get('tab') == 'branches' - ).property('tab', 'repo.builds', 'repo.branches') - noticeData: (-> return { repo: @get('repo'), diff --git a/app/router.coffee b/app/router.coffee index 8808ad21..7dfb7326 100644 --- a/app/router.coffee +++ b/app/router.coffee @@ -46,11 +46,11 @@ Router.map -> @route 'search', path: '/search/:phrase' @resource 'repo', path: '/:owner/:name', -> @route 'index', path: '/' + @resource 'branches', path: '/branches' @resource 'build', path: '/builds/:build_id' @resource 'job', path: '/jobs/:job_id' @resource 'builds', path: '/builds' @resource 'pullRequests', path: '/pull_requests' - @resource 'branches', path: '/branches' @resource 'requests', path: '/requests' @resource 'caches', path: '/caches' if config.endpoints.caches @resource 'request', path: '/requests/:request_id' diff --git a/app/routes/branches.coffee b/app/routes/branches.coffee index c58239b4..0dce5361 100644 --- a/app/routes/branches.coffee +++ b/app/routes/branches.coffee @@ -1,5 +1,25 @@ -`import AbstractBuildsRoute from 'travis/routes/abstract-builds'` +`import Ember from 'ember'` +`import TravisRoute from 'travis/routes/basic'` +`import config from 'travis/config/environment'` + +Route = TravisRoute.extend + + model: (params) -> + apiEndpoint = config.apiEndpoint + repoId = @modelFor('repo').get('id') + + options = {} + if @get('auth.signedIn') + options.headers = { Authorization: "token #{@auth.token()}" } + + $.ajax("#{apiEndpoint}/repos/#{repoId}/branch/master", options).then (response) -> + + console.log(response) + # response.repositories.sortBy('last_build.finished_at').filter( (repo) -> + # repo.last_build + # ).map( (repo) -> + # Ember.Object.create(repo) + # ) -Route = AbstractBuildsRoute.extend(contentType: 'branches') `export default Route` diff --git a/app/routes/settings/index.coffee b/app/routes/settings/index.coffee index d9845989..bb33bbe5 100644 --- a/app/routes/settings/index.coffee +++ b/app/routes/settings/index.coffee @@ -9,29 +9,6 @@ Route = TravisRoute.extend repo.fetchSettings().then (settings) -> - console.log(settings) repo.set('settings', settings) - # return { - - # settings: (-> - # $.ajax('https://api.travis-ci.org/v3/repos/#{repo.id}/settings', { - # headers: { - # Authorization: 'token ' + @auth.token() - # } - # }).then (response) -> - # console.log(response); - # return response - # ) - # env_vars: (-> - # $.ajax('/settings/env_vars?repository_id={repo.id}', { - # headers: { - # Authorization: 'token ' + @auth.token() - # } - # }).then (response) -> - # console.log(response); - # return response - # ) - # } - `export default Route` diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs new file mode 100644 index 00000000..2a9c6027 --- /dev/null +++ b/app/templates/branches.hbs @@ -0,0 +1,25 @@ + +
    +

    Default Branch

    +
    + + +
    +

    Active Branches

    +
    + + + +
    +

    Inactive Branches

    +
    + + +{{!-- {{#if content.isLoaded}} --}} + +{{branch-row build=build}} + + +{{!-- {{else}} + {{loading-indicator}} +{{/if}} --}} \ No newline at end of file diff --git a/app/templates/builds.hbs b/app/templates/builds.hbs index 6c2d69de..b771f6d0 100644 --- a/app/templates/builds.hbs +++ b/app/templates/builds.hbs @@ -1,13 +1,7 @@ {{#if content.isLoaded}}
      {{#each controller as |build|}} - - {{#if displayNewBranchRows}} - {{branch-row build=build}} - {{else}} - {{builds-item build=build}} - {{/if}} - + {{builds-item build=build}} {{else}} {{no-builds repo=noticeData isPR=displayPullRequests isBranch=displayBranches}} {{/each}} diff --git a/tests/unit/controllers/branches-test.coffee b/tests/unit/controllers/branches-test.coffee new file mode 100644 index 00000000..36e4e43e --- /dev/null +++ b/tests/unit/controllers/branches-test.coffee @@ -0,0 +1,12 @@ +`import { test, moduleFor } from 'ember-qunit'` + +moduleFor 'controller:branches', { + # Specify the other units that are required for this test. + # needs: ['controller:foo'] +} + +# Replace this with your real tests. +test 'it exists', (assert) -> + controller = @subject() + assert.ok controller + From b3c966b2454d51225f3f8fcd023e40428a1a60b2 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 7 Sep 2015 18:09:39 +0200 Subject: [PATCH 07/52] toy around with branch requests --- app/components/branch-row.coffee | 17 ++++++++++++++++ app/controllers/branches.coffee | 17 ++++++++++++++++ app/routes/branches.coffee | 3 ++- app/templates/branches.hbs | 26 +++++++++++++++++++------ app/templates/components/branch-row.hbs | 16 ++++++++------- 5 files changed, 65 insertions(+), 14 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index fc702671..02115c73 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -1,12 +1,15 @@ `import Ember from 'ember'` `import { gravatarImage } from 'travis/utils/urls'` `import { githubCommit as githubCommitUrl } from 'travis/utils/urls'` +`import TravisRoute from 'travis/routes/basic'` +`import config from 'travis/config/environment'` BranchRowComponent = Ember.Component.extend tagName: 'li' classNameBindings: ['build.state'] classNames: ['branch-row'] + isLoading: true urlAuthorGravatarImage: (-> gravatarImage(@get('build.commit.authorEmail'), 15) @@ -16,4 +19,18 @@ BranchRowComponent = Ember.Component.extend githubCommitUrl(@get('build.repo.slug'), @get('build.commit.sha')) ).property('build.commit.sha') + getLast5Builds: (-> + + # apiEndpoint = config.apiEndpoint + # repoId = @get('build.repository.id') + + # options = {} + # if @get('auth.signedIn') + # options.headers = { Authorization: "token #{@auth.token()}" } + + # $.ajax("#{apiEndpoint}/v3/repo/269284/builds?branch.name=master&limit=5", options).then (response) -> + # console.log(response) + # @set('isLoading', false) + ).property('build') + `export default BranchRowComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 9b0549c7..06d2a622 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -4,6 +4,23 @@ BranchesController = Ember.Controller.extend + defaultBranch: (-> + + repos = @get('model') + + # repos = repos.filter (item, index) -> + # item.get('owner.login') == org + + ).property('model') + + activeBranches: (-> + repos = @get('model') + ).property('model') + + inactiveBranches: (-> + repos = @get('model') + ).property('model') + actions: tiggerBuild: (branch) -> console.log('trigger build') diff --git a/app/routes/branches.coffee b/app/routes/branches.coffee index 0dce5361..345319f1 100644 --- a/app/routes/branches.coffee +++ b/app/routes/branches.coffee @@ -12,7 +12,8 @@ Route = TravisRoute.extend if @get('auth.signedIn') options.headers = { Authorization: "token #{@auth.token()}" } - $.ajax("#{apiEndpoint}/repos/#{repoId}/branch/master", options).then (response) -> + # $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/branch/master", options).then (response) -> + $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=master&limit=5", options).then (response) -> console.log(response) # response.repositories.sortBy('last_build.finished_at').filter( (repo) -> diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 2a9c6027..3c2d4ea0 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -1,25 +1,39 @@

      Default Branch

      -
      +
        + {{branch-row build=defaultBranch}} +
      +

      Active Branches

      + +
        + {{#each branch in activeBranches}} + {{branch-row build=branch}} + {{else}} +
      • There are no active branches
      • + {{/each}} +
      - -

      Inactive Branches

      + +
        + {{#each branch in inactiveBranches}} + {{branch-row build=branch}} + {{else}} +
      • There are no inactive branches
      • + {{/each}} +
      {{!-- {{#if content.isLoaded}} --}} -{{branch-row build=build}} - - {{!-- {{else}} {{loading-indicator}} {{/if}} --}} \ No newline at end of file diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index f337f0a7..b2af955f 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -137,11 +137,13 @@
    -
      - {{build-tile build=build}} - {{build-tile build=build}} - {{build-tile build=build}} - {{build-tile build=build}} - {{build-tile build=build}} -
    + {{#unless isLoading }} +
      + {{#each buildTile in getLast5Builds}} + {{build-tile build=buildTile}} + {{/each}} +
    + {{else}} + {{loading-indicator}} + {{/unless}}
    From 05f9b0df7eb6e2a677154587326a7ae56f58ac70 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 8 Sep 2015 13:28:31 +0200 Subject: [PATCH 08/52] work on booting state icons --- app/components/status-icon.coffee | 8 +++ app/controllers/branches.coffee | 1 - app/styles/app.scss | 1 + app/styles/app/components/build-tile.sass | 61 ++++++++++++++++ app/styles/app/layouts/branches.sass | 87 ++++++++--------------- app/styles/app/layouts/settings.sass | 5 -- app/styles/app/misc.sass | 9 +++ app/templates/branches.hbs | 17 ++--- app/templates/components/branch-row.hbs | 20 +++--- app/templates/components/status-icon.hbs | 6 ++ 10 files changed, 132 insertions(+), 83 deletions(-) create mode 100644 app/styles/app/components/build-tile.sass diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee index c17a356a..493c4b8f 100644 --- a/app/components/status-icon.coffee +++ b/app/components/status-icon.coffee @@ -22,4 +22,12 @@ StatusIconComponent = Ember.Component.extend @get('build.state') == 'canceled' ).property('build.state') + isRunning: (-> + @get('build.state') == 'started' || + @get('build.state') == 'queued' || + @get('build.state') == 'booting' || + @get('build.state') == 'received' || + @get('build.state') == 'created' + ).property('build.state') + `export default StatusIconComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 06d2a622..77134a0d 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -5,7 +5,6 @@ BranchesController = Ember.Controller.extend defaultBranch: (-> - repos = @get('model') # repos = repos.filter (item, index) -> diff --git a/app/styles/app.scss b/app/styles/app.scss index 175173ce..091b7cb0 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -20,6 +20,7 @@ @import "app/components/sync-button"; @import "app/components/loading-indicator"; +@import "app/components/build-tile"; @import "app/animation/tractor"; diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass new file mode 100644 index 00000000..4a97075b --- /dev/null +++ b/app/styles/app/components/build-tile.sass @@ -0,0 +1,61 @@ +@mixin buildTileColors($color, $bg, $status) + > .#{$status} + background-color: $bg + .icon-request g > * + fill: $color + &:hover + background-color: $color + .status-icon g > * + fill: $white + .status-icon .circle + border-color: $white + + @media #{$medium-up} + .dropup--status + border-color: $color + color: $color + &:before + background-color: $color + + +.build-tiles + height: 5.6rem + margin: 0 + padding: 0 + list-style: none + li + position: relative + display: inline-block + height: 100% + width: 18.8% + .status-icon + position: absolute + top: 0 + right: 0 + bottom: 0 + left: 0 + width: 2rem + height: 2rem + margin: auto + background-color: transparent + .is-rotating + width: 100% + height: 100% + line-height: 1.5 + .circle + width: 8px + height: 8px + a + display: block + height: 100% + text-align: center + + @include buildTileColors(#44A662, #F5FBF6, 'passed') + @include buildTileColors(#D94341, #FFF7F5, 'failed') + @include buildTileColors(#D94341, #FFF7F5, 'errored') + @include buildTileColors(#A1A0A0, #F5F5F5, 'canceled') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'started') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'queued') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'booting') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'received') + @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'created') diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 19e64956..8ca940c1 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -10,28 +10,12 @@ .icon-request g > * fill: $color -@mixin buildTileColors($color, $bg, $status) - > .#{$status} - background-color: $bg - .icon-request g > * - fill: $color - &:hover - background-color: $color - .status-icon g > * - fill: $white - @media #{$medium-up} - .dropup--status - border-color: $color - color: $color - &:before - background-color: $color - -.tabbody - ul - padding: 0 - margin: 0 - list-style: none +// .tabbody +// ul +// padding: 0 +// margin: 0 +// list-style: none .branch-row border: 1px solid $cream-dark @@ -198,7 +182,6 @@ @media #{$medium-up} top: -3em padding: .2em .3em - transform: translate(-1em, 0em); white-space: nowrap font-size: 14px; border: 1px solid $red-dark @@ -210,41 +193,29 @@ path fill: $teal-dark +// @todo refactor to status-icon module +.status-icon + .is-rotating + width: 17px + height: 19px + line-height: 1 + transform-origin: center center + will-change: transform + animation: rotation 3s infinite ease + .circle + display: inline-block + vertical-align: middle + width: 5px + height: 5px + border: solid 2px #ECCE4B + border-radius: 50% + transform-origin: center center -// @todo refactor to build-tiles module -.build-tiles - height: 5.6rem - margin: 0 - padding: 0 - list-style: none - li - position: relative - display: inline-block - height: 100% - width: 18.8% - .status-icon - position: absolute - top: 0 - right: 0 - bottom: 0 - left: 0 - width: 2rem - height: 2rem - margin: auto - background-color: transparent - a - display: block - height: 100% - text-align: center - - @include buildTileColors(#44A662, #F5FBF6, 'passed') - @include buildTileColors(#D94341, #FFF7F5, 'failed') - @include buildTileColors(#D94341, #FFF7F5, 'errored') - @include buildTileColors(#A1A0A0, #F5F5F5, 'canceled') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'started') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'queued') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'booting') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'received') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.5), 'created') - +@keyframes rotation + 0% + transform: rotateZ(0deg) + 45%, 55% + transform: rotateZ(180deg) + 100% + transform: rotateZ(360deg) diff --git a/app/styles/app/layouts/settings.sass b/app/styles/app/layouts/settings.sass index 72bc903e..6ddaabca 100644 --- a/app/styles/app/layouts/settings.sass +++ b/app/styles/app/layouts/settings.sass @@ -1,9 +1,4 @@ -.small-title - font-size: 18px - color: $teal-light - font-weight: 400 - .settings padding-top: .8em diff --git a/app/styles/app/misc.sass b/app/styles/app/misc.sass index 0a6e4bb0..414a75c8 100644 --- a/app/styles/app/misc.sass +++ b/app/styles/app/misc.sass @@ -18,3 +18,12 @@ a color: #c00 text-decoration: underline + + +.small-title + font-size: 18px + color: $teal-light + font-weight: 400 + +.blank-list + @include resetul diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 3c2d4ea0..b5b0f92a 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -1,16 +1,14 @@
    -

    Default Branch

    - -
      +

      Default Branch

      +
        {{branch-row build=defaultBranch}}
    -

    Active Branches

    - -
      +

      Active Branches

      +
        {{#each branch in activeBranches}} {{branch-row build=branch}} {{else}} @@ -20,9 +18,8 @@
    -

    Inactive Branches

    - -
      +

      Inactive Branches

      +
        {{#each branch in inactiveBranches}} {{branch-row build=branch}} {{else}} @@ -36,4 +33,4 @@ {{!-- {{else}} {{loading-indicator}} -{{/if}} --}} \ No newline at end of file +{{/if}} --}} diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index b2af955f..386b677a 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -137,13 +137,15 @@
        - {{#unless isLoading }} -
          - {{#each buildTile in getLast5Builds}} - {{build-tile build=buildTile}} - {{/each}} -
        - {{else}} - {{loading-indicator}} - {{/unless}} +
          + {{#unless isLoading }} +
            + {{#each buildTile in getLast5Builds}} + {{build-tile build=buildTile}} + {{/each}} +
          + {{else}} + {{loading-indicator}} + {{/unless}} +
        diff --git a/app/templates/components/status-icon.hbs b/app/templates/components/status-icon.hbs index fe6b5c9c..d192fa78 100644 --- a/app/templates/components/status-icon.hbs +++ b/app/templates/components/status-icon.hbs @@ -42,3 +42,9 @@ {{/if}} +{{#if isRunning}} +
        + + +
        +{{/if}} \ No newline at end of file From fe67ce0882bfc9d7599d762cd5cca340e016a266 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 8 Sep 2015 17:48:47 +0200 Subject: [PATCH 09/52] work on branches templates --- app/components/branch-row.coffee | 10 +-- app/components/request-icon.coffee | 18 +++-- app/components/status-icon.coffee | 34 ++++---- app/controllers/branches.coffee | 10 ++- app/routes/branches.coffee | 12 +-- app/styles/app/components/build-tile.sass | 10 +-- app/styles/app/layouts/branches.sass | 29 +++---- app/templates/branches.hbs | 63 +++++++-------- app/templates/components/branch-row.hbs | 51 ++++++++---- app/templates/components/request-icon.hbs | 71 ++++++++++------- app/templates/components/status-icon.hbs | 95 +++++++++++++---------- 11 files changed, 225 insertions(+), 178 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 02115c73..25ee44bb 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -7,17 +7,13 @@ BranchRowComponent = Ember.Component.extend tagName: 'li' - classNameBindings: ['build.state'] + classNameBindings: ['build.last_build.state'] classNames: ['branch-row'] isLoading: true - urlAuthorGravatarImage: (-> - gravatarImage(@get('build.commit.authorEmail'), 15) - ).property('build.commit.authorEmail') - urlGithubCommit: (-> - githubCommitUrl(@get('build.repo.slug'), @get('build.commit.sha')) - ).property('build.commit.sha') + githubCommitUrl(@get('build.repository.slug'), @get('build.last_build.commit.sha')) + ).property('build.last_build') getLast5Builds: (-> diff --git a/app/components/request-icon.coffee b/app/components/request-icon.coffee index 031a47a1..a48846d9 100644 --- a/app/components/request-icon.coffee +++ b/app/components/request-icon.coffee @@ -4,19 +4,23 @@ RequestIconComponent = Ember.Component.extend tagName: 'span' classNames: ['icon-request'] - classNameBindings: ['build.state'] + classNameBindings: ['build.last_build.state'] isPush: (-> - @get('build.eventType') == 'push' - ).property('build.eventType') + @get('build.last_build.event_type') == 'push' + ).property('build.last_build') isPR: (-> - @get('build.eventType') == 'pull_request' - ).property('build.eventType') + @get('build.last_build.event_type') == 'pull_request' + ).property('build.last_build') isAPI: (-> - @get('build.eventType') == 'api' - ).property('build.eventType') + @get('build.last_build.event_type') == 'api' + ).property('build.last_build') + + isEmpty: (-> + true if @get('build.last_build') == null + ).property('build.last_build') diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee index 493c4b8f..b784b08f 100644 --- a/app/components/status-icon.coffee +++ b/app/components/status-icon.coffee @@ -4,30 +4,34 @@ StatusIconComponent = Ember.Component.extend tagName: 'span' classNames: ['status-icon'] - classNameBindings: ['build.state'] + classNameBindings: ['build.last_build.state'] hasPassed: (-> - @get('build.state') == 'passed' - ).property('build.state') + @get('build.last_build.state') == 'passed' + ).property('build.last_build.state') hasFailed: (-> - @get('build.state') == 'failed' - ).property('build.state') + @get('build.last_build.state') == 'failed' + ).property('build.last_build.state') hasErrored: (-> - @get('build.state') == 'errored' - ).property('build.state') + @get('build.last_build.state') == 'errored' + ).property('build.last_build.state') wasCanceled: (-> - @get('build.state') == 'canceled' - ).property('build.state') + @get('build.last_build.state') == 'canceled' + ).property('build.last_build.state') isRunning: (-> - @get('build.state') == 'started' || - @get('build.state') == 'queued' || - @get('build.state') == 'booting' || - @get('build.state') == 'received' || - @get('build.state') == 'created' - ).property('build.state') + @get('build.last_build.state') == 'started' || + @get('build.last_build.state') == 'queued' || + @get('build.last_build.state') == 'booting' || + @get('build.last_build.state') == 'received' || + @get('build.last_build.state') == 'created' + ).property('build.last_build.state') + + isEmpty: (-> + true if @get('build.last_build') == null + ).property('build.last_build') `export default StatusIconComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 77134a0d..7cf00272 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -6,18 +6,20 @@ BranchesController = Ember.Controller.extend defaultBranch: (-> repos = @get('model') - - # repos = repos.filter (item, index) -> - # item.get('owner.login') == org - + console.log(repos[0]) + repos[0] ).property('model') activeBranches: (-> repos = @get('model') + repos = repos.filter (item, index) -> + item if item.exists_on_github == true ).property('model') inactiveBranches: (-> repos = @get('model') + repos = repos.filter (item, index) -> + item if item.exists_on_github == false ).property('model') actions: diff --git a/app/routes/branches.coffee b/app/routes/branches.coffee index 345319f1..b6c9b1e4 100644 --- a/app/routes/branches.coffee +++ b/app/routes/branches.coffee @@ -12,15 +12,7 @@ Route = TravisRoute.extend if @get('auth.signedIn') options.headers = { Authorization: "token #{@auth.token()}" } - # $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/branch/master", options).then (response) -> - $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=master&limit=5", options).then (response) -> - - console.log(response) - # response.repositories.sortBy('last_build.finished_at').filter( (repo) -> - # repo.last_build - # ).map( (repo) -> - # Ember.Object.create(repo) - # ) - + $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/branches?include=build.commit", options).then (response) -> + response.branches `export default Route` diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 4a97075b..7a1cdda4 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -54,8 +54,8 @@ @include buildTileColors(#D94341, #FFF7F5, 'failed') @include buildTileColors(#D94341, #FFF7F5, 'errored') @include buildTileColors(#A1A0A0, #F5F5F5, 'canceled') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'started') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'queued') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'booting') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'received') - @include buildTileColors(#ECCE4B, rgba(#ECCE4B, 0.4), 'created') + @include buildTileColors(#bfb502, #fdfcee, 'started') + @include buildTileColors(#bfb502, #fdfcee, 'queued') + @include buildTileColors(#bfb502, #fdfcee, 'booting') + @include buildTileColors(#bfb502, #fdfcee, 'received') + @include buildTileColors(#bfb502, #fdfcee, 'created') diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 8ca940c1..22597170 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -1,6 +1,6 @@ -@mixin statusColors($color, $status) +@mixin statusColors($color, $status, $color2: $color) &.#{$status} - background: linear-gradient(to right, $color 0%, $color 9px, white 10px, white 100%) no-repeat + background: linear-gradient(to right, $color2 0%, $color2 9px, white 10px, white 100%) no-repeat .branch-name, .branch-request a color: $color @@ -10,12 +10,9 @@ .icon-request g > * fill: $color - -// .tabbody -// ul -// padding: 0 -// margin: 0 -// list-style: none +.branches + .small-title + margin: 1.5em 0 0.7em .branch-row border: 1px solid $cream-dark @@ -23,6 +20,7 @@ text-align: right margin-bottom: .3rem color: $grey-dark + background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat span width: 1.3em @@ -32,10 +30,13 @@ vertical-align: middle .avatar + display: inline-block width: 16px + height: 16px margin-right: .7em border-radius: 50% vertical-align: middle + background-color: #E9EBEB .row-item margin: .2em @@ -69,11 +70,11 @@ @include statusColors($red-dark, 'failed') @include statusColors($red-dark, 'errored') @include statusColors($grey-medium, 'canceled') - @include statusColors(#ECCE4B, 'started') - @include statusColors(#ECCE4B, 'queued') - @include statusColors(#ECCE4B, 'booting') - @include statusColors(#ECCE4B, 'received') - @include statusColors(#ECCE4B, 'created') + @include statusColors(#bfb502, 'started', #e5db29) + @include statusColors(#bfb502, 'queued', #e5db29) + @include statusColors(#bfb502, 'booting', #e5db29) + @include statusColors(#bfb502, 'received', #e5db29) + @include statusColors(#bfb502, 'created', #e5db29) %row-element @@ -207,7 +208,7 @@ vertical-align: middle width: 5px height: 5px - border: solid 2px #ECCE4B + border: solid 2px #e5db29 border-radius: 50% transform-origin: center center diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index b5b0f92a..9fed18f3 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -1,36 +1,37 @@ +
        +
        +

        Default Branch

        +
          + {{branch-row build=defaultBranch}} +
        +
        -
        -

        Default Branch

        -
          - {{branch-row build=defaultBranch}} -
        -
        +
        +

        Active Branches

        +
          + {{#each branch in activeBranches}} + {{branch-row build=branch}} + {{else}} +
        • There are no active branches
        • + {{/each}} +
        +
        -
        -

        Active Branches

        -
          - {{#each branch in activeBranches}} - {{branch-row build=branch}} - {{else}} -
        • There are no active branches
        • - {{/each}} -
        -
        - -
        -

        Inactive Branches

        -
          - {{#each branch in inactiveBranches}} - {{branch-row build=branch}} - {{else}} -
        • There are no inactive branches
        • - {{/each}} -
        -
        +
        +

        Inactive Branches

        +
          + {{#each branch in inactiveBranches}} + {{branch-row build=branch}} + {{else}} +
        • There are no inactive branches
        • + {{/each}} +
        +
        -{{!-- {{#if content.isLoaded}} --}} + {{!-- {{#if content.isLoaded}} --}} -{{!-- {{else}} - {{loading-indicator}} -{{/if}} --}} + {{!-- {{else}} + {{loading-indicator}} + {{/if}} --}} +
        \ No newline at end of file diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 386b677a..d70e952d 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -1,6 +1,6 @@
        -

        {{status-icon build=build}}{{build.commit.branch}}

        +

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

        - {{#link-to "build" build.repo build}} - {{request-icon build=build}} - #{{build.number}} {{build.state}} - {{/link-to}} -
        + {{#if build.last_build}} + {{#link-to "build" build.repository.slug build.last_build.id}} + {{request-icon build=build}} + #{{build.last_build.number}} {{build.last_build.state}} + {{/link-to}} + {{else}} + {{request-icon build=build}} - + {{/if}} +
        -
        +
        @@ -49,7 +58,12 @@ - {{format-time build.finishedAt}}
        + {{#if build.last_build}} + {{format-time build.last_build.finished_at}} + {{else}} + - + {{/if}} +
        diff --git a/app/templates/components/request-icon.hbs b/app/templates/components/request-icon.hbs index 051ed431..ef8b00f8 100644 --- a/app/templates/components/request-icon.hbs +++ b/app/templates/components/request-icon.hbs @@ -1,4 +1,4 @@ -{{#if isPush}} +{{#if isEmpty}} @@ -7,35 +7,46 @@ c0-1.2,1-2.2,2.2-2.2c1.2,0,2.2,1,2.2,2.2c0,0,0,0,0,0c0,0,0,0,0,0C12.2,11.2,11.2,12.2,10,12.2z"/> -{{/if}} +{{else}} + {{#if isPush}} + + + + + + {{/if}} -{{#if isPR}} - - - - - - -{{/if}} + {{#if isPR}} + + + + + + + {{/if}} -{{#if isAPI}} - - - - - + {{#if isAPI}} + + + + + + {{/if}} {{/if}} diff --git a/app/templates/components/status-icon.hbs b/app/templates/components/status-icon.hbs index d192fa78..b27ddc57 100644 --- a/app/templates/components/status-icon.hbs +++ b/app/templates/components/status-icon.hbs @@ -1,50 +1,61 @@ -{{#if hasPassed}} - - - +{{#if isEmpty}} + + + + + -{{/if}} +{{else}} + {{#if hasPassed}} + + + + + + {{/if}} -{{#if hasFailed}} - - - - - -{{/if}} + {{#if hasFailed}} + + + + + + {{/if}} -{{#if wasCanceled}} - - - - - -{{/if}} + {{#if wasCanceled}} + + + + + + {{/if}} -{{#if hasErrored}} - - - - - - -{{/if}} + {{#if hasErrored}} + + + + + + + {{/if}} -{{#if isRunning}} -
        - - -
        + {{#if isRunning}} +
        + + +
        + {{/if}} {{/if}} \ No newline at end of file From a00704943af785cfb02a439f31f7303e2340908c Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 8 Sep 2015 18:21:44 +0200 Subject: [PATCH 10/52] prepare for 5 builds per branch request --- app/components/branch-row.coffee | 18 ++++++++++++++++++ app/controllers/branches.coffee | 10 ---------- app/templates/components/branch-row.hbs | 12 +++--------- app/templates/components/build-tile.hbs | 14 ++++++++------ 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 25ee44bb..cbdbb7fb 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -17,6 +17,14 @@ BranchRowComponent = Ember.Component.extend getLast5Builds: (-> + array = [{}, {}, {}, {}, {}] + + if @get('build.last_build') == null + @set('isLoading', false) + array + else + array + # apiEndpoint = config.apiEndpoint # repoId = @get('build.repository.id') @@ -29,4 +37,14 @@ BranchRowComponent = Ember.Component.extend # @set('isLoading', false) ).property('build') + actions: + tiggerBuild: (branch) -> + console.log('trigger build') + + viewAllBuilds: (branch) -> + console.log('view all builds') + # updateFilter: (value) -> + # @set('_lastFilterValue', value) + # Ember.run.throttle this, @updateFilter, [], 200, false + `export default BranchRowComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 7cf00272..a0a0c96e 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -22,14 +22,4 @@ BranchesController = Ember.Controller.extend item if item.exists_on_github == false ).property('model') - actions: - tiggerBuild: (branch) -> - console.log('trigger build') - - viewAllBuilds: (branch) -> - console.log('view all builds') - # updateFilter: (value) -> - # @set('_lastFilterValue', value) - # Ember.run.throttle this, @updateFilter, [], 200, false - `export default BranchesController` diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index d70e952d..2313b85f 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -163,14 +163,8 @@
          - {{#unless isLoading }} -
            - {{#each buildTile in getLast5Builds}} - {{build-tile build=buildTile}} - {{/each}} -
          - {{else}} - {{loading-indicator}} - {{/unless}} + {{#each buildTile in getLast5Builds}} + {{build-tile build=buildTile}} + {{/each}}
        diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs index d2c640b1..b96158db 100644 --- a/app/templates/components/build-tile.hbs +++ b/app/templates/components/build-tile.hbs @@ -1,6 +1,8 @@ -
        - {{status-icon build=build}} -
        - {{request-icon build=build}} #{{build.number}} -
        -
        +{{#unless build}} + + {{status-icon build=build}} +
        + {{request-icon build=build}} #{{build.number}} +
        +
        +{{/unless}} \ No newline at end of file From 53268219905d3dd48ea48c0c6ea7f3335a3ce6f6 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 14 Sep 2015 14:16:17 +0200 Subject: [PATCH 11/52] make last 5 builds work --- app/components/branch-row.coffee | 42 +++++++++++++++-------- app/components/request-icon.coffee | 13 ++++--- app/components/status-icon.coffee | 37 +++++++++++++------- app/controllers/branches.coffee | 3 ++ app/styles/app/components/build-tile.sass | 3 +- app/styles/app/layouts/branches.sass | 2 +- app/templates/branches.hbs | 40 ++++++++++----------- app/templates/components/branch-row.hbs | 20 +++++++---- app/templates/components/build-tile.hbs | 8 ++--- 9 files changed, 104 insertions(+), 64 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index cbdbb7fb..b9219ca7 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -9,7 +9,7 @@ BranchRowComponent = Ember.Component.extend tagName: 'li' classNameBindings: ['build.last_build.state'] classNames: ['branch-row'] - isLoading: true + isLoading: false urlGithubCommit: (-> githubCommitUrl(@get('build.repository.slug'), @get('build.last_build.commit.sha')) @@ -17,25 +17,37 @@ BranchRowComponent = Ember.Component.extend getLast5Builds: (-> - array = [{}, {}, {}, {}, {}] + lastBuilds = Ember.ArrayProxy.create( + content: [{}, {}, {}, {}, {}] + isLoading: true, + count: 0 + ) - if @get('build.last_build') == null - @set('isLoading', false) - array + if !@get('build.last_build') + lastBuilds.set('isLoading', false) else - array + apiEndpoint = config.apiEndpoint + repoId = @get('build.repository.id') + branchName = @get('build.name') - # apiEndpoint = config.apiEndpoint - # repoId = @get('build.repository.id') + options = {} + if @get('auth.signedIn') + options.headers = { Authorization: "token #{@auth.token()}" } - # options = {} - # if @get('auth.signedIn') - # options.headers = { Authorization: "token #{@auth.token()}" } + $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=#{branchName}&limit=5&offset=1", options).then (response) -> + array = response.builds.map( (build) -> + Ember.Object.create(build) + ) + if array.length < 5 + for i in [1..5 - array.length] by 1 + array.push({}) - # $.ajax("#{apiEndpoint}/v3/repo/269284/builds?branch.name=master&limit=5", options).then (response) -> - # console.log(response) - # @set('isLoading', false) - ).property('build') + lastBuilds.set('count', response['@pagination'].count) + lastBuilds.set('content', array) + lastBuilds.set('isLoading', false) + + lastBuilds + ).property() actions: tiggerBuild: (branch) -> diff --git a/app/components/request-icon.coffee b/app/components/request-icon.coffee index a48846d9..6f377e49 100644 --- a/app/components/request-icon.coffee +++ b/app/components/request-icon.coffee @@ -4,22 +4,25 @@ RequestIconComponent = Ember.Component.extend tagName: 'span' classNames: ['icon-request'] - classNameBindings: ['build.last_build.state'] + classNameBindings: ['build.last_build.state', 'build.state'] isPush: (-> - @get('build.last_build.event_type') == 'push' + @get('build.last_build.event_type') == 'push' || + @get('build.event_type') == 'push' ).property('build.last_build') isPR: (-> - @get('build.last_build.event_type') == 'pull_request' + @get('build.last_build.event_type') == 'pull_request' || + @get('build.event_type') == 'pull_request' ).property('build.last_build') isAPI: (-> - @get('build.last_build.event_type') == 'api' + @get('build.last_build.event_type') == 'api' || + @get('build.event_type') == 'api' ).property('build.last_build') isEmpty: (-> - true if @get('build.last_build') == null + true if @get('build.last_build') == null || @get('build') == null ).property('build.last_build') diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee index b784b08f..a19d9c0e 100644 --- a/app/components/status-icon.coffee +++ b/app/components/status-icon.coffee @@ -7,31 +7,44 @@ StatusIconComponent = Ember.Component.extend classNameBindings: ['build.last_build.state'] hasPassed: (-> - @get('build.last_build.state') == 'passed' - ).property('build.last_build.state') + @get('build.last_build.state') == 'passed' || + @get('build.state') == 'passed' + ).property('build') hasFailed: (-> - @get('build.last_build.state') == 'failed' - ).property('build.last_build.state') + @get('build.last_build.state') == 'failed' || + @get('build.state') == 'failed' + ).property('build') hasErrored: (-> - @get('build.last_build.state') == 'errored' - ).property('build.last_build.state') + @get('build.last_build.state') == 'errored' || + @get('build.state') == 'errored' + ).property('build') wasCanceled: (-> - @get('build.last_build.state') == 'canceled' - ).property('build.last_build.state') + @get('build.last_build.state') == 'canceled' || + @get('build.state') == 'canceled' + ).property('build') isRunning: (-> @get('build.last_build.state') == 'started' || @get('build.last_build.state') == 'queued' || @get('build.last_build.state') == 'booting' || @get('build.last_build.state') == 'received' || - @get('build.last_build.state') == 'created' - ).property('build.last_build.state') + @get('build.last_build.state') == 'created' || + @get('build.state') == 'started' || + @get('build.state') == 'queued' || + @get('build.state') == 'booting' || + @get('build.state') == 'received' || + @get('build.state') == 'created' + ).property('build') isEmpty: (-> - true if @get('build.last_build') == null - ).property('build.last_build') + if @get('build.@type') == 'branch' + true if @get('build.last_build.state') == null + else if @get('build.@type') == 'build' + false if @get('build.state') != '' + + ).property('build') `export default StatusIconComponent` diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index a0a0c96e..1a8bec3d 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -14,6 +14,9 @@ BranchesController = Ember.Controller.extend repos = @get('model') repos = repos.filter (item, index) -> item if item.exists_on_github == true + .sort (a, b) -> + return 0 + ).property('model') inactiveBranches: (-> diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 7a1cdda4..3ee34ad8 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -28,6 +28,7 @@ display: inline-block height: 100% width: 18.8% + background-color: #F7F7F7 .status-icon position: absolute top: 0 @@ -36,7 +37,7 @@ left: 0 width: 2rem height: 2rem - margin: auto + margin: auto !important background-color: transparent .is-rotating width: 100% diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 22597170..d5ba8e02 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -22,7 +22,7 @@ color: $grey-dark background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat - span + span[class*="icon"] width: 1.3em height: 1.3em margin-right: .2em diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 9fed18f3..15cf2a0c 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -6,27 +6,27 @@
    -
    -

    Active Branches

    -
      - {{#each branch in activeBranches}} - {{branch-row build=branch}} - {{else}} -
    • There are no active branches
    • - {{/each}} -
    -
    + {{#if activeBranches}} +
    +

    Active Branches

    +
      + {{#each branch in activeBranches}} + {{branch-row build=branch}} + {{/each}} +
    +
    + {{/if}} -
    -

    Inactive Branches

    -
      - {{#each branch in inactiveBranches}} - {{branch-row build=branch}} - {{else}} -
    • There are no inactive branches
    • - {{/each}} -
    -
    + {{#if inactiveBranches}} +
    +

    Inactive Branches

    +
      + {{#each branch in inactiveBranches}} + {{branch-row build=branch}} + {{/each}} +
    +
    + {{/if}} {{!-- {{#if content.isLoaded}} --}} diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 2313b85f..5998addd 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -3,7 +3,7 @@

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

    @@ -42,7 +46,7 @@
    - + diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs index b96158db..6c493669 100644 --- a/app/templates/components/build-tile.hbs +++ b/app/templates/components/build-tile.hbs @@ -1,8 +1,8 @@ -{{#unless build}} - +{{#if build.number}} + {{#link-to "build" build.repository.slug build.id class="dropup-trigger"}} {{status-icon build=build}}
    {{request-icon build=build}} #{{build.number}}
    -
    -{{/unless}} \ No newline at end of file + {{/link-to}} +{{/if}} \ No newline at end of file From 26fe355e4075294bf97002c2942c6b26f088125d Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 14 Sep 2015 14:56:02 +0200 Subject: [PATCH 12/52] get icon coloring right --- app/components/branch-row.coffee | 1 + app/components/status-icon.coffee | 2 +- app/styles/app/components/build-tile.sass | 3 ++- app/styles/app/layouts/branches.sass | 4 ++-- app/templates/components/branch-row.hbs | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index b9219ca7..8393eb5e 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -55,6 +55,7 @@ BranchRowComponent = Ember.Component.extend viewAllBuilds: (branch) -> console.log('view all builds') + @transitionToRoute('builds') # updateFilter: (value) -> # @set('_lastFilterValue', value) # Ember.run.throttle this, @updateFilter, [], 200, false diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee index a19d9c0e..b16168fb 100644 --- a/app/components/status-icon.coffee +++ b/app/components/status-icon.coffee @@ -4,7 +4,7 @@ StatusIconComponent = Ember.Component.extend tagName: 'span' classNames: ['status-icon'] - classNameBindings: ['build.last_build.state'] + classNameBindings: ['build.last_build.state', 'build.state'] hasPassed: (-> @get('build.last_build.state') == 'passed' || diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 3ee34ad8..ece849fa 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -1,7 +1,8 @@ @mixin buildTileColors($color, $bg, $status) > .#{$status} background-color: $bg - .icon-request g > * + .icon-request g > *, + .status-icon g > * fill: $color &:hover background-color: $color diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index d5ba8e02..3237fc50 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -6,8 +6,8 @@ color: $color &:hover border-color: $color - .status-icon g > *, - .icon-request g > * + .branch-name .status-icon g > *, + .branch-request .icon-request g > * fill: $color .branches diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 5998addd..abd4cf93 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -135,7 +135,7 @@
    + + + {{/if}} -
    +
      {{#if getLast5Builds.isLoading}} {{loading-indicator center=true}} @@ -175,4 +177,18 @@ {{/each}} {{/if}}
    + {{#unless build.last_build}} + + + + + + + + + Trigger a build + {{/unless}}
    From 4dc5c030774a254beba76ce375973fd2a17c7759 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 15 Sep 2015 15:39:36 +0200 Subject: [PATCH 16/52] sort branches by date --- app/controllers/branches.coffee | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index 9a80c996..d5630011 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -16,26 +16,16 @@ BranchesController = Ember.Controller.extend repos = repos.filter (item, index) -> console.log(item) item if item.exists_on_github == true && item.repository.default_branch.name != undefined - .sort (a, b) -> - # if a.last_build && b.last_build - - # if a.last_build.finished_at == null - # return 1 - # else - # if a.last_build.finished_at > b.last_build.finished_at - # return -1 - # else if a.last_build.finished_at < b.last_build.finished_at - # return 1 - # else - # return 0 - # else - # return -1 + .sortBy('last_build.finished_at') + .reverse() ).property('model') inactiveBranches: (-> repos = @get('model') repos = repos.filter (item, index) -> item if item.exists_on_github == false + .sortBy('last_build.finished_at') + .reverse() ).property('model') `export default BranchesController` From e8fb719591eff3a0d43e11a4f72e51e2ca712839 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 15 Sep 2015 17:59:15 +0200 Subject: [PATCH 17/52] tweak some styles and responsive behaviour --- app/components/branch-row.coffee | 16 ++++++++-- app/controllers/branches.coffee | 1 - app/styles/app/components/build-tile.sass | 2 +- app/styles/app/layouts/branches.sass | 37 ++++++++++++++++++----- app/templates/branches.hbs | 9 +----- app/templates/components/branch-row.hbs | 32 ++++++++++++-------- 6 files changed, 63 insertions(+), 34 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 788d40fc..803d8b04 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -34,7 +34,7 @@ BranchRowComponent = Ember.Component.extend if @get('auth.signedIn') options.headers = { Authorization: "token #{@auth.token()}" } - $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=#{branchName}&limit=5&offset=1", options).then (response) -> + $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/builds?branch.name=#{branchName}&limit=5", options).then (response) -> array = response.builds.map( (build) -> Ember.Object.create(build) ) @@ -49,17 +49,27 @@ BranchRowComponent = Ember.Component.extend lastBuilds ).property() + triggeredBuild: (-> + triggeredBuild = Ember.ArrayProxy.create( + isTriggered: false, + status: null + ) + ).property("triggeredBuild.status['@type']") + triggerBuild: (-> apiEndpoint = config.apiEndpoint repoId = @get('build.repository.id') + branchName = @get('build.name') options = { type: 'POST' } if @get('auth.signedIn') options.headers = { Authorization: "token #{@auth.token()}" } $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) -> - console.log(response); - console.log('Build triggered'); + @triggerBuild.set('isTriggered', true) + @triggerBuild.set('status', response) + console.log(response) + console.log('Build triggered') ) actions: diff --git a/app/controllers/branches.coffee b/app/controllers/branches.coffee index d5630011..47d9de78 100644 --- a/app/controllers/branches.coffee +++ b/app/controllers/branches.coffee @@ -14,7 +14,6 @@ BranchesController = Ember.Controller.extend activeBranches: (-> repos = @get('model') repos = repos.filter (item, index) -> - console.log(item) item if item.exists_on_github == true && item.repository.default_branch.name != undefined .sortBy('last_build.finished_at') .reverse() diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 34ae9388..a7ab8778 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -28,7 +28,7 @@ position: relative display: inline-block height: 100% - width: 18.8% + width: 18.7% background-color: #F7F7F7 .status-icon position: absolute diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index f4ffae8a..f787d80c 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -64,7 +64,7 @@ & > div:nth-of-type(4) width: 5% & > div:nth-of-type(5) - width: 26% + width: 27% @include statusColors($green-dark, 'passed') @include statusColors($red-dark, 'failed') @@ -76,7 +76,6 @@ @include statusColors(#bfb502, 'received', #e5db29) @include statusColors(#bfb502, 'created', #e5db29) - %row-element vertical-align: middle @media #{$medium-up} @@ -99,9 +98,22 @@ display: inline-block .branch-nav display: none + text-align: center @media #{$medium-up} display: block +.branch-last-build + @media #{$medium-up} + padding-left: 1em + &:before + content: ""; + display: block; + width: 1px; + background-color: #EFF0EC; + position: absolute; + height: 3.7em; + margin-left: -1em; + // @todo refactor into dropup module %dropup @media #{$medium-up} @@ -120,10 +132,7 @@ height: 10px left: 46% transform: rotate(45deg) - &:before - bottom: -6px &:after - bottom: -4px background-color: $white .dropup-trigger:hover ~ &, .dropup-trigger:hover &, @@ -132,6 +141,10 @@ .dropup--blue @extend %dropup + &:before + bottom: -5px + &:after + bottom: -4px ul margin: 0 padding: 0 @@ -152,13 +165,15 @@ fill: $white @media #{$medium-up} - padding: .4em - transform: translate(-2.7em, -8.2em) + padding: .5em + transform: translate(-37%, -180%) border: 1px solid $teal-dark li display: block margin: 0 background-color: $white + &:first-of-type + border-bottom: 1px solid #E4E6E6 .icon-trigger path, .icon-eye path fill: #A7AEAE @@ -174,6 +189,10 @@ .icon-eye path fill: $white + @media #{$large-up} + padding: .5em + transform: translate(-30%, -180%) + &:before background-color: $teal-dark @@ -182,6 +201,8 @@ display: none &:after bottom: -5px + &:before + bottom: -6px @media #{$medium-up} top: -3em padding: .2em .3em @@ -210,7 +231,7 @@ vertical-align: middle width: 5px height: 5px - border: solid 1px #e5db29 + border: solid 1px #bfb502 border-radius: 50% transform-origin: center center diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 15cf2a0c..650a6cc4 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -27,11 +27,4 @@ {{/if}} - - - {{!-- {{#if content.isLoaded}} --}} - - {{!-- {{else}} - {{loading-indicator}} - {{/if}} --}} -
    \ No newline at end of file + diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 593e94cc..c48da485 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -31,7 +31,7 @@ -
    +
    {{#if build.last_build}} @@ -136,18 +136,24 @@
    - + +
    {{#if build.last_build}}
    - + + + - +
    -

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

    +

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

    @@ -138,7 +138,16 @@
    • {{#if hasTriggered}} - build was triggered + + + + + + + + Build triggered {{else}} {{#if isTriggering}} {{loading-indicator}} diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs index 6c493669..8ab70419 100644 --- a/app/templates/components/build-tile.hbs +++ b/app/templates/components/build-tile.hbs @@ -1,6 +1,8 @@ {{#if build.number}} {{#link-to "build" build.repository.slug build.id class="dropup-trigger"}} - {{status-icon build=build}} + {{status-icon status=build.state}} + + {{build.last_build.state}}
      {{request-icon build=build}} #{{build.number}}
      diff --git a/app/templates/components/repos-list-item.hbs b/app/templates/components/repos-list-item.hbs index 8b7f4b97..8a408f1a 100644 --- a/app/templates/components/repos-list-item.hbs +++ b/app/templates/components/repos-list-item.hbs @@ -1,7 +1,7 @@

      {{#if repo.slug}} - + {{status-icon status=repo.lastBuildState}} {{#link-to "repo" repo class="slug"}}{{repo.slug}}{{/link-to}} {{/if}}

      @@ -26,7 +26,22 @@

      - + + + + + + + + + Finished: {{format-time repo.lastBuildFinishedAt}} From ac8765f0f126afec8132de4cbbeeb739f5005399 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 14:49:35 +0200 Subject: [PATCH 24/52] moar alignment fun --- app/styles/app/layouts/branches.sass | 8 ++++++-- app/styles/app/modules/tiles.sass | 12 ++++++------ app/templates/branches.hbs | 2 +- app/templates/components/branch-row.hbs | 18 ++++++++++++------ app/templates/components/build-tile.hbs | 2 +- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index aeb10414..b8809ff4 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -52,7 +52,7 @@ @media #{$medium-up} & > div:first-of-type - width: 25% + width: 26% position: relative &:after content: "" @@ -222,7 +222,7 @@ bottom: -4px @media #{$medium-up} top: -2.3em - width: 4em + width: 4.1em padding: .1em .1em white-space: nowrap font-size: 14px; @@ -235,6 +235,10 @@ path fill: $teal-dark +.label-align + vertical-align: middle + line-height: 1.4 + // @todo refactor to status-icon module .status-icon .is-rotating diff --git a/app/styles/app/modules/tiles.sass b/app/styles/app/modules/tiles.sass index c73b6a79..47bd5af9 100644 --- a/app/styles/app/modules/tiles.sass +++ b/app/styles/app/modules/tiles.sass @@ -3,7 +3,7 @@ svg g > * fill: $color -@mixin colorTiles($color, $status) +@mixin colorTiles($color, $status, $extra-bg: $color) &.#{$status} .tile-status background-color: $color @@ -34,11 +34,11 @@ @include colorTiles($red-dark, 'failed') @include colorTiles($red-dark, 'errored') @include colorTiles($grey-medium, 'canceled') - @include colorTiles(#bfb502, 'started') - @include colorTiles(#bfb502, 'queued') - @include colorTiles(#bfb502, 'booting') - @include colorTiles(#bfb502, 'received') - @include colorTiles(#bfb502, 'created') + @include colorTiles(#bfb502, 'started', #e5da3f) + @include colorTiles(#bfb502, 'queued', #e5da3f) + @include colorTiles(#bfb502, 'booting', #e5da3f) + @include colorTiles(#bfb502, 'received', #e5da3f) + @include colorTiles(#bfb502, 'created', #e5da3f) .status-icon .is-rotating width: 17px; diff --git a/app/templates/branches.hbs b/app/templates/branches.hbs index 650a6cc4..d423b0d8 100644 --- a/app/templates/branches.hbs +++ b/app/templates/branches.hbs @@ -22,7 +22,7 @@

      Inactive Branches

        {{#each branch in inactiveBranches}} - {{branch-row build=branch}} + {{branch-row build=branch inactive=true}} {{/each}}
      diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 3ba2ffa4..2a90f88d 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -19,6 +19,7 @@ l0.5,0.1V4c-0.1,0-0.4-0.1-0.9-0.2c0,0-0.1,0-0.1,0L6.4,3.5V4.7z"/> + {{#if build.last_build}} {{#if getLast5Builds.isLoading}} {{loading-indicator inline=true}} @@ -27,7 +28,7 @@ {{/if}} {{else}} 0 builds - {{/if}} + {{/if}}
    @@ -37,7 +38,7 @@ {{#if build.last_build}} {{#link-to "build" build.repository.slug build.last_build.id}} {{request-icon build=build}} - #{{build.last_build.number}} {{build.last_build.state}} + #{{build.last_build.number}} {{build.last_build.state}} {{/link-to}} {{else}} {{request-icon build=build}} - @@ -62,11 +63,12 @@
    + {{#if build.last_build}} {{format-time build.last_build.finished_at}} {{else}} - - {{/if}} + {{/if}}
    @@ -100,24 +102,27 @@
    + {{#if build.last_build}} {{format-sha build.last_build.commit.sha}} {{else}} - - {{/if}} + {{/if}}
    {{#if build.last_build}} - avatar{{build.last_build.commit.committer.name}} + avatar + {{build.last_build.commit.committer.name}} {{else}} -
    no commits yet +
    no commits yet {{/if}}
    +{{#unless inactive}} {{#if build.last_build}}
    @@ -185,6 +190,7 @@
    {{/if}} +{{/unless}}
      diff --git a/app/templates/components/build-tile.hbs b/app/templates/components/build-tile.hbs index 8ab70419..7216bd17 100644 --- a/app/templates/components/build-tile.hbs +++ b/app/templates/components/build-tile.hbs @@ -4,7 +4,7 @@ {{build.last_build.state}}
      - {{request-icon build=build}} #{{build.number}} + {{request-icon build=build}} #{{build.number}}
      {{/link-to}} {{/if}} \ No newline at end of file From 5a35f0c1b7e7d865b8ab40732926b0f0e11b5332 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 15:51:58 +0200 Subject: [PATCH 25/52] 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}}
    From cb01f58f4d6a48370bd288cd077ddc26e48dfb15 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 16:16:37 +0200 Subject: [PATCH 26/52] new icons for the sidebar --- app/components/branch-row.coffee | 5 +++- app/styles/app/layouts/branches.sass | 2 +- app/templates/components/repos-list-item.hbs | 27 +++++++++++++++++--- public/images/line-icons/icon-clock.svg | 9 +++++++ public/images/line-icons/icon-hash.svg | 10 ++++++++ 5 files changed, 48 insertions(+), 5 deletions(-) create mode 100644 public/images/line-icons/icon-clock.svg create mode 100644 public/images/line-icons/icon-hash.svg diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 46ee17a0..29f30887 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -52,7 +52,10 @@ BranchRowComponent = Ember.Component.extend ).property() canTrigger: (-> - @get('auth.signedIn') + if !@get('auth.signedIn') + return false + else + true ).property() triggerBuild: (-> diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 3cea43a5..8080d1b6 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -237,7 +237,7 @@ .label-align vertical-align: middle - line-height: 1.4 + line-height: 1.5 // @todo refactor to status-icon module .status-icon diff --git a/app/templates/components/repos-list-item.hbs b/app/templates/components/repos-list-item.hbs index 8a408f1a..ba106a21 100644 --- a/app/templates/components/repos-list-item.hbs +++ b/app/templates/components/repos-list-item.hbs @@ -9,7 +9,18 @@ {{#if repo.slug}} {{#if lastBuild.id}}

    - + + + + + {{#link-to "build" repo lastBuild.id class="last_build"}}{{lastBuild.number}}{{/link-to}}

    @@ -18,7 +29,17 @@ {{/with}}

    - + + + + + + + + Duration: {{format-duration repo.lastBuildDuration}} @@ -27,7 +48,7 @@

    - + diff --git a/public/images/line-icons/icon-clock.svg b/public/images/line-icons/icon-clock.svg new file mode 100644 index 00000000..132af39a --- /dev/null +++ b/public/images/line-icons/icon-clock.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/public/images/line-icons/icon-hash.svg b/public/images/line-icons/icon-hash.svg new file mode 100644 index 00000000..6bcd4ad9 --- /dev/null +++ b/public/images/line-icons/icon-hash.svg @@ -0,0 +1,10 @@ + + + From b79b711e4003d9a0bec753a7001868d9cdc0dcdb Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 16:39:00 +0200 Subject: [PATCH 27/52] check for permissions before displaying trigger button --- app/components/branch-row.coffee | 8 ++++++-- app/styles/app/modules/tiles.sass | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 29f30887..17de95df 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -53,9 +53,13 @@ BranchRowComponent = Ember.Component.extend canTrigger: (-> if !@get('auth.signedIn') - return false + false else - true + permissions = @get('auth.currentUser.permissions') + if permissions.contains parseInt(@get('build.repository.id')) + true + else + false ).property() triggerBuild: (-> diff --git a/app/styles/app/modules/tiles.sass b/app/styles/app/modules/tiles.sass index e6e1207c..924e6087 100644 --- a/app/styles/app/modules/tiles.sass +++ b/app/styles/app/modules/tiles.sass @@ -13,7 +13,7 @@ .build-status a, .tile-header, .tile-header a, - a + .tile-title a color: $color @include colorStatusIcons($color, $status) From 732f572c6ecd18898f421f68f999067c30228199 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 16:42:08 +0200 Subject: [PATCH 28/52] make sidebar icons smaller --- app/templates/components/repos-list-item.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/components/repos-list-item.hbs b/app/templates/components/repos-list-item.hbs index ba106a21..ef49a0e3 100644 --- a/app/templates/components/repos-list-item.hbs +++ b/app/templates/components/repos-list-item.hbs @@ -31,7 +31,7 @@

    + viewBox="-288 192 20 20" {{!-- style="enable-background:new -289 191 20 20;" --}} xml:space="preserve"> @@ -48,7 +48,7 @@

    - + From f9b1c37d0483b4a90a0aa1e12abacc38c340360e Mon Sep 17 00:00:00 2001 From: Lisa P Date: Thu, 17 Sep 2015 17:07:54 +0200 Subject: [PATCH 29/52] make transition to build history work --- app/components/branch-row.coffee | 4 ++-- app/components/status-icon.coffee | 7 +++++-- app/styles/app/layouts/branches.sass | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 17de95df..b6efcfce 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -5,7 +5,7 @@ `import config from 'travis/config/environment'` BranchRowComponent = Ember.Component.extend - + routing: Ember.inject.service('-routing') tagName: 'li' classNameBindings: ['build.last_build.state'] classNames: ['branch-row'] @@ -86,6 +86,6 @@ BranchRowComponent = Ember.Component.extend @triggerBuild() viewAllBuilds: (branch) -> - console.log('view all builds') + @get('routing').transitionTo('builds') `export default BranchRowComponent` diff --git a/app/components/status-icon.coffee b/app/components/status-icon.coffee index 2668845e..5ba1a048 100644 --- a/app/components/status-icon.coffee +++ b/app/components/status-icon.coffee @@ -31,10 +31,13 @@ StatusIconComponent = Ember.Component.extend ).property('status') isEmpty: (-> - if @get('status') == null || @get('status') == '' + unless @get('status') true else - false + if @get('status') == '' + true + else + false ).property('status') diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 8080d1b6..be4d68fe 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -179,7 +179,7 @@ @media #{$medium-up} width: 10em left: 0 - padding: .3em + padding: .4em transform: translate(-42%, -170%) border: 1px solid $teal-dark li From d44f020decfb77b185e571f62e68b7dc05c323c3 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 18 Sep 2015 12:13:18 +0200 Subject: [PATCH 30/52] fix tab highlighting --- app/controllers/settings.coffee | 5 ----- app/routes/branches.coffee | 8 ++++++++ app/styles/app/layouts/branches.sass | 2 +- app/templates/components/branch-row.hbs | 3 +-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/app/controllers/settings.coffee b/app/controllers/settings.coffee index 55aee2b7..2b2ff314 100644 --- a/app/controllers/settings.coffee +++ b/app/controllers/settings.coffee @@ -10,9 +10,4 @@ SettingsController = Ember.Controller.extend sshKeyDeleted: -> @set('model.customSshKey', null) - # deactivate: -> - # console.log('deactivate') - # debugger - - `export default SettingsController` diff --git a/app/routes/branches.coffee b/app/routes/branches.coffee index b6c9b1e4..164cf6eb 100644 --- a/app/routes/branches.coffee +++ b/app/routes/branches.coffee @@ -15,4 +15,12 @@ Route = TravisRoute.extend $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/branches?include=build.commit", options).then (response) -> response.branches + activate: () -> + $('.tab.tabs--main li').removeClass('active') + $('#tab_branches').addClass('active') + + deactivate: () -> + $('#tab_branches').removeClass('active') + + `export default Route` diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index be4d68fe..95a17631 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -222,7 +222,7 @@ bottom: -4px @media #{$medium-up} top: -2.3em - width: 4.1em + width: 4.8em padding: .1em .1em white-space: nowrap font-size: 14px; diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 44ca0036..08c653c7 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -114,8 +114,7 @@

    {{#if build.last_build}} - avatar - {{build.last_build.commit.committer.name}} + avatar{{build.last_build.commit.committer.name}} {{else}}
    no commits yet {{/if}} From b665468bf71da002d010b529d19a5e05c9ccb98f Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 18 Sep 2015 12:41:20 +0200 Subject: [PATCH 31/52] add moire breakpoint for row spacing --- app/components/branch-row.coffee | 6 +++--- app/styles/app/layouts/branches.sass | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index b6efcfce..0c392424 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -76,13 +76,13 @@ BranchRowComponent = Ember.Component.extend if @get('auth.signedIn') options.headers = { Authorization: "token #{@auth.token()}" } $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) => - @.set('isTriggering', false) - @.set('hasTriggered', true) + @set('isTriggering', false) + @set('hasTriggered', true) ) actions: tiggerBuild: (branch) -> - @.set('isTriggering', true) + @set('isTriggering', true) @triggerBuild() viewAllBuilds: (branch) -> diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 95a17631..7ff70029 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -75,6 +75,13 @@ & > div:nth-of-type(5) width: 25% + @media #{$xlarge-up} + & > div:first-of-type + width: 28% + @media (min-width: 2000px) + & > div:first-of-type + width: 30% + @include statusColors($green-dark, 'passed') @include statusColors($red-dark, 'failed') @include statusColors($red-dark, 'errored') From abf40de3c237a8a3aa03e53f2492ad5d49ce19ec Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 18 Sep 2015 13:59:16 +0200 Subject: [PATCH 32/52] fix list padding bug --- app/styles/app/layouts/buildheader.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/styles/app/layouts/buildheader.sass b/app/styles/app/layouts/buildheader.sass index d1050319..3438e459 100644 --- a/app/styles/app/layouts/buildheader.sass +++ b/app/styles/app/layouts/buildheader.sass @@ -60,6 +60,9 @@ font-weight: 400 & span:hover + .tooltip display: block + ul + padding: 0 + margin: 0 .repo-main-commit position: relative From 33917bf73cf9e797b188abcaeea1aee969ebb254 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 18 Sep 2015 15:02:07 +0200 Subject: [PATCH 33/52] try to refactor coloring mixins --- app/styles/app/_mixins/mixins.sass | 44 ++++++++++++++++++++ app/styles/app/components/build-tile.sass | 2 +- app/styles/app/layouts/branches.sass | 11 ----- app/styles/app/layouts/owner.sass | 16 ++----- app/styles/app/modules/tiles.sass | 19 --------- app/templates/components/owner-repo-tile.hbs | 6 +-- 6 files changed, 50 insertions(+), 48 deletions(-) diff --git a/app/styles/app/_mixins/mixins.sass b/app/styles/app/_mixins/mixins.sass index 96a48c7f..9c245cd8 100644 --- a/app/styles/app/_mixins/mixins.sass +++ b/app/styles/app/_mixins/mixins.sass @@ -64,3 +64,47 @@ font-size: $font-size-sm color: $grey-medium font-weight: 400 + + + +// @todo simplyfiy coloring mixins + +@mixin colorStatusIcons($color, $status) + .status-icon.#{$status} + svg g > * + fill: $color + +@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-title a + color: $color + @include colorStatusIcons($color, $status) + +@mixin statusColors($color, $status, $color2: $color) + &.#{$status} + background: linear-gradient(to right, $color2 0%, $color2 9px, white 10px, white 100%) no-repeat + .branch-name, + .branch-request a + color: $color + &:hover + border-color: $color + .branch-name .status-icon g > *, + .branch-request .icon-request g > * + fill: $color + + .build a, + .repo-title a + color: $color + &:hover + border-color: $color + .build-status + color: $color + @include colorStatusIcons($color, $status) diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 5c3315a8..85588c8a 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -6,7 +6,7 @@ fill: $color &:hover background-color: $extra-hover - .status-icon g > * + .status-icon.#{$status} g > * fill: $white .status-icon .circle border-color: $white diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 7ff70029..fa0b0f0a 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -1,14 +1,3 @@ -@mixin statusColors($color, $status, $color2: $color) - &.#{$status} - background: linear-gradient(to right, $color2 0%, $color2 9px, white 10px, white 100%) no-repeat - .branch-name, - .branch-request a - color: $color - &:hover - border-color: $color - .branch-name .status-icon g > *, - .branch-request .icon-request g > * - fill: $color .branches .small-title diff --git a/app/styles/app/layouts/owner.sass b/app/styles/app/layouts/owner.sass index 2c81884c..36cc992c 100644 --- a/app/styles/app/layouts/owner.sass +++ b/app/styles/app/layouts/owner.sass @@ -97,18 +97,6 @@ padding: 0 line-height: 1 -@mixin statusColors($color, $status) - &.#{$status} - background: linear-gradient(to right, $color 0%, $color 9px, transparent 10px, transparent 100%) no-repeat; - .build a, - .repo-title a - color: $color - &:hover - border-color: $color - .build-status - color: $color - - .owner-tile padding: .8em 0 .8em 2em margin-bottom: .5em @@ -122,6 +110,10 @@ .repo-title a:hover text-decoration: underline + .status-icon + width: 1.3em + height: 1.1em + .icon--job, .icon-push, .icon-pull_request, diff --git a/app/styles/app/modules/tiles.sass b/app/styles/app/modules/tiles.sass index 924e6087..4b6e2449 100644 --- a/app/styles/app/modules/tiles.sass +++ b/app/styles/app/modules/tiles.sass @@ -1,22 +1,3 @@ -@mixin colorStatusIcons($color, $status) - .status-icon.#{$status} - svg g > * - fill: $color - -@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-title a - color: $color - - @include colorStatusIcons($color, $status) .tile @extend %border-radius-4px diff --git a/app/templates/components/owner-repo-tile.hbs b/app/templates/components/owner-repo-tile.hbs index e67440c4..d246a1d5 100644 --- a/app/templates/components/owner-repo-tile.hbs +++ b/app/templates/components/owner-repo-tile.hbs @@ -2,11 +2,7 @@
    {{/if}} --}}
    - {{#if isAnimating}} - - {{else}} - - {{/if}} + {{status-icon status=repo.default_branch.last_build.state}}

    {{#link-to "repo" ownerName repoName }}{{repoName}}{{/link-to}}

    {{#if repo.default_branch.last_build}} From ace639adc052c0fe97f279c5c8eaa59d8be76e57 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 18 Sep 2015 15:25:25 +0200 Subject: [PATCH 34/52] update icons on owner page --- app/styles/app/layouts/branches.sass | 2 +- app/styles/app/layouts/owner.sass | 19 +---- app/templates/components/owner-repo-tile.hbs | 76 +++++++++++++++++--- 3 files changed, 67 insertions(+), 30 deletions(-) diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index fa0b0f0a..e3bb9f14 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -66,7 +66,7 @@ @media #{$xlarge-up} & > div:first-of-type - width: 28% + width: 27% @media (min-width: 2000px) & > div:first-of-type width: 30% diff --git a/app/styles/app/layouts/owner.sass b/app/styles/app/layouts/owner.sass index 36cc992c..cdd62b9c 100644 --- a/app/styles/app/layouts/owner.sass +++ b/app/styles/app/layouts/owner.sass @@ -110,27 +110,10 @@ .repo-title a:hover text-decoration: underline - .status-icon + .icon width: 1.3em height: 1.1em - .icon--job, - .icon-push, - .icon-pull_request, - .icon-calendar, - .icon-hash, - .icon-github - width: 1em - height: 1.1em - margin-right: .5em - background-repeat: no-repeat - background-size: 100% - - .icon--job - height: 1em - margin-top: .1em - .icon-push - margin-top: .6em .build-status text-transform: capitalize diff --git a/app/templates/components/owner-repo-tile.hbs b/app/templates/components/owner-repo-tile.hbs index d246a1d5..858a53be 100644 --- a/app/templates/components/owner-repo-tile.hbs +++ b/app/templates/components/owner-repo-tile.hbs @@ -2,32 +2,86 @@
    {{/if}} --}}
    +

    {{status-icon status=repo.default_branch.last_build.state}} -

    {{#link-to "repo" ownerName repoName }}{{repoName}}{{/link-to}}

    + {{#link-to "repo" ownerName repoName }} + {{repoName}} + {{/link-to}} +
    {{#if repo.default_branch.last_build}}
    {{#link-to "build" ownerName repoName repo.default_branch.last_build.id}} - + + + x + + {{repo.default_branch.last_build.number}} {{/link-to}}
    - -

    - {{repo.default_branch.name}} -

    + {{request-icon build=repo.default_branch.last_build}} + {{repo.default_branch.name}} +
    - - {{repo.default_branch.last_build.state}} - {{format-time repo.default_branch.last_build.finished_at}} + + + + + + + + + + {{repo.default_branch.last_build.state}} + {{format-time repo.default_branch.last_build.finished_at}}
    {{else}}

    there is no build

    From 3ef64f09102491140eb458898c5e7f1ae5aa6182 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 21 Sep 2015 18:56:00 +0200 Subject: [PATCH 35/52] start redoing dashboard --- app/components/dashboard-row.coffee | 55 ++++ app/routes/dashboard/repositories.coffee | 3 +- app/styles/app/_mixins/mixins.sass | 8 +- app/styles/app/layouts/branches.sass | 4 +- app/styles/app/layouts/dashboard.sass | 277 ++++++--------------- app/templates/components/branch-row.hbs | 16 +- app/templates/components/dashboard-row.hbs | 151 +++++++++++ app/templates/dashboard/repositories.hbs | 45 +--- 8 files changed, 303 insertions(+), 256 deletions(-) create mode 100644 app/components/dashboard-row.coffee create mode 100644 app/templates/components/dashboard-row.hbs diff --git a/app/components/dashboard-row.coffee b/app/components/dashboard-row.coffee new file mode 100644 index 00000000..410c4e81 --- /dev/null +++ b/app/components/dashboard-row.coffee @@ -0,0 +1,55 @@ +`import Ember from 'ember'` +`import { githubCommit as githubCommitUrl } from 'travis/utils/urls'` +`import config from 'travis/config/environment'` + +DashboardRowComponent = Ember.Component.extend + + tagName: 'li' + classNameBindings: ['repo.last_build.state'] + classNames: ['dashboard-row'] + isLoading: false + isTriggering: false + hasTriggered: false + + urlGithubCommit: (-> + githubCommitUrl(@get('repo.slug'), @get('repo.default_branch.last_build.commit.sha')) + ).property('repo.last_build') + + # canTrigger: (-> + # if !@get('auth.signedIn') + # false + # else + # permissions = @get('auth.currentUser.permissions') + # if permissions.contains parseInt(@get('build.repository.id')) + # true + # else + # false + # ).property() + + # triggerBuild: (-> + # apiEndpoint = config.apiEndpoint + # repoId = @get('build.repository.id') + # options = { + # type: 'POST', + # body: { + # request: { + # branch: @get('build.name') + # } + # } + # } + # if @get('auth.signedIn') + # options.headers = { Authorization: "token #{@auth.token()}" } + # $.ajax("#{apiEndpoint}/v3/repo/#{repoId}/requests", options).then (response) => + # @set('isTriggering', false) + # @set('hasTriggered', true) + # ) + + actions: + tiggerBuild: (branch) -> + @set('isTriggering', true) + @triggerBuild() + + # viewAllBuilds: (branch) -> + # @get('routing').transitionTo('builds') + +`export default DashboardRowComponent` diff --git a/app/routes/dashboard/repositories.coffee b/app/routes/dashboard/repositories.coffee index 1cc081e3..93976fd5 100644 --- a/app/routes/dashboard/repositories.coffee +++ b/app/routes/dashboard/repositories.coffee @@ -7,8 +7,7 @@ Route = TravisRoute.extend filter: { replace: true } model: -> apiEndpoint = config.apiEndpoint - $.ajax(apiEndpoint + '/v3/repos?repository.active=true', { - # $.ajax(apiEndpoint + '/v3/#{params.owner}?include=user.repositories,organization.repositories,build.commit', { + $.ajax(apiEndpoint + '/v3/repos?repository.active=true&include=build.commit', { headers: { Authorization: 'token ' + @auth.token() } diff --git a/app/styles/app/_mixins/mixins.sass b/app/styles/app/_mixins/mixins.sass index 9c245cd8..dc8ae160 100644 --- a/app/styles/app/_mixins/mixins.sass +++ b/app/styles/app/_mixins/mixins.sass @@ -91,13 +91,13 @@ @mixin statusColors($color, $status, $color2: $color) &.#{$status} background: linear-gradient(to right, $color2 0%, $color2 9px, white 10px, white 100%) no-repeat - .branch-name, - .branch-request a + .row-name, + .row-request a color: $color &:hover border-color: $color - .branch-name .status-icon g > *, - .branch-request .icon-request g > * + .row-name .status-icon g > *, + .row-request .icon-request g > * fill: $color .build a, diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index e3bb9f14..083247f8 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -101,13 +101,13 @@ @extend %row-element .row-item display: inline-block - .branch-nav + .row-nav display: none text-align: center @media #{$medium-up} display: block -.branch-last-build +.row-last-build @media #{$medium-up} padding-left: 1em &:before diff --git a/app/styles/app/layouts/dashboard.sass b/app/styles/app/layouts/dashboard.sass index 8fbbc463..5a8aec0a 100644 --- a/app/styles/app/layouts/dashboard.sass +++ b/app/styles/app/layouts/dashboard.sass @@ -1,224 +1,95 @@ -/* - * Dashboard List - */ -@mixin colorDbelements($color, $icon) - .db-status - background-color: $color - .icon-star - @extend %icon-star-#{$icon} - .db-repo - h2, h3, a - color: $color - .db-job - color: $color - a + +@mixin colorDashboardTiles($color, $status, $color2: $color) + &.#{$status} + .row-request color: $color -$db-gray: #C9C9C9 -$db-text-color: #ACAAAA .dashboard - color: $grey-medium - hr + .centered + margin: auto max-width: 1024px - margin: auto - border-top: none - border-bottom: $db-gray dashed 1px -.dashboard--empty - padding: 2em 5em - background: $cream-light - color: #979597 - font-size: 20px - font-weight: 400 - text-align: center - @extend border-radius-4px - p .icon - width: 1.5em - height: 1.5em - transform: translate(-20%, 18%) - .icon-star - @extend %icon-star-grey +.dashboard-active li -.db - @include resetul - margin: auto - position: relative - margin-bottom: 1em - background: $cream-light - @extend border-radius-4px + padding: 0 + margin: 0 + list-style-type: none - h2, h3, p - margin: 0 - font-weight: 400 - white-space: nowrap - - p - font-size: $font-size-m + border: 1px solid $cream-dark + font-size: 16px + text-align: left + margin-bottom: .3rem + color: $grey-dark + background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat .icon - position: absolute - left: 0 - top: 0 - bottom: 0 - margin: auto - - &.started, - &.created - @include colorDbelements($start-color, yellow) - &.failed - @include colorDbelements($fail-color, red) - &.errored - @include colorDbelements($error-color, red) - &.canceled - @include colorDbelements($cancel-color, grey) - &.passed - @include colorDbelements($pass-color, green) - &.inactive - @include colorDbelements($cancel-color, grey) - -.db-repo - padding-left: 3em - transform: translateY(0.4em) - overflow: hidden - margin-bottom: 1em - &:after - content: "" - @include fadeOut(right, -90deg, $cream-light) - @media #{$medium-up} - margin-bottom: 0 - -.db-status - position: absolute; - top: 0 - left: 0 - height: 100% - width: 2.5em - border-top-left-radius: 4px - border-bottom-left-radius: 4px - - .icon - width: 1.1em - height: 1.1em - right: 0 - .icon-status - top: -6em - .icon-star - top: 1.7em - opacity: .9 - -.db-controls - line-height: 2.2 - p, - button - display: inline-block - button - margin-left: 1em - a:hover - text-decoration: underline - - .icon - width: 1em - height: 1.1em - .icon-branch width: 1.3em - height: .8em + height: 1.3em + margin-right: .2em + display: inline-block + vertical-align: middle -.db-job, -.db-branch, -.db-commit, -.db-timeago - position: relative - padding-left: 1.5em - z-index: 30 - overflow: hidden - -.db-branch - position: relative - &:after - content: "" - @include fadeOut(right, -90deg, $cream-light) - -.db-lock - position: absolute - left: -2.1em; - top: 1.2em; - .icon - width: 1em - height: 1em - -.db-activation - margin: 1em 0 .5em - text-align: right - padding-right: 0 - @media #{$medium-up} + h2, h3 margin: 0 + font-weight: 300 -.db-burger - position: absolute; - top: 0 - right: 0 - height: 4em - width: 4em - cursor: pointer - z-index: 30 - .icon - width: 2em - height: 2em - right: 0 + h3 + font-size: 16px -.dropdown--db - display: none + h2 + padding-left: 1.5em + font-size: 18px -.db-burger:hover ~ .dropdown--db, -.dropdown--db:hover - display: block + .row-item + margin: .2em + font-size: 16px + font-weight: 300 + white-space: nowrap + overflow: hidden + a + color: $grey-dark + text-decoration: none + &:hover + text-decoration: underline -.dashboard-starred, -.dashboard-active, -.dashboard-inactive - padding: 0 3em - margin: 3em 0 3em - -.dashboard-starred - .db - padding-bottom: .2em - @media #{$medium-up} - width: grid-calc(17, 36) - &:nth-child(2n) - float: right - &:nth-child(2n + 1) - float: left - .db-controls - padding-left: 3em - -.dashboard-active, -.dashboard-inactive - .db-repo, - .db-controls - padding-left: 4em @media #{$medium-up} - .db - height: 57px - .db-repo - padding-left: 4em - .db-controls - padding: 0 4em 0 2em - line-height: 3em - transform: translateY(26%) - border-left: 1px solid $cream-dark - .db-burger - height: 100% - .db-status - .icon-status - top: -2em + & > div:first-of-type + width: 27% + position: relative + padding-left: 1em + &:after + content: "" + @include fadeOut(right, -90deg, $white) + & > div:nth-of-type(2) + width: 25% + & > div:nth-of-type(3) + width: 18% + & > div:nth-of-type(4) + width: 18% + & > div:nth-of-type(5) + width: 10% + + + @include statusColors($green-dark, 'passed') + @include statusColors($red-dark, 'failed') + @include statusColors($red-dark, 'errored') + @include statusColors($grey-medium, 'canceled') + @include statusColors(#bfb502, 'started', #e5da3f) + @include statusColors(#bfb502, 'queued', #e5da3f) + @include statusColors(#bfb502, 'booting', #e5da3f) + @include statusColors(#bfb502, 'received', #e5da3f) + @include statusColors(#bfb502, 'created', #e5da3f) + + @include colorDashboardTiles($green-dark, 'passed') + @include colorDashboardTiles($red-dark, 'failed') + @include colorDashboardTiles($red-dark, 'errored') + @include colorDashboardTiles($grey-medium, 'canceled') + @include colorDashboardTiles(#bfb502, 'started', #e5da3f) + @include colorDashboardTiles(#bfb502, 'queued', #e5da3f) + @include colorDashboardTiles(#bfb502, 'booting', #e5da3f) + @include colorDashboardTiles(#bfb502, 'received', #e5da3f) + @include colorDashboardTiles(#bfb502, 'created', #e5da3f) -.dashboard-inactive - margin-bottom: 5e3 - .db - h2, h3, p, button, .db-status - opacity: .7 -.dashboard .topbar - background-color: transparent !important diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 08c653c7..4f62166d 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -1,9 +1,9 @@
    -
    +

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

    -
    +
    @@ -33,8 +33,8 @@
    -
    -
    +
    +
    {{#if build.last_build}} {{#link-to "build" build.repository.slug build.last_build.id}} @@ -46,7 +46,7 @@ {{/if}}
    -
    +
    @@ -74,7 +74,7 @@
    -
    + -
    +
    {{#if build.last_build}} avatar{{build.last_build.commit.committer.name}} @@ -126,7 +126,7 @@ {{#if canTrigger}} {{#if build.last_build}} -
    +
    diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs new file mode 100644 index 00000000..11c9066f --- /dev/null +++ b/app/templates/components/dashboard-row.hbs @@ -0,0 +1,151 @@ + +
    +
    +

    {{status-icon status=repo.last_build.state}} {{repo.owner.login}}

    +

    {{repo.name}}

    +
    +
    + +
    +
    +
    + {{!-- {{#link-to "build" repo.slug repo.default_branch.last_build.id}} --}} + {{request-icon build=repo.last_build}} + #{{repo.last_build.number}} {{repo.last_build.state}} on {{repo.default_branch.name}} + {{!-- {{/link-to}} --}} +
    +
    +
    + +
    + +
    +
    +
    + + + + + + + + + + + {{#if repo.last_build}} + {{format-time repo.last_build.finished_at}} + {{else}} + - + {{/if}} +
    +
    +
    + +
    + + {{!--
    + +
    --}} +
    diff --git a/app/templates/dashboard/repositories.hbs b/app/templates/dashboard/repositories.hbs index c5ad82c8..235821f3 100644 --- a/app/templates/dashboard/repositories.hbs +++ b/app/templates/dashboard/repositories.hbs @@ -7,51 +7,22 @@
    -
    -
    +
    + {{!--

    Want to keep an eye on certain projects? Star repositories below to add them in this section.

    -
    - -
    +
    --}} +
      {{#each repo in filteredRepositories}} -
      - {{#if repo.private }} -
      - {{/if}} -
      - - -
      -
      -

      {{repo.owner.login}}

      -

      {{#link-to "repo" repo.owner.login repo.name}}{{repo.name}}{{/link-to}}

      -
      -
      -

      - {{#link-to "build" repo.owner.login repo.name repo.last_build.id}} - {{repo.last_build.number}} {{repo.last_build.state}} - {{/link-to}}

      -

      master

      -

      394348a

      -

      {{format-time repo.last_build.finished_at}}

      -
      -
      - -
      - -
      + {{dashboard-row repo=repo}} {{/each}} -
    +
    -
    -
    +
      +
    From a964272df2c44407f16a920d37dd56506a521ba2 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 22 Sep 2015 17:49:11 +0200 Subject: [PATCH 36/52] change some styles on dashboard --- app/routes/dashboard/repositories.coffee | 2 +- app/styles/app/layouts/dashboard.sass | 22 ++++++++++--- app/styles/app/modules/dropdown.sass | 9 ++++-- app/styles/app/modules/icons.sass | 2 +- app/templates/components/dashboard-row.hbs | 36 ++++++++++------------ app/templates/dashboard/repositories.hbs | 2 +- 6 files changed, 44 insertions(+), 29 deletions(-) diff --git a/app/routes/dashboard/repositories.coffee b/app/routes/dashboard/repositories.coffee index 93976fd5..252f9a6a 100644 --- a/app/routes/dashboard/repositories.coffee +++ b/app/routes/dashboard/repositories.coffee @@ -7,7 +7,7 @@ Route = TravisRoute.extend filter: { replace: true } model: -> apiEndpoint = config.apiEndpoint - $.ajax(apiEndpoint + '/v3/repos?repository.active=true&include=build.commit', { + $.ajax(apiEndpoint + '/v3/repos?repository.active=true&include=user.repositories,organization.repositories,build.commit', { headers: { Authorization: 'token ' + @auth.token() } diff --git a/app/styles/app/layouts/dashboard.sass b/app/styles/app/layouts/dashboard.sass index 5a8aec0a..58e56f48 100644 --- a/app/styles/app/layouts/dashboard.sass +++ b/app/styles/app/layouts/dashboard.sass @@ -11,12 +11,13 @@ margin: auto max-width: 1024px -.dashboard-active li - +.dashboard-active padding: 0 - margin: 0 + margin: 3rem 0 5rem list-style-type: none +.dashboard-active li + border: 1px solid $cream-dark font-size: 16px text-align: left @@ -39,8 +40,11 @@ font-size: 16px h2 - padding-left: 1.5em font-size: 18px + .one-line + margin-left: 2em + .two-line + padding: .1em 0 .row-item margin: .2em @@ -71,6 +75,16 @@ & > div:nth-of-type(5) width: 10% + h2 + padding-left: 1.5em + .one-line + margin-left: 0 + + .dropup--blue + li + border: none + transform: translate(-19%, -170%) + @include statusColors($green-dark, 'passed') @include statusColors($red-dark, 'failed') diff --git a/app/styles/app/modules/dropdown.sass b/app/styles/app/modules/dropdown.sass index 1f1ea8a1..ee34d863 100644 --- a/app/styles/app/modules/dropdown.sass +++ b/app/styles/app/modules/dropdown.sass @@ -55,6 +55,8 @@ $dropdown-border: #C3D9DB .filter-current padding: .9em 0 cursor: pointer + a + color: $teal-dark .filter-dropdown @include resetul @@ -62,9 +64,10 @@ $dropdown-border: #C3D9DB top: 3em min-width: 14em background-color: $white - border-radius: 4px + border-radius: 2px overflow: hidden - box-shadow: 2px 1px 4px 0px rgba(148,145,138,0.4) + border: 1px solid $cream-dark + border-top: none z-index: 40 display: none li @@ -75,7 +78,7 @@ $dropdown-border: #C3D9DB padding: 10px 10px 10px 20px &:hover color: $white - background : #5e869a + background : $teal-dark .is-selected a font-weight: 600 diff --git a/app/styles/app/modules/icons.sass b/app/styles/app/modules/icons.sass index a31b007c..bab6eaf2 100644 --- a/app/styles/app/modules/icons.sass +++ b/app/styles/app/modules/icons.sass @@ -217,7 +217,7 @@ margin-left : 5px border-left : 5px solid transparent border-right : 5px solid transparent - border-top : 5px solid $dashboard-text-color + border-top : 5px solid $teal-dark .icon-flag background-image: inline-image('svg/notice-flag.svg') diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs index 11c9066f..b5302446 100644 --- a/app/templates/components/dashboard-row.hbs +++ b/app/templates/components/dashboard-row.hbs @@ -1,7 +1,7 @@
    -

    {{status-icon status=repo.last_build.state}} {{repo.owner.login}}

    +

    {{status-icon status=repo.default_branch.last_build.state}} {{repo.owner.login}}

    {{repo.name}}

    @@ -9,10 +9,8 @@
    - {{!-- {{#link-to "build" repo.slug repo.default_branch.last_build.id}} --}} - {{request-icon build=repo.last_build}} - #{{repo.last_build.number}} {{repo.last_build.state}} on {{repo.default_branch.name}} - {{!-- {{/link-to}} --}} + {{request-icon build=repo.default_branch.last_build}} + #{{repo.default_branch.last_build.number}} {{repo.default_branch.last_build.state}} on {{repo.default_branch.name}}
    @@ -47,7 +45,9 @@ - {{format-sha repo.last_build.commit.sha}} + + {{format-sha repo.default_branch.last_build.commit.sha}} +
    @@ -55,7 +55,7 @@
    -
    +
    @@ -73,8 +73,8 @@ - {{#if repo.last_build}} - {{format-time repo.last_build.finished_at}} + {{#if repo.default_branch.last_build}} + {{format-time repo.default_branch.last_build.finished_at}} {{else}} - {{/if}} @@ -98,21 +98,19 @@
    - {{!--
    +
    -
    --}} +
    diff --git a/app/templates/dashboard/repositories.hbs b/app/templates/dashboard/repositories.hbs index 235821f3..622738dc 100644 --- a/app/templates/dashboard/repositories.hbs +++ b/app/templates/dashboard/repositories.hbs @@ -21,7 +21,7 @@ {{dashboard-row repo=repo}} {{/each}} -
    + {{!--
    --}}
    From ffb635b846805a942d54529f420071f4029fe2ca Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 22 Sep 2015 17:57:57 +0200 Subject: [PATCH 37/52] switch back to default branch --- app/templates/components/dashboard-row.hbs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs index b5302446..e3d1efe0 100644 --- a/app/templates/components/dashboard-row.hbs +++ b/app/templates/components/dashboard-row.hbs @@ -1,7 +1,7 @@
    -

    {{status-icon status=repo.default_branch.last_build.state}} {{repo.owner.login}}

    +

    {{status-icon status=repo.last_build.state}} {{repo.owner.login}}

    {{repo.name}}

    @@ -9,8 +9,8 @@
    - {{request-icon build=repo.default_branch.last_build}} - #{{repo.default_branch.last_build.number}} {{repo.default_branch.last_build.state}} on {{repo.default_branch.name}} + {{request-icon build=repo.last_build}} + #{{repo.last_build.number}} {{repo.last_build.state}} on {{repo.name}}
    @@ -46,7 +46,7 @@ - {{format-sha repo.default_branch.last_build.commit.sha}} + {{format-sha repo.last_build.commit.sha}}
    @@ -55,7 +55,7 @@
    -
    +
    @@ -73,8 +73,8 @@ - {{#if repo.default_branch.last_build}} - {{format-time repo.default_branch.last_build.finished_at}} + {{#if repo.last_build}} + {{format-time repo.last_build.finished_at}} {{else}} - {{/if}} From c38a64bc2f194bf117b263f9f8fcb812e5938688 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 28 Sep 2015 14:12:04 +0200 Subject: [PATCH 38/52] fix links in dashboard templates --- app/styles/app/_mixins/mixins.sass | 2 +- app/styles/app/layouts/dashboard.sass | 13 ++++++++++++- app/templates/components/dashboard-row.hbs | 6 ++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/app/styles/app/_mixins/mixins.sass b/app/styles/app/_mixins/mixins.sass index dc8ae160..f98025d7 100644 --- a/app/styles/app/_mixins/mixins.sass +++ b/app/styles/app/_mixins/mixins.sass @@ -90,7 +90,7 @@ @mixin statusColors($color, $status, $color2: $color) &.#{$status} - background: linear-gradient(to right, $color2 0%, $color2 9px, white 10px, white 100%) no-repeat + background: linear-gradient(to right, $color2 0%, $color2 9px, white 9px, white 100%) no-repeat .row-name, .row-request a color: $color diff --git a/app/styles/app/layouts/dashboard.sass b/app/styles/app/layouts/dashboard.sass index 58e56f48..a3e7cd47 100644 --- a/app/styles/app/layouts/dashboard.sass +++ b/app/styles/app/layouts/dashboard.sass @@ -1,9 +1,20 @@ - +// .two-line, +// .one-line +// @media #{$medium-up} +// white-space: nowrap +// position:relative +// overflow: hidden +// &:after +// content: "" +// @include fadeOut(right, -90deg, $white) @mixin colorDashboardTiles($color, $status, $color2: $color) &.#{$status} .row-request color: $color + .row-name a, + .row-request a + color: $color .dashboard diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs index e3d1efe0..9d2fc268 100644 --- a/app/templates/components/dashboard-row.hbs +++ b/app/templates/components/dashboard-row.hbs @@ -1,16 +1,18 @@
    -

    {{status-icon status=repo.last_build.state}} {{repo.owner.login}}

    -

    {{repo.name}}

    +

    {{#link-to "owner" repo.owner.login}}{{status-icon status=repo.last_build.state}} {{repo.owner.login}}{{/link-to}}

    +

    {{#link-to "repo" repo.owner.login repo.name}}{{repo.name}}{{/link-to}}

    + {{#link-to "build" repo.owner.login repo.name repo.last_build.id}} {{request-icon build=repo.last_build}} #{{repo.last_build.number}} {{repo.last_build.state}} on {{repo.name}} + {{/link-to}}
    From e350f7bb04db5b16e6b2a163c72f3134fa98744a Mon Sep 17 00:00:00 2001 From: Lisa P Date: Mon, 28 Sep 2015 14:41:09 +0200 Subject: [PATCH 39/52] fix dashboard avatars and filter padding --- app/styles/app.scss | 1 - app/styles/app/layouts/branches.sass | 2 ++ app/styles/app/layouts/dashboard.sass | 5 +++++ app/styles/app/modules/section.sass | 8 -------- app/templates/components/orgs-filter.hbs | 6 +++--- app/templates/dashboard/repositories.hbs | 2 +- 6 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 app/styles/app/modules/section.sass diff --git a/app/styles/app.scss b/app/styles/app.scss index 091b7cb0..24bfdfbc 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -24,7 +24,6 @@ @import "app/animation/tractor"; -@import "app/modules/section"; @import "app/modules/loader"; @import "app/modules/tiles"; @import "app/modules/buttons"; diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 083247f8..f4176a1b 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -168,6 +168,7 @@ padding: 0.3em 0.5em color: $white text-decoration: none + line-height: 1 .icon-trigger path, .icon-eye path fill: $white @@ -192,6 +193,7 @@ padding: 0.3em .5em 0.4em text-decoration: none color: $grey-dark + line-height: 1.4 &:hover color: $white background-color: $teal-dark diff --git a/app/styles/app/layouts/dashboard.sass b/app/styles/app/layouts/dashboard.sass index a3e7cd47..4312e700 100644 --- a/app/styles/app/layouts/dashboard.sass +++ b/app/styles/app/layouts/dashboard.sass @@ -22,6 +22,11 @@ margin: auto max-width: 1024px +.dashboard-filter + padding: 0 $column-gutter/2 + @media #{$medium-up} + padding: 0 + .dashboard-active padding: 0 margin: 3rem 0 5rem diff --git a/app/styles/app/modules/section.sass b/app/styles/app/modules/section.sass deleted file mode 100644 index 4bdd6285..00000000 --- a/app/styles/app/modules/section.sass +++ /dev/null @@ -1,8 +0,0 @@ -.section - font-size: $font-size-normal - -.section--white - background-color: $white - -.section--maxheight - height: 3.3em diff --git a/app/templates/components/orgs-filter.hbs b/app/templates/components/orgs-filter.hbs index a01e4c71..41072c7c 100644 --- a/app/templates/components/orgs-filter.hbs +++ b/app/templates/components/orgs-filter.hbs @@ -5,7 +5,7 @@ {{else}} {{#if selected }} - + {{org.login}} {{#if selected.name}} {{selected.name}} {{else}} @@ -19,11 +19,11 @@
    -
    +
    --}} From 3a366a234afb7d3727dce38c0ad9043c58024b21 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 29 Sep 2015 18:15:29 +0200 Subject: [PATCH 45/52] refactor new styles --- app/components/branch-row.coffee | 2 +- app/components/dashboard-row.coffee | 2 +- app/components/owner-repo-tile.coffee | 2 +- app/controllers/dashboard/repositories.coffee | 1 - app/styles/app.scss | 1 + app/styles/app/_mixins/mixins.sass | 15 +- app/styles/app/layouts/branches.sass | 87 ++-------- app/styles/app/layouts/dashboard.sass | 81 +-------- app/styles/app/layouts/owner.sass | 92 ++--------- app/styles/app/modules/row.sass | 79 +++++++++ app/templates/components/branch-row.hbs | 2 +- app/templates/components/dashboard-row.hbs | 2 +- app/templates/components/owner-repo-tile.hbs | 156 ++++++++++-------- 13 files changed, 201 insertions(+), 321 deletions(-) create mode 100644 app/styles/app/modules/row.sass diff --git a/app/components/branch-row.coffee b/app/components/branch-row.coffee index 0c392424..43437095 100644 --- a/app/components/branch-row.coffee +++ b/app/components/branch-row.coffee @@ -8,7 +8,7 @@ BranchRowComponent = Ember.Component.extend routing: Ember.inject.service('-routing') tagName: 'li' classNameBindings: ['build.last_build.state'] - classNames: ['branch-row'] + classNames: ['branch-row', 'row-li'] isLoading: false isTriggering: false hasTriggered: false diff --git a/app/components/dashboard-row.coffee b/app/components/dashboard-row.coffee index 4ed5cbe4..62379a05 100644 --- a/app/components/dashboard-row.coffee +++ b/app/components/dashboard-row.coffee @@ -6,7 +6,7 @@ DashboardRowComponent = Ember.Component.extend tagName: 'li' classNameBindings: ['repo.default_branch.last_build.state'] - classNames: ['dashboard-row'] + classNames: ['dashboard-row', 'row-li'] isLoading: false isTriggering: false hasTriggered: false diff --git a/app/components/owner-repo-tile.coffee b/app/components/owner-repo-tile.coffee index 1f491361..d98020a1 100644 --- a/app/components/owner-repo-tile.coffee +++ b/app/components/owner-repo-tile.coffee @@ -3,7 +3,7 @@ OwnerRepoTileComponent = Ember.Component.extend tagName: 'li' - classNames: ['owner-tile'] + classNames: ['owner-tile', 'row-li'] classNameBindings: ['repo.default_branch.last_build.state'] ownerName: (-> diff --git a/app/controllers/dashboard/repositories.coffee b/app/controllers/dashboard/repositories.coffee index f536320c..cdeae39b 100644 --- a/app/controllers/dashboard/repositories.coffee +++ b/app/controllers/dashboard/repositories.coffee @@ -12,7 +12,6 @@ Controller = Ember.Controller.extend org = @get('org') repos = repos.filter (item, index) -> - console.log(item) item.get('default_branch.last_build') != null .sortBy('default_branch.last_build.finished_at') .reverse() diff --git a/app/styles/app.scss b/app/styles/app.scss index 24bfdfbc..fa7db947 100644 --- a/app/styles/app.scss +++ b/app/styles/app.scss @@ -24,6 +24,7 @@ @import "app/animation/tractor"; +@import "app/modules/row"; @import "app/modules/loader"; @import "app/modules/tiles"; @import "app/modules/buttons"; diff --git a/app/styles/app/_mixins/mixins.sass b/app/styles/app/_mixins/mixins.sass index f98025d7..5280c306 100644 --- a/app/styles/app/_mixins/mixins.sass +++ b/app/styles/app/_mixins/mixins.sass @@ -29,17 +29,6 @@ padding: 0 list-style: none -%border-radius-4px - border-radius: 4px - -%border-top-4px - border-top-left-radius: 4px - border-top-right-radius: 4px - -%border-bottom-4px - border-bottom-left-radius: 4px - border-bottom-right-radius: 4px - %absolute-center position: absolute top: 0 @@ -66,7 +55,6 @@ font-weight: 400 - // @todo simplyfiy coloring mixins @mixin colorStatusIcons($color, $status) @@ -92,7 +80,8 @@ &.#{$status} background: linear-gradient(to right, $color2 0%, $color2 9px, white 9px, white 100%) no-repeat .row-name, - .row-request a + .row-request a, + .row-color a color: $color &:hover border-color: $color diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index 12e6621d..a4f6f024 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -4,19 +4,6 @@ margin: 1.5em 0 0.7em .branch-row - border: 1px solid $cream-dark - font-size: 16px - text-align: right - margin-bottom: .3rem - color: $grey-dark - background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat - - .icon - width: 1.3em - height: 1.3em - margin-right: .2em - display: inline-block - vertical-align: middle .avatar display: inline-block @@ -27,21 +14,10 @@ vertical-align: middle background-color: #E9EBEB - .row-item - margin: .2em - font-size: 16px - font-weight: $font-weight-normal - white-space: nowrap - overflow: hidden - a - color: $grey-dark - text-decoration: none - &:hover - text-decoration: underline - @media #{$medium-up} & > div:first-of-type width: 30% + padding-left: 1em & > div:nth-of-type(2) width: 20% & > div:nth-of-type(3) @@ -50,6 +26,7 @@ // width: 5% & > div:nth-of-type(4) width: 28% + float: right @media #{$large-up} & > div:nth-of-type(2) width: 21% @@ -60,53 +37,17 @@ & > div:nth-of-type(4) width: 25% - @include statusColors($green-dark, 'passed') - @include statusColors($red-dark, 'failed') - @include statusColors($red-dark, 'errored') - @include statusColors($grey-medium, 'canceled') - @include statusColors(#bfb502, 'started', #e5da3f) - @include statusColors(#bfb502, 'queued', #e5da3f) - @include statusColors(#bfb502, 'booting', #e5da3f) - @include statusColors(#bfb502, 'received', #e5da3f) - @include statusColors(#bfb502, 'created', #e5da3f) - -%row-element - vertical-align: middle - @media #{$medium-up} - display: inline-block - .row-item - vertical-align: middle - -.two-line - @extend %row-element - padding: .4em 0 - margin-left: 2em - text-align: left - - @media #{$medium-up} - margin-left: 0 - -.one-line - @extend %row-element - .row-item - display: inline-block - .row-nav - display: none - text-align: center + .row-last-build @media #{$medium-up} - display: block - -.row-last-build - @media #{$medium-up} - padding-left: 1em - &:before - content: ""; - display: block; - width: 1px; - background-color: #EFF0EC; - position: absolute; - height: 3.7em; - margin-left: -1em; + padding-left: 1em + &:before + content: ""; + display: block; + width: 1px; + background-color: #EFF0EC; + position: absolute; + height: 3.7em; + margin-left: -1em; // @todo refactor into dropup module %dropup @@ -222,10 +163,6 @@ path fill: $teal-dark -.label-align - vertical-align: middle - line-height: 1.5 - // @todo refactor to status-icon module .status-icon .is-rotating diff --git a/app/styles/app/layouts/dashboard.sass b/app/styles/app/layouts/dashboard.sass index d7ea1667..f8a533c1 100644 --- a/app/styles/app/layouts/dashboard.sass +++ b/app/styles/app/layouts/dashboard.sass @@ -1,20 +1,3 @@ -.fade-out - @media #{$medium-up} - white-space: nowrap - position:relative - overflow: hidden - &:after - content: "" - @include fadeOut(right, -90deg, $white, 30%) - -@mixin colorDashboardTiles($color, $status, $color2: $color) - &.#{$status} - .row-request - color: $color - .row-name a, - .row-request a - color: $color - .dashboard .centered @@ -33,51 +16,20 @@ margin: 3rem 0 5rem list-style-type: none + .dashboard-active li - - border: 1px solid $cream-dark - font-size: 16px text-align: left - margin-bottom: .3rem - color: $grey-dark - background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 9px, white 100%) no-repeat - - .icon - width: 1.3em - height: 1.3em - margin-right: .2em - display: inline-block - vertical-align: middle - - h2, h3 - margin: 0 - font-weight: $font-weight-normal - - h3 - font-size: 16px - - h2 - font-size: 18px .one-line margin-left: 2em + text-align: left .two-line padding: .1em 0 - - .row-item - margin: .2em - font-size: 16px - font-weight: $font-weight-normal - white-space: nowrap - overflow: hidden - a - color: $grey-dark - text-decoration: none - &:hover - text-decoration: underline + .row-item h2 + font-size: 18px @media #{$medium-up} & > div:first-of-type - width: 28% + width: 30% position: relative padding-left: 1em &:after @@ -100,26 +52,3 @@ li border: none transform: translate(-19%, -170%) - - - @include statusColors($green-dark, 'passed') - @include statusColors($red-dark, 'failed') - @include statusColors($red-dark, 'errored') - @include statusColors($grey-medium, 'canceled') - @include statusColors(#bfb502, 'started', #e5da3f) - @include statusColors(#bfb502, 'queued', #e5da3f) - @include statusColors(#bfb502, 'booting', #e5da3f) - @include statusColors(#bfb502, 'received', #e5da3f) - @include statusColors(#bfb502, 'created', #e5da3f) - - @include colorDashboardTiles($green-dark, 'passed') - @include colorDashboardTiles($red-dark, 'failed') - @include colorDashboardTiles($red-dark, 'errored') - @include colorDashboardTiles($grey-medium, 'canceled') - @include colorDashboardTiles(#bfb502, 'started', #e5da3f) - @include colorDashboardTiles(#bfb502, 'queued', #e5da3f) - @include colorDashboardTiles(#bfb502, 'booting', #e5da3f) - @include colorDashboardTiles(#bfb502, 'received', #e5da3f) - @include colorDashboardTiles(#bfb502, 'created', #e5da3f) - - diff --git a/app/styles/app/layouts/owner.sass b/app/styles/app/layouts/owner.sass index cdd62b9c..4f611658 100644 --- a/app/styles/app/layouts/owner.sass +++ b/app/styles/app/layouts/owner.sass @@ -82,87 +82,21 @@ padding: 0 list-style-type: none -%one-line - font-size: 16px - font-weight: 400 - vertical-align: middle - margin: 0 - display: inline-block - * - display: inline-block - font-size: inherit - font-weight: 400 - vertical-align: middle - margin: 0 - padding: 0 - line-height: 1 - -.owner-tile - padding: .8em 0 .8em 2em - margin-bottom: .5em - border: #F2F0F0 solid 1px - - a - text-decoration: none - &:hover - span - text-decoration: underline - .repo-title a:hover - text-decoration: underline - - .icon - width: 1.3em - height: 1.1em - .build-status text-transform: capitalize - .repo - @extend %one-line - white-space: nowrap - width: grid-calc(9, 12) - .build - @extend %one-line - width: grid-calc(5, 12) - .branch - @extend %one-line - width: grid-calc(6, 12) - .commit - @extend %one-line - width: grid-calc(6, 12) - .duration - @extend %one-line - width: grid-calc(12, 12) +.owner-tile + padding: .4em 0 .3em @media #{$medium-up} - display: flex - flex-direction: row - flex-flow: space-between - align-items: baseline - height: 3.8em - padding: .8em 0 - - .build - width: grid-calc(2, 12) - .branch - width: grid-calc(2, 12) - .commit - width: grid-calc(2, 12) - .duration - width: grid-calc(4, 12) - .repo - width: grid-calc(4, 12) - margin-left: 2em - - - @include statusColors($green-dark, 'passed') - @include statusColors($red-dark, 'failed') - @include statusColors($red-dark, 'errored') - @include statusColors($grey-medium, 'canceled') - @include statusColors(#ECCE4B, 'started') - @include statusColors(#ECCE4B, 'queued') - @include statusColors(#ECCE4B, 'booting') - @include statusColors(#ECCE4B, 'received') - @include statusColors(#ECCE4B, 'created') - - + & > div:first-of-type + width: 30% + padding-left: 1em + & > div:nth-of-type(2) + width: 10% + & > div:nth-of-type(3) + width: 15% + & > div:nth-of-type(4) + width: 15% + & > div:nth-of-type(5) + width: 25% diff --git a/app/styles/app/modules/row.sass b/app/styles/app/modules/row.sass new file mode 100644 index 00000000..5a267809 --- /dev/null +++ b/app/styles/app/modules/row.sass @@ -0,0 +1,79 @@ +.fade-out + @media #{$medium-up} + white-space: nowrap + position:relative + overflow: hidden + &:after + content: "" + @include fadeOut(right, -90deg, $white, 30%) + +.label-align + vertical-align: middle + line-height: 1.5 + +.row-li + border: 1px solid $cream-dark + font-size: 16px + margin-bottom: .3rem + color: $grey-dark + background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat + + .row-item + display: inline-block + margin: .2em + font-size: 16px + font-weight: $font-weight-normal + white-space: nowrap + overflow: hidden + a + color: $grey-dark + text-decoration: none + &:hover + text-decoration: underline + h2, h3 + margin: 0 + font-weight: $font-weight-normal + font-size: 16px + + %row-element + vertical-align: middle + @media #{$medium-up} + display: inline-block + .row-item + vertical-align: middle + + .two-line + @extend %row-element + padding: .4em 0 + margin-left: 2em + text-align: left + + @media #{$medium-up} + margin-left: 0 + + .one-line + @extend %row-element + .row-item + display: inline-block + .row-nav + display: none + text-align: center + @media #{$medium-up} + display: block + + .icon + width: 1.3em + height: 1.3em + margin-right: .2em + display: inline-block + vertical-align: middle + + @include statusColors($green-dark, 'passed') + @include statusColors($red-dark, 'failed') + @include statusColors($red-dark, 'errored') + @include statusColors($grey-medium, 'canceled') + @include statusColors(#bfb502, 'started', #e5da3f) + @include statusColors(#bfb502, 'queued', #e5da3f) + @include statusColors(#bfb502, 'booting', #e5da3f) + @include statusColors(#bfb502, 'received', #e5da3f) + @include statusColors(#bfb502, 'created', #e5da3f) \ No newline at end of file diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 009350d5..9baf6753 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -33,7 +33,7 @@
    -
    +
    {{#if build.last_build}} diff --git a/app/templates/components/dashboard-row.hbs b/app/templates/components/dashboard-row.hbs index 80f1bca2..035f9d26 100644 --- a/app/templates/components/dashboard-row.hbs +++ b/app/templates/components/dashboard-row.hbs @@ -1,6 +1,6 @@
    -
    +

    {{#link-to "owner" repo.owner.login}}{{status-icon status=repo.default_branch.last_build.state}} {{repo.owner.login}}{{/link-to}}

    {{#link-to "repo" repo.owner.login repo.name}}{{repo.name}}{{/link-to}}

    diff --git a/app/templates/components/owner-repo-tile.hbs b/app/templates/components/owner-repo-tile.hbs index e818221c..f47ab4b7 100644 --- a/app/templates/components/owner-repo-tile.hbs +++ b/app/templates/components/owner-repo-tile.hbs @@ -1,87 +1,99 @@ {{!-- {{#if repo.private }}
    {{/if}} --}} -
    -

    - {{status-icon status=repo.default_branch.last_build.state}} - {{#link-to "repo" ownerName repoName }} - {{repoName}} - {{/link-to}} -

    +
    +
    +

    + {{status-icon status=repo.default_branch.last_build.state}} + {{#link-to "repo" ownerName repoName }} + {{repoName}} + {{/link-to}} +

    +
    {{#if repo.default_branch.last_build}} -
    - {{#link-to "build" ownerName repoName repo.default_branch.last_build.id}} - - - x +
    +
    + {{#link-to "build" ownerName repoName repo.default_branch.last_build.id}} + + + x + + + {{repo.default_branch.last_build.number}} + {{/link-to}} +
    +
    + +
    +
    + {{request-icon build=repo.default_branch.last_build}} + {{repo.default_branch.name}} +
    +
    + + -
    - {{request-icon build=repo.default_branch.last_build}} - {{repo.default_branch.name}} - -
    -
    - + +
    + -
    - - - - - - - - - - {{repo.default_branch.last_build.state}} - {{format-time repo.default_branch.last_build.finished_at}} + {{repo.default_branch.last_build.state}} + {{format-time repo.default_branch.last_build.finished_at}} +
    {{else}}

    there is no build

    From 4687957514cda6027831e5fbf8a362d68ccc6336 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Tue, 29 Sep 2015 18:20:23 +0200 Subject: [PATCH 46/52] fix mobile for owner page --- app/styles/app/modules/row.sass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/styles/app/modules/row.sass b/app/styles/app/modules/row.sass index 5a267809..66fe4670 100644 --- a/app/styles/app/modules/row.sass +++ b/app/styles/app/modules/row.sass @@ -19,12 +19,12 @@ background: linear-gradient(to right, #CACECE 0%, #CACECE 9px, white 10px, white 100%) no-repeat .row-item - display: inline-block margin: .2em font-size: 16px font-weight: $font-weight-normal white-space: nowrap overflow: hidden + padding-left: 1em a color: $grey-dark text-decoration: none @@ -34,6 +34,9 @@ margin: 0 font-weight: $font-weight-normal font-size: 16px + @media #{$medium-up} + display: inline-block + padding-left: 0 %row-element vertical-align: middle From eb502c90941784bb74abe645d74986acbeb4a1bd Mon Sep 17 00:00:00 2001 From: Lisa P Date: Wed, 30 Sep 2015 18:18:51 +0200 Subject: [PATCH 47/52] fix some tests --- tests/acceptance/dashboard-test.coffee | 4 ++-- tests/unit/components/owner-repo-tile-test.coffee | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/acceptance/dashboard-test.coffee b/tests/acceptance/dashboard-test.coffee index f3b2a29a..94844ce5 100644 --- a/tests/acceptance/dashboard-test.coffee +++ b/tests/acceptance/dashboard-test.coffee @@ -63,5 +63,5 @@ test 'visiting /dashboard', -> visit '/dashboard' andThen -> - equal find('.dashboard-active .row').length, 1, 'there should be one repo displayed on dashboard' - equal find('.dashboard-active .row h2').text(), 'travis-web', 'travis-web repository should be displayed' + equal find('.dashboard-active .dashboard-row').length, 1, 'there should be one repo displayed on dashboard' + equal find('.dashboard-active .dashboard-row h2').text(), 'travis-web', 'travis-web repository should be displayed' diff --git a/tests/unit/components/owner-repo-tile-test.coffee b/tests/unit/components/owner-repo-tile-test.coffee index 7b705ddf..2e5271e3 100644 --- a/tests/unit/components/owner-repo-tile-test.coffee +++ b/tests/unit/components/owner-repo-tile-test.coffee @@ -2,7 +2,7 @@ moduleForComponent 'owner-repo-tile', 'OwnerRepoTileComponent', { # specify the other units that are required for this test - needs: ['helper:format-time', 'helper:format-duration', 'helper:format-sha'] + needs: ['helper:format-time', 'helper:format-duration', 'helper:format-sha', 'component:status-icon', 'component:request-icon'] } test 'it renders', -> @@ -35,8 +35,6 @@ test 'it renders', -> @append() ok component.$().hasClass('passed'), 'component should have state class (passed)' - equal component.$('.repo-title a').text().trim(), 'travis-chat', 'should display correct repo name' - equal component.$('.build a').text().trim(), '25', 'should display correct build numbee' - equal component.$('.build-status').text().trim(), 'passed', 'should display a last build state' - equal component.$('.commit a').text().trim(), '16fff34', 'should display correct commit sha' - equal component.$('.finished-at').text().trim(), '2 years ago', 'should display correct build duration' + equal component.$('.row-item:nth-of-type(1)').text().trim(), 'travis-chat', 'should display correct repo name' + equal component.$('.row-item:nth-of-type(3)').text().trim(), 'master', 'should display branch name' + equal component.$('.row-item:nth-of-type(4)').text().trim(), '16fff34', 'should display correct commit sha' From d07afa8b6f6a41640b4f0c56aa6ac357a8a0a85c Mon Sep 17 00:00:00 2001 From: Lisa P Date: Wed, 30 Sep 2015 18:27:39 +0200 Subject: [PATCH 48/52] also remove trigger build from branches without builds --- app/templates/components/branch-row.hbs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/components/branch-row.hbs b/app/templates/components/branch-row.hbs index 9baf6753..3aa513c5 100644 --- a/app/templates/components/branch-row.hbs +++ b/app/templates/components/branch-row.hbs @@ -207,7 +207,7 @@ {{/each}} {{/if}} - {{#unless build.last_build}} + {{!-- {{#unless build.last_build}} {{#unless inactive}} {{#if canTrigger}} @@ -243,5 +243,5 @@ {{/if}} {{/if}} {{/unless}} - {{/unless}} + {{/unless}} --}}
    From 27cb6035a3be1cafbc195ac12a1eb3c47c91e7b9 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 2 Oct 2015 13:35:59 +0200 Subject: [PATCH 49/52] fixed weird spacing and responsive behaviour with flexbox --- app/styles/app/components/build-tile.sass | 4 ++-- app/styles/app/layouts/branches.sass | 3 ++- app/styles/app/layouts/owner.sass | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/styles/app/components/build-tile.sass b/app/styles/app/components/build-tile.sass index 85588c8a..b796c827 100644 --- a/app/styles/app/components/build-tile.sass +++ b/app/styles/app/components/build-tile.sass @@ -20,7 +20,7 @@ .build-tiles - height: 5.6rem + height: 4.7em margin: 0 padding: 0 clear: both @@ -28,8 +28,8 @@ li position: relative height: 100% - width: 20% float: left + width: 20% background-color: #F7F7F7 border-right: 1px solid $white &:last-of-type diff --git a/app/styles/app/layouts/branches.sass b/app/styles/app/layouts/branches.sass index a4f6f024..ba31a64f 100644 --- a/app/styles/app/layouts/branches.sass +++ b/app/styles/app/layouts/branches.sass @@ -15,6 +15,8 @@ background-color: #E9EBEB @media #{$medium-up} + display: flex + justify-content: space-between & > div:first-of-type width: 30% padding-left: 1em @@ -26,7 +28,6 @@ // width: 5% & > div:nth-of-type(4) width: 28% - float: right @media #{$large-up} & > div:nth-of-type(2) width: 21% diff --git a/app/styles/app/layouts/owner.sass b/app/styles/app/layouts/owner.sass index 4f611658..f599efe3 100644 --- a/app/styles/app/layouts/owner.sass +++ b/app/styles/app/layouts/owner.sass @@ -99,4 +99,4 @@ & > div:nth-of-type(4) width: 15% & > div:nth-of-type(5) - width: 25% + width: 24% From 42b75fab6a52ad6446ca1e64ed1ef94748456846 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 2 Oct 2015 14:36:28 +0200 Subject: [PATCH 50/52] add a unit test for branch-row --- tests/unit/components/branch-row.coffee | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tests/unit/components/branch-row.coffee diff --git a/tests/unit/components/branch-row.coffee b/tests/unit/components/branch-row.coffee new file mode 100644 index 00000000..fb617ecd --- /dev/null +++ b/tests/unit/components/branch-row.coffee @@ -0,0 +1,51 @@ +`import { test, moduleForComponent } from 'ember-qunit'` + +moduleForComponent 'branch-row', 'BranchRowComponent', { + # specify the other units that are required for this test + needs: ['helper:format-time', 'helper:format-duration', 'helper:format-sha', 'component:status-icon', 'component:request-icon'] +} + +test 'it renders', -> + + attributes = { + name: "local-test", + repository: { + id: 13661, + slug: "meatballhat/yolo-octo-adventure", + default_branch: { + name: "master", + last_build: { + id: 434835, + number: "1086", + state: "passed", + duration: 11, + event_type: "push", + previous_state: "passed", + started_at: "2015-08-24T21:34:22Z", + finished_at: "2015-08-24T21:35:14Z", + commit: { + sha: "0e9d8ebc78d2192cc599580751763a5dd6be0ccd", + committer: { + name: "Dan Buch", + avatar_url: "https://0.gravatar.com/avatar/563fd372b4d51781853bc85147f06a36" + }, + author: { + name: "Dan Buch", + avatar_url: "https://0.gravatar.com/avatar/563fd372b4d51781853bc85147f06a36" + } + } + } + } + } + } + + + component = @subject(repo: attributes) + + @append() + + ok component.$().hasClass('passed'), 'component should have state class (passed)' + equal component.$('.row-name').text().trim(), 'master', 'should display correct branch name' + equal component.$('.row-request').text().trim(), '#1086 passed', 'should display build number and state' + equal component.$('.row-commiter').text().trim(), 'Dan Buch', 'should display correct commiter name' + equal component.$('.row-commit').text().trim(), '0e9d8eb', 'should display correct commit sha' From a6ca21f03dc690880cd96772c449da2e02126592 Mon Sep 17 00:00:00 2001 From: Lisa P Date: Fri, 2 Oct 2015 14:49:10 +0200 Subject: [PATCH 51/52] remove some deprecation errors --- app/templates/account.hbs | 4 ++-- app/templates/branches.hbs | 4 ++-- app/templates/caches.hbs | 4 ++-- app/templates/components/branch-row.hbs | 2 +- app/templates/components/flash-display.hbs | 2 +- app/templates/components/jobs-list.hbs | 2 +- app/templates/components/orgs-filter.hbs | 2 +- app/templates/home.hbs | 2 +- app/templates/jobs.hbs | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/templates/account.hbs b/app/templates/account.hbs index 93a0d8f0..abfc6c97 100644 --- a/app/templates/account.hbs +++ b/app/templates/account.hbs @@ -73,7 +73,7 @@