Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ API_URL=https://dev.kartat.hsl.fi/routemap-api
GENERATE_API_URL=https://dev.kartat.hsl.fi/map-generator
PORT=3000
REACT_APP_CLIENT_ID=7833861618225795
REACT_APP_LOGIN_PROVIDER_URI=https://hslid-uat.cinfra.fi
REACT_APP_REDIRECT_URI=https://dev.kartat.hsl.fi/kartta
NAMESPACE=hsl-kartta

Expand All @@ -12,4 +13,4 @@ DIGITRANSIT_APIKEY=
CYPRESS_TESTING_HSLID_USERNAME=
CYPRESS_TESTING_HSLID_PASSWORD=
CYPRESS_HSLID_CLIENT_ID=
CYPRESS_HSLID_CLIENT_SECRET=
CYPRESS_HSLID_CLIENT_SECRET=
3 changes: 2 additions & 1 deletion .env.prod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ NODE_ENV=production
API_URL=https://kartat.hsl.fi/routemap-api
GENERATE_API_URL=https://kartat.hsl.fi/map-generator
PORT=3000
REACT_APP_CLIENT_ID=7833861618225795
REACT_APP_CLIENT_ID=0704589208046070
REACT_APP_LOGIN_PROVIDER_URI=https://id.hsl.fi
REACT_APP_REDIRECT_URI=https://kartat.hsl.fi/kartta
NAMESPACE=hsl-kartta

Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/check_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check version numbering is updated prior to merging

on:
pull_request:
branches:
- master

jobs:
check_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v2
- name: Fail if version is not changed prior to merge
if: steps.check.outputs.changed == 'false'
uses: actions/github-script@v7
with:
script: |
core.setFailed('No version number change found. Run `yarn version`-command to upgrade version before merge can be completed.')
223 changes: 206 additions & 17 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ If you want to use the cypress ui for running tests use

## License

MIT © [HSL](https://github.com/HSLdevcom)
AGPL-3.0-only © [HSL](https://github.com/HSLdevcom)
2 changes: 1 addition & 1 deletion app/components/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const LightTooltip = withStyles((theme) => ({

const openLoginForm = () => {
window.location.replace(
`https://hslid-uat.cinfra.fi/openid/auth?client_id=${process.env.REACT_APP_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_REDIRECT_URI}&response_type=code&scope=email+https://oneportal.trivore.com/scope/groups.readonly`
`${process.env.REACT_APP_LOGIN_PROVIDER_URI}/openid/auth?client_id=${process.env.REACT_APP_CLIENT_ID}&redirect_uri=${process.env.REACT_APP_REDIRECT_URI}&response_type=code&scope=email+https://oneportal.trivore.com/scope/groups.readonly`
);
};

Expand Down
20 changes: 11 additions & 9 deletions app/components/ZoneSymbolMarkers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useRef} from "react";
import ReactDOM from "react-dom";
import {createRoot} from "react-dom/client";
import maplibregl from "maplibre-gl";
import AZone from "../icons/icon-Zone-A";
import BZone from "../icons/icon-Zone-B";
Expand Down Expand Up @@ -76,10 +76,8 @@ const ZoneSymbolMarkers = ({
const svgSize = getSymbolSize(symbolSize, mapSelection, map);
zoneSymbols.forEach((symbol) => {
const markerElement = document.createElement("div");
ReactDOM.render(
getZoneIcon(symbol.get("zone"), svgSize),
markerElement
);
const root = createRoot(markerElement);
root.render(getZoneIcon(symbol.get("zone"), svgSize));

const marker = new maplibregl.Marker({
element: markerElement,
Expand All @@ -93,6 +91,7 @@ const ZoneSymbolMarkers = ({
updateSymbol(symbol, {lng: lngLat.lng, lat: lngLat.lat});
});
marker.symbol = symbol;
marker.reactRoot = root;
markersRef.current.push(marker);
});

Expand All @@ -108,10 +107,13 @@ const ZoneSymbolMarkers = ({
const newSvgSize = getSymbolSize(symbolSize, mapSelection, map);
markersRef.current.forEach((marker) => {
const element = marker.getElement();
if (marker.symbol) {
ReactDOM.render(
getZoneIcon(marker.symbol.get("zone"), newSvgSize),
element
if (marker.symbol && marker.reactRoot) {
marker.reactRoot.render(
getZoneIcon(
marker.symbol.get("zone"),
newSvgSize,
element
)
);
}
});
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hsl-map-generator-ui",
"productName": "MapGenerator",
"version": "0.0.1",
"version": "1.1.0",
"description": "Map Generator application based on React, Webpack, React Hot Loader for rapid application development",
"main": "index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"email": "hannes.junnila@gmail.com",
"url": "https://github.com/hannesj"
},
"license": "MIT",
"license": "AGPL-3.0-only",
"bugs": {
"url": "https://github.com/HSLdevcom/hsl-map-generator-ui/issues"
},
Expand Down Expand Up @@ -91,9 +91,9 @@
"memoizee": "^0.4.11",
"moment": "^2.19.4",
"prop-types": "^15.7.2",
"react": "^16",
"react": "18.2.0",
"react-day-picker": "^7.0.5",
"react-dom": "^16",
"react-dom": "18.2.0",
"react-map-gl": "^5.0.10",
"react-modal": "^3.9.1",
"react-redux": "~7",
Expand Down
31 changes: 13 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6488,15 +6488,13 @@ react-dock@^0.3.0:
lodash.debounce "^4.0.8"
prop-types "^15.7.2"

react-dom@^16:
version "16.14.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.14.0.tgz#7ad838ec29a777fb3c75c3a190f661cf92ab8b89"
integrity sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==
react-dom@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d"
integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.19.1"
scheduler "^0.23.0"

react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1"
Expand Down Expand Up @@ -6594,14 +6592,12 @@ react-transition-group@^4.4.0:
loose-envify "^1.4.0"
prop-types "^15.6.2"

react@^16:
version "16.14.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.14.0.tgz#94d776ddd0aaa37da3eda8fc5b6b18a4c9a3114d"
integrity sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==
react@18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"

readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.2.2, readable-stream@^2.3.6:
version "2.3.8"
Expand Down Expand Up @@ -7045,13 +7041,12 @@ sax@~1.2.1:
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==

scheduler@^0.19.1:
version "0.19.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.19.1.tgz#4f3e2ed2c1a7d65681f4c854fa8c5a1ccb40f196"
integrity sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==
scheduler@^0.23.0:
version "0.23.0"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe"
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"

schema-utils@^0.3.0:
version "0.3.0"
Expand Down
Loading