Skip to content

Commit

Permalink
Merge pull request #241 from urbanriskmap/dev
Browse files Browse the repository at this point in the history
Merging dev to master
Reviewed changes, tested in prod environment via riskmap.us deployment off dev branch
  • Loading branch information
ojha-url authored Sep 29, 2017
2 parents e55b144 + bbf069c commit 12090de
Show file tree
Hide file tree
Showing 76 changed files with 1,972 additions and 253 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ coverage/
src/environment.js
src/deployment.js
src/components/side-pane/
src/resources/locales/local_lang.js
src/resources/locales/
/index.html
/favicon.ico

#for vim:
*.swp
Expand Down
2 changes: 1 addition & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"ignoreDelimiters": [
{ "start": "start-non-standard", "end": "end-non-standard" }
{ "start": "start-aurelia-decorators", "end": "end-aurelia-decorators" }
],
"esversion":6
}
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### PetaBencana.id
Front-end code  
### RiskMap
Client application for cognicity map  
[![Build Status](https://travis-ci.org/urbanriskmap/petabencana.id.svg?branch=master)](https://travis-ci.org/urbanriskmap/petabencana.id)
<br>
[Project description](https://github.com/urbanriskmap/petabencana-docs/blob/master/README.md)
Expand All @@ -12,6 +12,11 @@ DOI for current stable release [v1.0.1](https://github.com/urbanriskmap/petabenc
[![DOI](https://zenodo.org/badge/70249665.svg)](https://zenodo.org/badge/latestdoi/70249665)
____

### Supported deployments
* riskmap.us
* petabencana.id
* riskmap.in

### Machine setup
* Install NodeJS >= 4.x
* You can [download it here](https://nodejs.org/en/).
Expand Down
16 changes: 8 additions & 8 deletions assets/fonts/fontello/config.json
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "",
"name": "fontello",
"css_prefix_text": "icon-",
"css_use_suffix": false,
"hinting": true,
Expand Down Expand Up @@ -84,12 +84,6 @@
"code": 62073,
"src": "fontawesome"
},
{
"uid": "559647a6f430b3aeadbecd67194451dd",
"css": "menu",
"code": 61641,
"src": "fontawesome"
},
{
"uid": "9bd60140934a1eb9236fd7a8ab1ff6ba",
"css": "spin4",
Expand Down Expand Up @@ -403,6 +397,12 @@
"search": [
"flood_icon"
]
},
{
"uid": "2cfb3f2b46b34a1790aec0aa846297b6",
"css": "menu",
"code": 59425,
"src": "entypo"
}
]
}
}
Empty file modified assets/fonts/fontello/css/animation.css
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion assets/fonts/fontello/css/fontello-codes.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
.icon-desilting:before { content: '\e81e'; } /* '' */
.icon-canalrepair:before { content: '\e81f'; } /* '' */
.icon-map-flood:before { content: '\e820'; } /* '' */
.icon-menu:before { content: '\e821'; } /* '' */
.icon-flood:before { content: '\e822'; } /* '' */
.icon-spin4:before { content: '\e834'; } /* '' */
.icon-menu:before { content: '\f0c9'; } /* '' */
.icon-angle-double-right:before { content: '\f101'; } /* '' */
.icon-apple:before { content: '\f179'; } /* '' */
.icon-android:before { content: '\f17b'; } /* '' */
Expand Down
22 changes: 11 additions & 11 deletions assets/fonts/fontello/css/fontello-embedded.css
100644 → 100755

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/fonts/fontello/css/fontello-ie7-codes.css
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
.icon-desilting { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
.icon-canalrepair { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
.icon-map-flood { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
.icon-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
.icon-flood { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
.icon-spin4 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe834;&nbsp;'); }
.icon-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0c9;&nbsp;'); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf101;&nbsp;'); }
.icon-apple { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf179;&nbsp;'); }
.icon-android { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf17b;&nbsp;'); }
Expand Down
4 changes: 2 additions & 2 deletions assets/fonts/fontello/css/fontello-ie7.css
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[class^="icon-"], [class*=" icon-"] {
font-family: 'fontello';
font-family: 'manu';
font-style: normal;
font-weight: normal;

Expand Down Expand Up @@ -43,9 +43,9 @@
.icon-desilting { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81e;&nbsp;'); }
.icon-canalrepair { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe81f;&nbsp;'); }
.icon-map-flood { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe820;&nbsp;'); }
.icon-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe821;&nbsp;'); }
.icon-flood { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe822;&nbsp;'); }
.icon-spin4 { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe834;&nbsp;'); }
.icon-menu { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0c9;&nbsp;'); }
.icon-angle-double-right { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf101;&nbsp;'); }
.icon-apple { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf179;&nbsp;'); }
.icon-android { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf17b;&nbsp;'); }
Expand Down
22 changes: 11 additions & 11 deletions assets/fonts/fontello/css/fontello.css
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?61121405');
src: url('../font/fontello.eot?61121405#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?61121405') format('woff2'),
url('../font/fontello.woff?61121405') format('woff'),
url('../font/fontello.ttf?61121405') format('truetype'),
url('../font/fontello.svg?61121405#fontello') format('svg');
font-family: 'manu';
src: url('../font/manu.eot?32698092');
src: url('../font/manu.eot?32698092#iefix') format('embedded-opentype'),
url('../font/manu.woff2?32698092') format('woff2'),
url('../font/manu.woff?32698092') format('woff'),
url('../font/manu.ttf?32698092') format('truetype'),
url('../font/manu.svg?32698092#manu') format('svg');
font-weight: normal;
font-style: normal;
}
Expand All @@ -14,14 +14,14 @@
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?61121405#fontello') format('svg');
font-family: 'manu';
src: url('../font/manu.svg?32698092#manu') format('svg');
}
}
*/

[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-family: "manu";
font-style: normal;
font-weight: normal;
speak: none;
Expand Down Expand Up @@ -88,9 +88,9 @@
.icon-desilting:before { content: '\e81e'; } /* '' */
.icon-canalrepair:before { content: '\e81f'; } /* '' */
.icon-map-flood:before { content: '\e820'; } /* '' */
.icon-menu:before { content: '\e821'; } /* '' */
.icon-flood:before { content: '\e822'; } /* '' */
.icon-spin4:before { content: '\e834'; } /* '' */
.icon-menu:before { content: '\f0c9'; } /* '' */
.icon-angle-double-right:before { content: '\f101'; } /* '' */
.icon-apple:before { content: '\f179'; } /* '' */
.icon-android:before { content: '\f17b'; } /* '' */
Expand Down
Binary file removed assets/fonts/fontello/font/fontello.woff
Binary file not shown.
Binary file removed assets/fonts/fontello/font/fontello.woff2
Binary file not shown.
Binary file renamed assets/fonts/fontello/font/fontello.eot → assets/fonts/fontello/font/manu.eot
100644 → 100755
Binary file not shown.
8 changes: 4 additions & 4 deletions assets/fonts/fontello/font/fontello.svg → assets/fonts/fontello/font/manu.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file renamed assets/fonts/fontello/font/fontello.ttf → assets/fonts/fontello/font/manu.ttf
100644 → 100755
Binary file not shown.
Binary file added assets/fonts/fontello/font/manu.woff
Binary file not shown.
Binary file added assets/fonts/fontello/font/manu.woff2
Binary file not shown.
Binary file added assets/images/cards_image_twitter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions aurelia_project/deployments/br.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
export default {
name: 'riskmap_us',
height_units: 'in',
map: {
"instance_regions": {
"broward": {
"region": "brw",
"bounds": {
"sw":[ 25.83, -80.80],
"ne":[ 26.44, -79.60]
}
}
},
"default_region": {
"region": "south_east_florida",
"bounds": {
"sw":[ 25.35, -81.73], //old coordinates 25.948143, -80.477974
"ne":[ 26.95, -78.45] //old coordinates 26.372556, -80.056669
}
},
"region_center": [26.138301, -80.199261],
"start_city_center": [26.138301, -80.199261],
"starting_zoom":8,
"minimum_zoom":11
}
};
5 changes: 4 additions & 1 deletion aurelia_project/deployments/pb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
name: 'petabencana',
height_units: 'cm',
map: {
"instance_regions": {
"jakarta": {
Expand Down Expand Up @@ -32,6 +33,8 @@ export default {
}
},
"region_center": [-7, 110],
"start_city_center": [-6.1754, 106.8271]
"start_city_center": [-6.1754, 106.8271],
"starting_zoom":8,
"minimum_zoom":8
}
};
7 changes: 5 additions & 2 deletions aurelia_project/deployments/rm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export default {
name: 'riskmap',
name: 'riskmap_in',
height_units: 'cm',
map: {
"instance_regions": {
"chennai": {
Expand All @@ -18,6 +19,8 @@ export default {
}
},
"region_center": [13.017163, 80.185031],
"start_city_center": [13.017163, 80.185031]
"start_city_center": [13.017163, 80.185031],
"starting_zoom":10,
"minimum_zoom":10
}
};
12 changes: 11 additions & 1 deletion aurelia_project/environments/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@ export default {
testing: true,
report_timeperiod: 604800,
//deployment specific env params
riskmap_us: {
title: 'RiskMap.us',
supported_languages: ['en', 'es'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
data_server: 'https://data-dev.riskmap.us/',
app: 'https://broward-dev.riskmap.us/'
},
petabencana: {
title: 'Petabencana.id',
supported_languages: ['en', 'id'],
default_language: 'en',
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/'
},
riskmap: {
riskmap_in: {
title: 'RiskMap.in',
supported_languages: ['en', 'tm'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
Expand Down
11 changes: 10 additions & 1 deletion aurelia_project/environments/prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,23 @@ export default {
testing: false,
report_timeperiod: 3600,
//deployment specific env params
riskmap_us: {
supported_languages: ['en', 'es'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
data_server: 'https://data.riskmap.us/',
app: 'https://broward.riskmap.us/'
},
petabencana: {
title: 'Petabencana.id',
supported_languages: ['en', 'id'],
default_language: 'id',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNpdmVhbTFraDAwNHIyeWw1ZDB6Y2hhbTYifQ.tpgt1PB5lkJ-wITS02c96Q',
data_server: 'https://data.petabencana.id/',
app: 'https://petabencana.id/'
},
riskmap: {
riskmap_in: {
title: 'RiskMap.in',
supported_languages: ['en', 'tm'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
Expand Down
14 changes: 12 additions & 2 deletions aurelia_project/environments/stage.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
export default {
debug: false,
testing: false,
report_timeperiod: 604800,
report_timeperiod: 14400,
//deployment specific env params
riskmap_us: {
title: 'RiskMap.us',
supported_languages: ['en', 'es'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
data_server: 'https://data.riskmap.us/',
app: 'https://riskmap.us/'
},
petabencana: {
title: 'Petabencana.id',
supported_languages: ['en', 'id'],
default_language: 'en',
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/'
},
riskmap: {
riskmap_in: {
title: 'RiskMap.in',
supported_languages: ['en', 'tm'],
default_language: 'en',
tile_layer: 'https://api.mapbox.com/v4/mapbox.streets/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoidXJiYW5yaXNrbWFwIiwiYSI6ImNqMnFraWVzYzAyd24ycXRqMmpvbmhyZ2QifQ.xc_v7umok760t2q6NZK1RA',
Expand Down
2 changes: 1 addition & 1 deletion aurelia_project/tasks/fetch-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import changedInPlace from 'gulp-changed-in-place';
import {CLIOptions} from 'aurelia-cli';

export default function fetchComponents() {
let dep = CLIOptions.getFlagValue('dep', 'dep') ? CLIOptions.getFlagValue('dep', 'dep') : 'pb';
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src([`deployment_specific/${dep}/ds_components/**/*`])
.pipe(changedInPlace({firstPass: true}))
Expand Down
26 changes: 23 additions & 3 deletions aurelia_project/tasks/transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,42 @@ function configureEnvironment() {

// Use deployment specific config file
function configureDeployment() {
let dep = CLIOptions.getFlagValue('dep', 'dep') ? CLIOptions.getFlagValue('dep', 'dep') : 'pb';
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src(`aurelia_project/deployments/${dep}.js`)
.pipe(changedInPlace({firstPass: true}))
.pipe(rename('deployment.js'))
.pipe(gulp.dest(project.paths.root));
}

//deployment specific index.html so that
//opengraph preview works as expected.
function fetchIndex() {
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src([`deployment_specific/${dep}/index.html`])
.pipe(changedInPlace({firstPass: true}))
.pipe(gulp.dest('.'));
}

function fetchIcon() {
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src([`deployment_specific/${dep}/favicon.ico`])
.pipe(changedInPlace({firstPass: true}))
.pipe(gulp.dest('.'));
}

function fetchAssets() {
let dep = CLIOptions.getFlagValue('dep', 'dep') ? CLIOptions.getFlagValue('dep', 'dep') : 'pb';
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src([`deployment_specific/${dep}/ds_assets/**/*`])
.pipe(changedInPlace({firstPass: true}))
.pipe(gulp.dest('assets/'));
}

function fetchLocales() {
let dep = CLIOptions.getFlagValue('dep', 'dep') ? CLIOptions.getFlagValue('dep', 'dep') : 'pb';
let dep = CLIOptions.getFlagValue('dep', 'dep');

return gulp.src([`deployment_specific/${dep}/ds_locales/**/*`])
.pipe(changedInPlace({firstPass: true}))
Expand All @@ -55,6 +73,8 @@ function buildJavaScript() {
export default gulp.series(
configureEnvironment,
configureDeployment,
fetchIndex,
fetchIcon,
fetchAssets,
fetchLocales,
buildJavaScript
Expand Down
Loading

0 comments on commit 12090de

Please sign in to comment.