diff --git a/.env.acceptance b/.env.acceptance index 3a373f2a9..ac5f8a2f7 100644 --- a/.env.acceptance +++ b/.env.acceptance @@ -1,17 +1,18 @@ REACT_APP_ENVIRONMENT=acceptance -REACT_APP_API_HOST=https://acc.api.wonen.zaken.amsterdam.nl/ -REACT_APP_AUTH_URL="https://auth.grip-on-it.com/v2/rjsfm52t/oidc/idp/authorize?response_type=code&scope=openid&client_id=d3d664c7-bb33-4bf0-b7c9-b8bdf1199b76&redirect_uri=https%3A%2F%2Facc.wonen.zaken.amsterdam.nl%2Fauthentication%2Fcallback" +REACT_APP_API_HOST=https://api.wonen.zaken.woon-a.azure.amsterdam.nl/ # AZA -REACT_APP_AZA_FE=https://acc.wonen.zaken.amsterdam.nl/ +REACT_APP_AZA_FE=https://wonen.zaken.woon-a.azure.amsterdam.nl/ # TON -REACT_APP_API_HOST_TON=https://acc.api.ton.amsterdam.nl/ -REACT_APP_HOST_TON=https://acc.ton.amsterdam.nl/ +REACT_APP_API_HOST_TON=https://api.ton.woon-a.azure.amsterdam.nl/ +REACT_APP_HOST_TON=https://ton.woon-a.azure.amsterdam.nl/ # Keycloak +REACT_APP_AUTH_URL=https://acc.iam.amsterdam.nl/auth/ REACT_APP_KEYCLOAK_REALM=datapunt-ad-acc +REACT_APP_KEYCLOAK_CLIENT_ID=wonen-zaaksysteem-frontend # Sentry REACT_APP_SENTRY_PROJECT_NAME=zaken-frontend diff --git a/.env.development b/.env.development index 24c24891b..e801499d8 100644 --- a/.env.development +++ b/.env.development @@ -8,8 +8,13 @@ REACT_APP_API_HOST=http://localhost:8080/ REACT_APP_API_PATH=api/v1/ +# Keycloak +REACT_APP_AUTH_URL=https://acc.iam.amsterdam.nl/auth/ # wonen-zaaksysteem-frontend client only exist for iam.amsterdam (prod) +REACT_APP_KEYCLOAK_CLIENT_ID=wonen-zaaksysteem-frontend +REACT_APP_KEYCLOAK_REALM=datapunt-ad-acc + # AZA -REACT_APP_AZA_FE=https://acc.wonen.zaken.amsterdam.nl/ +REACT_APP_AZA_FE=http://localhost:2999/ # TON REACT_APP_API_HOST_TON=https://acc.api.ton.amsterdam.nl/ diff --git a/.env.production b/.env.production index 79910d78a..3388d4a30 100644 --- a/.env.production +++ b/.env.production @@ -7,7 +7,8 @@ REACT_APP_ENVIRONMENT=production REACT_APP_API_HOST=https://api.wonen.zaken.amsterdam.nl/ REACT_APP_API_PATH=api/v1/ -REACT_APP_AUTH_URL="https://auth.grip-on-it.com/v2/rjsfm52t/oidc/idp/authorize?response_type=code&scope=openid&client_id=65ba2077-9c90-4fcd-be2a-f7549e783bdc&redirect_uri=https%3A%2F%2Fwonen.zaken.amsterdam.nl%2Fauthentication%2Fcallback" +REACT_APP_AUTH_URL=https://iam.amsterdam.nl/auth/ + # AZA REACT_APP_AZA_FE=https://wonen.zaken.amsterdam.nl/ diff --git a/.env.test b/.env.test deleted file mode 100644 index c0d776ad9..000000000 --- a/.env.test +++ /dev/null @@ -1,3 +0,0 @@ -REACT_APP_API_HOST=http://localhost:8080/ -REACT_APP_API_PATH=api/v1/ -REACT_APP_AUTH_URL=/authentication/callback?code=1234567890abcdefghijkl diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..c4c7eba73 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint:fix diff --git a/Dockerfile b/Dockerfile index e049f0c18..151240d25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,35 +8,35 @@ ARG COMMIT_HASH ENV DIR /var/www COPY . $DIR/ +RUN ls -la $DIR # build dirs -RUN mkdir -p $DIR/builds/acceptance -RUN mkdir -p $DIR/builds/production +RUN mkdir -p $DIR/builds/application WORKDIR $DIR - -# install dependencies +COPY package*.json $DIR/ RUN npm ci --production --unsafe-perm --ignore-scripts . # global variables -RUN echo "REACT_APP_GIT_COMMIT_HASH=$COMMIT_HASH" > .env.local +# RUN echo "REACT_APP_GIT_COMMIT_HASH=$COMMIT_HASH" > .env.local + +# remove storybook files +RUN find src -type f -name "*.stories.tsx" -delete -# build production RUN npm run build -RUN mv $DIR/build/* $DIR/builds/production/ -# build acceptance -RUN npm run build:acc -RUN mv $DIR/build/* $DIR/builds/acceptance/ +RUN mv $DIR/build/* $DIR/builds/application/ -# Use the official Nginx image as the final stage FROM nginx:stable-alpine -# Copy the nginx configuration ADD nginx.conf /etc/nginx/nginx.conf - -# Copy the build artifacts from the builder stage COPY --from=builder /var/www/builds /var/www +COPY --from=builder /var/www/env.* /var/www +COPY --from=builder /var/www/package.json /var/www/package.json + +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh -# Start nginx +ENTRYPOINT [ "/entrypoint.sh" ] CMD nginx -g 'daemon off;' diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..52f0bb7d6 --- /dev/null +++ b/Makefile @@ -0,0 +1,47 @@ +.PHONY: manifests deploy + +dc = docker-compose + +ENVIRONMENT ?= local +HELM_ARGS = manifests/chart \ + -f manifests/values.yaml \ + -f manifests/env/${ENVIRONMENT}.yaml \ + --set image.tag=${VERSION} + +REGISTRY ?= 127.0.0.1:5001 +REPOSITORY ?= salmagundi/zaken-frontend +VERSION ?= latest + +build: + $(dc) build + +test: + echo "No tests available" + +migrate: + +push: + $(dc) push + + +manifests: + @helm template wonen-frontend $(HELM_ARGS) $(ARGS) + +deploy: manifests + helm upgrade --install wonen-frontend $(HELM_ARGS) $(ARGS) + +update-chart: + rm -rf manifests/chart + git clone --branch 1.5.2 --depth 1 git@github.com:Amsterdam/helm-application.git manifests/chart + rm -rf manifests/chart/.git + +clean: + $(dc) down -v --remove-orphans + +reset: + helm uninstall wonen-frontend + +refresh: reset build push deploy + +dev: + nohup kubycat kubycat-config.yaml > /dev/null 2>&1& diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..8f6b0dccc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3" +services: + zaken-frontend: + build: + context: . + dockerfile: Dockerfile + container_name: zaken-frontend + image: ${REGISTRY:-127.0.0.1:5001}/${REPOSITORY:-salmagundi/zaken-frontend}:${VERSION:-latest} + ports: + - "8081:8000" diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 000000000..e8ce34dd2 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -x + +# This script will read all the env variables prefixed with REACT_APP on start of the container and write them to the env.js file +# The code uses this file as the env variables instead of the .env files +# This makes it possible to use a single build artifact/image for multiple environment + +echo "window.env = {" >> /var/www/application/config/env.js + +for var in $(printenv); do + if [[ $var == REACT_APP* ]]; then + key=$(echo $var | cut -f1 -d=) + value=$(echo $var | cut -f2 -d=) + echo " \"$key\": \"$value\"," >> /var/www/application/config/env.js + fi +done + +echo "}" >> /var/www/application/config/env.js + +exec "$@" \ No newline at end of file diff --git a/index.html b/index.html index a6582963b..d8f74a46e 100644 --- a/index.html +++ b/index.html @@ -7,14 +7,13 @@ - + %REACT_APP_PAGE_TITLE% - + + +
@@ -26,7 +25,6 @@ if (elem != null) elem.style.display = "block"; }, 4000); - + + diff --git a/nginx.conf b/nginx.conf index 3865c43e8..28f994849 100644 --- a/nginx.conf +++ b/nginx.conf @@ -5,38 +5,7 @@ events { http { include mime.types; - # Acceptance - - server { - server_name acc.wonen.zaken.amsterdam.nl; - - listen 8000; - - gzip on; - gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml; - - location / { - - if ($request_method != GET) { - return 405; - } - - gzip_static on; - - root /var/www/acceptance; - - try_files $uri /index.html; - - location /static/ { - expires max; - } - } - } - - # Production - server { - server_name wonen.zaken.amsterdam.nl; listen 8000; @@ -51,7 +20,7 @@ http { gzip_static on; - root /var/www/production; + root /var/www/application; try_files $uri /index.html; diff --git a/package-lock.json b/package-lock.json index fbc8d6ad4..881368e93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,8 +50,8 @@ "react-router-dom": "^6.22.3", "resize-observer-polyfill": "^1.5.1", "styled-components": "^5.3.11", - "typescript": "^5.4.2", - "vite": "^5.1.6", + "typescript": "5.1.6", + "vite": "^5.2.10", "vite-plugin-eslint": "^1.8.1", "vite-tsconfig-paths": "^4.3.1" }, @@ -62,9 +62,10 @@ "@types/dotenv-flow": "^3.2.0", "@types/jest": "^29.5.3", "@types/node": "^20.11.25", - "cypress": "^13.6.6", + "cypress": "^13.11.0", "dotenv-flow": "^3.2.0", "dtsgenerator": "^3.18.0", + "husky": "^9.0.11", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "nock": "^13.5.4", @@ -2315,9 +2316,9 @@ "integrity": "sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==" }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.12.tgz", - "integrity": "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", "cpu": [ "ppc64" ], @@ -2330,9 +2331,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.12.tgz", - "integrity": "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -2345,9 +2346,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.12.tgz", - "integrity": "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -2360,9 +2361,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.12.tgz", - "integrity": "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -2375,9 +2376,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.12.tgz", - "integrity": "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -2390,9 +2391,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.12.tgz", - "integrity": "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -2405,9 +2406,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.12.tgz", - "integrity": "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -2420,9 +2421,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.12.tgz", - "integrity": "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -2435,9 +2436,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.12.tgz", - "integrity": "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -2450,9 +2451,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.12.tgz", - "integrity": "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -2465,9 +2466,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.12.tgz", - "integrity": "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -2480,9 +2481,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.12.tgz", - "integrity": "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -2495,9 +2496,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.12.tgz", - "integrity": "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -2510,9 +2511,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.12.tgz", - "integrity": "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -2525,9 +2526,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.12.tgz", - "integrity": "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -2540,9 +2541,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.12.tgz", - "integrity": "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -2555,9 +2556,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.12.tgz", - "integrity": "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -2570,9 +2571,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.12.tgz", - "integrity": "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -2585,9 +2586,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.12.tgz", - "integrity": "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -2600,9 +2601,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.12.tgz", - "integrity": "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -2615,9 +2616,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.12.tgz", - "integrity": "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -2630,9 +2631,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.12.tgz", - "integrity": "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -2645,9 +2646,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.12.tgz", - "integrity": "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", "cpu": [ "x64" ], @@ -3863,9 +3864,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz", - "integrity": "sha512-+ac02NL/2TCKRrJu2wffk1kZ+RyqxVUlbjSagNgPm94frxtr+XDL12E5Ll1enWskLrtrZ2r8L3wED1orIibV/w==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.14.3.tgz", + "integrity": "sha512-X9alQ3XM6I9IlSlmC8ddAvMSyG1WuHk5oUnXGw+yUBs3BFoTizmG1La/Gr8fVJvDWAq+zlYTZ9DBgrlKRVY06g==", "cpu": [ "arm" ], @@ -3875,9 +3876,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.12.0.tgz", - "integrity": "sha512-OBqcX2BMe6nvjQ0Nyp7cC90cnumt8PXmO7Dp3gfAju/6YwG0Tj74z1vKrfRz7qAv23nBcYM8BCbhrsWqO7PzQQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.14.3.tgz", + "integrity": "sha512-eQK5JIi+POhFpzk+LnjKIy4Ks+pwJ+NXmPxOCSvOKSNRPONzKuUvWE+P9JxGZVxrtzm6BAYMaL50FFuPe0oWMQ==", "cpu": [ "arm64" ], @@ -3887,9 +3888,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.12.0.tgz", - "integrity": "sha512-X64tZd8dRE/QTrBIEs63kaOBG0b5GVEd3ccoLtyf6IdXtHdh8h+I56C2yC3PtC9Ucnv0CpNFJLqKFVgCYe0lOQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.14.3.tgz", + "integrity": "sha512-Od4vE6f6CTT53yM1jgcLqNfItTsLt5zE46fdPaEmeFHvPs5SjZYlLpHrSiHEKR1+HdRfxuzXHjDOIxQyC3ptBA==", "cpu": [ "arm64" ], @@ -3899,9 +3900,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.12.0.tgz", - "integrity": "sha512-cc71KUZoVbUJmGP2cOuiZ9HSOP14AzBAThn3OU+9LcA1+IUqswJyR1cAJj3Mg55HbjZP6OLAIscbQsQLrpgTOg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.14.3.tgz", + "integrity": "sha512-0IMAO21axJeNIrvS9lSe/PGthc8ZUS+zC53O0VhF5gMxfmcKAP4ESkKOCwEi6u2asUrt4mQv2rjY8QseIEb1aw==", "cpu": [ "x64" ], @@ -3911,9 +3912,21 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.12.0.tgz", - "integrity": "sha512-a6w/Y3hyyO6GlpKL2xJ4IOh/7d+APaqLYdMf86xnczU3nurFTaVN9s9jOXQg97BE4nYm/7Ga51rjec5nfRdrvA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.14.3.tgz", + "integrity": "sha512-ge2DC7tHRHa3caVEoSbPRJpq7azhG+xYsd6u2MEnJ6XzPSzQsTKyXvh6iWjXRf7Rt9ykIUWHtl0Uz3T6yXPpKw==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.14.3.tgz", + "integrity": "sha512-ljcuiDI4V3ySuc7eSk4lQ9wU8J8r8KrOUvB2U+TtK0TiW6OFDmJ+DdIjjwZHIw9CNxzbmXY39wwpzYuFDwNXuw==", "cpu": [ "arm" ], @@ -3923,9 +3936,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.12.0.tgz", - "integrity": "sha512-0fZBq27b+D7Ar5CQMofVN8sggOVhEtzFUwOwPppQt0k+VR+7UHMZZY4y+64WJ06XOhBTKXtQB/Sv0NwQMXyNAA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.14.3.tgz", + "integrity": "sha512-Eci2us9VTHm1eSyn5/eEpaC7eP/mp5n46gTRB3Aar3BgSvDQGJZuicyq6TsH4HngNBgVqC5sDYxOzTExSU+NjA==", "cpu": [ "arm64" ], @@ -3935,9 +3948,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.12.0.tgz", - "integrity": "sha512-eTvzUS3hhhlgeAv6bfigekzWZjaEX9xP9HhxB0Dvrdbkk5w/b+1Sxct2ZuDxNJKzsRStSq1EaEkVSEe7A7ipgQ==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.14.3.tgz", + "integrity": "sha512-UrBoMLCq4E92/LCqlh+blpqMz5h1tJttPIniwUgOFJyjWI1qrtrDhhpHPuFxULlUmjFHfloWdixtDhSxJt5iKw==", "cpu": [ "arm64" ], @@ -3946,10 +3959,22 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.14.3.tgz", + "integrity": "sha512-5aRjvsS8q1nWN8AoRfrq5+9IflC3P1leMoy4r2WjXyFqf3qcqsxRCfxtZIV58tCxd+Yv7WELPcO9mY9aeQyAmw==", + "cpu": [ + "ppc64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.12.0.tgz", - "integrity": "sha512-ix+qAB9qmrCRiaO71VFfY8rkiAZJL8zQRXveS27HS+pKdjwUfEhqo2+YF2oI+H/22Xsiski+qqwIBxVewLK7sw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.14.3.tgz", + "integrity": "sha512-sk/Qh1j2/RJSX7FhEpJn8n0ndxy/uf0kI/9Zc4b1ELhqULVdTfN6HL31CDaTChiBAOgLcsJ1sgVZjWv8XNEsAQ==", "cpu": [ "riscv64" ], @@ -3958,10 +3983,22 @@ "linux" ] }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.14.3.tgz", + "integrity": "sha512-jOO/PEaDitOmY9TgkxF/TQIjXySQe5KVYB57H/8LRP/ux0ZoO8cSHCX17asMSv3ruwslXW/TLBcxyaUzGRHcqg==", + "cpu": [ + "s390x" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.12.0.tgz", - "integrity": "sha512-TenQhZVOtw/3qKOPa7d+QgkeM6xY0LtwzR8OplmyL5LrgTWIXpTQg2Q2ycBf8jm+SFW2Wt/DTn1gf7nFp3ssVA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.14.3.tgz", + "integrity": "sha512-8ybV4Xjy59xLMyWo3GCfEGqtKV5M5gCSrZlxkPGvEPCGDLNla7v48S662HSGwRd6/2cSneMQWiv+QzcttLrrOA==", "cpu": [ "x64" ], @@ -3971,9 +4008,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.12.0.tgz", - "integrity": "sha512-LfFdRhNnW0zdMvdCb5FNuWlls2WbbSridJvxOvYWgSBOYZtgBfW9UGNJG//rwMqTX1xQE9BAodvMH9tAusKDUw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.14.3.tgz", + "integrity": "sha512-s+xf1I46trOY10OqAtZ5Rm6lzHre/UiLA1J2uOhCFXWkbZrJRkYBPO6FhvGfHmdtQ3Bx793MNa7LvoWFAm93bg==", "cpu": [ "x64" ], @@ -3983,9 +4020,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.12.0.tgz", - "integrity": "sha512-JPDxovheWNp6d7AHCgsUlkuCKvtu3RB55iNEkaQcf0ttsDU/JZF+iQnYcQJSk/7PtT4mjjVG8N1kpwnI9SLYaw==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.14.3.tgz", + "integrity": "sha512-+4h2WrGOYsOumDQ5S2sYNyhVfrue+9tc9XcLWLh+Kw3UOxAvrfOrSMFon60KspcDdytkNDh7K2Vs6eMaYImAZg==", "cpu": [ "arm64" ], @@ -3995,9 +4032,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.12.0.tgz", - "integrity": "sha512-fjtuvMWRGJn1oZacG8IPnzIV6GF2/XG+h71FKn76OYFqySXInJtseAqdprVTDTyqPxQOG9Exak5/E9Z3+EJ8ZA==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.14.3.tgz", + "integrity": "sha512-T1l7y/bCeL/kUwh9OD4PQT4aM7Bq43vX05htPJJ46RTI4r5KNt6qJRzAfNfM+OYMNEVBWQzR2Gyk+FXLZfogGw==", "cpu": [ "ia32" ], @@ -4007,9 +4044,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.12.0.tgz", - "integrity": "sha512-ZYmr5mS2wd4Dew/JjT0Fqi2NPB/ZhZ2VvPp7SmvPZb4Y1CG/LRcS6tcRo2cYU7zLK5A7cdbhWnnWmUjoI4qapg==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.14.3.tgz", + "integrity": "sha512-/BypzV0H1y1HzgYpxqRaXGBRqfodgoBBCcsrujT6QRcakDQdfU+Lq9PENPh5jB4I44YWq+0C2eHsHya+nZY1sA==", "cpu": [ "x64" ], @@ -4973,24 +5010,10 @@ } } }, - "node_modules/@typescript-eslint/parser/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/parser/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -4998,11 +5021,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/parser/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz", @@ -5071,24 +5089,10 @@ } } }, - "node_modules/@typescript-eslint/type-utils/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@typescript-eslint/type-utils/node_modules/semver": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", - "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", - "dependencies": { - "lru-cache": "^6.0.0" - }, + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "bin": { "semver": "bin/semver.js" }, @@ -5096,11 +5100,6 @@ "node": ">=10" } }, - "node_modules/@typescript-eslint/type-utils/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, "node_modules/@typescript-eslint/types": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", @@ -6687,9 +6686,9 @@ "integrity": "sha512-Z1PhmomIfypOpoMjRQB70jfvy/wxT50qW08YXO5lMIJkrdq4yOTR+AW7FqutScmB9NkLwxo+jU+kZLbofZZq/w==" }, "node_modules/cypress": { - "version": "13.6.6", - "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.6.6.tgz", - "integrity": "sha512-S+2S9S94611hXimH9a3EAYt81QM913ZVA03pUmGDfLTFa5gyp85NJ8dJGSlEAEmyRsYkioS1TtnWtbv/Fzt11A==", + "version": "13.11.0", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-13.11.0.tgz", + "integrity": "sha512-NXXogbAxVlVje4XHX+Cx5eMFZv4Dho/2rIcdBHg9CNPFUGZdM4cRdgIgM7USmNYsC12XY0bZENEQ+KBk72fl+A==", "dev": true, "hasInstallScript": true, "dependencies": { @@ -7435,9 +7434,9 @@ } }, "node_modules/esbuild": { - "version": "0.19.12", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", - "integrity": "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -7446,29 +7445,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.12", - "@esbuild/android-arm": "0.19.12", - "@esbuild/android-arm64": "0.19.12", - "@esbuild/android-x64": "0.19.12", - "@esbuild/darwin-arm64": "0.19.12", - "@esbuild/darwin-x64": "0.19.12", - "@esbuild/freebsd-arm64": "0.19.12", - "@esbuild/freebsd-x64": "0.19.12", - "@esbuild/linux-arm": "0.19.12", - "@esbuild/linux-arm64": "0.19.12", - "@esbuild/linux-ia32": "0.19.12", - "@esbuild/linux-loong64": "0.19.12", - "@esbuild/linux-mips64el": "0.19.12", - "@esbuild/linux-ppc64": "0.19.12", - "@esbuild/linux-riscv64": "0.19.12", - "@esbuild/linux-s390x": "0.19.12", - "@esbuild/linux-x64": "0.19.12", - "@esbuild/netbsd-x64": "0.19.12", - "@esbuild/openbsd-x64": "0.19.12", - "@esbuild/sunos-x64": "0.19.12", - "@esbuild/win32-arm64": "0.19.12", - "@esbuild/win32-ia32": "0.19.12", - "@esbuild/win32-x64": "0.19.12" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" } }, "node_modules/escalade": { @@ -8894,6 +8893,21 @@ "node": ">=8.12.0" } }, + "node_modules/husky": { + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", + "dev": true, + "bin": { + "husky": "bin.mjs" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/hyphenate-style-name": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz", @@ -12908,9 +12922,9 @@ "integrity": "sha512-Kjw8nKRl1m+VrSFCoVGPph93W/qrSO7ZkqPpTf7F4bk/sqcfWK019dWBUpE/fBOsOQY1dks/Bmcbfn1heM/IsA==" }, "node_modules/postcss": { - "version": "8.4.35", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", - "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "funding": [ { "type": "opencollective", @@ -12928,7 +12942,7 @@ "dependencies": { "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" @@ -13596,9 +13610,9 @@ } }, "node_modules/rollup": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.12.0.tgz", - "integrity": "sha512-wz66wn4t1OHIJw3+XU7mJJQV/2NAfw5OAk6G6Hoo3zcvz/XOfQ52Vgi+AN4Uxoxi0KBBwk2g8zPrTDA4btSB/Q==", + "version": "4.14.3", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.14.3.tgz", + "integrity": "sha512-ag5tTQKYsj1bhrFC9+OEWqb5O6VYgtQDO9hPDBMmIbePwhfSr+ExlcU741t8Dhw5DkPCQf6noz0jb36D6W9/hw==", "dependencies": { "@types/estree": "1.0.5" }, @@ -13610,19 +13624,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.12.0", - "@rollup/rollup-android-arm64": "4.12.0", - "@rollup/rollup-darwin-arm64": "4.12.0", - "@rollup/rollup-darwin-x64": "4.12.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.12.0", - "@rollup/rollup-linux-arm64-gnu": "4.12.0", - "@rollup/rollup-linux-arm64-musl": "4.12.0", - "@rollup/rollup-linux-riscv64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-gnu": "4.12.0", - "@rollup/rollup-linux-x64-musl": "4.12.0", - "@rollup/rollup-win32-arm64-msvc": "4.12.0", - "@rollup/rollup-win32-ia32-msvc": "4.12.0", - "@rollup/rollup-win32-x64-msvc": "4.12.0", + "@rollup/rollup-android-arm-eabi": "4.14.3", + "@rollup/rollup-android-arm64": "4.14.3", + "@rollup/rollup-darwin-arm64": "4.14.3", + "@rollup/rollup-darwin-x64": "4.14.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.14.3", + "@rollup/rollup-linux-arm-musleabihf": "4.14.3", + "@rollup/rollup-linux-arm64-gnu": "4.14.3", + "@rollup/rollup-linux-arm64-musl": "4.14.3", + "@rollup/rollup-linux-powerpc64le-gnu": "4.14.3", + "@rollup/rollup-linux-riscv64-gnu": "4.14.3", + "@rollup/rollup-linux-s390x-gnu": "4.14.3", + "@rollup/rollup-linux-x64-gnu": "4.14.3", + "@rollup/rollup-linux-x64-musl": "4.14.3", + "@rollup/rollup-win32-arm64-msvc": "4.14.3", + "@rollup/rollup-win32-ia32-msvc": "4.14.3", + "@rollup/rollup-win32-x64-msvc": "4.14.3", "fsevents": "~2.3.2" } }, @@ -13892,9 +13909,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "engines": { "node": ">=0.10.0" } @@ -14542,9 +14559,9 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -14718,13 +14735,13 @@ } }, "node_modules/vite": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.1.6.tgz", - "integrity": "sha512-yYIAZs9nVfRJ/AiOLCA91zzhjsHUgMjB+EigzFb6W2XTLO8JixBCKCjvhKZaye+NKYHCrkv3Oh50dH9EdLU2RA==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.11.tgz", + "integrity": "sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==", "dependencies": { - "esbuild": "^0.19.3", - "postcss": "^8.4.35", - "rollup": "^4.2.0" + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" diff --git a/package.json b/package.json index d064ea3a3..d04265176 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,12 @@ "npm": ">=8" }, "scripts": { + "start": "PORT=2999 vite", + "acc": "PORT=2999 env-cmd -f .env.acceptance vite", + "build": "vite build", + "build:acc": "env-cmd -f .env.acceptance vite build", + "deploy:prod": "npm version patch && git push origin HEAD --follow-tags", + "swagger:generate-schema": "TS_NODE_PROJECT='./scripts/tsconfig.json' NODE_ENV='development' ts-node scripts/src/generateSwaggerSchema.ts", "lint": "eslint --max-warnings 0 --cache --ext .ts,.tsx src", "lint:fix": "eslint --fix --ext .ts,.tsx src", "test": "env-cmd -f .env.development jest --watchAll=false", @@ -14,14 +20,9 @@ "test:coverage": "jest --coverage --watchAll=false", "cy": "npx cypress open", "cy:run": "cypress run", - "start": "PORT=2999 vite", - "acc": "PORT=2999 env-cmd -f .env.acceptance vite", - "swagger:generate-schema": "TS_NODE_PROJECT='./scripts/tsconfig.json' NODE_ENV='development' ts-node scripts/src/generateSwaggerSchema.ts", - "build": "vite build", - "build:acc": "env-cmd -f .env.acceptance vite build", - "deploy:prod": "npm version patch && git push origin HEAD --follow-tags", "dev": "vite", - "preview": "vite preview" + "preview": "vite preview", + "prepare": "husky" }, "dependencies": { "@amsterdam/amsterdam-react-final-form": "^0.1.140", @@ -66,8 +67,8 @@ "react-router-dom": "^6.22.3", "resize-observer-polyfill": "^1.5.1", "styled-components": "^5.3.11", - "typescript": "^5.4.2", - "vite": "^5.1.6", + "typescript": "5.1.6", + "vite": "^5.2.10", "vite-plugin-eslint": "^1.8.1", "vite-tsconfig-paths": "^4.3.1" }, @@ -78,9 +79,10 @@ "@types/dotenv-flow": "^3.2.0", "@types/jest": "^29.5.3", "@types/node": "^20.11.25", - "cypress": "^13.6.6", + "cypress": "^13.11.0", "dotenv-flow": "^3.2.0", "dtsgenerator": "^3.18.0", + "husky": "^9.0.11", "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "nock": "^13.5.4", diff --git a/scripts/src/generateSwaggerSchema.ts b/scripts/src/generateSwaggerSchema.ts index 6973c4ec1..6bb8cb58d 100644 --- a/scripts/src/generateSwaggerSchema.ts +++ b/scripts/src/generateSwaggerSchema.ts @@ -1,12 +1,8 @@ #!/usr/bin/env ts-node-script import { exec } from "child_process" -import { config } from "dotenv-flow" - -// Loads .env.development or .env.production based on NODE_ENV -config() - -const url = `${ process.env.REACT_APP_API_HOST }${ process.env.REACT_APP_API_PATH }schema/` +import { env } from "app/config/env" +const url = `${ env.REACT_APP_API_HOST }${ env.REACT_APP_API_PATH }schema/` exec(`dtsgen -o ./src/__generated__/apiSchema.d.ts --url ${ url }`, (error, stdout, stderr) => { if (error) { diff --git a/src/App.tsx b/src/App.tsx index e7bcfbe0f..37c5a78f9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -11,8 +11,9 @@ import ValueProvider from "app/state/context/ValueProvider" import isLocalDevelopment from "app/state/auth/keycloak/isLocalDevelopment" import { ErrorBoundary } from "@sentry/react" import PageTitle from "app/routing/components/PageTitle" +import { env } from "app/config/env" -const SentryErrorBoundary = process.env.REACT_APP_ENVIRONMENT !== undefined ? ErrorBoundary : Fragment +const SentryErrorBoundary = env.REACT_APP_ENVIRONMENT !== undefined ? ErrorBoundary : Fragment const App = () => ( diff --git a/src/app/components/addresses/AddressSuffixSwitcher/ShowOtherAddressesButton.tsx b/src/app/components/addresses/AddressSuffixSwitcher/ShowOtherAddressesButton.tsx index a6f9ed7db..897275d42 100644 --- a/src/app/components/addresses/AddressSuffixSwitcher/ShowOtherAddressesButton.tsx +++ b/src/app/components/addresses/AddressSuffixSwitcher/ShowOtherAddressesButton.tsx @@ -5,6 +5,7 @@ import { Button, Icon } from "@amsterdam/asc-ui" import { useModal } from "app/components/shared/Modal/hooks/useModal" import OtherAddressesModal from "./OtherAddressesModal" +import { env } from "app/config/env" export type Index = "first" | "last" | undefined type Props = { @@ -27,7 +28,7 @@ const renderIcon = (index: Index) => { default: return } diff --git a/src/app/components/case/CaseDetails/EditableTag/CaseTags.tsx b/src/app/components/case/CaseDetails/EditableTag/CaseTags.tsx index d42783c18..d34b8c48e 100644 --- a/src/app/components/case/CaseDetails/EditableTag/CaseTags.tsx +++ b/src/app/components/case/CaseDetails/EditableTag/CaseTags.tsx @@ -1,6 +1,6 @@ import styled, { keyframes } from "styled-components" -import { Icon, Tag, themeSpacing } from "@amsterdam/asc-ui" +import { Icon, themeSpacing } from "@amsterdam/asc-ui" import { Edit } from "app/components/shared/Icons" @@ -26,7 +26,12 @@ const ClickableSpan = styled.span` cursor: pointer; ` -const StyledTag = styled(Tag)` +const Tag = styled.span` + background-color: #f9f9f9; + padding: 0 0.5em; + font-family: "Nimbus Mono PS", "Courier New", monospace; + border: 1px solid #eee; + border-radius: 2px; margin-right: ${ themeSpacing(2) }; animation: 0.5s ${ fadeIn } cubic-bezier(0.250, 0.460, 0.450, 0.940) both; ` @@ -43,7 +48,7 @@ const CaseTags: React.FC = ({ tags = [], titleAccess = "Wijzig tag", onCl role="link" onClick={ onClick } > - { tags.map(tag => { tag.name })} + { tags.map(tag => { tag.name })} diff --git a/src/app/components/case/CaseTimeline/TimelineContainer.tsx b/src/app/components/case/CaseTimeline/TimelineContainer.tsx index b07d004da..ed71be0e3 100644 --- a/src/app/components/case/CaseTimeline/TimelineContainer.tsx +++ b/src/app/components/case/CaseTimeline/TimelineContainer.tsx @@ -1,6 +1,7 @@ import { Spinner, ErrorMessage } from "@amsterdam/asc-ui" import { EventsTimeline } from "@amsterdam/wonen-ui" import { useCaseEvents } from "app/state/rest" +import { env } from "app/config/env" type Props = { caseId: Components.Schemas.CaseEvent["id"] @@ -20,7 +21,7 @@ const TimelineContainer: React.FC = ({ caseId }) => { ) } diff --git a/src/app/components/case/Workflow/columns.tsx b/src/app/components/case/Workflow/columns.tsx index ea2136f68..7fdc08774 100644 --- a/src/app/components/case/Workflow/columns.tsx +++ b/src/app/components/case/Workflow/columns.tsx @@ -6,7 +6,7 @@ import TaskButton from "app/components/case/tasks/TaskButton/TaskButton" import taskActionMap from "./utils/taskActionMap" import LockIcon from "./components/LockIcon" import TableAction from "app/components/shared/TableAction/TableAction" -import UserInitials from "./components/UserInitials" +import SelectTask from "./components/SelectTask" // This width value (113px) is the width of a date + edit icon including the spacing between them const Span = styled.span` @@ -31,7 +31,7 @@ export default (execPost: (payload?: any) => Promise) => ( }, { header: "Opgepakt door", dataIndex: "owner", - render: (owner: any) => + render: (owner: any, task: any) => }, { header: "Slotdatum", dataIndex: "due_date", diff --git a/src/app/components/case/Workflow/components/SelectTask.tsx b/src/app/components/case/Workflow/components/SelectTask.tsx new file mode 100644 index 000000000..13b7f45d2 --- /dev/null +++ b/src/app/components/case/Workflow/components/SelectTask.tsx @@ -0,0 +1,98 @@ +import { useState, useEffect } from "react" +import styled from "styled-components" +import { Spinner, Checkbox, Label } from "@amsterdam/asc-ui" +import { useTask, useUsersMe } from "app/state/rest" +import useContextCache from "app/state/rest/provider/useContextCache" +import { createNameAbbreviation } from "app/components/shared/Helpers/helpers" +import CustomTooltip from "app/components/help/HelpContent/CustomTooltip" +import { makeApiUrl } from "app/state/rest/hooks/utils/apiUrl" +import UserIcon from "./UserInitials" + + +type Props = { + task: Components.Schemas.CaseUserTaskWorkdflow +} + +const StyledSpinner = styled(Spinner)` + margin: 2px 0px; +` + +const StyledLabel = styled(Label)` + font-weight: 400; + height: 24px; // Hacky solution to prevent the row from shifting in height every time it loads or is't getting checked. +` + +const StyledCheckbox = styled(Checkbox)` + margin-left: -8px; +` + +const SelectTask: React.FC = ({ task }) => { + const { case_user_task_id: taskId, owner: taskOwner, case: caseId } = task + const [isChecked, setIsChecked] = useState(false) + const [loading, setLoading] = useState(false) + const [me, { isBusy }] = useUsersMe() + const [, { execPatch }] = useTask(taskId) + const apiUrl = makeApiUrl("cases", caseId) + const { getContextItem, updateContextItem } = useContextCache("cases", apiUrl) + + useEffect(() => { + // Check if userId is matching with the taskOwner. + const isSelected = me?.id === taskOwner + setIsChecked(isSelected) + }, [me?.id, taskOwner]) + + const onChange = () => { + setLoading((prevLoading) => !prevLoading) + const owner = isChecked ? null : me?.id + + execPatch({ owner }) + .then((resp: any) => { + if (resp.status === 200) { + // Owner is siuccesfully changed so update context tp prevent a hard page reload for just a checkbox. + const caseItem = getContextItem() + // Find the index of the workflow containing the task to be updated + const workflowIndex = caseItem.workflows.findIndex((workflow: any) => + workflow.tasks.some((task: any) => task.case_user_task_id === taskId) + ) + // If the workflow containing the task is found + if (workflowIndex !== -1) { + // Find the index of the task within the workflow + const taskIndex = caseItem.workflows[workflowIndex].tasks.findIndex((task: any) => + task.case_user_task_id === taskId + ) + // If the task is found within the workflow + if (taskIndex !== -1) { + // Make a deep copy of the original case object (Optional: to maintain immutability) + const updatedCase = structuredClone(caseItem) + // Update the task as needed + updatedCase.workflows[workflowIndex].tasks[taskIndex].owner = resp.data.owner + // Update context of the case + updateContextItem(updatedCase) + } else { + console.error("Task not found within the workflow.") + } + } else { + console.error("Workflow containing the task not found.") + } + } + }) + .finally(() => setLoading((prevLoading) => !prevLoading)) + } + + if (isBusy || loading) { + return + } + // If taskOwner is known but the the taskOwner is not the active user, show a user icon. + if (taskOwner && taskOwner !== me?.id ) { + return + } + return ( + + + + + + ) +} + +export default SelectTask diff --git a/src/app/components/cases/Cases/Cases.tsx b/src/app/components/cases/Cases/Cases.tsx index e8a5b4839..58b005668 100644 --- a/src/app/components/cases/Cases/Cases.tsx +++ b/src/app/components/cases/Cases/Cases.tsx @@ -4,7 +4,7 @@ import { Heading } from "@amsterdam/asc-ui" import TableCases from "app/components/cases/TableCases/TableCases" import CasesFilter from "app/components/cases/CasesFilter/CasesFilter" import { useCases, useCaseThemes, useTasksReasons, useDistricts, - useCorporations, useSubjects, useProjects + useCorporations, useSubjects, useProjects, useTags } from "app/state/rest" import useHasPermission, { SENSITIVE_CASE_PERMISSION } from "app/state/rest/custom/usePermissions/useHasPermission" import { ContextValues } from "app/state/context/ValueProvider" @@ -34,7 +34,7 @@ const UNDERMINING = "Ondermijning" const Cases: React.FC = () => { const { count, districtNames, fromStartDate, housingCorporations, pagination, projects, - reason, results, sorting, subjects, theme, updateContextCases + reason, results, sorting, subjects, tags, theme, updateContextCases } = useContext(ContextValues)["cases"] const [hasPermission] = useHasPermission([SENSITIVE_CASE_PERMISSION]) const [caseThemes] = useCaseThemes() @@ -42,6 +42,7 @@ const Cases: React.FC = () => { const themeId = getThemeId(caseThemes?.results, theme) const [projectsTheme] = useProjects(themeId) const [subjectsTheme] = useSubjects(themeId) + const [tagsTheme] = useTags(themeId) const [caseDistricts] = useDistricts() const [corporationData] = useCorporations() const [dataSource, { isBusy }] = useCases( @@ -53,6 +54,7 @@ const Cases: React.FC = () => { projects, reason, subjects, + tags, districtNames, housingCorporations ) @@ -85,6 +87,7 @@ const Cases: React.FC = () => { casesContextItem.reason = "" casesContextItem.projects = [] casesContextItem.subjects = [] + casesContextItem.tags = [] } updateContextCases(casesContextItem) } @@ -140,6 +143,7 @@ const Cases: React.FC = () => { selectedCorporations={ housingCorporations } selectedProjects={ projects } selectedSubjects={ subjects } + selectedTags={ tags } setDate={ (value: string) => onChangeFilter("fromStartDate", value) } setDistrictNames={ (value: Components.Schemas.District["name"][]) => onChangeFilter("districtNames", value) } setPageSize={ onChangePageSize } @@ -147,8 +151,10 @@ const Cases: React.FC = () => { setSelectedCorporations={ (value: string[]) => onChangeFilter("housingCorporations", value) } setSelectedProjects={ (value: string[]) => onChangeFilter("projects", value) } setSelectedSubjects={ (value: string[]) => onChangeFilter("subjects", value) } + setSelectedTags={ (value: string[]) => onChangeFilter("tags", value) } setTheme={ (value: string) => onChangeFilter("theme", value) } subjects={ subjectsTheme?.results } + tags={ tagsTheme?.results } theme={ theme } themes={ themes } /> diff --git a/src/app/components/cases/CasesFilter/CasesFilter.tsx b/src/app/components/cases/CasesFilter/CasesFilter.tsx index b33701d02..2ce1c0342 100644 --- a/src/app/components/cases/CasesFilter/CasesFilter.tsx +++ b/src/app/components/cases/CasesFilter/CasesFilter.tsx @@ -21,6 +21,7 @@ type Props = { selectedCorporations: string[] selectedProjects: string[] selectedSubjects: string[] + selectedTags: string[] setDate: (value: string) => void setDistrictNames: (value: Components.Schemas.District["name"][]) => void setPageSize: (value: string) => void @@ -28,8 +29,10 @@ type Props = { setSelectedCorporations: (value: Components.Schemas.HousingCorporation["name"][]) => void setSelectedProjects: (value: string[]) => void setSelectedSubjects: (value: string[]) => void + setSelectedTags: (value: string[]) => void setTheme: (value: string) => void subjects?: Components.Schemas.Subject[] + tags?: Components.Schemas.Tag[] theme: string themes: Components.Schemas.CaseTheme[] } @@ -38,7 +41,8 @@ const CasesFilter: React.FC = ({ date, setDate, theme, themes, setTheme, pageSize, setPageSize, reasons, reason, setReason, districts, districtNames, setDistrictNames, corporations, selectedCorporations, setSelectedCorporations, subjects, - setSelectedSubjects, selectedSubjects, projects, selectedProjects, setSelectedProjects + setSelectedSubjects, selectedSubjects, tags, selectedTags, setSelectedTags, + projects, selectedProjects, setSelectedProjects }) => ( @@ -77,6 +81,15 @@ const CasesFilter: React.FC = ({ byId /> )} + { subjects !== undefined && ( + + )} = ({ bagId }) => { const [data, { isBusy }] = usePermitsPowerBrowser(bagId) - const [isChecked, setIsChecked] = useState(false) + const [isChecked, setIsChecked] = useState(true) const permits: any = data || [] return ( <> @@ -39,8 +39,8 @@ const PermitsPowerBrowser: React.FC = ({ bagId }) => { data-testid="checkBox_display_all_permts" onChange={ (e: React.ChangeEvent) => { setIsChecked(e.target.checked) - } } - + }} + defaultChecked={true} /> )} diff --git a/src/app/components/search/SearchResults/columns.tsx b/src/app/components/search/SearchResults/columns.tsx index 157f362aa..7a4d42efa 100644 --- a/src/app/components/search/SearchResults/columns.tsx +++ b/src/app/components/search/SearchResults/columns.tsx @@ -2,7 +2,14 @@ import TableAction from "app/components/shared/TableAction/TableAction" import to from "app/routing/utils/to" const columns = [ - { header: "Adres", dataIndex: "adres", minWidth: 100 }, + { + header: "Adres", + dataIndex: "adres", + minWidth: 100, + render: (adres: any, obj: any) => ( + `${ adres } ${ obj.type_adres === "Nevenadres" ? "(Nevenadres)" : "" }` + ) + }, { header: "Postcode", dataIndex: "postcode", minWidth: 100 }, { dataIndex: "adresseerbaar_object_id", diff --git a/src/app/components/shared/MockWrapper/MockWrapper.tsx b/src/app/components/shared/MockWrapper/MockWrapper.tsx index 42b136482..1ec3aada4 100644 --- a/src/app/components/shared/MockWrapper/MockWrapper.tsx +++ b/src/app/components/shared/MockWrapper/MockWrapper.tsx @@ -1,5 +1,6 @@ import styled from "styled-components" import { themeColor, ascDefaultTheme } from "@amsterdam/asc-ui" +import { env } from "app/config/env" type Props = { hasPadding?: boolean @@ -19,7 +20,7 @@ const Div = styled.div` ` const MockWrapper: React.FC = ({ hasPadding = true, children }) => ( -
+
{ children }
) diff --git a/src/app/components/shared/navigation/IsAuthorizedMenuButton.tsx b/src/app/components/shared/navigation/IsAuthorizedMenuButton.tsx index 477eb4f26..0fdb95ff0 100644 --- a/src/app/components/shared/navigation/IsAuthorizedMenuButton.tsx +++ b/src/app/components/shared/navigation/IsAuthorizedMenuButton.tsx @@ -2,6 +2,7 @@ import { MenuButton, Link } from "@amsterdam/asc-ui" import styled from "styled-components" import useHasPermission from "app/state/rest/custom/usePermissions/useHasPermission" import StyledButtonLink from "./StyledButtonLink" +import { env } from "app/config/env" type Props = React.ComponentProps & { permissionNames: Components.Schemas.PermissionsEnum[] @@ -52,7 +53,7 @@ const IsAuthorizedMenuButton: React.FC = ({ permissionNames, isHidden, to */ if (isAuthorized && text === "Digitaal toezicht") { return ( - { text } + { text } ) } else if (isAuthorized) { return ( diff --git a/src/app/components/tasks/TableTasks/SelectTask/SelectTask.tsx b/src/app/components/tasks/TableTasks/SelectTask/SelectTask.tsx index 0a94a6c80..4aaf59a3a 100644 --- a/src/app/components/tasks/TableTasks/SelectTask/SelectTask.tsx +++ b/src/app/components/tasks/TableTasks/SelectTask/SelectTask.tsx @@ -34,7 +34,7 @@ const SelectTask: React.FC = ({ taskId, taskOwner, isEnforcement }) => { // Two different providers are being used. :( const { pagination, sorting, role, theme, owner, projects, subjects, - taskNames, reason, districtNames, housingCorporations + tags, taskNames, reason, districtNames, housingCorporations } = useContext(ContextValues)["tasks"] const [hasPermission] = useHasPermission([SENSITIVE_CASE_PERMISSION]) const [isChecked, setIsChecked] = useState(false) @@ -54,6 +54,7 @@ const SelectTask: React.FC = ({ taskId, taskOwner, isEnforcement }) => { projects, reason, subjects, + tags, districtNames, housingCorporations ) diff --git a/src/app/components/tasks/Tasks/Tasks.tsx b/src/app/components/tasks/Tasks/Tasks.tsx index 7c3fc4dee..f19f7ce98 100644 --- a/src/app/components/tasks/Tasks/Tasks.tsx +++ b/src/app/components/tasks/Tasks/Tasks.tsx @@ -1,6 +1,7 @@ import { useEffect, useContext } from "react" -import { useRoles, useTasks, useCaseThemes, useTaskNames, useProjects, - useUsersMe, useTasksReasons, useDistricts, useCorporations, useSubjects +import { useRoles, useTasks, useCaseThemes, useTaskNames, + useProjects, useUsersMe, useTasksReasons, useDistricts, + useCorporations, useSubjects, useTags } from "app/state/rest" import TableTasks from "app/components/tasks/TableTasks/TableTasks" import TasksFilter from "../TasksFilter/TasksFilter" @@ -46,7 +47,7 @@ const FilterContainer = styled.div` const Tasks: React.FC = () => { const { count, districtNames, housingCorporations, owner, pagination, projects, - reason, results, role, sorting, subjects, taskNames, theme, updateContextTasks + reason, results, role, sorting, subjects, tags, taskNames, theme, updateContextTasks } = useContext(ContextValues)["tasks"] const [hasPermission] = useHasPermission([SENSITIVE_CASE_PERMISSION]) const [roles] = useRoles() @@ -56,6 +57,7 @@ const Tasks: React.FC = () => { const themeId = getThemeId(caseThemes?.results, theme) const [projectsTheme] = useProjects(themeId) const [subjectsTheme] = useSubjects(themeId) + const [tagsTheme] = useTags(themeId) const [tasksDistricts] = useDistricts() const [corporationData] = useCorporations() const [dataSource, { isBusy }] = useTasks( @@ -70,6 +72,7 @@ const Tasks: React.FC = () => { projects, reason, subjects, + tags, districtNames, housingCorporations ) @@ -88,6 +91,7 @@ const Tasks: React.FC = () => { projects, reason, subjects, + tags, districtNames, housingCorporations ) @@ -138,6 +142,7 @@ const Tasks: React.FC = () => { tasksContextItem.projects = [] tasksContextItem.reason = "" tasksContextItem.subjects = [] + tasksContextItem.tags = [] } updateContextTasks(tasksContextItem) } @@ -212,6 +217,7 @@ const Tasks: React.FC = () => { selectedCorporations={ housingCorporations } selectedProjects={ projects } selectedSubjects={ subjects } + selectedTags={ tags } selectedTaskNames={ taskNames } setDistrictNames={ (value: Components.Schemas.District["name"][]) => onChangeFilter("districtNames", value) } setOwner={ (value: string) => onChangeFilter("owner", value) } @@ -221,9 +227,11 @@ const Tasks: React.FC = () => { setSelectedCorporations={ (value: string[]) => onChangeFilter("housingCorporations", value) } setSelectedProjects={ (value: string[]) => onChangeFilter("projects", value) } setSelectedSubjects={ (value: string[]) => onChangeFilter("subjects", value) } + setSelectedTags={ (value: string[]) => onChangeFilter("tags", value) } setSelectedTaskNames={ (value: Components.Schemas.CaseUserTaskTaskName["name"][]) => onChangeFilter("taskNames", value) } setTheme={ (value: string) => onChangeFilter("theme", value) } subjects={ subjectsTheme?.results } + tags={ tagsTheme?.results } taskNames={ taskNamesData } theme={ theme } themes={ caseThemes?.results } diff --git a/src/app/components/tasks/TasksFilter/TasksFilter.tsx b/src/app/components/tasks/TasksFilter/TasksFilter.tsx index 3123dfdae..3c95a27fe 100644 --- a/src/app/components/tasks/TasksFilter/TasksFilter.tsx +++ b/src/app/components/tasks/TasksFilter/TasksFilter.tsx @@ -24,6 +24,7 @@ type Props = { selectedCorporations: string[] selectedProjects: string[] selectedSubjects: string[] + selectedTags: string[] selectedTaskNames: string[] setDistrictNames: (value: Components.Schemas.District["name"][]) => void setPageSize: (value: string) => void @@ -32,10 +33,12 @@ type Props = { setSelectedCorporations: (value: Components.Schemas.HousingCorporation["name"][]) => void setSelectedProjects: (value: string[]) => void setSelectedSubjects: (value: string[]) => void + setSelectedTags: (value: string[]) => void setSelectedTaskNames: (value: Components.Schemas.CaseUserTaskTaskName["name"][]) => void setTheme: (value: string) => void setOwner: (value: string) => void subjects?: Components.Schemas.Subject[] + tags?: Components.Schemas.Tag[] taskNames?: Components.Schemas.CaseUserTaskTaskName[] theme: string themes?: Components.Schemas.CaseTheme[] @@ -45,7 +48,8 @@ const TasksFilter: React.FC = ({ role, roles, setRole, theme, themes, setTheme, pageSize, setPageSize, owner, setOwner, taskNames, selectedTaskNames, setSelectedTaskNames, reasons, reason, setReason, districts, districtNames, setDistrictNames, corporations, selectedCorporations, - setSelectedCorporations, subjects, setSelectedSubjects, selectedSubjects, projects, + setSelectedCorporations, subjects, setSelectedSubjects, selectedSubjects, + tags, selectedTags, setSelectedTags, projects, selectedProjects, setSelectedProjects }) => ( <> @@ -109,6 +113,15 @@ const TasksFilter: React.FC = ({ byId /> )} + { tags !== undefined && ( + + )} { const showNotFound = has404 const [isDocumentsTabActive, setIsDocumentsTabActive] = useState(false) - if (showSpinner) { return } @@ -63,7 +63,7 @@ const DetailsPage: React.FC = () => { ] - if (process.env.REACT_APP_ENVIRONMENT !== "production") { + if (env.REACT_APP_ENVIRONMENT !== "production") { tabs.push( setIsDocumentsTabActive(true) } > diff --git a/src/app/routing/components/PageTitle.tsx b/src/app/routing/components/PageTitle.tsx index 4e0743fdf..b5a1df728 100644 --- a/src/app/routing/components/PageTitle.tsx +++ b/src/app/routing/components/PageTitle.tsx @@ -1,8 +1,9 @@ import { useEffect } from "react" import find from "../utils/find" import routes from "app/routing/routes" +import { env } from "app/config/env" -const PAGE_TITLE = process.env.REACT_APP_PAGE_TITLE ?? "" +const PAGE_TITLE = env.REACT_APP_PAGE_TITLE ?? "" const setPageTitle = () => { const route = find(routes, window.location.pathname) diff --git a/src/app/routing/routes.tsx b/src/app/routing/routes.tsx index 89bd69025..5a344c1af 100644 --- a/src/app/routing/routes.tsx +++ b/src/app/routing/routes.tsx @@ -6,6 +6,7 @@ import helpRoutes from "../pages/help/routes" import fineRoutes from "../pages/fines/routes" import homeRoutes from "../pages/home/routes" import tonRoutes from "../pages/ton/routes" +import { env } from "app/config/env" import routesToRouteConfig, { RouteConfigObject } from "./utils/routesToRouteConfig" @@ -22,6 +23,6 @@ const routes = { const homeRoutesObject = routesToRouteConfig(homeRoutes, []) const routesObject = routesToRouteConfig(routes as RouteConfigObject, homeRoutesObject["/"].path, homeRoutesObject) -if (process.env.NODE_ENV === "development") console.log("Routes:", routesObject) +if (env.NODE_ENV === "development") console.log("Routes:", routesObject) export type Routes = typeof routesObject export default routesObject diff --git a/src/app/routing/utils/to.ts b/src/app/routing/utils/to.ts index 42efa1471..37fdc8e56 100644 --- a/src/app/routing/utils/to.ts +++ b/src/app/routing/utils/to.ts @@ -1,3 +1,4 @@ +import { env } from "app/config/env" import routesObject, { Routes } from "app/routing/routes" import slashSandwich from "./slashSandwich" @@ -39,7 +40,7 @@ const applyRouteParams = export default (path: K, params?: RouteParams) => { const str = path.toString() - if (process.env.NODE_ENV === "development" && !(slashSandwich([str], { trailingSlash: true }) in routesObject)) console.warn(`${ str } is not an existing route`) + if (env.NODE_ENV === "development" && !(slashSandwich([str], { trailingSlash: true }) in routesObject)) console.warn(`${ str } is not an existing route`) return params !== undefined ? applyRouteParams(str, params) : str diff --git a/src/app/sentry/init.ts b/src/app/sentry/init.ts index 0c39e03ad..de532e6cb 100644 --- a/src/app/sentry/init.ts +++ b/src/app/sentry/init.ts @@ -1,10 +1,11 @@ import { init } from "@sentry/react" +import { env } from "app/config/env" export default () => { - const dsn = process.env.REACT_APP_SENTRY_DSN - const environment = process.env.REACT_APP_ENVIRONMENT - const name = process.env.REACT_APP_SENTRY_PROJECT_NAME ?? "" - const release = process.env.REACT_APP_GIT_COMMIT_HASH ?? "" + const dsn = env.REACT_APP_SENTRY_DSN + const environment = env.REACT_APP_ENVIRONMENT + const name = env.REACT_APP_SENTRY_PROJECT_NAME ?? "" + const release = env.REACT_APP_GIT_COMMIT_HASH ?? "" if (dsn === undefined || environment === undefined) return init({ diff --git a/src/app/state/auth/keycloak/isLocalDevelopment.ts b/src/app/state/auth/keycloak/isLocalDevelopment.ts index 66382e9f5..f263c49a3 100644 --- a/src/app/state/auth/keycloak/isLocalDevelopment.ts +++ b/src/app/state/auth/keycloak/isLocalDevelopment.ts @@ -1 +1,3 @@ -export default process.env.NODE_ENV === "development" && process.env.REACT_APP_API_TOKEN !== undefined +import { env } from "app/config/env" + +export default env.NODE_ENV === "development" && env.REACT_APP_API_TOKEN !== undefined diff --git a/src/app/state/auth/keycloak/keycloak.mock.ts b/src/app/state/auth/keycloak/keycloak.mock.ts index 3d3da4e08..30ce25e0e 100644 --- a/src/app/state/auth/keycloak/keycloak.mock.ts +++ b/src/app/state/auth/keycloak/keycloak.mock.ts @@ -1,6 +1,8 @@ +import { env } from "app/config/env" + export default { init: async () => {}, updateToken: async () => {}, logout: () => {}, - token: process.env.REACT_APP_API_TOKEN ?? "" + token: env.REACT_APP_API_TOKEN ?? "" } diff --git a/src/app/state/auth/keycloak/keycloak.ts b/src/app/state/auth/keycloak/keycloak.ts index 4d70a7d2c..9d55f3833 100644 --- a/src/app/state/auth/keycloak/keycloak.ts +++ b/src/app/state/auth/keycloak/keycloak.ts @@ -2,9 +2,10 @@ import settings from "./settings" import Keycloak from "keycloak-js" import keycloakMock from "./keycloak.mock" import isLocalDevelopment from "./isLocalDevelopment" +import { env } from "app/config/env" -export const keycloak = process.env.NODE_ENV !== "test" && isLocalDevelopment === false ? new (Keycloak as any)(settings) : keycloakMock +export const keycloak = env.NODE_ENV !== "test" && isLocalDevelopment === false ? new (Keycloak as any)(settings) : keycloakMock -if (process.env.NODE_ENV === "development") { +if (env.NODE_ENV === "development") { (window as any).keycloak = keycloak } diff --git a/src/app/state/auth/keycloak/settings.ts b/src/app/state/auth/keycloak/settings.ts index 87749dfd8..edaf3473a 100644 --- a/src/app/state/auth/keycloak/settings.ts +++ b/src/app/state/auth/keycloak/settings.ts @@ -1,9 +1,11 @@ +import { env } from "app/config/env" + export default { - "url": "https://iam.amsterdam.nl/auth/", - "realm": process.env.REACT_APP_KEYCLOAK_REALM ?? "datapunt-ad-acc", + "url": env.REACT_APP_AUTH_URL ?? "https://iam.amsterdam.nl/auth/", + "realm": env.REACT_APP_KEYCLOAK_REALM ?? "", "ssl-required": "external", - "resource": "wonen-zaaksysteem-frontend", + "resource": env.REACT_APP_KEYCLOAK_CLIENT_ID ?? "wonen-woon-o-azure", "public-client": true, "confidential-port": 0, - "clientId": "wonen-zaaksysteem-frontend" + "clientId": env.REACT_APP_KEYCLOAK_CLIENT_ID ?? "wonen-woon-o-azure" } diff --git a/src/app/state/context/initialState.ts b/src/app/state/context/initialState.ts index 3413d8453..6601aa614 100644 --- a/src/app/state/context/initialState.ts +++ b/src/app/state/context/initialState.ts @@ -12,6 +12,7 @@ export type StateType = { results: Components.Schemas.Case[] sorting: TABLE.Schemas.Sorting subjects: string[] + tags: string[] theme: string updateContextCases: (payload: any) => void } @@ -28,6 +29,7 @@ export type StateType = { sorting: TABLE.Schemas.Sorting theme: string subjects: string[] + tags: string[] taskNames: Components.Schemas.CaseUserTaskTaskName["name"][] updateContextTasks: (payload: any) => void } @@ -52,6 +54,7 @@ export const initialState: StateType = { order: "DESCEND" }, subjects: [], + tags: [], theme: "", updateContextCases: noop }, @@ -73,6 +76,7 @@ export const initialState: StateType = { order: "ASCEND" }, subjects: [], + tags: [], taskNames: [], theme: "", updateContextTasks: noop diff --git a/src/app/state/rest/cases.ts b/src/app/state/rest/cases.ts index c5584cebc..865ff2c10 100644 --- a/src/app/state/rest/cases.ts +++ b/src/app/state/rest/cases.ts @@ -39,6 +39,7 @@ export const useCases = ( projects?: string[], reason?: string, subjects?: string[], + tags?: string[], districtNames?: Components.Schemas.District["name"][], housingCorporations?: string[], options?: Options @@ -66,6 +67,9 @@ export const useCases = ( if (subjects && subjects?.length > 0) { urlParams.subject = subjects } + if (tags && tags?.length > 0) { + urlParams.tag = tags + } if (districtNames && districtNames?.length > 0) { urlParams.district_name = districtNames } diff --git a/src/app/state/rest/custom/usePanoramaByBagId/usePanoramaByBagId.ts b/src/app/state/rest/custom/usePanoramaByBagId/usePanoramaByBagId.ts index 54d2a94c3..53e4e5c59 100644 --- a/src/app/state/rest/custom/usePanoramaByBagId/usePanoramaByBagId.ts +++ b/src/app/state/rest/custom/usePanoramaByBagId/usePanoramaByBagId.ts @@ -6,8 +6,8 @@ const usePanoramaByBagId = (bagId: string, width: number | undefined, aspect: nu const foundAddress = getAddressFromBagResults(data) return usePanorama( - foundAddress?.centroid[1], - foundAddress?.centroid[0], + foundAddress?.centroid?.[1], + foundAddress?.centroid?.[0], width, aspect, radius, diff --git a/src/app/state/rest/hooks/utils/apiUrl.ts b/src/app/state/rest/hooks/utils/apiUrl.ts index fe090df67..4d0586b11 100644 --- a/src/app/state/rest/hooks/utils/apiUrl.ts +++ b/src/app/state/rest/hooks/utils/apiUrl.ts @@ -1,18 +1,20 @@ import slashSandwich from "../../../../routing/utils/slashSandwich" +import { env } from "app/config/env" /** * Utility function to create an API URL */ -export const makeApiUrl = (...paths: Array) => slashSandwich([process.env.REACT_APP_API_HOST, process.env.REACT_APP_API_PATH, ...paths]) +export const makeApiUrl = (...paths: Array) => + slashSandwich([env.REACT_APP_API_HOST, env.REACT_APP_API_PATH, ...paths]) /** * Utility function to strip API host from URL */ export const stripApiHostFromUrl = (url: string) => - url.replace(new RegExp(`^${ process.env.REACT_APP_API_HOST }${ process.env.REACT_APP_API_PATH }`), "") + url.replace(new RegExp(`^${ env.REACT_APP_API_HOST }${ env.REACT_APP_API_PATH }`), "") /** * Utility function to create an API URL for TON */ export const makeTonApiUrl = (...paths: Array) => - slashSandwich([process.env.REACT_APP_API_HOST_TON, process.env.REACT_APP_API_PATH_TON, ...paths], { trailingSlash: false }) + slashSandwich([env.REACT_APP_API_HOST_TON, env.REACT_APP_API_PATH_TON, ...paths], { trailingSlash: false }) \ No newline at end of file diff --git a/src/app/state/rest/tasks.ts b/src/app/state/rest/tasks.ts index 23e2a18a3..41bacbf25 100644 --- a/src/app/state/rest/tasks.ts +++ b/src/app/state/rest/tasks.ts @@ -43,6 +43,7 @@ export const getQueryUrl = ( projects?: string[], reason?: string, subjects?: string[], + tags?: string[], districtNames?: Components.Schemas.District["name"][], housingCorporations?: string[] ) => { @@ -67,6 +68,9 @@ export const getQueryUrl = ( if (subjects && subjects?.length > 0) { urlParams.subject = subjects } + if (tags && tags?.length > 0) { + urlParams.tag = tags + } if (taskNames && taskNames?.length > 0) { urlParams.name = taskNames } @@ -103,6 +107,7 @@ export const useTasks = ( projects?: string[], reason?: string, subjects?: string[], + tags?: string[], districtNames?: Components.Schemas.District["name"][], housingCorporations?: string[], options?: Options @@ -120,6 +125,7 @@ export const useTasks = ( projects, reason, subjects, + tags, districtNames, housingCorporations ) diff --git a/src/index.tsx b/src/index.tsx index 4a292a0eb..220ddc107 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,6 +5,7 @@ import ReactDOM from "react-dom" import App from "./App" import * as serviceWorker from "./serviceWorker" import packageInfo from "../package.json" +import { env } from "app/config/env" // Sentry import initSentry from "./app/sentry/init" @@ -23,4 +24,4 @@ ReactDOM.render( serviceWorker.unregister() console.log("Name:", packageInfo.name, packageInfo.version) -console.log("Commit hash:", process.env.REACT_APP_GIT_COMMIT_HASH ?? "n/a") +console.log("Commit hash:", env.REACT_APP_GIT_COMMIT_HASH ?? "n/a") diff --git a/src/serviceWorker.ts b/src/serviceWorker.ts index 7901f0d0d..8bf0c970f 100644 --- a/src/serviceWorker.ts +++ b/src/serviceWorker.ts @@ -9,6 +9,7 @@ // To learn more about the benefits of this model and instructions on how to // opt-in, read https://bit.ly/CRA-PWA +import { env } from "app/config/env" const isLocalhost = Boolean( window.location.hostname === "localhost" || @@ -26,10 +27,10 @@ type Config = { }; export function register(config?: Config) { - if (process.env.NODE_ENV === "production" && "serviceWorker" in navigator) { + if (env.NODE_ENV === "production" && "serviceWorker" in navigator) { // The URL constructor is available in all browsers that support SW. const publicUrl = new URL( - process.env.PUBLIC_URL, + env.PUBLIC_URL, window.location.href ) if (publicUrl.origin !== window.location.origin) { @@ -40,7 +41,7 @@ export function register(config?: Config) { } window.addEventListener("load", () => { - const swUrl = `${ process.env.PUBLIC_URL }/service-worker.js` + const swUrl = `${ env.PUBLIC_URL }/service-worker.js` if (isLocalhost) { // This is running on localhost. Let's check if a service worker still exists or not.