Repository: couchdb-fauxton Updated Branches: refs/heads/master 2d8cabfc2 -> eb201de75
Fix Active Tasks polling widget -after some css work with the active tasks page, the css for the polling widget got messed up Project: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/commit/eb201de7 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/tree/eb201de7 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/diff/eb201de7 Branch: refs/heads/master Commit: eb201de75ebdaa82f096108f5260d2f096064ea1 Parents: 2d8cabf Author: michelleph...@gmail.com <michelleph...@gmail.com> Authored: Thu Jul 23 21:34:09 2015 -0400 Committer: michelleph...@gmail.com <michelleph...@gmail.com> Committed: Fri Jul 24 17:24:20 2015 -0400 ---------------------------------------------------------------------- app/addons/activetasks/actions.js | 5 ++-- .../activetasks/assets/less/activetasks.less | 29 ++++++++++++-------- app/addons/activetasks/components.react.jsx | 4 +-- app/addons/activetasks/resources.js | 7 +++-- .../activetasks/tests/activetasks.storesSpec.js | 13 +++++++++ 5 files changed, 39 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/eb201de7/app/addons/activetasks/actions.js ---------------------------------------------------------------------- diff --git a/app/addons/activetasks/actions.js b/app/addons/activetasks/actions.js index 55469ab..41498d9 100644 --- a/app/addons/activetasks/actions.js +++ b/app/addons/activetasks/actions.js @@ -11,10 +11,9 @@ // the License. define([ 'api', - 'addons/activetasks/actiontypes', - 'addons/activetasks/resources' + 'addons/activetasks/actiontypes' ], -function (FauxtonAPI, ActionTypes, Resources) { +function (FauxtonAPI, ActionTypes) { return { init: function (activeTasks) { this.fetchAndSetActiveTasks(activeTasks.table, activeTasks); http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/eb201de7/app/addons/activetasks/assets/less/activetasks.less ---------------------------------------------------------------------- diff --git a/app/addons/activetasks/assets/less/activetasks.less b/app/addons/activetasks/assets/less/activetasks.less index bcbbd73..a6afaa8 100644 --- a/app/addons/activetasks/assets/less/activetasks.less +++ b/app/addons/activetasks/assets/less/activetasks.less @@ -179,16 +179,6 @@ } } - .active-tasks-loading-lines { - padding-top: 15px; - float: left; - margin-left: -40px; - - #line1, #line2, #line3, #line4 { - background-color: #bbb; - } - } - .view-source-sequence-btn { // "View" Button background-color: #999; display: inline; @@ -255,8 +245,7 @@ .polling-interval-widget { width: 250px; - margin-right: 20px; - margin-top: 10px; + margin: 10px 20px 0px 0px; color: #666; float:right; @@ -275,3 +264,19 @@ width: 250px; } } + +.active-tasks-loading-lines-container { + + width: 350px; + + .active-tasks-loading-lines { + border: 0px; + position: relative; + top: 17px; + float: left; + + #line1, #line2, #line3, #line4 { + background-color: #bbb; + } + } +} http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/eb201de7/app/addons/activetasks/components.react.jsx ---------------------------------------------------------------------- diff --git a/app/addons/activetasks/components.react.jsx b/app/addons/activetasks/components.react.jsx index 607881d..2be4acf 100644 --- a/app/addons/activetasks/components.react.jsx +++ b/app/addons/activetasks/components.react.jsx @@ -444,7 +444,7 @@ define([ getStoreState: function () { return { pollingInterval: activeTasksStore.getPollingInterval(), - isLoading: false//activeTasksStore.isLoading() + isLoading: activeTasksStore.isLoading() }; }, @@ -507,7 +507,7 @@ define([ } return ( - <div> + <div className="active-tasks-loading-lines-container"> <span className="active-tasks-loading-lines"> {loadLines} </span> http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/eb201de7/app/addons/activetasks/resources.js ---------------------------------------------------------------------- diff --git a/app/addons/activetasks/resources.js b/app/addons/activetasks/resources.js index 292521c..87dadcd 100644 --- a/app/addons/activetasks/resources.js +++ b/app/addons/activetasks/resources.js @@ -12,10 +12,11 @@ define([ 'app', - 'api' + 'api', + 'addons/activetasks/actions' ], -function (app, FauxtonAPI) { +function (app, FauxtonAPI, Actions) { var Active = {}; Active.AllTasks = Backbone.Collection.extend({ @@ -26,11 +27,13 @@ function (app, FauxtonAPI) { pollingFetch: function () { //still need this for the polling this.fetch({reset: true, parse: true}); + Actions.setActiveTaskIsLoading(true); return this; }, parse: function (resp) { //no more backbone models, collection is converted into an array of objects + Actions.setActiveTaskIsLoading(false); var collectionTable = []; _.each(resp, function (item) { http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/eb201de7/app/addons/activetasks/tests/activetasks.storesSpec.js ---------------------------------------------------------------------- diff --git a/app/addons/activetasks/tests/activetasks.storesSpec.js b/app/addons/activetasks/tests/activetasks.storesSpec.js index e71e600..2e913c0 100644 --- a/app/addons/activetasks/tests/activetasks.storesSpec.js +++ b/app/addons/activetasks/tests/activetasks.storesSpec.js @@ -104,6 +104,19 @@ define([ activeTasksStore.setPolling(); assert.ok(spy.calledOnce); }); + + it('should set the isLoading variable so that the loading lines show up', function () { + spy = sinon.spy(activeTasksStore, 'setIsLoading'); + var date = new Date(); + + activeTasksCollection.pollingFetch(); + assert.ok(spy.withArgs(true, date).calledOnce); + + activeTasksCollection.parse(fakedResponse); + assert.ok(spy.withArgs(false, date).calledOnce); + + restore(activeTasksStore.setIsLoading); + }); }); describe('Active Task Stores - Filter Tab Tray', function () {