Return-Path: X-Original-To: apmail-zeppelin-commits-archive@minotaur.apache.org Delivered-To: apmail-zeppelin-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 51A6618204 for ; Thu, 2 Jul 2015 06:55:35 +0000 (UTC) Received: (qmail 3416 invoked by uid 500); 2 Jul 2015 06:55:35 -0000 Delivered-To: apmail-zeppelin-commits-archive@zeppelin.apache.org Received: (qmail 3377 invoked by uid 500); 2 Jul 2015 06:55:35 -0000 Mailing-List: contact commits-help@zeppelin.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zeppelin.incubator.apache.org Delivered-To: mailing list commits@zeppelin.incubator.apache.org Received: (qmail 3368 invoked by uid 99); 2 Jul 2015 06:55:35 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 06:55:35 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A8E79C0482 for ; Thu, 2 Jul 2015 06:55:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.791 X-Spam-Level: * X-Spam-Status: No, score=1.791 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 7jbBuLa9rKA2 for ; Thu, 2 Jul 2015 06:55:21 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id F13B224F69 for ; Thu, 2 Jul 2015 06:55:19 +0000 (UTC) Received: (qmail 3087 invoked by uid 99); 2 Jul 2015 06:55:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 06:55:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id BACEDE17F9; Thu, 2 Jul 2015 06:55:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: moon@apache.org To: commits@zeppelin.incubator.apache.org Date: Thu, 02 Jul 2015 06:55:31 -0000 Message-Id: <0e6d4449a1944d8d9a1b917c2e3a9d4b@git.apache.org> In-Reply-To: <0707d104785046e6ae9e55f84403d2b5@git.apache.org> References: <0707d104785046e6ae9e55f84403d2b5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [14/14] incubator-zeppelin git commit: Zeppelin-web Spring Cleaning Zeppelin-web Spring Cleaning After so much time in the Wild Wild West of Internet, It's Time for the Spring Cleaning of Zeppelin-web. This PR will be taking care of cleaning the code, architecture, cutting code into smaller pieces etc... * [x] - Change Code Folder Structure to a Folder Tree Style * [x] - Change original code and compiled code folder names * [x] - Update Contributing README.md to explain most of changes * [x] - Organize well the components and app folders We will do a first merge and handle this part in a different PR: * [ ] - Replace as much code as possible by their lodash.js counterpart * [ ] - Cut the code into more smaller components (who said paragraph.js?) * [ ] - Move Jquery code out of the controllers (by directive when possible or to somewhere else) Needs to make sure that: * [x] - #127 is handled Author: Damien Corneau Author: CORNEAU Damien Closes #56 from corneadoug/improvement/SpringCleaning and squashes the following commits: 453af1a [Damien Corneau] Merge Master and Fix ports 678c0fa [Damien Corneau] Fix RAT excluded and add Apache licenses in zeppelin-web 0addb80 [Damien Corneau] Change AppScriptServlet configuration ef764fc [Damien Corneau] Improve uglifyjs options 15cc7b1 [CORNEAU Damien] Fix README e3ca174 [CORNEAU Damien] Small fix in doc 775f3ca [Damien Corneau] Remove unused ngdoc comments 25a3a63 [Damien Corneau] Fix Interpreter Create form bdde389 [Damien Corneau] Set loonknfeel to default for everypage, and change only if looknfeel is different bdf3a8e [Damien Corneau] Include lodash + Interpreter Web refactoring Part1: reducing code 931067a [Damien Corneau] Align form label to form input + improve form disable opacity 75d12c3 [Damien Corneau] Fix CSS of paragraph forms e3f3016 [Damien Corneau] Fix ZEPPELIN-102 a6ec901 [Damien Corneau] Fix ZEPPELIN-103 7eccca8 [Damien Corneau] Fix navbar selected menu + small code improvement a1fe1c1 [Damien Corneau] Refactoring of Websocket a36adf9 [Damien Corneau] Move all websocket calls to a service b21cc69 [Damien Corneau] Refactor Navbar controller to controller pattern + data factory 5a40c4c [Damien Corneau] Separate navbar to its own html file 2dac138 [Damien Corneau] Move directives to solo directory 9201360 [Damien Corneau] Fix project after git clean 9b249ea [Damien Corneau] Clean JSHint errors except for already defined and configuration functions related errors ef6baa0 [CORNEAU Damien] Update Zeppelin-web CONTRIBUTING.md 411df6a [Damien Corneau] Create Zeppelin-web CONTRIBUTING.md d3c22cf [CORNEAU Damien] Update Zeppelin-web README.md 48eed51 [Damien Corneau] Move the font css 3e28c3c [Damien Corneau] Change Zeppelin-web code and compiled code folders 0ee04a2 [Damien Corneau] Fix Grunt watch 15b502c [Damien Corneau] Change Zeppelin Folder Structure and its GruntFile 9f9059e [Damien Corneau] Add spark dependency reduced pom to gitignore Project: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/commit/8c7424a1 Tree: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/tree/8c7424a1 Diff: http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/diff/8c7424a1 Branch: refs/heads/master Commit: 8c7424a191d1a5891a48bcb5abd926f27ba30b09 Parents: ae092e9 Author: Damien Corneau Authored: Thu Jul 2 12:01:14 2015 +0900 Committer: Lee moon soo Committed: Wed Jul 1 23:55:11 2015 -0700 ---------------------------------------------------------------------- .gitignore | 26 +- bin/common.sh | 4 +- .../zeppelin/server/AppScriptServlet.java | 16 +- zeppelin-web/.jshintrc | 3 +- zeppelin-web/CONTRIBUTING.md | 118 ++ zeppelin-web/Gruntfile.js | 120 +- zeppelin-web/README.md | 57 +- zeppelin-web/app/.buildignore | 1 - zeppelin-web/app/404.html | 172 -- zeppelin-web/app/WEB-INF/web.xml | 44 - zeppelin-web/app/favicon.ico | Bin 4286 -> 0 bytes zeppelin-web/app/fonts/FontAwesome.otf | Bin 85908 -> 0 bytes zeppelin-web/app/fonts/Simple-Line-Icons.eot | Bin 35514 -> 0 bytes zeppelin-web/app/fonts/Simple-Line-Icons.svg | 1369 --------------- zeppelin-web/app/fonts/Simple-Line-Icons.ttf | Bin 35304 -> 0 bytes zeppelin-web/app/fonts/Simple-Line-Icons.woff | Bin 59324 -> 0 bytes zeppelin-web/app/fonts/custom-font.eot | Bin 1520 -> 0 bytes zeppelin-web/app/fonts/custom-font.svg | 41 - zeppelin-web/app/fonts/custom-font.ttf | Bin 1340 -> 0 bytes zeppelin-web/app/fonts/custom-font.woff | Bin 1416 -> 0 bytes zeppelin-web/app/fonts/fontawesome-webfont.eot | Bin 56006 -> 0 bytes zeppelin-web/app/fonts/fontawesome-webfont.svg | 520 ------ zeppelin-web/app/fonts/fontawesome-webfont.ttf | Bin 112160 -> 0 bytes zeppelin-web/app/fonts/fontawesome-webfont.woff | Bin 65452 -> 0 bytes zeppelin-web/app/images/zepLogo.png | Bin 18321 -> 0 bytes zeppelin-web/app/images/zepLogoW.png | Bin 16393 -> 0 bytes zeppelin-web/app/index.html | 156 -- .../scripts/ace/textarea/src/ace-bookmarklet.js | 14 - zeppelin-web/app/scripts/app.js | 129 -- .../app/scripts/controllers/interpreter.js | 313 ---- zeppelin-web/app/scripts/controllers/main.js | 120 -- zeppelin-web/app/scripts/controllers/nav.js | 54 - .../app/scripts/controllers/notebook.js | 494 ------ .../app/scripts/controllers/paragraph.js | 1620 ------------------ .../app/scripts/directives/dropdowninput.js | 25 - zeppelin-web/app/scripts/directives/ngdelete.js | 34 - zeppelin-web/app/scripts/directives/ngenter.js | 36 - .../scripts/directives/popover-html-unsafe.js | 28 - .../app/scripts/directives/resizable.js | 41 - zeppelin-web/app/styles/custom-font.css | 32 - zeppelin-web/app/styles/font-awesome.min.css | 4 - zeppelin-web/app/styles/interpreter.css | 79 - zeppelin-web/app/styles/looknfeel/default.css | 67 - zeppelin-web/app/styles/looknfeel/report.css | 69 - zeppelin-web/app/styles/looknfeel/simple.css | 73 - zeppelin-web/app/styles/main.css | 288 ---- zeppelin-web/app/styles/notebook.css | 508 ------ zeppelin-web/app/styles/printMode.css | 61 - zeppelin-web/app/styles/simple-line-icons.css | 526 ------ zeppelin-web/app/styles/typography.css | 46 - zeppelin-web/app/views/interpreter.html | 195 --- zeppelin-web/app/views/main.html | 51 - zeppelin-web/app/views/modal-shortcut.html | 130 -- zeppelin-web/app/views/notebooks.html | 170 -- zeppelin-web/app/views/paragraph.html | 449 ----- .../app/views/popover-html-unsafe-popup.html | 21 - zeppelin-web/bower.json | 34 +- zeppelin-web/package.json | 5 +- zeppelin-web/pom.xml | 29 +- zeppelin-web/src/.buildignore | 1 + zeppelin-web/src/404.html | 172 ++ zeppelin-web/src/WEB-INF/web.xml | 44 + zeppelin-web/src/app/app.controller.js | 45 + zeppelin-web/src/app/app.js | 62 + zeppelin-web/src/app/home/home.controller.js | 22 + zeppelin-web/src/app/home/home.css | 288 ++++ zeppelin-web/src/app/home/home.html | 53 + .../interpreter-create/interpreter-create.html | 77 + .../app/interpreter/interpreter.controller.js | 202 +++ .../src/app/interpreter/interpreter.css | 79 + .../src/app/interpreter/interpreter.html | 119 ++ .../src/app/notebook/notebook.controller.js | 473 +++++ zeppelin-web/src/app/notebook/notebook.css | 517 ++++++ zeppelin-web/src/app/notebook/notebook.html | 170 ++ .../notebook/paragraph/paragraph.controller.js | 1594 +++++++++++++++++ .../src/app/notebook/paragraph/paragraph.html | 449 +++++ zeppelin-web/src/assets/images/zepLogo.png | Bin 0 -> 18321 bytes zeppelin-web/src/assets/images/zepLogoW.png | Bin 0 -> 16393 bytes .../src/assets/styles/looknfeel/default.css | 67 + .../src/assets/styles/looknfeel/report.css | 68 + .../src/assets/styles/looknfeel/simple.css | 73 + zeppelin-web/src/assets/styles/printMode.css | 61 + .../src/components/baseUrl/baseUrl.service.js | 66 + .../dropdowninput/dropdowninput.directive.js | 25 + .../modal-shortcut/modal-shortcut.html | 130 ++ .../src/components/navbar/navbar.controller.js | 49 + zeppelin-web/src/components/navbar/navbar.html | 54 + .../components/ngdelete/ngdelete.directive.js | 28 + .../src/components/ngenter/ngenter.directive.js | 27 + .../notebookList.datafactory.js | 26 + .../popover-html-unsafe-popup.html | 21 + .../popover-html-unsafe.directive.js | 28 + .../components/resizable/resizable.directive.js | 41 + .../websocketEvents/websocketEvents.factory.js | 66 + .../websocketEvents/websocketMsg.service.js | 107 ++ zeppelin-web/src/favicon.ico | Bin 0 -> 4286 bytes zeppelin-web/src/fonts/FontAwesome.otf | Bin 0 -> 85908 bytes zeppelin-web/src/fonts/Simple-Line-Icons.eot | Bin 0 -> 35514 bytes zeppelin-web/src/fonts/Simple-Line-Icons.svg | 1369 +++++++++++++++ zeppelin-web/src/fonts/Simple-Line-Icons.ttf | Bin 0 -> 35304 bytes zeppelin-web/src/fonts/Simple-Line-Icons.woff | Bin 0 -> 59324 bytes zeppelin-web/src/fonts/custom-font.css | 32 + zeppelin-web/src/fonts/custom-font.eot | Bin 0 -> 1520 bytes zeppelin-web/src/fonts/custom-font.svg | 41 + zeppelin-web/src/fonts/custom-font.ttf | Bin 0 -> 1340 bytes zeppelin-web/src/fonts/custom-font.woff | Bin 0 -> 1416 bytes zeppelin-web/src/fonts/font-awesome.min.css | 4 + zeppelin-web/src/fonts/fontawesome-webfont.eot | Bin 0 -> 56006 bytes zeppelin-web/src/fonts/fontawesome-webfont.svg | 520 ++++++ zeppelin-web/src/fonts/fontawesome-webfont.ttf | Bin 0 -> 112160 bytes zeppelin-web/src/fonts/fontawesome-webfont.woff | Bin 0 -> 65452 bytes zeppelin-web/src/fonts/simple-line-icons.css | 526 ++++++ zeppelin-web/src/index.html | 124 ++ .../zeppelin/conf/ZeppelinConfiguration.java | 2 +- 114 files changed, 8204 insertions(+), 8110 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/.gitignore ---------------------------------------------------------------------- diff --git a/.gitignore b/.gitignore index 93962a1..1358a42 100644 --- a/.gitignore +++ b/.gitignore @@ -12,26 +12,30 @@ conf/keystore conf/truststore conf/interpreter.json +# other generated files +spark/dependency-reduced-pom.xml + #webapp zeppelin-web/node_modules zeppelin-web/dist zeppelin-web/.tmp zeppelin-web/.sass-cache zeppelin-web/bower_components -zeppelin-web/src **nbproject/ **node/ -logs/ -run/ -metastore_db/ -*.log -jobs/ -zan-repo/ -drivers/ -warehouse/ -notebook/ -local-repo/ + +# project level +/logs/ +/run/ +/metastore_db/ +/*.log +/jobs/ +/zan-repo/ +/drivers/ +/warehouse/ +/notebook/ +/local-repo/ **/sessions/ **/data/ http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/bin/common.sh ---------------------------------------------------------------------- diff --git a/bin/common.sh b/bin/common.sh index 8087e9d..7aab870 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -45,8 +45,8 @@ if [[ -z "$ZEPPELIN_PID_DIR" ]]; then fi if [[ -z "${ZEPPELIN_WAR}" ]]; then - if [[ -d "${ZEPPELIN_HOME}/zeppelin-web/src/main/webapp" ]]; then - export ZEPPELIN_WAR="${ZEPPELIN_HOME}/zeppelin-web/src/main/webapp" + if [[ -d "${ZEPPELIN_HOME}/zeppelin-web/dist" ]]; then + export ZEPPELIN_WAR="${ZEPPELIN_HOME}/zeppelin-web/dist" else export ZEPPELIN_WAR=$(find -L "${ZEPPELIN_HOME}" -name "zeppelin-web*.war") fi http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-server/src/main/java/org/apache/zeppelin/server/AppScriptServlet.java ---------------------------------------------------------------------- diff --git a/zeppelin-server/src/main/java/org/apache/zeppelin/server/AppScriptServlet.java b/zeppelin-server/src/main/java/org/apache/zeppelin/server/AppScriptServlet.java index 8c8f9a7..7a31461 100644 --- a/zeppelin-server/src/main/java/org/apache/zeppelin/server/AppScriptServlet.java +++ b/zeppelin-server/src/main/java/org/apache/zeppelin/server/AppScriptServlet.java @@ -41,7 +41,7 @@ public class AppScriptServlet extends DefaultServlet { private static Set scriptPaths = new HashSet( Arrays.asList( "/scripts/scripts.js", - "/scripts/app.js" + "/components/baseUrl/baseUrl.js" ) ); @@ -77,14 +77,16 @@ public class AppScriptServlet extends DefaultServlet { script.append(new String(buffer, 0, numRead, "UTF-8")); } - // Replace the string "function getPort(){...}" to return - // the proper value - int startIndex = script.indexOf("function getPort()"); - int endIndex = script.indexOf("}", startIndex); + // Replace the getPort function to return the proper value + String startReplaceString = "/* @preserve AppScriptServlet - getPort */"; + String endReplaceString = "/* @preserve AppScriptServlet - close */"; + + int startIndex = script.indexOf(startReplaceString); + int endIndex = script.indexOf(endReplaceString, startIndex); if (startIndex >= 0 && endIndex >= 0) { - String replaceString = "function getPort(){return " + websocketPort + "}"; - script.replace(startIndex, endIndex + 1, replaceString); + String replaceString = "this.getPort=function(){return " + websocketPort + "};"; + script.replace(startIndex, endIndex + endReplaceString.length(), replaceString); } response.getWriter().println(script.toString()); http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/.jshintrc ---------------------------------------------------------------------- diff --git a/zeppelin-web/.jshintrc b/zeppelin-web/.jshintrc index 40377ba..008037e 100644 --- a/zeppelin-web/.jshintrc +++ b/zeppelin-web/.jshintrc @@ -12,9 +12,10 @@ "newcap": true, "noarg": true, "quotmark": "single", + "shadow": "inner", "regexp": true, "undef": true, - "unused": true, + "unused": "vars", "strict": true, "trailing": true, "smarttabs": true, http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/CONTRIBUTING.md ---------------------------------------------------------------------- diff --git a/zeppelin-web/CONTRIBUTING.md b/zeppelin-web/CONTRIBUTING.md new file mode 100644 index 0000000..6873b0f --- /dev/null +++ b/zeppelin-web/CONTRIBUTING.md @@ -0,0 +1,118 @@ +# Contributing to Zeppelin-Web + +## Technologies + +Zeppelin WebApplication is using **AngularJS** as main Framework, and **Grunt** and **Bower** as helpers. + +So you might want to get familiar with it. +[Here is a good start](http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/) +(There is obviously plenty more ressources to learn) + +## Coding style + +* We follow mainly the [Google Javascript Guide](https://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) +* We use a 2 spaces indentation +* We use single quotes + +But don't worry, JSHint will make you remember it for the most part. + +There is also a rule of **No JQuery except in directives**, If you want to include a library, +please search for its **angularJS** directive first and if it doesn't exist, make one :) + +## Folder Structure & Code Organization + +* `src` folder: Contains the Source code for Zeppelin WebApplication +* `dist` folder: Contains the compiled code after using **grunt build** + +### Src and Code Organization + +The `src` folder is organized as such: + +
+ src/
+ ├──  app/
+ │   ├──  name/
+ │   │    ├──  name.controller.js
+ |   |    ├──  name.html
+ |   |    ├──  subComponent1/
+ |   |    |    ├──  subComponent1.html
+ |   |    |    ├──  subComponent1.css
+ │   |    |    └──  subComponent1.controller.js
+ │   │    └──  name.css
+ │   └──  app.js
+ ├──  assets/
+ │   ├──  images/
+ │   └──  styles/
+ |        ├──  looknfeel/
+ │        └──  printMode.css
+ ├──  components/
+ │   ├──  component1/
+ |   |    ├──  component1.html
+ │   |    └──  component1.controller.js
+ │   └──  component2/
+ ├──  fonts/
+ |    ├──  *.{eot,svg,ttf,woff,otf}
+ │    └──  *.css
+ ├──  favico.ico
+ ├──  index.html
+ └──  404.html
+
+ +The code is now organized in a component type of architecture, where everything is logically grouped. + +#### File type name convention + +In order to understand what is contained inside the .js files without opening it, we use some name conventions: +* .controller.js +* .directive.js +* .service.js + +### Component Architecture + +When we talk about Component architecture, we think about grouping files together in a logical way. + +A component can then be made of multiple files like `.html`, `.css` or any other file type mentioned above. + +Related components can be grouped as sub-component as long as they are used in that component only. + + +#### App folder + +Contains the application `app.js` and page related components. +* Home Page +* Interpreter Page +* Notebook Page +etc... + +The only resctiction being that a component in the `app` folder is **not used anywhere else** + +#### Components folder + +The `components` folder is here to contains any reusable component (used more than once) + +### Fonts + +Fonts files and their css are mixed together in the `fonts` folder + +## Compiling and using dev mode + +As we do not use yeoman to generate controllers or other type of files with this new structure, +we need to do some includes manually in `index.html` in order to use dev mode and compile correctly. + +* Non-bower `.js` files needs to be injected between the tag `` +* Css files needs to be injected between the tag `` + +## Add plugins with Bower +``` +bower install --save +``` +The file index.html will automatically update with the new bower_component + +
+ +**Example**: `./bower install angular-nvd3` + +You should find that line in the index.html file +``` + +```` http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/Gruntfile.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/Gruntfile.js b/zeppelin-web/Gruntfile.js index d544ba4..dc2a33e 100644 --- a/zeppelin-web/Gruntfile.js +++ b/zeppelin-web/Gruntfile.js @@ -34,8 +34,8 @@ module.exports = function (grunt) { // Configurable paths for the application var appConfig = { - app: require('./bower.json').appPath || 'app', - dist: 'src/main/webapp' + app: require('./bower.json').appPath || 'src', + dist: 'dist' }; // Define the configuration for all the tasks @@ -63,7 +63,10 @@ module.exports = function (grunt) { tasks: ['wiredep'] }, js: { - files: ['<%= yeoman.app %>/scripts/{,*/}*.js'], + files: [ + '<%= yeoman.app %>/app/**/*.js', + '<%= yeoman.app %>/components/**/*.js' + ], tasks: ['newer:jshint:all'], options: { livereload: '<%= connect.options.livereload %>' @@ -74,7 +77,12 @@ module.exports = function (grunt) { tasks: ['newer:jshint:test', 'karma'] }, styles: { - files: ['<%= yeoman.app %>/styles/{,*/}*.css'], + files: [ + '<%= yeoman.app %>/app/**/*.css', + '<%= yeoman.app %>/components/**/*.css', + '<%= yeoman.app %>/assets/styles/**/*.css', + '<%= yeoman.app %>/fonts/**/*.css' + ], tasks: ['newer:copy:styles', 'autoprefixer'] }, gruntfile: { @@ -85,9 +93,11 @@ module.exports = function (grunt) { livereload: '<%= connect.options.livereload %>' }, files: [ - '<%= yeoman.app %>/{,*/}*.html', + '<%= yeoman.app %>/app/**/*.html', + '<%= yeoman.app %>/*.html', + '<%= yeoman.app %>/components/**/*.html', '.tmp/styles/{,*/}*.css', - '<%= yeoman.app %>/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' + '<%= yeoman.app %>/assets/images/**/*.{png,jpg,jpeg,gif,webp,svg}' ] } }, @@ -148,7 +158,8 @@ module.exports = function (grunt) { all: { src: [ 'Gruntfile.js', - '<%= yeoman.app %>/scripts/{,*/}*.js' + '<%= yeoman.app %>/app/**/*.js', + '<%= yeoman.app %>/components/**/*.js' ] }, test: { @@ -199,18 +210,6 @@ module.exports = function (grunt) { } }, - // Renames files for browser caching purposes - filerev: { - dist: { - src: [ - '<%= yeoman.dist %>/scripts/{,*/}*.js', - '<%= yeoman.dist %>/styles/*.css', - '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}', - '<%= yeoman.dist %>/styles/fonts/*' - ] - } - }, - // Reads HTML for usemin blocks to enable smart builds that automatically // concat, minify and revision files. Creates configurations in memory so // additional tasks can operate on them @@ -235,7 +234,7 @@ module.exports = function (grunt) { html: ['<%= yeoman.dist %>/{,*/}*.html'], css: ['<%= yeoman.dist %>/styles/*.css'], options: { - assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images'] + assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/assets'] } }, @@ -243,24 +242,35 @@ module.exports = function (grunt) { // By default, your `index.html`'s will take care of // minification. These next options are pre-configured if you do not wish // to use the Usemin blocks. - // cssmin: { - // dist: { - // files: { - // '<%= yeoman.dist %>/styles/main.css': [ - // '.tmp/styles/{,*/}*.css' - // ] - // } - // } - // }, - // uglify: { - // dist: { - // files: { - // '<%= yeoman.dist %>/scripts/scripts.js': [ - // '<%= yeoman.dist %>/scripts/scripts.js' - // ] - // } - // } - // }, + cssmin: { + dist: { + files: { + '<%= yeoman.dist %>/styles/main.css': [ + '.tmp/styles/{,*/}*.css' + ] + } + } + }, + + uglify: { + options: { + mangle: { + screw_ie8: true + }, + preserveComments: 'some', + compress: { + screw_ie8: true, + sequences: true, + dead_code: true, + conditionals: true, + booleans: true, + unused: true, + if_return: true, + join_vars: true, + drop_console: true + } + } + }, // concat: { // dist: {} // }, @@ -269,9 +279,9 @@ module.exports = function (grunt) { dist: { files: [{ expand: true, - cwd: '<%= yeoman.app %>/images', + cwd: '<%= yeoman.app %>/assets/images', src: '{,*/}*.svg', - dest: '<%= yeoman.dist %>/images' + dest: '<%= yeoman.dist %>/assets/images' }] } }, @@ -288,7 +298,11 @@ module.exports = function (grunt) { files: [{ expand: true, cwd: '<%= yeoman.dist %>', - src: ['*.html', 'views/{,*/}*.html'], + src: [ + '*.html', + 'app/**/*.html', + 'components/**/*.html' + ], dest: '<%= yeoman.dist %>' }] } @@ -306,18 +320,21 @@ module.exports = function (grunt) { '*.{ico,png,txt}', '.htaccess', '*.html', - 'views/{,*/}*.html', - 'images/*', - 'fonts/*', - 'WEB-INF/*', - 'scripts/ace/{,*/}/{,*/}/*' + 'assets/styles/**/*', + 'assets/images/**/*', + 'WEB-INF/*' ] }, { + // copy fonts + expand : true, + cwd: '<%= yeoman.app %>', + dest: '<%= yeoman.dist %>', + src: ['fonts/**/*.{eot,svg,ttf,woff}'] + }, { expand : true, - dot : true, cwd: '<%= yeoman.app %>', dest: '<%= yeoman.dist %>', - src: ['styles/looknfeel/*'] + src: ['app/**/*.html', 'components/**/*.html'] }, { expand: true, cwd: '.tmp/images', @@ -337,9 +354,10 @@ module.exports = function (grunt) { }, styles: { expand: true, - cwd: '<%= yeoman.app %>/styles', + flatten: true, + cwd: '<%= yeoman.app %>', dest: '.tmp/styles/', - src: '{,*/}*.css' + src: '{fonts,components,app}/**/*.css' } }, @@ -378,7 +396,6 @@ module.exports = function (grunt) { 'concurrent:server', 'autoprefixer', 'connect:livereload', - /*'newer:jshint'*/ 'watch' ]); }); @@ -407,7 +424,6 @@ module.exports = function (grunt) { 'copy:dist', 'cssmin', 'uglify', - /*'filerev',*/ 'usemin', 'htmlmin' ]); http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/README.md ---------------------------------------------------------------------- diff --git a/zeppelin-web/README.md b/zeppelin-web/README.md index 4df6e4c..cbd7d73 100644 --- a/zeppelin-web/README.md +++ b/zeppelin-web/README.md @@ -1,12 +1,34 @@ # Zeppelin Web Application -This is a Zeppelin web frontend project. +This is Zeppelin's frontend project. ## Compile Zeppelin web -If you want to compile the WebApplication, you will have to simply run `mvn package`. + +### New environment + +If you want to compile the WebApplication only, you will have to simply run `mvn package` in this folder. + This will Download all the dependencies including node js and npm (you will find the binaries in the folder `zeppelin-web/node`). -We also provide some **helper script** for bower and grunt (you dont need to install them). +We are supposed to provide some **helper script** for __bower__ and __grunt__, but they are currently outdated, so you might want install them on your machine and use them instead. + +### Configured environment + +Here are the basic commands to compile the WebApplication with a configured environment (Installed grunt, bower, npm) + +**Build the application for production** + +`./grunt build` + +**Run the application in dev mode** + +``./grunt serve`` + +This will launch a Zeppelin WebApplication on port **9000** and update on code changes. +(You will need to have Zeppelin running on the side) + + +#### Troubleshooting In case of the error `ECMDERR Failed to execute "git ls-remote --tags --heads git://xxxxx", exit code of #128` @@ -24,31 +46,4 @@ Try to add to the `.bowerrc` file the following content: and retry to build again. ## Contribute on Zeppelin Web -If you wish to help us to contribute on Zeppelin Web, you will need to install some deps. -Here this is a good start to understand how zeppelin web is architectured. -http://www.sitepoint.com/kickstart-your-angularjs-development-with-yeoman-grunt-and-bower/ - -### Run the application in dev mode -``./grunt serve`` - -### Build the application -`./grunt build` - -### Add composents to Zeppelin Webapp - * New controller : `yo angular:controller ` - * New directive : `yo angular:directive ` - * New service : `yo angular:service ` - - ### Add plugin - - `./bower install -save` - update the file index.html with the new bower_components - - ex: `./bower install angular-nvd3` - ``` - - ```` - - - - +If you wish to help us and contribute to Zeppelin WebApplication, please look at [Zeppelin WebApplication's contribution guideline](CONTRIBUTING.md). http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/.buildignore ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/.buildignore b/zeppelin-web/app/.buildignore deleted file mode 100644 index fc98b8e..0000000 --- a/zeppelin-web/app/.buildignore +++ /dev/null @@ -1 +0,0 @@ -*.coffee \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/404.html ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/404.html b/zeppelin-web/app/404.html deleted file mode 100644 index 9b1fb4c..0000000 --- a/zeppelin-web/app/404.html +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - Page Not Found :( - - - -
-

Not found :(

-

Sorry, but the page you were trying to view does not exist.

-

It looks like this was the result of either:

-
    -
  • a mistyped address
  • -
  • an out-of-date link
  • -
- - -
- - http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/WEB-INF/web.xml b/zeppelin-web/app/WEB-INF/web.xml deleted file mode 100644 index f34da18..0000000 --- a/zeppelin-web/app/WEB-INF/web.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - zeppelin-web - - default - com.sun.jersey.spi.container.servlet.ServletContainer - - com.sun.jersey.config.property.packages - org.apache.zeppelin.rest;com.wordnik.swagger.jersey.listing - - 1 - - - - - default - /rest/* - - - - configuration - deployment - - http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/favicon.ico ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/favicon.ico b/zeppelin-web/app/favicon.ico deleted file mode 100644 index 7e5049a..0000000 Binary files a/zeppelin-web/app/favicon.ico and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/fonts/FontAwesome.otf ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/fonts/FontAwesome.otf b/zeppelin-web/app/fonts/FontAwesome.otf deleted file mode 100644 index 81c9ad9..0000000 Binary files a/zeppelin-web/app/fonts/FontAwesome.otf and /dev/null differ http://git-wip-us.apache.org/repos/asf/incubator-zeppelin/blob/8c7424a1/zeppelin-web/app/fonts/Simple-Line-Icons.eot ---------------------------------------------------------------------- diff --git a/zeppelin-web/app/fonts/Simple-Line-Icons.eot b/zeppelin-web/app/fonts/Simple-Line-Icons.eot deleted file mode 100644 index d258f62..0000000 Binary files a/zeppelin-web/app/fonts/Simple-Line-Icons.eot and /dev/null differ