Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme, package.json #180

Merged
merged 6 commits into from
Oct 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion dcc-portal-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ app/styles/bootstrap.css
report/
app/scripts/common/js/pql/pqlparser.js
target/
test-bower*
translations/*.mo
90 changes: 13 additions & 77 deletions dcc-portal-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,15 @@ Requiments
---

- Install [node.js](http://nodejs.org/download/ )
- Install ruby
- Install rubygems
- Install global modules:

```
npm install -g grunt-cli@0.1.13
npm install -g bower@1.3.12
npm install -g bower-art-resolver
```

Setup
---

- Install local modules
- Install npm and bower dependencies

```
npm install
```

- Install client-side dependencies
```
npm install -g bower
bower install
```

- Install ruby gems

```
sudo gem install bundler -v 1.5.3
bundle install
# bower dependencies are auto-installed via the postinstall hook script
```

Run
Expand All @@ -44,10 +23,7 @@ Run

- Start the [Portal Server](../dcc-portal-server/README.md)

- View the site: [localhost:9000](http://localhost:9000/)

- You can change some of the front end develop options (used `grunt server`) by modifying the `app/develop/scripts/config.js` file.

- View the site: [localhost:9000](http://local.dcc.icgc.org:9000/)

## Basic Style Guide

Expand Down Expand Up @@ -154,14 +130,11 @@ its entirety or none at all.
var _theMeaningOfLife = 42;
```

### Keeping your Code Private + Code Commenting and Documentation
### Code Commenting and Documentation

* The bad example - contents of secrets.js

```javascript
// Without a function closure this becomes global (added to the window object in the browser!)
var _theMeaningOfLife = 42;

// What does this method do?
function meaningOfLife(meaningOfLifeVal) {
// ... some implementation details
Expand All @@ -174,35 +147,15 @@ its entirety or none at all.
* The good example - contents of secrets.js

```javascript
/**
* Anonymous executed function - use this comment style for multiline comments
* its also useful for documenting your functions - we use jsDoc syntax
* http://usejsdoc.org/about-getting-started.html
**/

(function() {
/**
* You should always include this little guy - it will tell your browser to be more
* watchful for common JS issues.
**/
'use strict';

// without a function closure this becomes global (added to the window object in the browser!)
var _theMeaningOfLife = 42;

/**
* Gets and sets the meaning of Life (this is a method description that is picked up by jsdocs).
* @param {string} meaningOfLifeVal - The new meaning of life.
* @returns {string} The current meaning of life.
*/
function meaningOfLife(meaningOfLifeVal) {
// ...
return _theMeaningOfLife;
}

/* ... Some code ... */

})();
/**
* Gets and sets the meaning of Life (this is a method description that is picked up by jsdocs).
* @param {string} meaningOfLifeVal - The new meaning of life.
* @returns {string} The current meaning of life.
*/
function meaningOfLife(meaningOfLifeVal) {
// ...
return _theMeaningOfLife;
}
```


Expand Down Expand Up @@ -262,9 +215,6 @@ Angular makes the controller available via the **$scope** variable irregardless
* An example of a module called projects in a file called projects.js

```javascript
(function () {
'use strict';

// Projects modules definition including dependencies
angular.module('session', ['session.controllers', 'ui.router'])
.constant('sessionConstants', {
Expand All @@ -283,8 +233,6 @@ Angular makes the controller available via the **$scope** variable irregardless
.run(function(someDependency1, someDependency1, ..., someDependencyN) {
/* ... Run block implementation ... */
});

})();
```


Expand Down Expand Up @@ -320,9 +268,6 @@ you can do it inline as long as it does not span more then 3 lines.
* A Good Example

```javascript
(function() {
'use strict';

angular.module('session.controllers', [])
/**
* This controller does ...
Expand Down Expand Up @@ -364,7 +309,6 @@ you can do it inline as long as it does not span more then 3 lines.
.controller('FixedSessionCtrl', function(someService) {
/* ... */
});
})();
```

* If you must use ```$scope``` in your controllers/directives ensure that you are at least encapsulating your
Expand All @@ -375,9 +319,6 @@ you might run into with child scopes used in forms, subcontrollers, and directiv
* A Bad Example

```javascript
(function() {
'use strict';

angular.module('sessions.controller')
.controller(function($scope) {
var _controller = this;
Expand All @@ -388,14 +329,10 @@ you might run into with child scopes used in forms, subcontrollers, and directiv

/* ... */
});
})();
```
* A Good Example

```javascript
(function() {
'use strict';

angular.module('users.controllers')
.controller('UserCtrl', function($scope) {

Expand All @@ -410,7 +347,6 @@ you might run into with child scopes used in forms, subcontrollers, and directiv

/* ... */
});
})();
```

Before Pull Request
Expand Down
4 changes: 1 addition & 3 deletions dcc-portal-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@
"url": "git://github.com:icgc-dcc/dcc-portal.git"
},
"scripts": {
"bower": "bower install",
"postinstall": "bower install",
"sethost": "hostile set localhost local.dcc.icgc.org",
"unsethost": "hostile remove local.dcc.icgc.org",
"checkhost": "node tasks/checkDns.js",
"predev": "npm run checkhost",
"dev": "npm start",
"dev:prodapi": "API_SOURCE=production npm run dev",
"font:open": "fontello-cli --config app/styles/fonts/config.json open",
"test-bower": "rm -rf app/bower_components/ && rm -rf ~/.cache/bower/ && bower install -V 2>&1 | tee test-bower-$(date +%Y%m%d%H%M%S).txt && cat app/bower_components/angular/bower.json | grep version",
"--build": "webpack --verbose --colors --display-error-details --config tasks/webpackConfig.js",
"build": "node ./tasks/build.js",
"start": "node ./tasks/start.js",
"test": "karma start karma.conf.js",
Expand Down
15 changes: 0 additions & 15 deletions dcc-portal-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,6 @@
<workingDirectory>.</workingDirectory>
</configuration>
</execution>
<execution>
<id>bower-install</id>
<phase>compile</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>npm</executable>
<arguments>
<argument>run</argument>
<argument>bower</argument>
</arguments>
<workingDirectory>.</workingDirectory>
</configuration>
</execution>
<execution>
<id>npm-build</id>
<phase>compile</phase>
Expand Down