Skip to content

Commit

Permalink
Merge pull request #197 from urbanriskmap/dev
Browse files Browse the repository at this point in the history
User agreement updates, permanent link for T&Cs
  • Loading branch information
tomasholderness authored Jun 28, 2017
2 parents e090068 + 7316623 commit e0ff914
Show file tree
Hide file tree
Showing 37 changed files with 746 additions and 263 deletions.
11 changes: 9 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,17 @@
"comments": false,
"compact": false,
"code": true,
"presets": [ "es2015-loose", "stage-1"],
"presets": [ ["es2015", {"loose": true}], "stage-1"],
"plugins": [
"syntax-flow",
"transform-decorators-legacy",
"transform-flow-strip-types"
]
],
"env": {
"test": {
"plugins": [
["istanbul"]
],
}
}
}
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ node_js:
- "6.10.0"
sudo: false

addons:
chrome: stable

branches:
only:
- master
Expand All @@ -16,12 +19,6 @@ notifications:
on_failure: always # options: [always|never|change] default: always
on_start: always # options: [always|never|change] default: always

addons:
browserstack:
username: abrahamquintero1
access_key:
secure: "tf4N4MjqK/0yyI+FOTuCq+douo1m9UEW8VRn8/n8tYr/RGDkOkmGfaalrdrayv9v/LO6FmHb3vWwYKD3cfZEqe574Mcywk03mCGt+Pghq2tMFW8jpTUO7DB9KhFteCmHz39vEnL5/vY4FVVwyEEUQ7t5ycU6L/DP2kCmy7JdqC/XdvvDQu4UB39pAbDabY3/FsNexXKjQ2JZRuL7kHxBAX8qOkidoppZezxvK1DGNWiVGSXZ2Grnu8RSPcEo9OIo+TMLcT9l4p2nO1JC6+iNn73u5ZuNLFB2brf0wbP1nIL2h2ptwnWmADAWGlXUB0/vZU1iawN2M0aaR1s7kbCSs/DIcgWvnZ3Uz+mCufc0JyytKydGH8AdGr2eCU/HBUhju8tjimeXN/KsAwUeHufLqfEQo5jdrOToGx/Jm8GjSFMxE7OpwLl7Qdv93EK8hlGMXuKI+ofTjtRsBP4Bco1vEMiuvPiaY8sLIE6b+6gC8UiNdJpzf4Ul/+vgrvQGsysg7/B/EjTBXtHNDjv9AVKWujnlk/fjknwpSW+QclABan6NvlPzdZSbjDnHnHiSiEsMcrw2YO9OKd/izomuCS9R5LxeIk8noXhoQ/UGMNffVnhI40hYbYmzNsHtpKkVKdv3mhZzSpdq0YpLwHVepctKZH5kBq5paeoGBcNYdkW99iA="

before_install:
- if [[ `npm -v` != 3* ]]; then npm i -g npm@3; fi

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ ___
* '/map/:city/:report' *query parameter (city & report): flyTo queried report id in a supported city*
* '/cards/:id' *query parameter (one time card id): link to access report cards, (use test123 as card id in dev & local environments*

* *Additional query parameters*
* ?lang : Use for setting language to one of the supported languages (en || id).
* ?tab : Use for opening the side pane set to one of the following tabs (report || map || info)
* eg. https://dev.petabencana.id/map?lang=en&tab=info

___

### Configuration
Expand Down Expand Up @@ -99,10 +104,12 @@ Do ('npm test') to build the project and run the tests.

If you want to run BrowserStack, you need to provide environment variables with your
username and password. Put `export BROWSERSTACK_USERNAME=yourUsername` and `export BROWSERSTACK_KEY=yourAccessKey` into
your ~/.bashrc or ~/.bash_profile in order for karma to pick up the browserstack credentials.
your ~/.bashrc or ~/.bash_profile in order for karma to pick up the browserstack credentials. Now run `source ~/bash_profile` and
npm test in order to build the bundle and run karama unit tests against it.

##e2e testing:

You also need the browserstack local [testing binary](https://www.browserstack.com/local-testing). Install it with your key:
`./BrowserStackLocal --key yourAccessKey`
End to end testing is implemented using protractor, webdriver, and browserstack. First install protractor: `npm install -g protractor` then download the webdriver binaries: `webdriver-manager update`. In order to run the tests, the front end must be being served. Run au run in a separate terminal, and then run `protractor protractor.conf.js` which will start the tests. Protractor can be a little finicky, so you should let it run without interacting with other browser windows.

Mockapi to be used in the future.

Expand Down
8 changes: 4 additions & 4 deletions aurelia_project/environments/dev.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export default {
debug: true,
testing: true,
tile_layer: 'https://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.{ext}',
debug: false,
testing: false,
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNpdmVhbTFraDAwNHIyeWw1ZDB6Y2hhbTYifQ.tpgt1PB5lkJ-wITS02c96Q',
data_server: 'https://data-dev.petabencana.id/',
app: 'https://dev.petabencana.id/',
default_language: 'en',
supported_languages: ['en', 'id'],
enable_test_cardid: true
enable_test_cardid: true
};
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- Open Graph data -->
<meta property="og:title" content="PetaBencana.id" />
<meta property="og:url" content="http://www.petabencana.id/" />
<meta property="og:site_name" content="Petabencana.id" />
<meta property="og:site_name" content="PetaBencana.id" />
<meta property="og:image" content="https://dev.petabencana.id/assets/images/cards_image.png" />
<meta property="og:description" content="PetaBencana harnesses the power of social media to gather, sort, and display information about flooding in real time." />

Expand Down
35 changes: 7 additions & 28 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = function(config) {
[project.unitTestRunner.source]: [project.transpiler.id]
},
'babelPreprocessor': { options: project.transpiler.options },
reporters: ['progress'],
reporters: ['progress', 'coverage', 'BrowserStack'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
Expand All @@ -36,33 +36,12 @@ module.exports = function(config) {
args: ['aurelia-root', project.paths.root]
},

// global config of your BrowserStack account
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_KEY
},

// define browsers
customLaunchers: {
bs_firefox_mac: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: '21.0',
os: 'OS X',
os_version: 'Mountain Lion'
},
bs_iphone5: {
base: 'BrowserStack',
device: 'iPhone 5',
os: 'ios',
os_version: '6.0'
}
},

browsers: ['bs_firefox_mac', 'bs_iphone5'],
//optionally, configure the reporter
coverageReporter: {
type : 'html',
dir : 'coverage/'
},

browsers: ['Chrome']
});
if (!process.env.TRAVIS) {
config.browsers.push('Chrome');
}
};
80 changes: 40 additions & 40 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,62 @@
},
"license": "GPL-3.0",
"dependencies": {
"aurelia-animator-css": "^1.0.0",
"aurelia-bootstrapper": "^1.0.0",
"aurelia-fetch-client": "^1.0.1",
"aurelia-http-client": "^1.0.3",
"bluebird": "^3.4.1",
"chart.js": "^2.4.0",
"jquery": "^3.1.1",
"leaflet": "^1.0.1",
"less": "^2.7.1",
"aurelia-animator-css": "^1.0.2",
"aurelia-bootstrapper": "^2.1.1",
"aurelia-fetch-client": "^1.1.2",
"aurelia-http-client": "^1.1.1",
"aurelia-protractor-plugin": "^1.0.3",
"bluebird": "^3.5.0",
"chart.js": "^2.5.0",
"jquery": "^3.2.1",
"leaflet": "^1.0.3",
"less": "^2.7.2",
"nprogress": "^0.2.0",
"requirejs": "^2.3.2",
"requirejs": "^2.3.3",
"text": "github:requirejs/text#latest",
"whatwg-fetch": "^1.0.0"
"whatwg-fetch": "^2.0.3"
},
"peerDependencies": {},
"devDependencies": {
"aurelia-cli": "^0.22.0",
"aurelia-testing": "^1.0.0-beta.2.0.0",
"aurelia-tools": "^0.2.2",
"babel-eslint": "^6.0.4",
"babel-plugin-syntax-flow": "^6.8.0",
"aurelia-cli": "^0.29.0",
"aurelia-testing": "^1.0.0-beta.3.0.1",
"aurelia-tools": "^1.0.0",
"babel-eslint": "^7.2.3",
"babel-plugin-syntax-flow": "^6.18.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-plugin-transform-es2015-modules-amd": "^6.8.0",
"babel-plugin-transform-es2015-modules-commonjs": "^6.10.3",
"babel-plugin-transform-flow-strip-types": "^6.8.0",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-es2015-loose": "^7.0.0",
"babel-preset-stage-1": "^6.5.0",
"babel-register": "^6.9.0",
"browser-sync": "^2.13.0",
"canned": "^0.3.9",
"connect-history-api-fallback": "^1.2.0",
"babel-plugin-transform-es2015-modules-amd": "^6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.24.1",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-polyfill": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-1": "^6.24.1",
"babel-register": "^6.24.1",
"browser-sync": "^2.18.8",
"canned": "^0.3.10",
"connect-history-api-fallback": "^1.3.0",
"gulp": "github:gulpjs/gulp#4.0",
"gulp-babel": "^6.1.2",
"gulp-changed-in-place": "^2.0.3",
"gulp-cli": "^1.2.2",
"gulp-eslint": "^2.0.0",
"gulp-changed-in-place": "^2.2.0",
"gulp-cli": "^1.3.0",
"gulp-eslint": "^3.0.1",
"gulp-flatten": "^0.3.1",
"gulp-less": "^3.3.0",
"gulp-notify": "^2.2.0",
"gulp-notify": "^3.0.0",
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^2.0.0-alpha",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"gulp-sourcemaps": "^2.6.0",
"jasmine-core": "^2.6.1",
"karma": "^1.7.0",
"karma-babel-preprocessor": "^6.0.1",
"karma-browserstack-launcher": "^1.2.0",
"karma-chrome-launcher": "^1.0.1",
"karma-chrome-launcher": "^2.1.1",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"minimatch": "^3.0.2",
"karma-jasmine": "^1.1.0",
"minimatch": "^3.0.4",
"notifyjs-browser": "^0.4.2",
"through2": "^2.0.1",
"topojson-client": "^2.1.0",
"through2": "^2.0.3",
"topojson-client": "^3.0.0",
"uglify-js": "~2.7.5",
"vinyl-fs": "^2.4.3"
"vinyl-fs": "^2.4.4"
}
}
36 changes: 36 additions & 0 deletions protractor_config/protractor.browserstack.android.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// An example configuration file.
exports.config = {
//directConnect: true,

'seleniumAddress': 'http://hub-cloud.browserstack.com/wd/hub',

'capabilities': {
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_KEY,
'browserName': 'android',
'platform': 'ANDROID',
'device': 'Samsung Galaxy S5',
'browserstack.local': 'true',
},

// Capabilities to be passed to the webdriver instance.
//capabilities: {
// 'browserName': 'chrome'
//},

// optional: add seleniumServerJar with proper version number
// seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.53.1.jar',
specs: ['test/e2e/**/*.js'],

plugins: [{
path: './node_modules/aurelia-protractor-plugin'
//package: 'aurelia-protractor-plugin'
}],


// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
37 changes: 37 additions & 0 deletions protractor_config/protractor.browserstack.iphone.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// An example configuration file.
exports.config = {
//directConnect: true,

'seleniumAddress': 'http://hub-cloud.browserstack.com/wd/hub',

'capabilities': {
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_KEY,
'browserName': 'iPhone',
'platform': 'MAC',
'device': 'iPhone 6S',
'browserstack.debug': 'true',
'browserstack.local': 'true',
},

// Capabilities to be passed to the webdriver instance.
//capabilities: {
// 'browserName': 'chrome'
//},

// optional: add seleniumServerJar with proper version number
// seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.53.1.jar',
specs: ['test/e2e/**/*.js'],

plugins: [{
path: './node_modules/aurelia-protractor-plugin'
//package: 'aurelia-protractor-plugin'
}],


// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
39 changes: 39 additions & 0 deletions protractor_config/protractor.browserstack.safari.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// An example configuration file.
exports.config = {
//directConnect: true,

'seleniumAddress': 'http://hub-cloud.browserstack.com/wd/hub',

'capabilities': {
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_KEY,
'os': 'OS X',
'os_version': 'Yosemite',
'browserName': 'Safari',
'browser_version': '8.0',
'resolution': '1024x768',
'browserstack.debug': 'true',
'browserstack.local': 'true',
},

// Capabilities to be passed to the webdriver instance.
//capabilities: {
// 'browserName': 'chrome'
//},

// optional: add seleniumServerJar with proper version number
// seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.53.1.jar',
specs: ['test/e2e/**/*.js'],

plugins: [{
path: './node_modules/aurelia-protractor-plugin'
//package: 'aurelia-protractor-plugin'
}],


// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
25 changes: 25 additions & 0 deletions protractor_config/protractor.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// An example configuration file.
exports.config = {
directConnect: true,

// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},

// optional: add seleniumServerJar with proper version number
// seleniumServerJar: './node_modules/gulp-protractor/node_modules/protractor/selenium/selenium-server-standalone-2.53.1.jar',
specs: ['../test/e2e/**/*.js'],

plugins: [{
path: '../node_modules/aurelia-protractor-plugin'
//package: 'aurelia-protractor-plugin'
}],


// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
5 changes: 2 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ export class App {
config.options.pushState = true;
config.options.root = '/';
config.map([
{route: ['', 'map', 'map/:city', 'map/:city/'], name: 'map', moduleId: 'routes/landing/landing'},
{route: 'map/:city/:report', moduleId: 'routes/landing/landing'},
{route: 'cards/:id', moduleId: 'routes/cards/cards'}
{route: ['', 'map', 'map/:city', 'map/:city/:report'], name: 'map', moduleId: 'routes/landing/landing'},
{route: 'cards/:id', moduleId: 'routes/cards/cards'}
]);
config.mapUnknownRoutes({moduleId: 'routes/landing/landing'});
this.router = router;
Expand Down
Loading

0 comments on commit e0ff914

Please sign in to comment.