diff --git a/app/controllers/queue.coffee b/app/controllers/queue.coffee index cabd5b7f..a89d1b28 100644 --- a/app/controllers/queue.coffee +++ b/app/controllers/queue.coffee @@ -1,9 +1,14 @@ `import Ember from 'ember'` Controller = Ember.ArrayController.extend + isLoaded: false content: (-> - @store.filter 'job', {}, (job) -> + result = @store.filter('job', {}, (job) -> ['created', 'queued'].indexOf(job.get('state')) != -1 + ) + result.then => + @set('isLoaded', true) + result ).property() `export default Controller` diff --git a/app/controllers/repos.coffee b/app/controllers/repos.coffee index 5299869a..390500f6 100644 --- a/app/controllers/repos.coffee +++ b/app/controllers/repos.coffee @@ -7,6 +7,19 @@ Controller = Ember.ArrayController.extend activate: (name) -> @activate(name) + showRunningJobs: -> + @activate('running') + + showMyRepositories: -> + # this is a bit of a hack. I don't want to switch URL for 'running' + # so depending on current state I'm either just switching back or + # redirecting + if @get('tab') == 'running' + @activate('owned') + else + @transitionToRoute('main.repositories') + + tabOrIsLoadedDidChange: (-> @possiblyRedirectToGettingStartedPage() ).observes('isLoaded', 'tab', 'length') @@ -17,7 +30,7 @@ Controller = Ember.ArrayController.extend @container.lookup('router:main').send('redirectToGettingStarted') isLoadedBinding: 'content.isLoaded' - needs: ['currentUser', 'repo'] + needs: ['currentUser', 'repo', 'runningJobs', 'queue'] currentUserBinding: 'controllers.currentUser' selectedRepo: (-> # we need to observe also repo.content here, because we use @@ -26,6 +39,11 @@ Controller = Ember.ArrayController.extend @get('controllers.repo.repo.content') || @get('controllers.repo.repo') ).property('controllers.repo.repo', 'controllers.repo.repo.content') + startedJobsCount: Ember.computed.alias('controllers.runningJobs.length') + allJobsCount: (-> + @get('startedJobsCount') + @get('controllers.queue.length') + ).property('startedJobsCount', 'controllers.queue.length') + init: -> @_super.apply this, arguments if !Ember.testing @@ -57,6 +75,8 @@ Controller = Ember.ArrayController.extend viewOwned: -> @set('content', @get('userRepos')) + viewRunning: -> + userRepos: (-> if login = @get('currentUser.login') Repo.accessibleBy(@store, login) @@ -91,4 +111,8 @@ Controller = Ember.ArrayController.extend 'Could not find any repos' ).property('tab') + showRunningJobs: (-> + @get('tab') == 'running' + ).property('tab') + `export default Controller` diff --git a/app/controllers/running-jobs.coffee b/app/controllers/running-jobs.coffee index 44ca18fc..d7d21cb6 100644 --- a/app/controllers/running-jobs.coffee +++ b/app/controllers/running-jobs.coffee @@ -1,9 +1,14 @@ `import Ember from 'ember'` Controller = Ember.ArrayController.extend + isLoaded: false content: (-> - @store.filter 'job', { state: 'started' }, (job) -> + result = @store.filter('job', { state: 'started' }, (job) -> ['started', 'received'].indexOf(job.get('state')) != -1 + ) + result.then => + @set('isLoaded', true) + result ).property() `export default Controller` diff --git a/app/controllers/sidebar.coffee b/app/controllers/sidebar.coffee deleted file mode 100644 index 47336d56..00000000 --- a/app/controllers/sidebar.coffee +++ /dev/null @@ -1,19 +0,0 @@ -`import Ember from 'ember'` - -Controller = Ember.ArrayController.extend - init: -> - @_super.apply this, arguments - @tickables = [] - - tips: [ - "Did you know that you can parallelize tests on Travis CI? Learn more" - "Did you know that you can split a build into several smaller pieces? Learn more" - "Did you know that you can skip a build? Learn more" - ] - - tip: (-> - if tips = @get('tips') - tips[Math.floor(Math.random()*tips.length)] - ).property().volatile() - -`export default Controller` diff --git a/app/styles/app/layout.sass b/app/styles/app/layout.sass index aea15936..fae03927 100644 --- a/app/styles/app/layout.sass +++ b/app/styles/app/layout.sass @@ -75,15 +75,15 @@ min-height: 100vh #left - width: grid-calc(5, 24) + width: grid-calc(6, 24) float: left margin-left: -100% max-width: 325px .wrapper-main - width: grid-calc(19, 24) + width: grid-calc(18, 24) float: left - margin-left: grid-calc(5, 24) + margin-left: grid-calc(6, 24) overflow: visible @media #{$xlarge-up} diff --git a/app/styles/app/layouts/sidebar.sass b/app/styles/app/layouts/sidebar.sass index f04c92d6..12b5cd1e 100644 --- a/app/styles/app/layouts/sidebar.sass +++ b/app/styles/app/layouts/sidebar.sass @@ -23,7 +23,8 @@ $sb-font-size: 14px @include colorSidebarTiles($pass-color) &.started, &.created, - &.received + &.received, + &.queued @include colorSidebarTiles($created-color) h2, p @@ -60,10 +61,11 @@ $sb-font-size: 14px border-bottom: solid 2px $sb-grey width: 90% margin: auto - ul - height: 1.7em - li.float-right - padding-right: 0 + + .active a:after, + a:hover:after + bottom: -4px + .icon--plus &:after transform: translateX(35%) @@ -73,14 +75,37 @@ $sb-font-size: 14px .icon--plus:after color: $teal1 &:after - bottom: 0.05em + bottom: 0 + + @media (min-width: #{lower-bound($large-range)}) + ul + height: 1.7em + li + padding-right: 1em + + @media #{$xxlarge-up} + li + padding-right: 2em + + @media (max-width: #{lower-bound($large-range)}) + li + display: block !important + float: none + a + padding: 0 0 .35em + margin-bottom: .8em .sidebar-list margin-top: 1.4rem + color: $grey1 ul @include resetul border-bottom: .46rem solid #FAF9F7 background-color: #FAF9F7 - +.sidebar-seperator + width: 90% + margin: 1rem auto + border: none + border-bottom: solid 2px #f2f2f2 diff --git a/app/styles/app/maximize.sass b/app/styles/app/maximize.sass index c18d9d8e..d4e1b1ea 100644 --- a/app/styles/app/maximize.sass +++ b/app/styles/app/maximize.sass @@ -18,7 +18,7 @@ width: 20px height: 20px border-bottom-left-radius: 4px - display: block + // display: block &:hover background-color: $color-border-slider-hover diff --git a/app/templates/layouts/home.hbs b/app/templates/layouts/home.hbs index 2e601499..afb3b277 100644 --- a/app/templates/layouts/home.hbs +++ b/app/templates/layouts/home.hbs @@ -9,11 +9,6 @@ {{render "flash"}} {{yield}} - {{#if config.pro}} -