Skip to content

Commit

Permalink
Merge pull request #68 from sykefi/merge-hajapaastot-to-prtr
Browse files Browse the repository at this point in the history
Merge air-pollutant-map to prtr main application
  • Loading branch information
mirkosillanp authored Oct 6, 2023
2 parents 5c1a5cb + 577bb8f commit 4a88201
Show file tree
Hide file tree
Showing 107 changed files with 56,576 additions and 10 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ API should now be accessible at [localhost:8000](http://localhost:8000/).
```
$ python -m pytest tests/
```

## Getting Started with the Air-pollutant-map

Changes for the air-pollutant-map (tab Hajapäästöt in the application) are made in the directory [air-pollutant-map](air-pollutant-map). Air-pollutant-map is originally implemented with Vue, therefore it's code is maintained separately from UI. Build of air-pollutant-map is placed inside the public-directory of UI so that the build runs on the same server as the main app. Running air-pollutant-map is embedded in to the UI with an iframe.

Whenever new changes are made to the air-pollutant-map, new build needs to be made and copied in [ui/public/air-pollutant-map](ui/public/air-pollutant-map). More information about updating the changes in the other [README.md](air-pollutant-map/README.md)
3 changes: 3 additions & 0 deletions air-pollutant-map/.browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
> 1%
last 2 versions
not dead
5 changes: 5 additions & 0 deletions air-pollutant-map/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VUE_APP_GEOSERVER_URI=http://kkxgeot1/geoserver/hajapaastotkartalla/
VUE_APP_DATA_YEAR_OPTIONS=2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
VUE_APP_DOWNLOAD_FULL_DATA_CSV_ENABLED=False
VUE_APP_USE_AGGREGATED_GNFRS=true
VUE_APP_USE_PROD_POLLUTANT_LIST=true
1 change: 1 addition & 0 deletions air-pollutant-map/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NODE_ENV=development
3 changes: 3 additions & 0 deletions air-pollutant-map/.env.dev-syke
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=development
VUE_APP_USE_AGGREGATED_GNFRS=false
VUE_APP_USE_PROD_POLLUTANT_LIST=false
2 changes: 2 additions & 0 deletions air-pollutant-map/.env.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NODE_ENV=production
VUE_APP_GEOSERVER_URI=https://geoserver2.ymparisto.fi/geoserver/paastotkartalla/
4 changes: 4 additions & 0 deletions air-pollutant-map/.env.prod-syke
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NODE_ENV=production
VUE_APP_GEOSERVER_URI=https://geoserver2.ymparisto.fi/geoserver/paastotkartalla/
VUE_APP_USE_AGGREGATED_GNFRS=false
VUE_APP_USE_PROD_POLLUTANT_LIST=false
17 changes: 17 additions & 0 deletions air-pollutant-map/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
root: true,
env: {
node: true
},
extends: ["plugin:vue/essential", "eslint:recommended", "@vue/typescript/recommended"],
parserOptions: {
ecmaVersion: 2020
},
rules: {
"no-console": process.env.NODE_ENV === "production" ? "off" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"@typescript-eslint/ban-ts-ignore": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-non-null-assertion": "off"
}
};
5 changes: 5 additions & 0 deletions air-pollutant-map/.firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "paastokartta-demo"
}
}
131 changes: 131 additions & 0 deletions air-pollutant-map/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env.local
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# Next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# other files
/dist
.DS_Store
db/temp
cypress/integration/examples
build-test-prod.sh
dist_test/
build-deploy-demo.sh
drafts
.firebase

cypress/csvDownloads/*

# db v2
db/import_grid_data/csv_data/
db/import_muni_data/csv_data/
db/update_prod_db/dev_dumps/
7 changes: 7 additions & 0 deletions air-pollutant-map/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "none",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"printWidth": 95
}
55 changes: 55 additions & 0 deletions air-pollutant-map/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
[![Tests & deploy dev status](https://github.com/sykefi/air-pollutant-map/workflows/Tests%20%26%20deploy%20dev/badge.svg)](https://github.com/sykefi/air-pollutant-map/actions)

# air-pollutant-map

Also known as _Hajapäästöt kartalla_


### Project setup

The project requires installation of [vue-cli](https://cli.vuejs.org/):
```
npm install -g @vue/cli
```

To install project dependencies with npm, run:
```
npm install
```

To use dev GeoServer, add file `.env.local` with the following environment variable:
`VUE_APP_GEOSERVER_URI=http://your-dev-geoserver-address:port/geoserver/paastotkartalla/`


### Compiles and hot-reloads for development

`npm run serve-dev`

### Compiles and minifies for production

`npm run build-prod`

### Tests

Open & run Cypress E2E tests with
`npm run cypress`

### Built with

Vue.js & OpenLayers

See [Configuration Reference](https://cli.vuejs.org/config/).

## Update air-pollutant-map changes to PRTR ui
To update changes that are made in air-pollutant-map to PRTR app, minified build needs to be copied in directory [ui/public/air-pollutant-map](../ui/public/air-pollutant-map/). Build script and copy script are chained for sequential execution. Copy-script requires installation of ncp. To install, run:
```
npm install -g ncp
```

### Compiles and minifies for development and copies minified file to PRTR ui

`npm run build-dev-prtr`

### Compiles and minifies for production and copies minified file to PRTR ui

`npm run build-prod-prtr`
5 changes: 5 additions & 0 deletions air-pollutant-map/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}
4 changes: 4 additions & 0 deletions air-pollutant-map/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"viewportWidth": 1000,
"viewportHeight": 1000
}
3 changes: 3 additions & 0 deletions air-pollutant-map/cypress/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["plugin:cypress/recommended"]
}
5 changes: 5 additions & 0 deletions air-pollutant-map/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io",
"body": "Fixtures are a great way to mock data for responses to routes"
}
Loading

0 comments on commit 4a88201

Please sign in to comment.