TEZ-3027. Tez UI 2: Add header and footer elements (sree)
Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/38887860 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/38887860 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/38887860 Branch: refs/heads/TEZ-2980 Commit: 3888786059326fa6c2e544f8936097ac341c8702 Parents: a4f6831 Author: Sreenath Somarajapuram <[email protected]> Authored: Sat Jan 9 13:18:01 2016 +0530 Committer: Sreenath Somarajapuram <[email protected]> Committed: Wed Jan 20 22:30:07 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + .../main/webapp/app/controllers/application.js | 38 +++++ tez-ui2/src/main/webapp/app/index.html | 2 + .../src/main/webapp/app/initializers/jquery.js | 26 ++-- .../src/main/webapp/app/routes/application.js | 35 +++++ tez-ui2/src/main/webapp/app/services/env.js | 7 + tez-ui2/src/main/webapp/app/styles/app.less | 15 +- tez-ui2/src/main/webapp/app/styles/colors.less | 44 ++++++ .../src/main/webapp/app/styles/page-layout.less | 150 +++++++++++++++++++ tez-ui2/src/main/webapp/app/styles/shared.less | 32 ++++ tez-ui2/src/main/webapp/app/styles/tooltip.less | 24 +++ .../main/webapp/app/templates/application.hbs | 49 +++++- tez-ui2/src/main/webapp/bower.json | 8 +- .../src/main/webapp/config/default-app-conf.js | 6 + tez-ui2/src/main/webapp/config/environment.js | 3 +- tez-ui2/src/main/webapp/ember-cli-build.js | 4 +- tez-ui2/src/main/webapp/package.json | 4 + .../webapp/public/assets/images/favicon.png | Bin 0 -> 1416 bytes .../main/webapp/public/assets/images/logo.png | Bin 0 -> 77160 bytes .../tests/unit/controllers/application-test.js | 45 ++++++ .../tests/unit/routes/application-test.js | 59 ++++++++ .../main/webapp/tests/unit/services/env-test.js | 7 + 22 files changed, 528 insertions(+), 31 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index 28584a8..355e7d6 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -11,3 +11,4 @@ ALL CHANGES: TEZ-3023. Tez UI 2: Abstract adapter and route TEZ-3022. Tez UI 2: Add serializer & adapter for timeline server TEZ-3026. Tez UI 2: Add adapters for RM & AM + TEZ-3027. Tez UI 2: Add header and footer elements http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/controllers/application.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/controllers/application.js b/tez-ui2/src/main/webapp/app/controllers/application.js new file mode 100644 index 0000000..24db40a --- /dev/null +++ b/tez-ui2/src/main/webapp/app/controllers/application.js @@ -0,0 +1,38 @@ +/** + * 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'; + +const BREADCRUMB_PREFIX = [{ + text: "All DAGs", + routeName: 'application' +}]; + +export default Ember.Controller.extend({ + breadcrumbs: null, + prefixedBreadcrumbs: Ember.computed("breadcrumbs", function () { + var prefix = BREADCRUMB_PREFIX, + breadcrumbs = this.get('breadcrumbs'); + + if(Array.isArray(breadcrumbs)) { + prefix = prefix.concat(breadcrumbs); + } + + return prefix; + }) +}); http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/index.html ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/index.html b/tez-ui2/src/main/webapp/app/index.html index 2108d0f..3f82152 100644 --- a/tez-ui2/src/main/webapp/app/index.html +++ b/tez-ui2/src/main/webapp/app/index.html @@ -27,6 +27,8 @@ {{content-for 'head'}} + <link rel="shortcut icon" href="assets/images/favicon.png" type="image/x-icon"> + <link rel="stylesheet" href="assets/vendor.css"> <link rel="stylesheet" href="assets/tez-ui.css"> http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/initializers/jquery.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/initializers/jquery.js b/tez-ui2/src/main/webapp/app/initializers/jquery.js index b0c52eb..2c34b1d 100644 --- a/tez-ui2/src/main/webapp/app/initializers/jquery.js +++ b/tez-ui2/src/main/webapp/app/initializers/jquery.js @@ -1,5 +1,3 @@ -/*global $*/ - /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -18,23 +16,21 @@ * limitations under the License. */ -import environment from '../config/environment'; +import Ember from 'ember'; export function initialize(/* application */) { - if(environment.environment !== 'test') { - $(document).tooltip({ - delay: 20, - tooltipClass: 'generic-tooltip' - }); + Ember.$(document).tooltip({ + delay: 20, + tooltipClass: 'generic-tooltip' + }); - $.ajaxPrefilter(function(options, originalOptions, jqXHR) { - jqXHR.requestOptions = originalOptions; - }); + Ember.$.ajaxPrefilter(function(options, originalOptions, jqXHR) { + jqXHR.requestOptions = originalOptions; + }); - $.ajaxSetup({ - cache: false - }); - } + Ember.$.ajaxSetup({ + cache: false + }); } export default { http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/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 new file mode 100644 index 0000000..1540107 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/routes/application.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'; + +export default Ember.Route.extend({ + + pageReset: function () { + Ember.$(document).tooltip("close"); + }, + + actions: { + didTransition: function(/* transition */) { + this.pageReset(); + }, + pageChanged: function (breadcrumbs) { + this.set("controller.breadcrumbs", breadcrumbs); + } + } +}); http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/services/env.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/services/env.js b/tez-ui2/src/main/webapp/app/services/env.js index bd7dde7..78193ee 100644 --- a/tez-ui2/src/main/webapp/app/services/env.js +++ b/tez-ui2/src/main/webapp/app/services/env.js @@ -42,9 +42,16 @@ export default Ember.Service.extend({ MoreObject.merge(collatedENV.APP, ENV); } + this.setComputedENVs(collatedENV); + this.set("ENV", collatedENV); }, + setComputedENVs: function (env) { + var navigator = window.navigator; + env.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') > 0; + }, + app: Ember.computed("ENV.APP", function () { return this.get("ENV.APP"); }) http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/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 8a21537..4c3b89d 100644 --- a/tez-ui2/src/main/webapp/app/styles/app.less +++ b/tez-ui2/src/main/webapp/app/styles/app.less @@ -16,9 +16,12 @@ * limitations under the License. */ -.generic-tooltip { - padding: 3px 5px !important; - background: rgba(0,0,0,.8) !important; - color: white !important; - border: none !important; -} +// External imports +@import "../../bower_components/snippet-ss/less/index"; + +@import "colors"; +@import "shared"; + +@import "tooltip"; + +@import "page-layout"; http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/styles/colors.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/colors.less b/tez-ui2/src/main/webapp/app/styles/colors.less new file mode 100644 index 0000000..af470ff --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/colors.less @@ -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. + */ + +// Colors +@logo-orange: #D27A22; + +@bg-lite: #f5f5f5; +@bg-liter: #f5f5f5; +@bg-red-light: #FFE6E6; + +@bg-grey: #f0f0f0; + +@border-lite: #e5e5e5; +@border-color: #dcdcdc; + +@white: #fff; + +@text-color: rgb(70, 70, 70); +@text-red: red; +@text-light: #BBBBBB; +@text-green: green; + +@top-nav-bg-color-from: #d5d5d5; +@top-nav-bg-color-to: #f0f0f0; + +@success-color: limegreen; +@error-color: crimson; +@warning-color: orange; +@unknown-color: crimson; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/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 new file mode 100644 index 0000000..ef00b40 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/page-layout.less @@ -0,0 +1,150 @@ +/** + * 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 "colors"; +@import "../../bower_components/snippet-ss/less/no"; + +body, html, body > .ember-view { + height: 100%; + overflow: visible; + color: @text-color; + + .san-helvetica; +} +body, html { + min-width: 1024px; +} + +// Styles used in both standalone and wrapped modes +.standalone, .wrapped { + + .lr-margin { + margin: 0px 30px; + } + + .header, .footer { + .content { + position: relative; + + .breadcrumb-container { + position: absolute; + left: 70px; + right: 20px; + top: 9px; + + .breadcrumb { + .no-border; + + background-color: transparent; + margin-bottom: 0px; + } + } + + .ui-info { + position: absolute; + right: 0px; + top: 0px; + + span { + .left-delim; + } + span:first-child { + .no-border; + } + } + } + } + + .header { + background-color: @bg-lite; + + height: 40px; + border-bottom: 1px @border-color solid; + margin-bottom: 10px; + + a.logo { + img { + margin-top: 2px; + height: 34px; + width: 70px; + } + &:hover { + text-decoration: none; + } + } + + .ui-info { + background-color: @bg-lite; + margin-top: 10px; + + .fa::before { + font-size: 20px; + } + } + } + + .footer { + background-color: @white; + color: @text-color; + + padding: 10px 0px; + margin: 0px; + + border-top: 1px @border-color solid; + + font-size: .8em; + + .ui-info { + background-color: @white; + } + } +} + +// TEZ UI in stand alone mode +.standalone { + height: 100%; + + a, .pagination > li > a, .btn-default, .clickable { + color: @logo-orange; + } + + .footer, .footer-frame { + height: 40px; + } + + .footer-pusher { + min-height: 100%; + height: auto !important; + height: 100%; + margin: 0 auto -40px; // Must be same as footer & footer-frame + } +} + +// TEZ UI wrapped in a host like Ambari +.wrapped { + .header { + border: 1px @border-lite solid; + border-radius: 5px; + } + .footer { + display: none; + } +} + + + http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/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 new file mode 100644 index 0000000..7fd4db9 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/shared.less @@ -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 "colors"; + +b { + font-weight: bold; +} +.horizontal-half { + width: 50%; +} + +.left-delim { + border-left: 1px solid @border-color; + margin-left: 5px; + padding-left: 5px; +} http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/styles/tooltip.less ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/styles/tooltip.less b/tez-ui2/src/main/webapp/app/styles/tooltip.less new file mode 100644 index 0000000..8a21537 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/styles/tooltip.less @@ -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. + */ + +.generic-tooltip { + padding: 3px 5px !important; + background: rgba(0,0,0,.8) !important; + color: white !important; + border: none !important; +} http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/app/templates/application.hbs ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/templates/application.hbs b/tez-ui2/src/main/webapp/app/templates/application.hbs index d1154b1..5d1df11 100644 --- a/tez-ui2/src/main/webapp/app/templates/application.hbs +++ b/tez-ui2/src/main/webapp/app/templates/application.hbs @@ -16,10 +16,49 @@ * limitations under the License. }} -<h2 id="title">Welcome to Ember</h2> +<div class="{{if env.app.isStandalone 'standalone' 'wrapped'}} {{if env.ENV.isIE 'ie'}}"> + <div class="footer-pusher"> -{{outlet}} + <div class="header"> + <div class="lr-margin content"> + {{#link-to 'application' class="logo"}} + <img src="assets/images/logo.png" width="70px"/> + <span>{{unbound App.env.version}}</span> + {{/link-to}} -Timeline: {{hosts.timeline}} -<br/> -RM: {{hosts.rm}} + <div class="breadcrumb-container"> + {{em-breadcrumbs items=prefixedBreadcrumbs}} + </div> + + <div class="ui-info"> + {{#if env.app.buildVersion}} + <span>Version <b>{{env.app.buildVersion}}</b></span> + {{/if}} + <span> + <a href={{env.app.hrefs.help}} target="_blank"> + <i class="fa fa-question-circle"></i> + </a> + </span> + </div> + </div> + </div> + + <div class="lr-margin"> + {{outlet}} + </div> + <div class="footer-frame"> </div> + </div> + + <div class="footer"> + <div class="lr-margin content"> + <a href={{env.app.hrefs.license}} target="_blank"> + Licensed under the Apache License, Version 2.0. + </a> + <div class="ui-info"> + {{#if env.app.timezone}} + <span>Timezone <b>{{env.app.timezone}}</b></span> + {{/if}} + </div> + </div> + </div> +</div> http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/bower.json ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/bower.json b/tez-ui2/src/main/webapp/bower.json index 98402b3..550ce85 100644 --- a/tez-ui2/src/main/webapp/bower.json +++ b/tez-ui2/src/main/webapp/bower.json @@ -8,10 +8,12 @@ "ember-load-initializers": "0.1.7", "ember-qunit": "0.4.16", "ember-qunit-notifications": "0.1.0", - "jquery": "^1.11.3", "loader.js": "3.3.0", "qunit": "~1.19.0", - "jquery-ui": "~1.11.4", - "more-js": "*" + "more-js": "*", + "bootstrap": "~3.3.5", + "snippet-ss": "*", + "font-awesome": "~4.5.0", + "jquery-ui": "1.11.4" } } http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/config/default-app-conf.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/config/default-app-conf.js b/tez-ui2/src/main/webapp/config/default-app-conf.js index 31a946f..e3d9076 100644 --- a/tez-ui2/src/main/webapp/config/default-app-conf.js +++ b/tez-ui2/src/main/webapp/config/default-app-conf.js @@ -17,6 +17,8 @@ */ module.exports = { // Tez App configurations + buildVersion: "", + isStandalone: true, // Must be set false while running in wrapped mode hosts: { timeline: 'localhost:8188', rm: 'localhost:8088', @@ -43,5 +45,9 @@ module.exports = { // Tez App configurations tezApp: 'TEZ_APPLICATION' } + }, + hrefs: { + help: "https://tez.apache.org/tez_ui_user_data.html", + license: "http://www.apache.org/licenses/LICENSE-2.0" } }; http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/config/environment.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/config/environment.js b/tez-ui2/src/main/webapp/config/environment.js index 4201f9a..b102c8f 100644 --- a/tez-ui2/src/main/webapp/config/environment.js +++ b/tez-ui2/src/main/webapp/config/environment.js @@ -36,7 +36,8 @@ module.exports = function(environment) { APP: DEFAULT_APP_CONF, contentSecurityPolicy: { - 'connect-src': "* 'self'" + 'connect-src': "* 'self'", + 'style-src': "'self' 'unsafe-inline'" } }; http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/ember-cli-build.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/ember-cli-build.js b/tez-ui2/src/main/webapp/ember-cli-build.js index c68e22b..ac5eea9 100644 --- a/tez-ui2/src/main/webapp/ember-cli-build.js +++ b/tez-ui2/src/main/webapp/ember-cli-build.js @@ -23,7 +23,9 @@ var Funnel = require("broccoli-funnel"); var EmberApp = require('ember-cli/lib/broccoli/ember-app'); module.exports = function(defaults) { - var app = new EmberApp(defaults, {}); + var app = new EmberApp(defaults, { + storeConfigInMeta: false + }); var extraAssets = new Funnel('config', { srcDir: '/', http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/package.json ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/package.json b/tez-ui2/src/main/webapp/package.json index c5ab3d0..33a27a6 100644 --- a/tez-ui2/src/main/webapp/package.json +++ b/tez-ui2/src/main/webapp/package.json @@ -23,14 +23,17 @@ "devDependencies": { "bower": "^1.7.1", "broccoli-asset-rev": "^2.2.0", + "ember-bootstrap": "0.5.1", "ember-cli": "1.13.13", "ember-cli-app-version": "^1.0.0", "ember-cli-auto-register": "^1.1.0", "ember-cli-babel": "^5.1.5", "ember-cli-content-security-policy": "0.4.0", "ember-cli-dependency-checker": "^1.1.0", + "ember-cli-font-awesome": "1.4.0", "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-inject-live-reload": "^1.3.1", + "ember-cli-jquery-ui": "0.0.20", "ember-cli-qunit": "^1.0.4", "ember-cli-release": "0.2.8", "ember-cli-sri": "^1.2.0", @@ -43,6 +46,7 @@ }, "dependencies": { "broccoli-funnel": "^1.0.1", + "em-helpers": "^0.5.2", "ember-cli-htmlbars": "^1.0.1", "ember-cli-less": "^1.4.0" } http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/public/assets/images/favicon.png ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/public/assets/images/favicon.png b/tez-ui2/src/main/webapp/public/assets/images/favicon.png new file mode 100644 index 0000000..4762bdf Binary files /dev/null and b/tez-ui2/src/main/webapp/public/assets/images/favicon.png differ http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/public/assets/images/logo.png ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/public/assets/images/logo.png b/tez-ui2/src/main/webapp/public/assets/images/logo.png new file mode 100644 index 0000000..f29455a Binary files /dev/null and b/tez-ui2/src/main/webapp/public/assets/images/logo.png differ http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/tests/unit/controllers/application-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/controllers/application-test.js b/tez-ui2/src/main/webapp/tests/unit/controllers/application-test.js new file mode 100644 index 0000000..6fe69df --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/controllers/application-test.js @@ -0,0 +1,45 @@ +/** + * 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('controller:application', 'Unit | Controller | application', { + // Specify the other units that are required for this test. + // needs: ['controller:foo'] +}); + +test('Basic creation test', function(assert) { + let controller = this.subject(); + + assert.ok(controller.prefixedBreadcrumbs); +}); + +test('prefixedBreadcrumbs test', function(assert) { + let controller = this.subject(), + prefixedBreadcrumbs, + testText = "foo"; + + controller.breadcrumbs = [{ + text: testText + }]; + prefixedBreadcrumbs = controller.get("prefixedBreadcrumbs"); + + assert.equal(prefixedBreadcrumbs.length, 2); + assert.equal(prefixedBreadcrumbs[0].text, "All DAGs"); + assert.equal(prefixedBreadcrumbs[1].text, testText); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/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 new file mode 100644 index 0000000..fbf515b --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/routes/application-test.js @@ -0,0 +1,59 @@ +/** + * 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:application', 'Unit | Route | application', { + // 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.pageReset); + assert.ok(route.actions.didTransition); + assert.ok(route.actions.pageChanged); +}); + +test('Test didTransition action', function(assert) { + let route = this.subject(); + + assert.expect(1); + + route.pageReset = function () { + assert.ok(true); + }; + + route.send("didTransition"); +}); + +test('Test pageChanged action', function(assert) { + let route = this.subject(), + testController = { + breadcrumbs: null + }, + testBreadcrumbs = [{}]; + + route.controller = testController; + + assert.notOk(route.get("controller.breadcrumbs")); + route.send("pageChanged", testBreadcrumbs); + assert.equal(route.get("controller.breadcrumbs"), testBreadcrumbs); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/38887860/tez-ui2/src/main/webapp/tests/unit/services/env-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/services/env-test.js b/tez-ui2/src/main/webapp/tests/unit/services/env-test.js index 5064fc3..ca17f85 100644 --- a/tez-ui2/src/main/webapp/tests/unit/services/env-test.js +++ b/tez-ui2/src/main/webapp/tests/unit/services/env-test.js @@ -32,6 +32,7 @@ test('Basic creation test', function(assert) { assert.ok(service.ENV); assert.ok(service.collateConfigs); assert.ok(service.app); + assert.ok(service.setComputedENVs); }); test('collateConfigs test', function(assert) { @@ -64,6 +65,12 @@ test('app computed property test', function(assert) { assert.equal(service.get("app.b"), ENV.b); }); +test('setComputedENVs test', function(assert) { + let service = this.subject(); + + assert.equal(service.ENV.isIE, false); +}); + test('Validate config/default-app-conf.js', function(assert) { let service = this.subject();
