Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9f9059e
Add spark dependency reduced pom to gitignore
corneadoug Apr 27, 2015
15b502c
Change Zeppelin Folder Structure and its GruntFile
corneadoug Apr 28, 2015
0ee04a2
Fix Grunt watch
corneadoug Apr 29, 2015
3e28c3c
Change Zeppelin-web code and compiled code folders
corneadoug Apr 29, 2015
48eed51
Move the font css
corneadoug May 6, 2015
d3c22cf
Update Zeppelin-web README.md
corneadoug May 6, 2015
411df6a
Create Zeppelin-web CONTRIBUTING.md
corneadoug May 6, 2015
ef6baa0
Update Zeppelin-web CONTRIBUTING.md
corneadoug May 6, 2015
9b249ea
Clean JSHint errors except for already defined and configuration func…
corneadoug May 6, 2015
9201360
Fix project after git clean
corneadoug May 18, 2015
2dac138
Move directives to solo directory
corneadoug May 21, 2015
5a40c4c
Separate navbar to its own html file
corneadoug May 26, 2015
b21cc69
Refactor Navbar controller to controller pattern + data factory
corneadoug Jun 11, 2015
a36adf9
Move all websocket calls to a service
corneadoug Jun 11, 2015
a1fe1c1
Refactoring of Websocket
corneadoug Jun 11, 2015
7eccca8
Fix navbar selected menu + small code improvement
corneadoug Jun 12, 2015
a6ec901
Fix ZEPPELIN-103
corneadoug Jun 15, 2015
e3f3016
Fix ZEPPELIN-102
corneadoug Jun 15, 2015
75d12c3
Fix CSS of paragraph forms
corneadoug Jun 15, 2015
931067a
Align form label to form input + improve form disable opacity
corneadoug Jun 16, 2015
bdf3a8e
Include lodash + Interpreter Web refactoring Part1: reducing code
corneadoug Jun 17, 2015
bdde389
Set loonknfeel to default for everypage, and change only if looknfeel…
corneadoug Jun 18, 2015
25a3a63
Fix Interpreter Create form
corneadoug Jun 18, 2015
775f3ca
Remove unused ngdoc comments
corneadoug Jun 18, 2015
e3ca174
Small fix in doc
corneadoug Jun 30, 2015
15cc7b1
Fix README
corneadoug Jun 30, 2015
ef764fc
Improve uglifyjs options
corneadoug Jul 1, 2015
0addb80
Change AppScriptServlet configuration
corneadoug Jul 1, 2015
678c0fa
Fix RAT excluded and add Apache licenses in zeppelin-web
corneadoug Jul 2, 2015
453af1a
Merge Master and Fix ports
corneadoug Jul 2, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 2 additions & 2 deletions bin/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class AppScriptServlet extends DefaultServlet {
private static Set<String> scriptPaths = new HashSet<String>(
Arrays.asList(
"/scripts/scripts.js",
"/scripts/app.js"
"/components/baseUrl/baseUrl.js"
)
);

Expand Down Expand Up @@ -77,14 +77,16 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response)
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());
Expand Down
3 changes: 2 additions & 1 deletion zeppelin-web/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
118 changes: 118 additions & 0 deletions zeppelin-web/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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:

<pre>
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
</pre>

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 `<!-- build:js({.tmp,src}) scripts/scripts.js -->`
* Css files needs to be injected between the tag `<!-- build:css(.tmp) styles/main.css -->`

## Add plugins with Bower
```
bower install <plugin> --save
```
The file index.html will automatically update with the new bower_component

<br/>

**Example**: `./bower install angular-nvd3`

You should find that line in the index.html file
```
<script src="bower_components/angular-nvd3/dist/angular-nvd3.js"></script>
````
Loading