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

Add air-pollutant-map on new tab #73

Merged
merged 39 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
022d100
Add air-pollutant-map on new tab
Jul 11, 2023
7ca8e02
Add air-pollutant-map on new tab
mirkosillanp Jul 11, 2023
6c6c02d
Merge branch 'hajapaastot-component' of https://github.com/sykefi/PRT…
mirkosillanp Jul 11, 2023
0ec4000
add proj4 definition to OlMap
mirkosillanp Aug 8, 2023
f0e2d31
Add air-pollutant-map files
mirkosillanp Aug 9, 2023
adc4e5b
Add scripts to copy air-pollutant-map build to prtr-ui
mirkosillanp Aug 9, 2023
3661569
Update air-pollutant-map code
mirkosillanp Aug 14, 2023
5a4767b
Improve design of AirPollutantMap tab
mirkosillanp Aug 14, 2023
4fe9a2f
Update air-pollutant-map info to Readme-files
mirkosillanp Aug 15, 2023
2a23784
Added all years and background map to be the topmost layer
danielhaaranen Aug 18, 2023
388b102
Legend won't show if no data is found. Fixed some text on info box. C…
danielhaaranen Sep 5, 2023
b40f261
Abort loadSourceFeatures if griddata is undefined.
danielhaaranen Sep 5, 2023
577bb8f
Modified the db import scripts to handle new data (removed s37)
danielhaaranen Oct 6, 2023
4a88201
Merge pull request #68 from sykefi/merge-hajapaastot-to-prtr
mirkosillanp Oct 6, 2023
ccab325
Deleted municipality stuff from code
danielhaaranen Oct 17, 2023
b6aea9e
Merge pull request #70 from sykefi/clean-air-pollutant-map
danielhaaranen Nov 2, 2023
a44ddbc
change air-pollutant-map prod geoserver url
Nov 2, 2023
92da516
Merge pull request #71 from sykefi/air-pollutant-map-geoserver-url
mirkosillanp Nov 2, 2023
f84243f
Update readme
Nov 2, 2023
900d15b
Merge pull request #72 from sykefi/update_readme
mirkosillanp Nov 2, 2023
739e68d
Debug github ref in ui-test-deploy-dev.yml
mirkosillanp Nov 3, 2023
e095275
Merge pull request #74 from sykefi/debug_github_ref
mirkosillanp Nov 3, 2023
c159e14
Add air-pollutant-map to dev-deploy paths
mirkosillanp Nov 3, 2023
d99ec42
Merge pull request #75 from sykefi/New-path-to-dev-deploy
mirkosillanp Nov 3, 2023
56d77ba
zoom bug fix and loading animation bug fix
danielhaaranen Nov 27, 2023
b8fdac0
Merge pull request #76 from sykefi/air-pollutant-bug-fix
danielhaaranen Nov 29, 2023
9ca3442
prod build of air-pollutant-map
danielhaaranen Nov 29, 2023
bebb4ee
Merge pull request #77 from sykefi/air-pollutant-bug-fix
danielhaaranen Nov 29, 2023
e1c08a3
Node updated realated package updates
danielhaaranen Nov 29, 2023
c5eb980
Changed node version from 14.x to 20.10.0
danielhaaranen Dec 8, 2023
c338109
back to 14.x test
danielhaaranen Dec 11, 2023
95d53c3
update node 20.10.0
danielhaaranen Dec 11, 2023
52f3717
added eslint-config-react-app to package.json (double)
danielhaaranen Dec 12, 2023
917ebd6
Merge pull request #78 from sykefi/node-update
danielhaaranen Dec 12, 2023
9ad3da1
changed node version from 14.x to 20.10.0
danielhaaranen Dec 13, 2023
34789dc
Added info text
danielhaaranen Dec 21, 2023
b7a611b
Merge pull request #79 from sykefi/info-text
danielhaaranen Dec 21, 2023
9b91e25
added air-pollutant-map to prod workflow paths
danielhaaranen Dec 21, 2023
35e6567
Merge pull request #80 from sykefi/node-update-prod
danielhaaranen Dec 21, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/ui-test-deploy-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ on:
- main
paths:
- 'ui/**'
- 'air-pollutant-map/**'
- '.github/workflows/ui-test-deploy-dev.yml'

env:
AZURE_WEBAPP_NAME: syke-prtr-d-web
AZURE_WEBAPP_PACKAGE_PATH: 'ui/build' # path to web resources
NODE_VERSION: '14.x'
NODE_VERSION: '20.10.0'

jobs:
test:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ui-test-deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ on:
- main
paths:
- 'ui/**'
- 'air-pollutant-map/**'
- '.github/workflows/ui-test-deploy-prod.yml'

env:
AZURE_WEBAPP_NAME: syke-prtr-p-web
AZURE_WEBAPP_PACKAGE_PATH: 'ui/build' # path to web resources
NODE_VERSION: '14.x'
NODE_VERSION: '20.10.0'
REACT_APP_PRTR_SERVER: https://syke-prtr-fastapi-p-cont.azurewebsites.net # TODO replace with the final prod address

jobs:
Expand Down
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). Dev-environment of air-pollutant-map can be used in local testing, but prod-environment needs to be used when changes are published. 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://paikkatiedot.ymparisto.fi/geoserver/hajapaastotkartalla/
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/). Dev-build can be used in local testing. Prod-build needs to be used when changes are published. 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
Loading