diff --git a/gui/.jshintrc b/gui/.jshintrc index 08096eff..d421faa3 100644 --- a/gui/.jshintrc +++ b/gui/.jshintrc @@ -27,6 +27,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/gui/.travis.yml b/gui/.travis.yml index 64533bea..e072a03c 100644 --- a/gui/.travis.yml +++ b/gui/.travis.yml @@ -12,7 +12,9 @@ cache: before_install: - npm config set spin false - npm install -g bower + - bower --version - npm install phantomjs-prebuilt + - phantomjs --version install: - npm install diff --git a/gui/Makefile b/gui/Makefile new file mode 100644 index 00000000..7d67384b --- /dev/null +++ b/gui/Makefile @@ -0,0 +1,59 @@ +# Copyright © 2016 Abcum Ltd +# +# Licensed 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. + +GO ?= go +LDF := + +# The `make default` command cleans +# the go build and test files and +# then runs a build and install. + +.PHONY: default +default: + @echo "Choose a Makefile target:" + @$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print " - " $$1}}' | sort + +# The `make setup` command installs +# the 3rd party dependencies needed +# to run this package. + +.PHONY: setup +setup: + @echo "Setup..." + npm install -g bower + npm install -g ember-cli@2.7.0 + +# The `make install` command installs +# the 3rd party dependencies needed +# to run this package. + +.PHONY: install +install: + @echo "Installing..." + npm cache clean && bower cache clean + rm -rf node_modules bower_components dist tmp + npm install && bower install + +# The `make upgrade` command updates +# ember-cli and runs the ember-cli +# init command. + +.PHONY: upgrade +upgrade: + @echo "Upgrading..." + npm cache clean && bower cache clean + rm -rf node_modules bower_components dist tmp + npm install --save-dev ember-cli@2.7.0 + npm install && bower install + ember init diff --git a/gui/README.md b/gui/README.md index c4170506..6030b660 100644 --- a/gui/README.md +++ b/gui/README.md @@ -2,36 +2,11 @@ The web gui for Surreal built using ember.js. -[![](https://img.shields.io/circleci/token/adb5ca379a334a4011fa894275c312fe35833d6d/project/abcum/surreal/master.svg?style=flat-square)](https://circleci.com/gh/abcum/surreal) [![](https://img.shields.io/badge/ember--cli-2.6.3-orange.svg?style=flat-square)](https://github.com/abcum/surreal) [![](https://img.shields.io/badge/license-Commercial-00bfff.svg?style=flat-square)](https://github.com/abcum/surreal) +[![](https://img.shields.io/circleci/token/adb5ca379a334a4011fa894275c312fe35833d6d/project/abcum/surreal/master.svg?style=flat-square)](https://circleci.com/gh/abcum/surreal) [![](https://img.shields.io/badge/ember--cli-2.7.0-orange.svg?style=flat-square)](https://github.com/abcum/surreal) [![](https://img.shields.io/badge/license-Commercial-00bfff.svg?style=flat-square)](https://github.com/abcum/surreal) -#### Setup +## Development -- Install node - `brew install node` -- Install bower - `npm install -g bower` -- Install ember-cli - `npm install -g ember-cli@2.6.3` - -#### Installing - -- Clean cache - `npm cache clean && bower cache clean` -- Clean build - `rm -rf node_modules bower_components dist tmp` -- Install application dependencies - `npm install && bower install` - -#### Upgrading - -- Clean cache - `npm cache clean && bower cache clean` -- Clean build - `rm -rf node_modules bower_components dist tmp` -- Upgrade project ember-cli `npm install --save-dev ember-cli@2.6.3` -- Install application dependencies - `npm install && bower install` -- Initialise ember - `ember init` - -#### Development - -- Serve application - `ember serve` - -#### Testing - -- Initialise tests - `npm test` - -#### Deployment - -- Deploy production app by pushing to master branch on github.com +- `make setup` (install bower and ember-cli) +- `make install` (install bower and ember-cli dependencies) +- `make upgrade` (upgrade ember-cli to the specified version) +- `npm test` (run all tests defined in the package) diff --git a/gui/app/index.html b/gui/app/index.html index 18efe861..9a371692 100644 --- a/gui/app/index.html +++ b/gui/app/index.html @@ -9,16 +9,16 @@ {{content-for "head"}} - - + + {{content-for "head-footer"}}
{{content-for "body"}} - - + + {{content-for "body-footer"}} diff --git a/gui/app/router.js b/gui/app/router.js index 3bba78eb..cdc25787 100644 --- a/gui/app/router.js +++ b/gui/app/router.js @@ -2,7 +2,8 @@ import Ember from 'ember'; import config from './config/environment'; const Router = Ember.Router.extend({ - location: config.locationType + location: config.locationType, + rootURL: config.rootURL }); Router.map(function() { diff --git a/gui/bower.json b/gui/bower.json index 2be0adb6..0b96caa1 100644 --- a/gui/bower.json +++ b/gui/bower.json @@ -1,9 +1,8 @@ { "name": "gui", "dependencies": { - "ember": "~2.6.0", + "ember": "~2.7.0", "ember-cli-shims": "0.1.1", - "ember-cli-test-loader": "0.2.2", "ember-qunit-notifications": "0.1.0" } } diff --git a/gui/package.json b/gui/package.json index 2c91517f..fadbc301 100644 --- a/gui/package.json +++ b/gui/package.json @@ -21,7 +21,7 @@ "devDependencies": { "broccoli-asset-rev": "^2.4.2", "ember-ajax": "^2.0.1", - "ember-cli": "2.6.3", + "ember-cli": "2.7.0", "ember-cli-app-version": "^1.0.0", "ember-cli-babel": "^5.1.6", "ember-cli-dependency-checker": "^1.2.0", @@ -29,11 +29,12 @@ "ember-cli-htmlbars-inline-precompile": "^0.3.1", "ember-cli-inject-live-reload": "^1.4.0", "ember-cli-jshint": "^1.0.0", - "ember-cli-qunit": "^1.4.0", + "ember-cli-qunit": "^2.0.0", "ember-cli-release": "^0.2.9", "ember-cli-sri": "^2.1.0", + "ember-cli-test-loader": "^1.1.0", "ember-cli-uglify": "^1.2.0", - "ember-data": "^2.6.0", + "ember-data": "^2.7.0", "ember-export-application-global": "^1.0.5", "ember-load-initializers": "^0.5.1", "ember-resolver": "^2.0.3", diff --git a/gui/tests/.jshintrc b/gui/tests/.jshintrc index 6ec0b7c1..d2bd1134 100644 --- a/gui/tests/.jshintrc +++ b/gui/tests/.jshintrc @@ -47,6 +47,6 @@ "strict": false, "white": false, "eqnull": true, - "esnext": true, + "esversion": 6, "unused": true } diff --git a/gui/tests/index.html b/gui/tests/index.html index 6192e801..9f4b8c41 100644 --- a/gui/tests/index.html +++ b/gui/tests/index.html @@ -10,9 +10,9 @@ {{content-for "head"}} {{content-for "test-head"}} - - - + + + {{content-for "head-footer"}} {{content-for "test-head-footer"}} @@ -21,12 +21,11 @@ {{content-for "body"}} {{content-for "test-body"}} - - - - - - + + + + + {{content-for "body-footer"}} {{content-for "test-body-footer"}}