TEZ-3038. Tez UI 2: Create DAG details page (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/a0ba39cb Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/a0ba39cb Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/a0ba39cb Branch: refs/heads/master Commit: a0ba39cbc150870ede7ebb80719889c4624d08c8 Parents: d34cbe0 Author: Sreenath Somarajapuram <s...@apache.org> Authored: Mon Jan 18 15:28:53 2016 +0530 Committer: Sreenath Somarajapuram <s...@apache.org> Committed: Thu Feb 25 03:32:15 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + .../main/webapp/app/components/tab-n-refresh.js | 44 +++++++++++ .../src/main/webapp/app/controllers/abstract.js | 42 ++++++++++ tez-ui2/src/main/webapp/app/controllers/dag.js | 47 +++++++++++ .../main/webapp/app/controllers/dag/attempts.js | 26 ++++++ .../main/webapp/app/controllers/dag/index.js | 22 ++++++ .../main/webapp/app/controllers/dag/tasks.js | 26 ++++++ .../main/webapp/app/controllers/dag/vertices.js | 26 ++++++ tez-ui2/src/main/webapp/app/controllers/dags.js | 25 +++--- tez-ui2/src/main/webapp/app/controllers/page.js | 30 +++++++ .../main/webapp/app/controllers/table-page.js | 8 +- tez-ui2/src/main/webapp/app/mixins/name.js | 30 +++++++ tez-ui2/src/main/webapp/app/router.js | 6 ++ tez-ui2/src/main/webapp/app/routes/abstract.js | 49 ++++++++++-- tez-ui2/src/main/webapp/app/routes/app.js | 22 ++++++ .../src/main/webapp/app/routes/application.js | 9 ++- tez-ui2/src/main/webapp/app/routes/dag.js | 31 ++++++++ .../src/main/webapp/app/routes/dag/attempts.js | 29 +++++++ tez-ui2/src/main/webapp/app/routes/dag/index.js | 34 ++++++++ tez-ui2/src/main/webapp/app/routes/dag/tasks.js | 29 +++++++ .../src/main/webapp/app/routes/dag/vertices.js | 29 +++++++ tez-ui2/src/main/webapp/app/routes/dags.js | 17 ++++ tez-ui2/src/main/webapp/app/styles/app.less | 3 + .../main/webapp/app/styles/details-page.less | 49 ++++++++++++ .../src/main/webapp/app/styles/page-layout.less | 3 + tez-ui2/src/main/webapp/app/styles/shared.less | 8 ++ .../main/webapp/app/styles/tab-n-refresh.less | 42 ++++++++++ tez-ui2/src/main/webapp/app/templates/app.hbs | 19 +++++ .../app/templates/components/tab-n-refresh.hbs | 42 ++++++++++ tez-ui2/src/main/webapp/app/templates/dag.hbs | 20 +++++ .../main/webapp/app/templates/dag/attempts.hbs | 19 +++++ .../src/main/webapp/app/templates/dag/index.hbs | 83 ++++++++++++++++++++ .../src/main/webapp/app/templates/dag/tasks.hbs | 19 +++++ .../main/webapp/app/templates/dag/vertices.hbs | 19 +++++ .../components/tab-n-refresh-test.js | 50 ++++++++++++ .../tests/unit/controllers/abstract-test.js | 74 +++++++++++++++++ .../webapp/tests/unit/controllers/dag-test.js | 36 +++++++++ .../tests/unit/controllers/dag/attempts-test.js | 35 +++++++++ .../tests/unit/controllers/dag/index-test.js | 34 ++++++++ .../tests/unit/controllers/dag/tasks-test.js | 35 +++++++++ .../tests/unit/controllers/dag/vertices-test.js | 35 +++++++++ .../webapp/tests/unit/controllers/dags-test.js | 5 +- .../webapp/tests/unit/controllers/page-test.js | 49 ++++++++++++ .../tests/unit/controllers/table-page-test.js | 6 +- .../main/webapp/tests/unit/mixins/name-test.js | 44 +++++++++++ .../webapp/tests/unit/routes/abstract-test.js | 62 ++++++++++++++- .../main/webapp/tests/unit/routes/app-test.js | 29 +++++++ .../tests/unit/routes/application-test.js | 6 +- .../main/webapp/tests/unit/routes/dag-test.js | 32 ++++++++ .../tests/unit/routes/dag/attempts-test.js | 44 +++++++++++ .../webapp/tests/unit/routes/dag/index-test.js | 46 +++++++++++ .../webapp/tests/unit/routes/dag/tasks-test.js | 44 +++++++++++ .../tests/unit/routes/dag/vertices-test.js | 44 +++++++++++ .../main/webapp/tests/unit/routes/dags-test.js | 2 + 54 files changed, 1584 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index 9fcb0ef..925dc7f 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -13,3 +13,4 @@ ALL CHANGES: TEZ-3026. Tez UI 2: Add adapters for RM & AM TEZ-3027. Tez UI 2: Add header and footer elements TEZ-2986. Tez UI 2: Implement All DAGs page + TEZ-3038. Tez UI 2: Create DAG details page http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..3f05371 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/components/tab-n-refresh.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Component.extend({ + init: function () { + this._super(); + this.setApplication(); + }, + + setApplication: function () { + var application = this.get("targetObject.container").lookup('controller:application'); + this.set("application", application); + }, + + normalizedTabs: Ember.computed("tabs", "application.currentPath", function () { + var tabs = this.get("tabs"), + activeRouteName = this.get("application.currentPath"); + + return tabs.map(function (tab) { + return { + text: tab.text, + routeName: tab.routeName, + active: tab.routeName === activeRouteName + }; + }); + }) +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..c077914 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/abstract.js @@ -0,0 +1,42 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import NameMixin from '../mixins/name'; + +export default Ember.Controller.extend(NameMixin, { + // Must be set by inheriting classes + breadcrumbs: null, + + init: function () { + this._super(); + Ember.run.later(this, "setBreadcrumbs"); + }, + + crumbObserver: Ember.observer("breadcrumbs", function () { + Ember.run.later(this, "setBreadcrumbs"); + }), + + setBreadcrumbs: function () { + var crumbs = {}, + name = this.get("name"); + crumbs[name] = this.get("breadcrumbs"); + this.send("setBreadcrumbs", crumbs); + } +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dag.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dag.js b/tez-ui2/src/main/webapp/app/controllers/dag.js new file mode 100644 index 0000000..f54d8cf --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/dag.js @@ -0,0 +1,47 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractController from './abstract'; + +export default AbstractController.extend({ + breadcrumbs: Ember.computed("model", function () { + var name = this.get("model.name"); + + return [{ + text: `DAG [${name}]`, + routeName: "dag.index", + model: this.get("model.entityID") + }]; + }), + + tabs: [{ + text: "DAG Details", + routeName: "dag.index" + }, { + text: "All Vertices", + routeName: "dag.vertices" + }, { + text: "All Tasks", + routeName: "dag.tasks" + }, { + text: "All Attempts", + routeName: "dag.attempts" + }] +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js b/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js new file mode 100644 index 0000000..d5efc50 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/dag/attempts.js @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import PageController from '../page'; + +export default PageController.extend({ + breadcrumbs: [{ + text: "All Attempts", + routeName: "dag.attempts", + }] +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dag/index.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/index.js b/tez-ui2/src/main/webapp/app/controllers/dag/index.js new file mode 100644 index 0000000..9745328 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/dag/index.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import PageController from '../page'; + +export default PageController.extend({ +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js b/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js new file mode 100644 index 0000000..e83df5d --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/dag/tasks.js @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import PageController from '../page'; + +export default PageController.extend({ + breadcrumbs: [{ + text: "All Tasks", + routeName: "dag.tasks", + }] +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js b/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js new file mode 100644 index 0000000..e001652 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/dag/vertices.js @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import PageController from '../page'; + +export default PageController.extend({ + breadcrumbs: [{ + text: "All Vertices", + routeName: "dag.vertices", + }] +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/dags.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/dags.js b/tez-ui2/src/main/webapp/app/controllers/dags.js index 900b03d..354f4f8 100644 --- a/tez-ui2/src/main/webapp/app/controllers/dags.js +++ b/tez-ui2/src/main/webapp/app/controllers/dags.js @@ -16,17 +16,25 @@ * limitations under the License. */ -import Ember from 'ember'; - import TablePageController from './table-page'; import ColumnDefinition from 'em-table/utils/column-definition'; export default TablePageController.extend({ + breadcrumbs: [], + columns: ColumnDefinition.make([{ id: 'dagName', headerTitle: 'Dag Name', - contentPath: 'name' + contentPath: 'name', + cellComponentName: 'em-table-linked-cell', + getCellContent: function (row) { + return { + routeName: "dag", + model: row.get("entityID"), + text: row.get("name") + }; + } },{ id: 'entityID', headerTitle: 'Id', @@ -89,15 +97,4 @@ export default TablePageController.extend({ } }]), - _loadObserver: Ember.on("init", Ember.observer("rowCount", function () { - var that = this, - query = { - limit: this.get("rowCount") - }; - - Ember.run.later(function () { - that.send("loadData", query); - }); - })) - }); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/page.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/page.js b/tez-ui2/src/main/webapp/app/controllers/page.js new file mode 100644 index 0000000..84882a8 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/page.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import AbstractController from './abstract'; + +export default AbstractController.extend({ + // Must be set from route + isLoading: false, + + loaded: Ember.computed("model", "isLoading", function () { + return this.get("model") && !this.get("isLoading"); + }), +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/controllers/table-page.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/table-page.js b/tez-ui2/src/main/webapp/app/controllers/table-page.js index c807393..14219d9 100644 --- a/tez-ui2/src/main/webapp/app/controllers/table-page.js +++ b/tez-ui2/src/main/webapp/app/controllers/table-page.js @@ -16,9 +16,9 @@ * limitations under the License. */ -import Ember from 'ember'; +import PageController from './page'; -export default Ember.Controller.extend({ +export default PageController.extend({ queryParams: ["rowCount", "searchText", "sortColumnId", "sortOrder", "pageNo"], rowCount: 10, searchText: "", @@ -26,10 +26,6 @@ export default Ember.Controller.extend({ sortOrder: "", pageNo: 1, - loaded: Ember.computed("model", "isLoading", function () { - return this.get("model") && !this.get("isLoading"); - }), - actions: { searchChanged: function (searchText) { this.set("searchText", searchText); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/mixins/name.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/mixins/name.js b/tez-ui2/src/main/webapp/app/mixins/name.js new file mode 100644 index 0000000..fe0c524 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/mixins/name.js @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Mixin.create({ + + name: Ember.computed(function () { + var name = this.toString(); + name = name.substr(0, name.indexOf("::")); + name = name.substr(name.indexOf(":") + 1); + return name; + }), + +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/router.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/router.js b/tez-ui2/src/main/webapp/app/router.js index 3aca665..d94a837 100644 --- a/tez-ui2/src/main/webapp/app/router.js +++ b/tez-ui2/src/main/webapp/app/router.js @@ -25,6 +25,12 @@ const Router = Ember.Router.extend({ Router.map(function() { this.route('dags', { path: '/' }); + this.route('dag', {path: '/dag/:dag_id'}, function() { + this.route('vertices'); + this.route('tasks'); + this.route('attempts'); + }); + this.route('app', {path: '/app/:app_id'}); }); export default Router; http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 8696b67..1624bea 100644 --- a/tez-ui2/src/main/webapp/app/routes/abstract.js +++ b/tez-ui2/src/main/webapp/app/routes/abstract.js @@ -1,3 +1,4 @@ +/*global more*/ /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -19,14 +20,40 @@ import Ember from 'ember'; import LoaderService from '../services/loader'; import UnlinkedPromise from '../errors/unlinked-promise'; +import NameMixin from '../mixins/name'; -export default Ember.Route.extend({ +var MoreObject = more.Object; + +export default Ember.Route.extend(NameMixin, { title: null, // Must be set by inheriting class isLoading: false, currentPromiseId: null, loadedValue: null, + isLeafRoute: false, + breadcrumbs: null, + childCrumbs: null, + + loaderQueryParams: {}, + + model: function(params/*, transition*/) { + Ember.run.later(this, "loadData", this.queryFromParams(params)); + }, + + queryFromParams: function (params) { + var query = {}; + + MoreObject.forEach(this.get("loaderQueryParams"), function (name, paramKey) { + var value = Ember.get(params, paramKey); + if(value) { + query[name] = value; + } + }); + + return query; + }, + setDocTitle: function () { Ember.$(document).attr('title', this.get('title')); }, @@ -78,7 +105,7 @@ export default Ember.Route.extend({ return value; }, - _setControllerModel: Ember.observer("_controller", "loadedValue", function () { + _setControllerModel: Ember.observer("loadedValue", function () { var controller = this.get("controller"); if(controller) { controller.set("model", this.get("loadedValue")); @@ -93,11 +120,21 @@ export default Ember.Route.extend({ })); }, + startCrumbBubble: function () { + this.send("bubbleBreadcrumbs", []); + }, + actions: { - loadData: function (query) { - // To be on the safer side - Ember.run.once(this, "loadData", query); + setBreadcrumbs: function (crumbs) { + var name = this.get("name"); + if(crumbs && crumbs[name]) { + this.set("breadcrumbs", crumbs[name]); + } + return true; + }, + bubbleBreadcrumbs: function (crumbs) { + crumbs.unshift.apply(crumbs, this.get("breadcrumbs")); + return true; } } - }); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..8719170 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/app.js @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +export default Ember.Route.extend({ +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/routes/application.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/application.js b/tez-ui2/src/main/webapp/app/routes/application.js index 1540107..8da6a31 100644 --- a/tez-ui2/src/main/webapp/app/routes/application.js +++ b/tez-ui2/src/main/webapp/app/routes/application.js @@ -19,16 +19,21 @@ import Ember from 'ember'; export default Ember.Route.extend({ + title: "Application", pageReset: function () { - Ember.$(document).tooltip("close"); + Ember.$(document).tooltip("destroy"); + Ember.$(document).tooltip({ + delay: 20, + tooltipClass: 'generic-tooltip' + }); }, actions: { didTransition: function(/* transition */) { this.pageReset(); }, - pageChanged: function (breadcrumbs) { + bubbleBreadcrumbs: function (breadcrumbs) { this.set("controller.breadcrumbs", breadcrumbs); } } http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..71ff019 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/dag.js @@ -0,0 +1,31 @@ +/** + * 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. + */ + +import AbstractRoute from './abstract'; + +export default AbstractRoute.extend({ + title: "DAG", + + loaderQueryParams: { + id: "dag_id" + }, + + model: function (params) { + return this.get("loader").queryRecord('dag', this.queryFromParams(params).id); + } +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..5de1cab --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/dag/attempts.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import AbstractRoute from '../abstract'; + +export default AbstractRoute.extend({ + title: "DAG Details", + + setupController: function (controller, model) { + this._super(controller, model); + Ember.run.later(this, "startCrumbBubble"); + }, +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..90929d0 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/dag/index.js @@ -0,0 +1,34 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import AbstractRoute from '../abstract'; + +export default AbstractRoute.extend({ + title: "DAG Details", + + 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); + }, + +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..5de1cab --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/dag/tasks.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import AbstractRoute from '../abstract'; + +export default AbstractRoute.extend({ + title: "DAG Details", + + setupController: function (controller, model) { + this._super(controller, model); + Ember.run.later(this, "startCrumbBubble"); + }, +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..5de1cab --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/dag/vertices.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import AbstractRoute from '../abstract'; + +export default AbstractRoute.extend({ + title: "DAG Details", + + setupController: function (controller, model) { + this._super(controller, model); + Ember.run.later(this, "startCrumbBubble"); + }, +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 b4b9070..ecd1b00 100644 --- a/tez-ui2/src/main/webapp/app/routes/dags.js +++ b/tez-ui2/src/main/webapp/app/routes/dags.js @@ -16,11 +16,28 @@ * limitations under the License. */ +import Ember from 'ember'; + import AbstractRoute from './abstract'; export default AbstractRoute.extend({ title: "All DAGs", + queryParams: { + rowCount: { + refreshModel: true + } + }, + + loaderQueryParams: { + rowCount: "rowCount" + }, + + setupController: function (controller, model) { + this._super(controller, model); + Ember.run.later(this, "startCrumbBubble"); + }, + load: function (value, query) { return this.get("loader").query('dag', query); } http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/styles/app.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/app.less b/tez-ui2/src/main/webapp/app/styles/app.less index 082c785..bdf9480 100644 --- a/tez-ui2/src/main/webapp/app/styles/app.less +++ b/tez-ui2/src/main/webapp/app/styles/app.less @@ -21,4 +21,7 @@ @import "tooltip"; +@import "tab-n-refresh"; + @import "page-layout"; +@import "details-page"; http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/styles/details-page.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/details-page.less b/tez-ui2/src/main/webapp/app/styles/details-page.less new file mode 100644 index 0000000..8c85d1f --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/details-page.less @@ -0,0 +1,49 @@ +/** + * 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. + */ + +.detail-list { + table-layout: fixed; + white-space: nowrap; + + .progress { + margin-bottom: 0px; + } + + tr { + margin: 0px 0px 0px 15px; + overflow: hidden; + } + + thead { + background-color: @bg-lite; + font-weight: bold; + } + + td { + padding: 0px 20px 0px 0px; + } + + td:first-child { + width:120px; + } + + th, td { + border: 1px solid @border-lite; + padding: 5px; + } +} http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/styles/page-layout.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/page-layout.less b/tez-ui2/src/main/webapp/app/styles/page-layout.less index aacb731..c3530ff 100644 --- a/tez-ui2/src/main/webapp/app/styles/page-layout.less +++ b/tez-ui2/src/main/webapp/app/styles/page-layout.less @@ -50,6 +50,9 @@ body, html { background-color: transparent; margin-bottom: 0px; + + .active { + } } } http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/app/styles/shared.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/shared.less b/tez-ui2/src/main/webapp/app/styles/shared.less index 7fd4db9..db79db4 100644 --- a/tez-ui2/src/main/webapp/app/styles/shared.less +++ b/tez-ui2/src/main/webapp/app/styles/shared.less @@ -30,3 +30,11 @@ b { margin-left: 5px; padding-left: 5px; } + +.align-checknradio { + input[type=checkbox], input[type=radio] { + vertical-align: middle; + position: relative; + bottom: .2em; + } +} http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..698f8f3 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/tab-n-refresh.less @@ -0,0 +1,42 @@ +/** + * 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. + */ + +@import "./shared"; + +.tab-n-refresh { + margin-bottom: 10px; + position: relative; + + .refresh-ui { + position: absolute; + right: 0px; + top: -10px; + + .text-elements { + display: inline-block; + position: relative; + + line-height: 18px; + top: 12px; + text-align: right; + font-size: .95em; + + .align-checknradio; + } + } +} http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..c1a05b4 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/app.hbs @@ -0,0 +1,19 @@ +{{! + * 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. +}} + +{{outlet}} http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..4075c54 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/components/tab-n-refresh.hbs @@ -0,0 +1,42 @@ +{{! + * 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. +}} + +<ul class="nav nav-tabs tab-n-refresh"> + {{#each normalizedTabs as |tab|}} + <li class="{{if tab.active 'active'}}"> + {{#link-to tab.routeName}} + {{tab.text}} + {{/link-to}} + </li> + {{/each}} + <span class="refresh-ui"> + <span class="text-elements"> + {{input type="checkbox" name="autoEnabled" checked=autoEnabled}} + Auto Refresh + <br/> + {{#if displayTime}} + Last refreshed at <b>{{displayTime}}</b> + {{else}} + Load time not available! + {{/if}} + </span> + <button type="button" class="btn btn-success"> + <i class='fa fa-refresh'></i> Refresh + </button> + </span> +</ul> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..308b905 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/dag.hbs @@ -0,0 +1,20 @@ +{{! + * 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. +}} + +{{tab-n-refresh tabs=tabs}} +{{outlet}} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..63840f5 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/dag/attempts.hbs @@ -0,0 +1,19 @@ +{{! + * 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. +}} + +Attempts \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..2811a35 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/dag/index.hbs @@ -0,0 +1,83 @@ +{{! + * 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. +}} + +{{#if loaded}} + <table class='detail-list'> + <thead> + <tr> + <th colspan=2>Details</th> + </tr> + </thead> + <tbody> + <tr> + <td colspan="2"> + {{bs-button icon="fa fa-download" title="Download data" defaultText="Download data" type="info" clicked="downloadDagJson"}} + </td> + </tr> + <tr> + <td>Application ID</td> + <td> + {{#link-to 'app' model.appID class='ember-table-content'}} + {{model.appID}} + {{/link-to}} + </td> + </tr> + <tr> + <td>ID</td> + <td>{{model.entityID}}</td> + </tr> + <tr> + <td>Submitter</td> + <td>{{model.user}}</td> + </tr> + <tr> + <td>Status</td> + <td> + {{em-table-status-cell content=model.status}} + {{#if progressStr}} {{bs-badge content=progressStr}}{{/if}} + {{#if hasFailedTasks}} + [ <a href='{{unbound failedTasksLink}}'>Failed Tasks</a> ] + {{/if}} + {{#if hasFailedTaskAttempts}} + [ <a href='{{unbound failedTaskAttemptsLink}}'>Failed TaskAttempts</a> ] + {{/if}} + </td> + </tr> + <tr> + <td>Start Time</td> + <td>{{txt model.startTime type="date"}}</td> + </tr> + <tr> + <td>End Time</td> + <td>{{txt model.endTime type="date"}}</td> + </tr> + <tr> + <td>Duration</td> + <td>{{txt model.duration type="duration"}}</td> + </tr> + <tr> + <td>Logs</td> + <td> + {{em-table-linked-cell content=model.containerLogs}} + </td> + </tr> + </tbody> + </table> +{{else}} + {{partial "partials/loading-anim"}} +{{/if}} http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..daee5b5 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/dag/tasks.hbs @@ -0,0 +1,19 @@ +{{! + * 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. +}} + +Tasks \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..7f0bd85 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/templates/dag/vertices.hbs @@ -0,0 +1,19 @@ +{{! + * 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. +}} + +Vertices \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/integration/components/tab-n-refresh-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/integration/components/tab-n-refresh-test.js b/tez-ui2/src/main/webapp/tests/integration/components/tab-n-refresh-test.js new file mode 100644 index 0000000..e45b461 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/integration/components/tab-n-refresh-test.js @@ -0,0 +1,50 @@ +/** + * 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. + */ + +import { moduleForComponent, test } from 'ember-qunit'; +import hbs from 'htmlbars-inline-precompile'; + +moduleForComponent('tab-n-refresh', 'Integration | Component | tab n refresh', { + integration: true +}); + +test('Basic creation test', function(assert) { + var testTabs = [{ + text: "Tab 1", + routeName: "route_1", + },{ + text: "Tab 2", + routeName: "route_2", + }]; + + this.set("tabs", testTabs); + + this.render(hbs`{{tab-n-refresh tabs=tabs}}`); + + assert.equal(this.$("button").text().trim(), 'Refresh'); + assert.equal($(this.$("li")[0]).text().trim(), testTabs[0].text); + assert.equal($(this.$("li")[1]).text().trim(), testTabs[1].text); + + this.render(hbs` + {{#tab-n-refresh tabs=tabs}} + template block text + {{/tab-n-refresh}} + `); + + assert.equal(this.$("button").text().trim(), 'Refresh'); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/abstract-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/abstract-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/abstract-test.js new file mode 100644 index 0000000..640e1e5 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/abstract-test.js @@ -0,0 +1,74 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:abstract', 'Unit | Controller | abstract', { + // Specify the other units that are required for this test. + // needs: ['route:abstract'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller.name); + assert.ok(controller.crumbObserver); + assert.ok(controller.setBreadcrumbs); +}); + +test('init test', function(assert) { + assert.expect(1); + + this.subject({ + send: function (name) { + assert.equal(name, "setBreadcrumbs"); + } + }); +}); + +test('crumbObserver test', function(assert) { + assert.expect(1 + 1); // Init and fired + + let controller = this.subject({ + send: function (name) { + assert.equal(name, "setBreadcrumbs"); + } + }); + + controller.set("breadcrumbs", []); +}); + +test('setBreadcrumbs test', function(assert) { + let testName = "Abc", // Because all controllers are pointing to the leaf rout + testBreadCrumbs = []; + + assert.expect(3); + this.subject({ + name: testName, + breadcrumbs: testBreadCrumbs, + send: function (name, crumbs) { + assert.equal(name, "setBreadcrumbs"); + assert.ok(crumbs.hasOwnProperty(testName)); + assert.equal(crumbs[testName], testBreadCrumbs); + } + }); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dag-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag-test.js new file mode 100644 index 0000000..304321e --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag-test.js @@ -0,0 +1,36 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag', 'Unit | Controller | dag', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); + assert.ok(controller.tabs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js new file mode 100644 index 0000000..1908e69 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/attempts-test.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/attempts', 'Unit | Controller | dag/attempts', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dag/index-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/index-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/index-test.js new file mode 100644 index 0000000..0b64e86 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/index-test.js @@ -0,0 +1,34 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/index', 'Unit | Controller | dag/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js new file mode 100644 index 0000000..9d22331 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/tasks-test.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/tasks', 'Unit | Controller | dag/tasks', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js new file mode 100644 index 0000000..ca6d3d9 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dag/vertices-test.js @@ -0,0 +1,35 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:dag/vertices', 'Unit | Controller | dag/vertices', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.breadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js index 51ea9fe..ddf6c44 100644 --- a/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/dags-test.js @@ -24,16 +24,15 @@ moduleFor('controller:dags', 'Unit | Controller | dags', { }); test('Basic creation test', function(assert) { - assert.expect(2 + 3); + assert.expect(2 + 2); let controller = this.subject({ send: function (name, query) { - assert.equal(name, "loadData"); + assert.equal(name, "setBreadcrumbs"); assert.ok(query); } }); assert.ok(controller); assert.ok(controller.columns); - assert.ok(controller._loadObserver); }); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/page-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/page-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/page-test.js new file mode 100644 index 0000000..ffbdd60 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/page-test.js @@ -0,0 +1,49 @@ +/** + * 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. + */ + +import Ember from 'ember'; + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('controller:page', 'Unit | Controller | page', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.ok(controller); + assert.ok(controller.loaded); + + assert.equal(controller.isLoading, false); +}); + +test('loaded test', function(assert) { + let controller = this.subject({ + send: Ember.K + }); + + assert.notOk(controller.get("loaded")); + controller.set("model", true); + assert.ok(controller.get("loaded")); + controller.set("isLoading", true); + assert.notOk(controller.get("loaded")); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/controllers/table-page-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/table-page-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/table-page-test.js index efe3f7e..4c41a20 100644 --- a/tez-ui2/src/main/webapp/tests/unit/controllers/table-page-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/table-page-test.js @@ -16,6 +16,8 @@ * limitations under the License. */ +import Ember from 'ember'; + import { moduleFor, test } from 'ember-qunit'; moduleFor('controller:table-page', 'Unit | Controller | table page', { @@ -24,7 +26,9 @@ moduleFor('controller:table-page', 'Unit | Controller | table page', { }); test('Basic creation test', function(assert) { - let controller = this.subject(); + let controller = this.subject({ + send: Ember.K + }); assert.ok(controller); assert.ok(controller.queryParams); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/mixins/name-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/mixins/name-test.js b/tez-ui2/src/main/webapp/tests/unit/mixins/name-test.js new file mode 100644 index 0000000..aedd0cd --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/mixins/name-test.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import Ember from 'ember'; +import NameMixin from '../../../mixins/name'; +import { module, test } from 'qunit'; + +module('Unit | Mixin | name'); + +test('Basic creation', function(assert) { + let NameObject = Ember.Object.extend(NameMixin); + let subject = NameObject.create(); + + assert.ok(subject); + assert.ok(subject.name); +}); + +test('name test', function(assert) { + let NameObject = Ember.Object.extend(NameMixin), + testName = "ts"; + + let subject = NameObject.create({ + toString: function () { + return `<tez-ui@test:${testName}::ember427>`; + } + }); + + assert.equal(subject.get("name"), testName); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 222a19e..e1e446a 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 @@ -31,6 +31,11 @@ test('Basic creation test', function(assert) { let route = this.subject(); assert.ok(route); + + assert.ok(route.loaderQueryParams); + assert.ok(route.model); + assert.ok(route.queryFromParams); + assert.ok(route.setDocTitle); assert.ok(route.setupController); @@ -46,7 +51,28 @@ test('Basic creation test', function(assert) { assert.ok(route._setControllerModel); assert.ok(route.setLoader); - assert.ok(route.actions.loadData); + assert.ok(route.actions.setBreadcrumbs); + assert.ok(route.actions.bubbleBreadcrumbs); +}); + +test('queryFromParams test', function(assert) { + let route = this.subject({ + loaderQueryParams: { + id: "a_id", + b: "b" + } + }), + testParam = { + a: 1, + a_id: 2, + b: 3, + b_id: 4 + }; + + assert.deepEqual(route.queryFromParams(testParam), { + id: 2, + b: 3 + }); }); test('checkAndCall test', function(assert) { @@ -208,3 +234,37 @@ test('setLoader test', function(assert) { assert.equal(route.get("loader.store"), route.get("store")); assert.equal(route.get("loader.container"), route.get("container")); }); + +test('actions.setBreadcrumbs test', function(assert) { + let testName = "ts", + route = this.subject({ + name: testName + }), + testCrumbs = {}; + + // Because all controllers are pointing to the leaf rout + testCrumbs[testName] = testCrumbs; + + route.send("setBreadcrumbs", testCrumbs); + assert.equal(route.get("breadcrumbs"), testCrumbs); + + route.send("setBreadcrumbs", {}); + assert.equal(route.get("breadcrumbs"), testCrumbs); + + route.send("setBreadcrumbs", null); + assert.equal(route.get("breadcrumbs"), testCrumbs); +}); + +test('actions.bubbleBreadcrumbs test', function(assert) { + let testName = "ts", + route = this.subject({ + name: testName + }), + existingCrumbs = [1, 2], + testCrumbs = [1, 2]; + + route.set("breadcrumbs", existingCrumbs); + + route.send("bubbleBreadcrumbs", testCrumbs); + assert.equal(testCrumbs.length, 2 + 2); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/routes/app-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/app-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/app-test.js new file mode 100644 index 0000000..8e361ea --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/app-test.js @@ -0,0 +1,29 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:app', 'Unit | Route | app', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + assert.ok(route); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js index fbf515b..695b72f 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js @@ -29,7 +29,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.pageReset); assert.ok(route.actions.didTransition); - assert.ok(route.actions.pageChanged); + assert.ok(route.actions.bubbleBreadcrumbs); }); test('Test didTransition action', function(assert) { @@ -44,7 +44,7 @@ test('Test didTransition action', function(assert) { route.send("didTransition"); }); -test('Test pageChanged action', function(assert) { +test('Test bubbleBreadcrumbs action', function(assert) { let route = this.subject(), testController = { breadcrumbs: null @@ -54,6 +54,6 @@ test('Test pageChanged action', function(assert) { route.controller = testController; assert.notOk(route.get("controller.breadcrumbs")); - route.send("pageChanged", testBreadcrumbs); + route.send("bubbleBreadcrumbs", testBreadcrumbs); assert.equal(route.get("controller.breadcrumbs"), testBreadcrumbs); }); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/routes/dag-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dag-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dag-test.js new file mode 100644 index 0000000..dc1c012 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag-test.js @@ -0,0 +1,32 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:dag', 'Unit | Route | dag', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('it exists', function(assert) { + let route = this.subject(); + + assert.ok(route); + assert.ok(route.loaderQueryParams); + assert.ok(route.model); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..f997891 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/attempts-test.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:dag/attempts', 'Unit | Route | dag/attempts', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + + assert.ok(route); + assert.ok(route.title); + assert.ok(route.setupController); +}); + +test('setupController test', function(assert) { + assert.expect(1); + + let route = this.subject({ + startCrumbBubble: function () { + assert.ok(true); + } + }); + + route.setupController({}, {}); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..aef7031 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/index-test.js @@ -0,0 +1,46 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:dag/index', 'Unit | Route | dag/index', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + + assert.ok(route); + assert.ok(route.title); + assert.ok(route.setupController); + assert.ok(route.load); +}); + +test('setupController test', function(assert) { + assert.expect(1); + + let route = this.subject({ + startCrumbBubble: function () { + assert.ok(true); + } + }); + + route.setupController({}, {}); +}); + http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..3e283ca --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/tasks-test.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:dag/tasks', 'Unit | Route | dag/tasks', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + + assert.ok(route); + assert.ok(route.title); + assert.ok(route.setupController); +}); + +test('setupController test', function(assert) { + assert.expect(1); + + let route = this.subject({ + startCrumbBubble: function () { + assert.ok(true); + } + }); + + route.setupController({}, {}); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/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 new file mode 100644 index 0000000..e55e184 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dag/vertices-test.js @@ -0,0 +1,44 @@ +/** + * 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. + */ + +import { moduleFor, test } from 'ember-qunit'; + +moduleFor('route:dag/vertices', 'Unit | Route | dag/vertices', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let route = this.subject(); + + assert.ok(route); + assert.ok(route.title); + assert.ok(route.setupController); +}); + +test('setupController test', function(assert) { + assert.expect(1); + + let route = this.subject({ + startCrumbBubble: function () { + assert.ok(true); + } + }); + + route.setupController({}, {}); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/a0ba39cb/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js b/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js index 3dabfe4..8b99a7f 100644 --- a/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/routes/dags-test.js @@ -28,5 +28,7 @@ test('Basic creation test', function(assert) { assert.ok(route); assert.ok(route.title); + assert.ok(route.loaderQueryParams); + assert.ok(route.setupController); assert.ok(route.load); });