TEZ-3059. Tez UI 2: Make refresh functional (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/8f6beddc Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/8f6beddc Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/8f6beddc Branch: refs/heads/master Commit: 8f6beddcfd8e9228b241114ae6a7a4967dca7aba Parents: 7040bbd Author: Sreenath Somarajapuram <s...@apache.org> Authored: Fri Jan 22 21:06:35 2016 +0530 Committer: Sreenath Somarajapuram <s...@apache.org> Committed: Thu Feb 25 03:32:52 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + .../main/webapp/app/components/tab-n-refresh.js | 8 ++- .../src/main/webapp/app/controllers/abstract.js | 3 + tez-ui2/src/main/webapp/app/entities/entity.js | 12 ++-- tez-ui2/src/main/webapp/app/models/abstract.js | 20 +++--- tez-ui2/src/main/webapp/app/routes/abstract.js | 66 +++++++++++++++----- tez-ui2/src/main/webapp/app/routes/app.js | 6 ++ .../src/main/webapp/app/routes/app/configs.js | 6 +- tez-ui2/src/main/webapp/app/routes/app/dags.js | 8 ++- tez-ui2/src/main/webapp/app/routes/app/index.js | 6 +- tez-ui2/src/main/webapp/app/routes/attempt.js | 6 ++ .../main/webapp/app/routes/attempt/counters.js | 6 +- .../src/main/webapp/app/routes/attempt/index.js | 6 +- tez-ui2/src/main/webapp/app/routes/dag.js | 6 ++ .../src/main/webapp/app/routes/dag/attempts.js | 8 ++- .../src/main/webapp/app/routes/dag/counters.js | 6 +- tez-ui2/src/main/webapp/app/routes/dag/index.js | 6 +- tez-ui2/src/main/webapp/app/routes/dag/tasks.js | 8 ++- .../src/main/webapp/app/routes/dag/vertices.js | 8 ++- tez-ui2/src/main/webapp/app/routes/dags.js | 12 +++- tez-ui2/src/main/webapp/app/routes/task.js | 6 ++ .../src/main/webapp/app/routes/task/attempts.js | 8 ++- .../src/main/webapp/app/routes/task/counters.js | 6 +- .../src/main/webapp/app/routes/task/index.js | 6 +- tez-ui2/src/main/webapp/app/routes/vertex.js | 6 ++ .../main/webapp/app/routes/vertex/attempts.js | 8 ++- .../main/webapp/app/routes/vertex/counters.js | 6 +- .../src/main/webapp/app/routes/vertex/index.js | 6 +- .../src/main/webapp/app/routes/vertex/tasks.js | 8 ++- tez-ui2/src/main/webapp/app/services/loader.js | 8 +-- .../webapp/app/styles/dags-page-search.less | 2 +- .../main/webapp/app/styles/tab-n-refresh.less | 2 +- tez-ui2/src/main/webapp/app/templates/app.hbs | 2 +- .../main/webapp/app/templates/app/configs.hbs | 2 +- .../src/main/webapp/app/templates/app/dags.hbs | 2 +- .../src/main/webapp/app/templates/app/index.hbs | 2 +- .../src/main/webapp/app/templates/attempt.hbs | 2 +- .../webapp/app/templates/attempt/counters.hbs | 2 +- .../main/webapp/app/templates/attempt/index.hbs | 2 +- .../app/templates/components/tab-n-refresh.hbs | 6 +- tez-ui2/src/main/webapp/app/templates/dag.hbs | 2 +- .../main/webapp/app/templates/dag/attempts.hbs | 2 +- .../main/webapp/app/templates/dag/counters.hbs | 2 +- .../src/main/webapp/app/templates/dag/index.hbs | 4 +- .../src/main/webapp/app/templates/dag/tasks.hbs | 2 +- .../main/webapp/app/templates/dag/vertices.hbs | 2 +- tez-ui2/src/main/webapp/app/templates/dags.hbs | 4 +- .../src/main/webapp/app/templates/loading.hbs | 24 +++++++ .../app/templates/partials/loading-anim.hbs | 24 ------- tez-ui2/src/main/webapp/app/templates/task.hbs | 2 +- .../main/webapp/app/templates/task/attempts.hbs | 2 +- .../main/webapp/app/templates/task/counters.hbs | 2 +- .../main/webapp/app/templates/task/index.hbs | 2 +- .../src/main/webapp/app/templates/vertex.hbs | 2 +- .../webapp/app/templates/vertex/attempts.hbs | 2 +- .../webapp/app/templates/vertex/counters.hbs | 2 +- .../main/webapp/app/templates/vertex/index.hbs | 3 +- .../main/webapp/app/templates/vertex/tasks.hbs | 2 +- .../webapp/tests/unit/models/abstract-test.js | 31 ++++++++- .../webapp/tests/unit/routes/abstract-test.js | 32 +++++++--- .../tests/unit/routes/app/configs-test.js | 1 + .../webapp/tests/unit/routes/app/dags-test.js | 1 + .../webapp/tests/unit/routes/app/index-test.js | 1 + .../tests/unit/routes/attempt/counters-test.js | 1 + .../tests/unit/routes/attempt/index-test.js | 1 + .../tests/unit/routes/dag/attempts-test.js | 1 + .../tests/unit/routes/dag/counters-test.js | 1 + .../webapp/tests/unit/routes/dag/index-test.js | 1 + .../webapp/tests/unit/routes/dag/tasks-test.js | 1 + .../tests/unit/routes/dag/vertices-test.js | 1 + .../tests/unit/routes/task/attempts-test.js | 1 + .../tests/unit/routes/task/counters-test.js | 1 + .../webapp/tests/unit/routes/task/index-test.js | 1 + .../tests/unit/routes/vertex/attempts-test.js | 1 + .../tests/unit/routes/vertex/counters-test.js | 1 + .../tests/unit/routes/vertex/index-test.js | 1 + .../tests/unit/routes/vertex/tasks-test.js | 1 + .../webapp/tests/unit/services/loader-test.js | 18 ++++-- 78 files changed, 334 insertions(+), 149 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index e34c0fd..e413bc3 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -24,3 +24,4 @@ ALL CHANGES: TEZ-3049. Tez UI 2: Add column selector TEZ-3050. Tez UI 2: Add counter columns TEZ-3064. Tez UI 2: Add All DAGs filters + TEZ-3059. Tez UI 2: Make refresh functional http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js b/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js index 555418e..75bac20 100644 --- a/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js +++ b/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js @@ -42,5 +42,11 @@ export default Ember.Component.extend({ active: tab.routeName === activeRouteName }; }); - }) + }), + + actions: { + refresh: function () { + this.get('targetObject').send('reload'); + } + } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/controllers/abstract.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/abstract.js b/tez-ui2/src/main/webapp/app/controllers/abstract.js index c077914..816e7d1 100644 --- a/tez-ui2/src/main/webapp/app/controllers/abstract.js +++ b/tez-ui2/src/main/webapp/app/controllers/abstract.js @@ -24,6 +24,9 @@ export default Ember.Controller.extend(NameMixin, { // Must be set by inheriting classes breadcrumbs: null, + // Must be set from route + loadTime: null, + init: function () { this._super(); Ember.run.later(this, "setBreadcrumbs"); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/entities/entity.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/entities/entity.js b/tez-ui2/src/main/webapp/app/entities/entity.js index c11c6d1..9cad7b7 100644 --- a/tez-ui2/src/main/webapp/app/entities/entity.js +++ b/tez-ui2/src/main/webapp/app/entities/entity.js @@ -23,8 +23,8 @@ var MoreObject = more.Object; export default Ember.Object.extend({ - loadRelations: function (loader, model) { - var needsPromise = this.loadNeeds(loader, model); + loadRelations: function (loader, model, options, urlParams) { + var needsPromise = this.loadNeeds(loader, model, options, urlParams); if(needsPromise) { return needsPromise.then(function () { @@ -51,15 +51,15 @@ export default Ember.Object.extend({ return Ember.Object.create(need); }, - loadNeeds: function (loader, parentModel) { + loadNeeds: function (loader, parentModel, options, urlParams) { var needLoaders = [], that = this, needs = parentModel.get("needs"); if(needs) { - MoreObject.forEach(needs, function (name, options) { - var need = that.normalizeNeed(name, options), - needLoader = loader.queryRecord(need.type, parentModel.get(need.idKey)); + MoreObject.forEach(needs, function (name, needOptions) { + var need = that.normalizeNeed(name, needOptions), + needLoader = loader.queryRecord(need.type, parentModel.get(need.idKey), null, options, urlParams); needLoader.then(function (model) { parentModel.set(need.name, model); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/models/abstract.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/models/abstract.js b/tez-ui2/src/main/webapp/app/models/abstract.js index 0dd084d..cf6ea8a 100644 --- a/tez-ui2/src/main/webapp/app/models/abstract.js +++ b/tez-ui2/src/main/webapp/app/models/abstract.js @@ -19,17 +19,21 @@ import DS from 'ember-data'; export default DS.Model.extend({ - timeStamp: null, + loadTime: null, mergedProperties: ["needs"], - refreshTimestamp: function () { - this.set('timeStamp', new Date()); + refreshLoadTime: function () { + this.set('loadTime', new Date()); }, - actions: { - didUpdate: function () { - this.refreshTimestamp(); - } - } + //TODO - Find a better alternative to detect property change in a model + _notifyProperties: function (keys) { + this.refreshLoadTime(); + return this._super(keys); + }, + + didLoad: function () { + this.refreshLoadTime(); + }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/abstract.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/abstract.js b/tez-ui2/src/main/webapp/app/routes/abstract.js index 1624bea..c3efc18 100644 --- a/tez-ui2/src/main/webapp/app/routes/abstract.js +++ b/tez-ui2/src/main/webapp/app/routes/abstract.js @@ -18,6 +18,8 @@ */ import Ember from 'ember'; +import DS from 'ember-data'; + import LoaderService from '../services/loader'; import UnlinkedPromise from '../errors/unlinked-promise'; import NameMixin from '../mixins/name'; @@ -27,6 +29,7 @@ var MoreObject = more.Object; export default Ember.Route.extend(NameMixin, { title: null, // Must be set by inheriting class + loaderNamespace: null, isLoading: false, currentPromiseId: null, loadedValue: null, @@ -35,10 +38,20 @@ export default Ember.Route.extend(NameMixin, { breadcrumbs: null, childCrumbs: null, + currentQuery: {}, + loaderQueryParams: {}, + init: function () { + var namespace = this.get("loaderNamespace"); + if(namespace) { + this.setLoader(namespace); + } + }, + model: function(params/*, transition*/) { - Ember.run.later(this, "loadData", this.queryFromParams(params)); + this.set("currentQuery", this.queryFromParams(params)); + Ember.run.later(this, "loadData"); }, queryFromParams: function (params) { @@ -63,48 +76,68 @@ export default Ember.Route.extend(NameMixin, { this.setDocTitle(); }, - checkAndCall: function (id, functionName, query, value) { + checkAndCall: function (id, functionName, query, options, value) { if(id === this.get("currentPromiseId")) { - return this[functionName](value, query); + return this[functionName](value, query, options); } else { throw new UnlinkedPromise(); } }, - loadData: function (query) { - var promiseId = Math.random(); + loadData: function (options) { + var promiseId = Math.random(), + query = this.get("currentQuery"); + + options = options || {}; this.set('currentPromiseId', promiseId); return Ember.RSVP.resolve(). - then(this.checkAndCall.bind(this, promiseId, "setLoading", query)). - then(this.checkAndCall.bind(this, promiseId, "beforeLoad", query)). - then(this.checkAndCall.bind(this, promiseId, "load", query)). - then(this.checkAndCall.bind(this, promiseId, "afterLoad", query)). - then(this.checkAndCall.bind(this, promiseId, "setValue", query)); + then(this.checkAndCall.bind(this, promiseId, "setLoading", query, options)). + then(this.checkAndCall.bind(this, promiseId, "beforeLoad", query, options)). + then(this.checkAndCall.bind(this, promiseId, "load", query, options)). + then(this.checkAndCall.bind(this, promiseId, "afterLoad", query, options)). + then(this.checkAndCall.bind(this, promiseId, "setValue", query, options)); }, - setLoading: function () { + setLoading: function (/*query, options*/) { this.set('isLoading', true); this.set('controller.isLoading', true); }, - beforeLoad: function (value) { + beforeLoad: function (value/*, query, options*/) { return value; }, - load: function (value) { + load: function (value/*, query, options*/) { return value; }, - afterLoad: function (value) { + afterLoad: function (value/*, query, options*/) { return value; }, - setValue: function (value) { + setValue: function (value/*, query, options*/) { this.set('loadedValue', value); + this.set('isLoading', false); this.set('controller.isLoading', false); + + this.send("setLoadTime", this.getLoadTime(value)); + return value; }, + getLoadTime: function (value) { + if(value instanceof DS.RecordArray) { + value = value.get("content.0.record"); + } + else if(Array.isArray(value)) { + value = value[0]; + } + + if(value) { + return Ember.get(value, "loadTime"); + } + }, + _setControllerModel: Ember.observer("loadedValue", function () { var controller = this.get("controller"); if(controller) { @@ -135,6 +168,9 @@ export default Ember.Route.extend(NameMixin, { bubbleBreadcrumbs: function (crumbs) { crumbs.unshift.apply(crumbs, this.get("breadcrumbs")); return true; + }, + reload: function () { + Ember.run.later(this, "loadData", {reload: true}); } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/app.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/app.js b/tez-ui2/src/main/webapp/app/routes/app.js index 2bbf14a..a60025e 100644 --- a/tez-ui2/src/main/webapp/app/routes/app.js +++ b/tez-ui2/src/main/webapp/app/routes/app.js @@ -27,5 +27,11 @@ export default AbstractRoute.extend({ model: function (params) { return this.get("loader").queryRecord('app', "tez_" + this.queryFromParams(params).id); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/app/configs.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/app/configs.js b/tez-ui2/src/main/webapp/app/routes/app/configs.js index b6768fa..825bdad 100644 --- a/tez-ui2/src/main/webapp/app/routes/app/configs.js +++ b/tez-ui2/src/main/webapp/app/routes/app/configs.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "Application Details", + loaderNamespace: "app", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('app', this.modelFor("app").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('app', this.modelFor("app").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/app/dags.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/app/dags.js b/tez-ui2/src/main/webapp/app/routes/app/dags.js index 8c695b3..80643c0 100644 --- a/tez-ui2/src/main/webapp/app/routes/app/dags.js +++ b/tez-ui2/src/main/webapp/app/routes/app/dags.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAGs", + loaderNamespace: "app", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('dag', { - appID: (this.modelFor("app").id || "").substr(4) - }); + appID: this.modelFor("app").get("appID") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/app/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/app/index.js b/tez-ui2/src/main/webapp/app/routes/app/index.js index b6768fa..825bdad 100644 --- a/tez-ui2/src/main/webapp/app/routes/app/index.js +++ b/tez-ui2/src/main/webapp/app/routes/app/index.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "Application Details", + loaderNamespace: "app", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('app', this.modelFor("app").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('app', this.modelFor("app").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/attempt.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/attempt.js b/tez-ui2/src/main/webapp/app/routes/attempt.js index 71be6d2..ff9d4fb 100644 --- a/tez-ui2/src/main/webapp/app/routes/attempt.js +++ b/tez-ui2/src/main/webapp/app/routes/attempt.js @@ -27,5 +27,11 @@ export default AbstractRoute.extend({ model: function (params) { return this.get("loader").queryRecord('attempt', this.queryFromParams(params).id); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/attempt/counters.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/attempt/counters.js b/tez-ui2/src/main/webapp/app/routes/attempt/counters.js index f88737d..e63e6ab 100644 --- a/tez-ui2/src/main/webapp/app/routes/attempt/counters.js +++ b/tez-ui2/src/main/webapp/app/routes/attempt/counters.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "attempt", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('attempt', this.modelFor("attempt").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('attempt', this.modelFor("attempt").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/attempt/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/attempt/index.js b/tez-ui2/src/main/webapp/app/routes/attempt/index.js index f88737d..e63e6ab 100644 --- a/tez-ui2/src/main/webapp/app/routes/attempt/index.js +++ b/tez-ui2/src/main/webapp/app/routes/attempt/index.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "attempt", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('attempt', this.modelFor("attempt").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('attempt', this.modelFor("attempt").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag.js b/tez-ui2/src/main/webapp/app/routes/dag.js index 71ff019..51e6ed9 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag.js +++ b/tez-ui2/src/main/webapp/app/routes/dag.js @@ -27,5 +27,11 @@ export default AbstractRoute.extend({ model: function (params) { return this.get("loader").queryRecord('dag', this.queryFromParams(params).id); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag/attempts.js b/tez-ui2/src/main/webapp/app/routes/dag/attempts.js index f438b95..c8c897a 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag/attempts.js +++ b/tez-ui2/src/main/webapp/app/routes/dag/attempts.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "All Task Attempts", + loaderNamespace: "dag", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('attempt', { - dagID: this.modelFor("dag").id - }); + dagID: this.modelFor("dag").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag/counters.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag/counters.js b/tez-ui2/src/main/webapp/app/routes/dag/counters.js index 90929d0..51b3fc5 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag/counters.js +++ b/tez-ui2/src/main/webapp/app/routes/dag/counters.js @@ -22,13 +22,15 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "dag", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('dag', this.modelFor("dag").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('dag', this.modelFor("dag").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag/index.js b/tez-ui2/src/main/webapp/app/routes/dag/index.js index 90929d0..51b3fc5 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag/index.js +++ b/tez-ui2/src/main/webapp/app/routes/dag/index.js @@ -22,13 +22,15 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "dag", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('dag', this.modelFor("dag").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('dag', this.modelFor("dag").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag/tasks.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag/tasks.js b/tez-ui2/src/main/webapp/app/routes/dag/tasks.js index 3408a3e..859a712 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag/tasks.js +++ b/tez-ui2/src/main/webapp/app/routes/dag/tasks.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "All Tasks", + loaderNamespace: "dag", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('task', { - dagID: this.modelFor("dag").id - }); + dagID: this.modelFor("dag").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dag/vertices.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dag/vertices.js b/tez-ui2/src/main/webapp/app/routes/dag/vertices.js index e8c0770..063f2cc 100644 --- a/tez-ui2/src/main/webapp/app/routes/dag/vertices.js +++ b/tez-ui2/src/main/webapp/app/routes/dag/vertices.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "All Vertices", + loaderNamespace: "dag", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('vertex', { - dagID: this.modelFor("dag").id - }); + dagID: this.modelFor("dag").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/dags.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/dags.js b/tez-ui2/src/main/webapp/app/routes/dags.js index b9484be..5fab777 100644 --- a/tez-ui2/src/main/webapp/app/routes/dags.js +++ b/tez-ui2/src/main/webapp/app/routes/dags.js @@ -75,22 +75,28 @@ export default AbstractRoute.extend({ }); }, - load: function (value, query) { + load: function (value, query, options) { var loader, that = this; if(query.dagID) { that.set("loadedRecords", []); - loader = this.get("loader").queryRecord('dag', query.dagID).then(function (record) { + loader = this.get("loader").queryRecord('dag', query.dagID, options).then(function (record) { return [record]; }); } else { - loader = this.get("loader").query('dag', query); + loader = this.get("loader").query('dag', query, options); } return loader.then(function (records) { return that.filterRecords(records, query); }); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/task.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/task.js b/tez-ui2/src/main/webapp/app/routes/task.js index 42809c9..835243f 100644 --- a/tez-ui2/src/main/webapp/app/routes/task.js +++ b/tez-ui2/src/main/webapp/app/routes/task.js @@ -27,5 +27,11 @@ export default AbstractRoute.extend({ model: function (params) { return this.get("loader").queryRecord('task', this.queryFromParams(params).id); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/task/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/task/attempts.js b/tez-ui2/src/main/webapp/app/routes/task/attempts.js index bc7af27..3a0bc18 100644 --- a/tez-ui2/src/main/webapp/app/routes/task/attempts.js +++ b/tez-ui2/src/main/webapp/app/routes/task/attempts.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "Task Attempts", + loaderNamespace: "task", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('attempt', { - taskID: this.modelFor("task").id - }); + taskID: this.modelFor("task").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/task/counters.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/task/counters.js b/tez-ui2/src/main/webapp/app/routes/task/counters.js index fd76df9..a2d5d33 100644 --- a/tez-ui2/src/main/webapp/app/routes/task/counters.js +++ b/tez-ui2/src/main/webapp/app/routes/task/counters.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "task", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('task', this.modelFor("task").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('task', this.modelFor("task").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/task/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/task/index.js b/tez-ui2/src/main/webapp/app/routes/task/index.js index fd76df9..a2d5d33 100644 --- a/tez-ui2/src/main/webapp/app/routes/task/index.js +++ b/tez-ui2/src/main/webapp/app/routes/task/index.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "task", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('task', this.modelFor("task").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('task', this.modelFor("task").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/vertex.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/vertex.js b/tez-ui2/src/main/webapp/app/routes/vertex.js index 2a38001..5e8ed33 100644 --- a/tez-ui2/src/main/webapp/app/routes/vertex.js +++ b/tez-ui2/src/main/webapp/app/routes/vertex.js @@ -27,5 +27,11 @@ export default AbstractRoute.extend({ model: function (params) { return this.get("loader").queryRecord('vertex', this.queryFromParams(params).id); + }, + + actions: { + setLoadTime: function (time) { + this.set("controller.loadTime", time); + } } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/vertex/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/vertex/attempts.js b/tez-ui2/src/main/webapp/app/routes/vertex/attempts.js index cead8a2..aa0a83d 100644 --- a/tez-ui2/src/main/webapp/app/routes/vertex/attempts.js +++ b/tez-ui2/src/main/webapp/app/routes/vertex/attempts.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "Task Attempts", + loaderNamespace: "vertex", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('attempt', { - vertexID: this.modelFor("vertex").id - }); + vertexID: this.modelFor("vertex").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/vertex/counters.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/vertex/counters.js b/tez-ui2/src/main/webapp/app/routes/vertex/counters.js index d05e5f6..bb5a9ce 100644 --- a/tez-ui2/src/main/webapp/app/routes/vertex/counters.js +++ b/tez-ui2/src/main/webapp/app/routes/vertex/counters.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "vertex", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('vertex', this.modelFor("vertex").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('vertex', this.modelFor("vertex").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/vertex/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/vertex/index.js b/tez-ui2/src/main/webapp/app/routes/vertex/index.js index d05e5f6..bb5a9ce 100644 --- a/tez-ui2/src/main/webapp/app/routes/vertex/index.js +++ b/tez-ui2/src/main/webapp/app/routes/vertex/index.js @@ -22,12 +22,14 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "DAG Details", + loaderNamespace: "vertex", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { - return this.get("loader").queryRecord('vertex', this.modelFor("vertex").id); + load: function (value, query, options) { + return this.get("loader").queryRecord('vertex', this.modelFor("vertex").get("id"), options); }, }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/routes/vertex/tasks.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/vertex/tasks.js b/tez-ui2/src/main/webapp/app/routes/vertex/tasks.js index e959fef..f392343 100644 --- a/tez-ui2/src/main/webapp/app/routes/vertex/tasks.js +++ b/tez-ui2/src/main/webapp/app/routes/vertex/tasks.js @@ -22,14 +22,16 @@ import AbstractRoute from '../abstract'; export default AbstractRoute.extend({ title: "All Tasks", + loaderNamespace: "vertex", + setupController: function (controller, model) { this._super(controller, model); Ember.run.later(this, "startCrumbBubble"); }, - load: function (/*value, query*/) { + load: function (value, query, options) { return this.get("loader").query('task', { - vertexID: this.modelFor("vertex").id - }); + vertexID: this.modelFor("vertex").get("id") + }, options); } }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/services/loader.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/services/loader.js b/tez-ui2/src/main/webapp/app/services/loader.js index 054a6b5..92758e3 100644 --- a/tez-ui2/src/main/webapp/app/services/loader.js +++ b/tez-ui2/src/main/webapp/app/services/loader.js @@ -81,7 +81,7 @@ export default Ember.Service.extend({ return parts.join(":"); }, - queryRecord: function(type, id, query, urlParams, options) { + queryRecord: function(type, id, options, query, urlParams) { var entity = this.entityFor(type), cache = this.get("cache"), cacheKey = this.getCacheKey(type, query, id), @@ -104,13 +104,13 @@ export default Ember.Service.extend({ params: query, urlParams: urlParams }).then(function (record) { - return entity.loadRelations(that, record); + return entity.loadRelations(that, record, options, urlParams); }); cache.set(cacheKey, record); return record; }, - query: function(type, query, urlParams, options) { + query: function(type, query, options, urlParams) { var entity = this.entityFor(type), cache = this.get("cache"), cacheKey = this.getCacheKey(type, query), @@ -133,7 +133,7 @@ export default Ember.Service.extend({ urlParams: urlParams }).then(function (records) { return Ember.RSVP.all(records.map(function (record) { - return entity.loadRelations(that, record); + return entity.loadRelations(that, record, options, urlParams); })).then(function () { return records; }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/styles/dags-page-search.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/dags-page-search.less b/tez-ui2/src/main/webapp/app/styles/dags-page-search.less index 2fa0216..ec64d11 100644 --- a/tez-ui2/src/main/webapp/app/styles/dags-page-search.less +++ b/tez-ui2/src/main/webapp/app/styles/dags-page-search.less @@ -16,7 +16,7 @@ * limitations under the License. */ -@media screen and (min-width: 1500px) { +@media screen and (min-width: 1300px) { .dags-page-search{ float: left; width: 1000px; http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less b/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less index ab930f2..16ad404 100644 --- a/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less +++ b/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less @@ -34,7 +34,7 @@ position: relative; line-height: 18px; - top: 12px; + top: 11px; text-align: right; font-size: .95em; http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/app.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/app.hbs b/tez-ui2/src/main/webapp/app/templates/app.hbs index 308b905..80ec4f4 100644 --- a/tez-ui2/src/main/webapp/app/templates/app.hbs +++ b/tez-ui2/src/main/webapp/app/templates/app.hbs @@ -16,5 +16,5 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs}} +{{tab-n-refresh tabs=tabs loadTime=loadTime}} {{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/app/configs.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/app/configs.hbs b/tez-ui2/src/main/webapp/app/templates/app/configs.hbs index 8617c81..62010e9 100644 --- a/tez-ui2/src/main/webapp/app/templates/app/configs.hbs +++ b/tez-ui2/src/main/webapp/app/templates/app/configs.hbs @@ -30,5 +30,5 @@ sortAction="sortChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/app/dags.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/app/dags.hbs b/tez-ui2/src/main/webapp/app/templates/app/dags.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/app/dags.hbs +++ b/tez-ui2/src/main/webapp/app/templates/app/dags.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/app/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/app/index.hbs b/tez-ui2/src/main/webapp/app/templates/app/index.hbs index 916051b..3567f32 100644 --- a/tez-ui2/src/main/webapp/app/templates/app/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/app/index.hbs @@ -122,5 +122,5 @@ </tbody> </table> {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/attempt.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/attempt.hbs b/tez-ui2/src/main/webapp/app/templates/attempt.hbs index 308b905..80ec4f4 100644 --- a/tez-ui2/src/main/webapp/app/templates/attempt.hbs +++ b/tez-ui2/src/main/webapp/app/templates/attempt.hbs @@ -16,5 +16,5 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs}} +{{tab-n-refresh tabs=tabs loadTime=loadTime}} {{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/attempt/counters.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/attempt/counters.hbs b/tez-ui2/src/main/webapp/app/templates/attempt/counters.hbs index e590b36..aa4c127 100644 --- a/tez-ui2/src/main/webapp/app/templates/attempt/counters.hbs +++ b/tez-ui2/src/main/webapp/app/templates/attempt/counters.hbs @@ -30,5 +30,5 @@ sortAction="sortChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs b/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs index cf83afe..9edaacd 100644 --- a/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/attempt/index.hbs @@ -61,5 +61,5 @@ </tbody> </table> {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs b/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs index 6b9c822..9b6a594 100644 --- a/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs +++ b/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs @@ -31,13 +31,13 @@ Auto Refresh <br/> </span> - {{#if displayTime}} - Last refreshed at <b>{{displayTime}}</b> + {{#if loadTime}} + Last refreshed at <b>{{txt loadTime type="date" format="DD MMM YYYY HH:mm:ss"}}</b> {{else}} Load time not available! {{/if}} </span> - <button type="button" class="btn btn-success"> + <button type="button" class="btn btn-success" {{action "refresh"}}> <i class='fa fa-refresh'></i> Refresh </button> </span> http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag.hbs b/tez-ui2/src/main/webapp/app/templates/dag.hbs index 308b905..80ec4f4 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag.hbs @@ -16,5 +16,5 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs}} +{{tab-n-refresh tabs=tabs loadTime=loadTime}} {{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs b/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag/counters.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/counters.hbs b/tez-ui2/src/main/webapp/app/templates/dag/counters.hbs index e590b36..aa4c127 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/counters.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/counters.hbs @@ -30,5 +30,5 @@ sortAction="sortChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/index.hbs b/tez-ui2/src/main/webapp/app/templates/dag/index.hbs index fdb0a91..2f4a214 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/index.hbs @@ -43,7 +43,7 @@ </tr> <tr> <td>Submitter</td> - <td>{{model.user}}</td> + <td>{{model.submitter}}</td> </tr> <tr> <td>Status</td> @@ -70,5 +70,5 @@ </tbody> </table> {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs b/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs b/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/dags.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/dags.hbs b/tez-ui2/src/main/webapp/app/templates/dags.hbs index 3e64a7e..56621e9 100644 --- a/tez-ui2/src/main/webapp/app/templates/dags.hbs +++ b/tez-ui2/src/main/webapp/app/templates/dags.hbs @@ -16,7 +16,7 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs autoRefreshEnabled=false}} +{{tab-n-refresh tabs=tabs autoRefreshEnabled=false loadTime=loadTime}} {{#if loaded}} {{em-table @@ -37,5 +37,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/loading.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/loading.hbs b/tez-ui2/src/main/webapp/app/templates/loading.hbs new file mode 100644 index 0000000..0b3bb19 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/loading.hbs @@ -0,0 +1,24 @@ +{{! + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +}} + +<h3>Loading...</h3> + +<div class="progress"> + <div class="progress-bar progress-bar-striped active" role="progressbar" style="width:100%"> + </div> +</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/partials/loading-anim.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/partials/loading-anim.hbs b/tez-ui2/src/main/webapp/app/templates/partials/loading-anim.hbs deleted file mode 100644 index 0b3bb19..0000000 --- a/tez-ui2/src/main/webapp/app/templates/partials/loading-anim.hbs +++ /dev/null @@ -1,24 +0,0 @@ -{{! - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. -}} - -<h3>Loading...</h3> - -<div class="progress"> - <div class="progress-bar progress-bar-striped active" role="progressbar" style="width:100%"> - </div> -</div> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/task.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/task.hbs b/tez-ui2/src/main/webapp/app/templates/task.hbs index 308b905..80ec4f4 100644 --- a/tez-ui2/src/main/webapp/app/templates/task.hbs +++ b/tez-ui2/src/main/webapp/app/templates/task.hbs @@ -16,5 +16,5 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs}} +{{tab-n-refresh tabs=tabs loadTime=loadTime}} {{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/task/attempts.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/task/attempts.hbs b/tez-ui2/src/main/webapp/app/templates/task/attempts.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/task/attempts.hbs +++ b/tez-ui2/src/main/webapp/app/templates/task/attempts.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/task/counters.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/task/counters.hbs b/tez-ui2/src/main/webapp/app/templates/task/counters.hbs index e590b36..aa4c127 100644 --- a/tez-ui2/src/main/webapp/app/templates/task/counters.hbs +++ b/tez-ui2/src/main/webapp/app/templates/task/counters.hbs @@ -30,5 +30,5 @@ sortAction="sortChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/task/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/task/index.hbs b/tez-ui2/src/main/webapp/app/templates/task/index.hbs index b559203..ee6b0c6 100644 --- a/tez-ui2/src/main/webapp/app/templates/task/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/task/index.hbs @@ -53,5 +53,5 @@ </tbody> </table> {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/vertex.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex.hbs b/tez-ui2/src/main/webapp/app/templates/vertex.hbs index 308b905..80ec4f4 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex.hbs @@ -16,5 +16,5 @@ * limitations under the License. }} -{{tab-n-refresh tabs=tabs}} +{{tab-n-refresh tabs=tabs loadTime=loadTime}} {{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/vertex/attempts.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex/attempts.hbs b/tez-ui2/src/main/webapp/app/templates/vertex/attempts.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex/attempts.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex/attempts.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/vertex/counters.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex/counters.hbs b/tez-ui2/src/main/webapp/app/templates/vertex/counters.hbs index e590b36..aa4c127 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex/counters.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex/counters.hbs @@ -30,5 +30,5 @@ sortAction="sortChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs b/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs index 8183842..153d583 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex/index.hbs @@ -124,7 +124,6 @@ </tr> </tbody> </table> - {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/app/templates/vertex/tasks.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/vertex/tasks.hbs b/tez-ui2/src/main/webapp/app/templates/vertex/tasks.hbs index 6d8d4c3..57cfe86 100644 --- a/tez-ui2/src/main/webapp/app/templates/vertex/tasks.hbs +++ b/tez-ui2/src/main/webapp/app/templates/vertex/tasks.hbs @@ -31,5 +31,5 @@ pageAction="pageChanged" }} {{else}} - {{partial "partials/loading-anim"}} + {{partial "loading"}} {{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/models/abstract-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/models/abstract-test.js b/tez-ui2/src/main/webapp/tests/unit/models/abstract-test.js index 42fe21c..cec99a2 100644 --- a/tez-ui2/src/main/webapp/tests/unit/models/abstract-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/models/abstract-test.js @@ -16,14 +16,43 @@ * limitations under the License. */ +import Ember from 'ember'; + import { moduleForModel, test } from 'ember-qunit'; moduleForModel('abstract', 'Unit | Model | abstract', { // Specify the other units that are required for this test. - needs: [] + // needs: [] }); test('Basic test for existence', function(assert) { let model = this.subject(); + assert.ok(model); + assert.ok(model.mergedProperties); + assert.ok(model.refreshLoadTime); + + assert.ok(model._notifyProperties); + assert.ok(model.didLoad); +}); + +test('_notifyProperties test - will fail if _notifyProperties implementation is changed in ember-data', function(assert) { + let model = this.subject(); + + Ember._beginPropertyChanges = Ember.beginPropertyChanges; + + assert.expect(1 + 1); + // refreshLoadTime will be called by us & beginPropertyChanges by ember data + + Ember.beginPropertyChanges = function () { + assert.ok(true); + Ember._beginPropertyChanges(); + }; + model.refreshLoadTime = function () { + assert.ok(true); + }; + + model._notifyProperties([]); + + Ember.beginPropertyChanges = Ember._beginPropertyChanges; }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/abstract-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/abstract-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/abstract-test.js index e1e446a..202e889 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/abstract-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/abstract-test.js @@ -48,6 +48,7 @@ test('Basic creation test', function(assert) { assert.ok(route.afterLoad); assert.ok(route.setValue); + assert.ok(route.getLoadTime); assert.ok(route._setControllerModel); assert.ok(route.setLoader); @@ -78,19 +79,21 @@ test('queryFromParams test', function(assert) { test('checkAndCall test', function(assert) { let route = this.subject(), testValue = {}, - testQuery = {}; + testQuery = {}, + testOptions = {}; - assert.expect(2 + 1); + assert.expect(3 + 1); - route.testFunction = function (value, query) { + route.testFunction = function (value, query, options) { assert.equal(value, testValue, "Value check for id 1"); assert.equal(query, testQuery, "Query check for id 1"); + assert.equal(options, testOptions, "Options check for id 1"); }; route.currentPromiseId = 1; - route.checkAndCall(1, "testFunction", testQuery, testValue); + route.checkAndCall(1, "testFunction", testQuery, testOptions, testValue); assert.throws(function () { - route.checkAndCall(2, "testFunction", testQuery, testValue); + route.checkAndCall(2, "testFunction", testQuery, testOptions, testValue); }); }); @@ -98,10 +101,10 @@ test('loadData test - Hook sequence check', function(assert) { let route = this.subject(); // Bind poilyfill - Function.prototype.bind = function (context, val1, val2, val3) { + Function.prototype.bind = function (context, val1, val2, val3, val4) { var that = this; return function (val) { - return that.call(context, val1, val2, val3, val); + return that.call(context, val1, val2, val3, val4, val); }; }; @@ -137,10 +140,10 @@ test('loadData test - ID change check with exception throw', function(assert) { let route = this.subject(); // Bind poilyfill - Function.prototype.bind = function (context, val1, val2, val3) { + Function.prototype.bind = function (context, val1, val2, val3, val4) { var that = this; return function (val) { - return that.call(context, val1, val2, val3, val); + return that.call(context, val1, val2, val3, val4, val); }; }; @@ -209,6 +212,17 @@ test('setValue test', function(assert) { assert.equal(route.get("isLoading"), false); }); +test('getLoadTime test', function(assert) { + let route = this.subject(), + testTime = Date.now(), + testRecord = { + loadTime: testTime + }; + + assert.equal(route.getLoadTime(testRecord), testTime); + assert.equal(route.getLoadTime([testRecord]), testTime); +}); + test('_setControllerModel test', function(assert) { let route = this.subject(), testValue = {}, http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/app/configs-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/app/configs-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/app/configs-test.js index 9ca6a7a..c12189d 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/app/configs-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/app/configs-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/app/dags-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/app/dags-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/app/dags-test.js index f7ac141..8c5f23d 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/app/dags-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/app/dags-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/app/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/app/index-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/app/index-test.js index 2ea4415..191cc18 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/app/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/app/index-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/attempt/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/attempt/counters-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/attempt/counters-test.js index 32d808d..4d47431 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/attempt/counters-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/attempt/counters-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/attempt/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/attempt/index-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/attempt/index-test.js index b0e3d2f..69877da 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/attempt/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/attempt/index-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js index 36a67b4..78dd520 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/dag/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/counters-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/counters-test.js index 41ca35c..d2cd66e 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/counters-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/counters-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js index aef7031..8c0cb5d 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js index fa30f2e..0dc533d 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js index fb27c80..b8d2f2e 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/task/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/task/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/task/attempts-test.js index 2c139b7..b38cc6f 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/task/attempts-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/task/attempts-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/task/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/task/counters-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/task/counters-test.js index fafb2a0..87895aa 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/task/counters-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/task/counters-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/task/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/task/index-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/task/index-test.js index 603a8d6..91d3e5b 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/task/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/task/index-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/vertex/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/attempts-test.js index 9ba3cf0..250a3b5 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/attempts-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/attempts-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/vertex/counters-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/counters-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/counters-test.js index 6f76c1c..9c14e8f 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/counters-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/counters-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/vertex/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/index-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/index-test.js index cc7e9de..bab59b6 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/index-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/index-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/routes/vertex/tasks-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/tasks-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/tasks-test.js index e70434f..432b619 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/vertex/tasks-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/vertex/tasks-test.js @@ -28,6 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderNamespace); assert.ok(route.setupController); assert.ok(route.load); }); http://git-wip-us.apache.org/repos/asf/tez/blob/8f6beddc/tez-ui2/src/main/webapp/tests/unit/services/loader-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/services/loader-test.js b/tez-ui2/src/main/webapp/tests/unit/services/loader-test.js index 548aca8..7000188 100644 --- a/tez-ui2/src/main/webapp/tests/unit/services/loader-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/services/loader-test.js @@ -180,6 +180,7 @@ test('getCacheKey test', function(assert) { test('queryRecord test', function(assert) { let service = this.subject(), testNameSpace = "ns", + testOptions = {}, testQueryParams = {}, testUrlParams = {}, testType = "type", @@ -187,7 +188,7 @@ test('queryRecord test', function(assert) { testID = 1, cacheKey = service.getCacheKey(testType, testQueryParams, testID); - assert.expect(3 + 5 + 3); + assert.expect(1 + 4 + 5 + 3); service.nameSpace = testNameSpace; service.checkRequisite = Ember.K; @@ -195,9 +196,11 @@ test('queryRecord test', function(assert) { assert.equal(type, testType); return { - loadRelations: function (thisService, record) { + loadRelations: function (thisService, record, options, urlParams) { assert.equal(thisService, service); assert.equal(record, testRecord); + assert.equal(options, testOptions); + assert.equal(urlParams, testUrlParams); return record; } @@ -216,7 +219,7 @@ test('queryRecord test', function(assert) { service.cache = Ember.Object.create(); assert.notOk(service.get("cache").get(cacheKey)); - service.queryRecord(testType, testID, testQueryParams, testUrlParams).then(function (record) { + service.queryRecord(testType, testID, testOptions, testQueryParams, testUrlParams).then(function (record) { assert.equal(record, testRecord); }); assert.ok(service.get("cache").get(cacheKey)); @@ -225,6 +228,7 @@ test('queryRecord test', function(assert) { test('query test', function(assert) { let service = this.subject(), testNameSpace = "ns", + testOptions = {}, testQueryParams = {}, testUrlParams = {}, testType = "type", @@ -232,7 +236,7 @@ test('query test', function(assert) { testRecords = [testRecord, testRecord], cacheKey = service.getCacheKey(testType, testQueryParams); - assert.expect(1 + (2 + 2) + 4 + 3); + assert.expect(1 + (4 + 4) + 4 + 3); service.nameSpace = testNameSpace; service.checkRequisite = Ember.K; @@ -240,9 +244,11 @@ test('query test', function(assert) { assert.equal(type, testType); return { - loadRelations: function (thisService, record) { + loadRelations: function (thisService, record, options, urlParams) { assert.equal(thisService, service); assert.equal(record, testRecord); + assert.equal(options, testOptions); + assert.equal(urlParams, testUrlParams); return record; } @@ -260,7 +266,7 @@ test('query test', function(assert) { service.cache = Ember.Object.create(); assert.notOk(service.get("cache").get(cacheKey)); - service.query(testType, testQueryParams, testUrlParams).then(function (records) { + service.query(testType, testQueryParams, testOptions, testUrlParams).then(function (records) { assert.equal(records, testRecords); }); assert.ok(service.get("cache").get(cacheKey));