Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9091bae
25226: react-map-gl switched to maplibre-gl (#130)
ahjyrkia Jan 10, 2024
d3258b7
AB#28974: Represent zone symbols correctly in UI in regards to prints
e-halinen Jan 10, 2024
8c8b495
zone symbol sizing
ahjyrkia Jan 17, 2024
7ebd179
lint fixes
ahjyrkia Jan 17, 2024
1301b63
resize symbols on all zoom events
ahjyrkia Jan 17, 2024
39a0e46
Merge pull request #131 from HSLdevcom/AB#28974_represent_zone_symbol…
ahjyrkia Jan 17, 2024
26c7571
Bump hsl-map-style version to 1.1.3 (#133)
e-halinen Apr 24, 2024
a0671b4
AB#35806: Fix crashing coordinate input fields (#134)
e-halinen Sep 12, 2024
600f3a6
AB#48634: Bump hsl-map-style to 1.2.0 (#135)
e-halinen Dec 30, 2024
bead52e
WIP: AB#34322: Fix marker glitching when dragging stops (#136)
e-halinen Jan 9, 2025
694d77a
AB#53258: Fix map generator appearing in google search results (#138)
e-halinen Feb 20, 2025
ff3dab3
AB#56575: Add version numbering and check against prod (#140)
e-halinen May 23, 2025
a776687
AB#56568: Change license to AGPL-3.0-only (#141)
e-halinen Jun 4, 2025
f18374b
React updates (#132)
ahjyrkia Jun 4, 2025
0bff186
Merge branch 'master' into development
e-halinen Jun 12, 2025
a75b275
v1.1.0
e-halinen Jun 12, 2025
1cf6590
Update login providers, make login provider configurable
e-halinen Jun 12, 2025
613dbb8
v1.1.1
e-halinen Jun 12, 2025
ea3d5dc
Bump elliptic from 6.5.3 to 6.5.4 (#75)
dependabot[bot] Aug 20, 2025
391a0a5
Bump moment from 2.29.1 to 2.29.4 (#104)
dependabot[bot] Aug 20, 2025
a30ebd0
Bump file-saver from 1.3.8 to 2.0.5 (#144)
dependabot[bot] Aug 22, 2025
64f997d
Bump moment from 2.29.4 to 2.30.1 (#146)
dependabot[bot] Aug 22, 2025
d00f182
Merge branch 'development' of github-e-halinen:HSLdevcom/hsl-map-gene…
e-halinen Aug 22, 2025
727df19
Bump eslint-import-resolver-webpack from 0.7.1 to 0.13.10 (#148)
dependabot[bot] Aug 22, 2025
aa486aa
AB#63130: Update node & dependencies
e-halinen Aug 22, 2025
70cb610
AB#63130: Merge dependency changes
e-halinen Aug 22, 2025
cf2088c
WIP: AB#61587: Add E-Zone
e-halinen Jul 29, 2025
69e0b96
Add E-zone symbol to dropdown
e-halinen Jul 30, 2025
bbc9b3d
Update push action version
avicarie Nov 12, 2025
4614404
dependecy updates, webpack configuration updates
ahjyrkia Jan 29, 2026
7fa55da
dependency scan, cypress updates
ahjyrkia Jan 29, 2026
349f9fe
test fix
ahjyrkia Jan 29, 2026
b983060
fix cypress commands
ahjyrkia Jan 30, 2026
6711129
deleted old cypress configs, updated test
ahjyrkia Jan 30, 2026
9b1cdad
updating generate poster test
ahjyrkia Jan 30, 2026
5b8d175
Merge pull request #159 from HSLdevcom/68397-dependency-upgrades
ahjyrkia Jan 30, 2026
0c4aa85
bundle path set to auto
ahjyrkia Feb 2, 2026
8580d91
Merge pull request #160 from HSLdevcom/68397-dependency-upgrades
ahjyrkia Feb 2, 2026
cf13a61
hide E-zone from dropdown
ahjyrkia Feb 3, 2026
6804dd5
lint fix
ahjyrkia Feb 3, 2026
db6fdef
Merge pull request #162 from HSLdevcom/68397-dependency-upgrades
ahjyrkia Feb 3, 2026
933b386
Merge branch 'master' into merge-conflict-fixes
ahjyrkia Feb 3, 2026
60fba0e
Merge pull request #163 from HSLdevcom/merge-conflict-fixes
ahjyrkia Feb 3, 2026
7bd78ce
disable e-zone
ahjyrkia Feb 3, 2026
2adb1e6
lint fixes
ahjyrkia Feb 3, 2026
b6aa5b9
Merge pull request #164 from HSLdevcom/disable-e-zone
ahjyrkia Feb 3, 2026
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
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

10 changes: 6 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
module.exports = {
parser: "@babel/eslint-parser",
parserOptions: {
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true
}
requireConfigFile: false,
babelOptions: {
presets: ["@babel/preset-env"],
},
},

extends: ["airbnb", "plugin:prettier/recommended"],
rules: {
"no-console": "off",
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/dependency_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Dependency scan'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
with:
fail-on-severity: high
9 changes: 4 additions & 5 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Cypress run
uses: cypress-io/github-action@v4
with:
config-file: /cypress.dev.json
env:
CYPRESS_BASE_URL: https://dev.kartat.hsl.fi/kartta
CYPRESS_API_URL: https://dev.kartat.hsl.fi/routemap-api
CYPRESS_HSLID_CLIENT_ID: ${{ secrets.CYPRESS_HSLID_CLIENT_ID }}
CYPRESS_HSLID_CLIENT_SECRET: ${{ secrets.CYPRESS_HSLID_CLIENT_SECRET }}
CYPRESS_TESTING_HSLID_USERNAME: ${{ secrets.CYPRESS_TESTING_HSLID_USERNAME }}
CYPRESS_TESTING_HSLID_PASSWORD: ${{ secrets.CYPRESS_TESTING_HSLID_PASSWORD }}
- name: Upload screenshot artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload video artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-alpine as builder
FROM node:20-alpine as builder

ENV WORK /opt/mapgenerator

Expand All @@ -23,7 +23,7 @@ RUN yarn build


# The actual image comes here
FROM node:18-alpine
FROM node:20-alpine

ENV WORK /opt/mapgenerator

Expand Down
1 change: 1 addition & 0 deletions app/components/RouteMapConfigurator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import AdvancedRouteMapOptions from "../containers/AdvancedRouteMapOptions";
import {PointStatus} from "../reducers/publisherRequests";
import {listModalStyles} from "../utils/ui-utils";

// const ZONE_SYMBOLS = [{value: "A"}, {value: "B"}, {value: "C"}, {value: "D"}, {value: "E"}];
const ZONE_SYMBOLS = [{value: "A"}, {value: "B"}, {value: "C"}, {value: "D"}];

export default class RouteMapConfigurator extends Component {
Expand Down
3 changes: 3 additions & 0 deletions app/components/ZoneSymbolMarkers.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import AZone from "../icons/icon-Zone-A";
import BZone from "../icons/icon-Zone-B";
import CZone from "../icons/icon-Zone-C";
import DZone from "../icons/icon-Zone-D";
// import EZone from "../icons/icon-Zone-E";
import {
mapSelectionToBbox,
bboxDiameterInMeters,
Expand All @@ -21,6 +22,8 @@ const getZoneIcon = (zone, svgSize) => {
return <CZone size={svgSize} />;
case "D":
return <DZone size={svgSize} />;
// case "E":
// return <EZone size={svgSize} />;
default:
return <div />;
}
Expand Down
38 changes: 38 additions & 0 deletions app/icons/icon-Zone-E.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";

const EZone = (props) => (
<div>
<svg
width={`${props.size}px`}
height={`${props.size}px`}
viewBox="0 0 36 36"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xlink="http://www.w3.org/1999/xlink">
<title>icon-Zone-E</title>
<desc>Created with Sketch.</desc>
<defs />
<g
id="Page-1"
stroke="none"
strokeWidth="1"
fill="none"
fillRule="evenodd">
<g id="icon-Zone-E">
<path
d="M36,18.00096 C36,27.94176 27.9408,36.00096 18,36.00096 C8.0592,36.00096 0,27.94176 0,18.00096 C0,8.05776 8.0592,0.00096 18,0.00096 C27.9408,0.00096 36,8.05776 36,18.00096"
id="Fill-1"
fill="#007AC9"
/>
<path
d="M9.94704,8.85792 C9.94704,7.78992 10.77024,6.96672 11.83584,6.96672 L17.90304,6.96672 C24.60864,6.96672 29.24064,11.56992 29.24064,17.57472 L29.24064,17.63472 C29.24064,23.63952 24.60864,28.30512 17.90304,28.30512 L11.83584,28.30512 C10.77024,28.30512 9.94704,27.48192 9.94704,26.41152 L9.94704,8.85792 Z M17.90304,24.88992 C22.38384,24.88992 25.30944,21.87312 25.30944,17.69712 L25.30944,17.63472 C25.30944,13.45872 22.38384,10.38192 17.90304,10.38192 L13.69584,10.38192 L13.69584,24.88992 L17.90304,24.88992 Z"
id="Fill-4"
fill="#FFFFFF"
/>
</g>
</g>
</svg>
</div>
);

export default EZone;
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env"],
["@babel/preset-react", { "runtime": "automatic" }]
]
}
17 changes: 17 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const { defineConfig } = require("cypress");

module.exports = defineConfig({
viewportWidth: 1200,
viewportHeight: 1300,
numTestsKeptInMemory: 1,
projectId: "rax4es",
video: true,
e2e: {
specPattern: "cypress/integration/**/*.spec.js",
supportFile: "cypress/support/index.js",
baseUrl: process.env.CYPRESS_BASE_URL || "http://localhost:3000",
env: {
apiUrl: process.env.CYPRESS_API_URL || "http://localhost:4000",
},
},
});
9 changes: 0 additions & 9 deletions cypress.dev.json

This file was deleted.

8 changes: 0 additions & 8 deletions cypress.json

This file was deleted.

43 changes: 16 additions & 27 deletions cypress/integration/general.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const uuidv4 = require("uuid/v4");
const { v4: uuidv4 } = require("uuid");

// TODO: Envify here and cypress.json properly
const API_URL = Cypress.config().apiUrl;
const API_URL = Cypress.env("API_URL");
const TEST_PREFIX = "CY-TEST";

describe("Basic functionalities", () => {
Expand Down Expand Up @@ -34,8 +34,7 @@ describe("Basic functionalities", () => {

it("Add list, select it for use and show it", () => {
const uuid = `${TEST_PREFIX}-${uuidv4()}`;
cy.server();
cy.route("POST", `${API_URL}/builds`).as("postBuild");
cy.intercept("POST", `${API_URL}/builds`).as("postBuild");

cy.get("[data-cy=toggle-mode-button]").click();
cy.get("[data-cy=new-list-button").click();
Expand Down Expand Up @@ -153,14 +152,12 @@ describe("Basic functionalities", () => {
it("Generate poster", () => {
const uuid = `${TEST_PREFIX}-${uuidv4()}`;
const posterName = uuid.substr(0, 5);
cy.server();
cy.route("POST", `${API_URL}/builds`).as("postBuild");

cy.intercept("POST", `${API_URL}/builds`).as("postBuild");

cy.get("[data-cy=toggle-mode-button]").click();
cy.get("[data-cy=new-list-button").click();
cy.get("[data-cy=new-list-name-input]")
.click()
.type(uuid);
cy.get("[data-cy=new-list-button]").click();
cy.get("[data-cy=new-list-name-input]").click().type(uuid);

cy.get("[data-cy=new-list-name-input]").should("have.value", uuid);
cy.get("[data-cy=add-list-button]").click();
Expand All @@ -170,33 +167,25 @@ describe("Basic functionalities", () => {
cy.get("[data-cy=select-list-button]").click();

cy.get("[data-cy=size-selector-button]").click();
cy.get("[data-cy=size-selector-width-input]")
.click()
.clear()
.type(200);
cy.get("[data-cy=size-selector-height-input]")
.click()
.clear()
.type(200);
cy.get("[data-cy=size-selector-width-input]").click().clear().type(200);
cy.get("[data-cy=size-selector-height-input]").click().clear().type(200);

cy.get("[data-cy=new-poster-name]").type(posterName);
cy.get("[data-cy=generate-button").click();
cy.get("[data-cy=close-generate-prompt-button").click();
cy.get("[data-cy=generate-button]").click();
cy.get("[data-cy=close-generate-prompt-button]").click();
cy.get("[data-cy=show-list-button]").click();

// 60 seconds should be more than enough for 200x200 poster.
// Better implementation would be to somehow stop waiting after
// polling for build status returns "pending: 0".
cy.wait(60000);
cy.get(`[data-cy=${posterName}]`).contains("READY");

// Remove build
cy.request("GET", `${API_URL}/builds`)
.its("body")
.then((buildArr) => {
const build = buildArr.find((build) => build.title === uuid);
cy.request("DELETE", `${API_URL}/builds/${build.id}`);
});
const build = buildArr.find((b) => b.title === uuid);
if (build) {
cy.request("DELETE", `${API_URL}/builds/${build.id}`);
}
});

cy.get("[data-cy=close-list-modal-button]").click();
});
Expand Down
17 changes: 12 additions & 5 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ Cypress.Commands.add("hslLogin", () => {
const AUTH_SCOPE =
"email https://oneportal.trivore.com/scope/groups.readonly";

const CLIENT_ID = Cypress.env("CYPRESS_HSLID_CLIENT_ID");
const CLIENT_SECRET = Cypress.env("CYPRESS_HSLID_CLIENT_SECRET");
const HSLID_USERNAME = Cypress.env("CYPRESS_TESTING_HSLID_USERNAME");
const HSLID_PASSWORD = Cypress.env("CYPRESS_TESTING_HSLID_PASSWORD");
const CLIENT_ID = Cypress.env("HSLID_CLIENT_ID");
const CLIENT_SECRET = Cypress.env("HSLID_CLIENT_SECRET");
const HSLID_USERNAME = Cypress.env("TESTING_HSLID_USERNAME");
const HSLID_PASSWORD = Cypress.env("TESTING_HSLID_PASSWORD");

if (!CLIENT_ID || !CLIENT_SECRET) {
throw new Error("Missing HSLID envs");
}

const authHeader = `Basic ${btoa(`${CLIENT_ID}:${CLIENT_SECRET}`)}`;

Expand All @@ -26,7 +30,10 @@ Cypress.Commands.add("hslLogin", () => {
}
};

cy.request(options).then((response) => {
cy.request({ ...options, failOnStatusCode: false }).then((response) => {
if (response.status !== 200) {
throw new Error(`Auth failed: ${response.status} ${JSON.stringify(response.body)}`);
}
const {access_token} = response.body;
cy.log(access_token);
expect(response.status).to.eq(200);
Expand Down
Loading
Loading