diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index c8eb3d452c..7a9b75d3d3 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-applicant-frontend-tests.yml b/.github/workflows/bf-applicant-frontend-tests.yml index 251c268d96..6c3326332f 100644 --- a/.github/workflows/bf-applicant-frontend-tests.yml +++ b/.github/workflows/bf-applicant-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -52,7 +52,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -68,4 +68,4 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build diff --git a/.github/workflows/bf-handler-frontend-tests.yml b/.github/workflows/bf-handler-frontend-tests.yml index 0c50506891..9596a69797 100644 --- a/.github/workflows/bf-handler-frontend-tests.yml +++ b/.github/workflows/bf-handler-frontend-tests.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -52,7 +52,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -68,4 +68,4 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build diff --git a/.github/workflows/bf-review.yml b/.github/workflows/bf-review.yml index 8ef45cf3a7..bcb6647e5e 100644 --- a/.github/workflows/bf-review.yml +++ b/.github/workflows/bf-review.yml @@ -238,7 +238,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/bf-shared-frontend-tests.yml b/.github/workflows/bf-shared-frontend-tests.yml index 03f5dfa07d..6cfa4d0f96 100644 --- a/.github/workflows/bf-shared-frontend-tests.yml +++ b/.github/workflows/bf-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-empl-frontend-tests.yml b/.github/workflows/ks-empl-frontend-tests.yml index dfb9bc36fb..b6e75f0e5a 100644 --- a/.github/workflows/ks-empl-frontend-tests.yml +++ b/.github/workflows/ks-empl-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Employer) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/employer/**' - - 'frontend/*' - - '.github/workflows/ks-empl-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/employer/**" + - "frontend/*" + - ".github/workflows/ks-empl-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/ks-handler-frontend-tests.yml b/.github/workflows/ks-handler-frontend-tests.yml index d15e7da6a3..aae9af617d 100644 --- a/.github/workflows/ks-handler-frontend-tests.yml +++ b/.github/workflows/ks-handler-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Handler) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/handler/**' - - 'frontend/*' - - '.github/workflows/ks-handler-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/handler/**" + - "frontend/*" + - ".github/workflows/ks-handler-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/ks-review.yml b/.github/workflows/ks-review.yml index 49151e01d6..a4588457b2 100644 --- a/.github/workflows/ks-review.yml +++ b/.github/workflows/ks-review.yml @@ -256,7 +256,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-shared-frontend-tests.yml b/.github/workflows/ks-shared-frontend-tests.yml index 272e4af157..39341ccd38 100644 --- a/.github/workflows/ks-shared-frontend-tests.yml +++ b/.github/workflows/ks-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/ks-youth-frontend-tests.yml b/.github/workflows/ks-youth-frontend-tests.yml index 1bc22fb856..8ba667154d 100644 --- a/.github/workflows/ks-youth-frontend-tests.yml +++ b/.github/workflows/ks-youth-frontend-tests.yml @@ -2,14 +2,14 @@ name: (KS Youth) Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/kesaseteli/shared/**' - - 'frontend/kesaseteli/youth/**' - - 'frontend/*' - - '.github/workflows/ks-youth-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/kesaseteli/shared/**" + - "frontend/kesaseteli/youth/**" + - "frontend/*" + - ".github/workflows/ks-youth-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -25,7 +25,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -63,7 +63,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -79,7 +79,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/shared-frontend-tests.yml b/.github/workflows/shared-frontend-tests.yml index 1b6faeeaf0..45317f81bc 100644 --- a/.github/workflows/shared-frontend-tests.yml +++ b/.github/workflows/shared-frontend-tests.yml @@ -23,7 +23,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-admn-frontend-tests.yml b/.github/workflows/te-admn-frontend-tests.yml index 227d992fcf..9b8b1a4143 100644 --- a/.github/workflows/te-admn-frontend-tests.yml +++ b/.github/workflows/te-admn-frontend-tests.yml @@ -2,13 +2,13 @@ name: (TET) Admin Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/tet/admin/**' - - 'frontend/*' - - '.github/workflows/te-admn-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/tet/admin/**" + - "frontend/*" + - ".github/workflows/te-admn-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -62,7 +62,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -78,7 +78,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/te-review.yml b/.github/workflows/te-review.yml index a1fee5245a..da23cec1e2 100644 --- a/.github/workflows/te-review.yml +++ b/.github/workflows/te-review.yml @@ -247,7 +247,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-shared-frontend-tests.yml b/.github/workflows/te-shared-frontend-tests.yml index 1a38d7038e..6700d9c690 100644 --- a/.github/workflows/te-shared-frontend-tests.yml +++ b/.github/workflows/te-shared-frontend-tests.yml @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/.github/workflows/te-yout-frontend-tests.yml b/.github/workflows/te-yout-frontend-tests.yml index 65592e4390..989b9b13ff 100644 --- a/.github/workflows/te-yout-frontend-tests.yml +++ b/.github/workflows/te-yout-frontend-tests.yml @@ -2,13 +2,13 @@ name: (TET) Youth Frontend Lint, Unit and Component tests on: push: - branches: [ develop, main ] + branches: [develop, main] pull_request: paths: - - 'frontend/shared/**' - - 'frontend/*' - - 'frontend/tet/**' - - '.github/workflows/te-yout-frontend-tests.yml' + - "frontend/shared/**" + - "frontend/*" + - "frontend/tet/**" + - ".github/workflows/te-yout-frontend-tests.yml" - "!**/browser-tests/**" - "!**/README.md" workflow_dispatch: @@ -24,7 +24,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -62,7 +62,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" @@ -78,7 +78,7 @@ jobs: - name: Check that building dev application works env: NEXTJS_DISABLE_SENTRY: true - run: yarn build + run: NODE_OPTIONS=--openssl-legacy-provider yarn build - name: Frontend build failure slack notification uses: rtCamp/action-slack-notify@v2 env: diff --git a/.github/workflows/yarn-audit-scheduled.yml b/.github/workflows/yarn-audit-scheduled.yml index 0c567a606c..ad180fb4b5 100644 --- a/.github/workflows/yarn-audit-scheduled.yml +++ b/.github/workflows/yarn-audit-scheduled.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js environment uses: actions/setup-node@v3 with: - node-version: '16' + node-version: "18" - name: Get yarn cache directory path id: yarn-cache-dir-path run: echo "::set-output name=dir::$(yarn config get cacheFolder)" diff --git a/README.md b/README.md index 069b3659cf..d0c542523d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This monorepo contains code for four different employment services: ## Requirements * Docker@^19.03.0 (or higher) -* NodeJS@^16.19.0 +* NodeJS@^18.16.0 * Yarn@^1.22 --- diff --git a/frontend/Dockerfile b/frontend/Dockerfile index e3efeefc75..1bb73acc6e 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,5 @@ # ======================================= -FROM helsinkitest/node:16-slim as appbase +FROM helsinkitest/node:18-slim as appbase # ======================================= # Install ca-certificates so that Sentry can upload source maps @@ -38,7 +38,7 @@ FROM appbase as development # Set V8 max heap size to 2GB (default is 512MB) # This prevents Docker Compose from crashing due to out of memory errors -ENV NODE_OPTIONS="--max_old_space_size=2048" +ENV NODE_OPTIONS="--max_old_space_size=2048 --openssl-legacy-provider" ARG PROJECT ARG FOLDER @@ -92,16 +92,18 @@ COPY --chown=appuser:appuser . . # Build application WORKDIR /app/$PROJECT/$FOLDER/ -RUN yarn build +RUN NODE_OPTIONS=--openssl-legacy-provider yarn build # Clean all dependencies (this should avoid caching + missing /pages directory problem) RUN rm -rf node_modules RUN yarn cache clean # ========================================== -FROM helsinkitest/node:16-slim AS production +FROM helsinkitest/node:18-slim AS production # ========================================== +ENV NODE_OPTIONS="--openssl-legacy-provider" + ARG PORT ARG PROJECT ARG FOLDER diff --git a/frontend/README.md b/frontend/README.md index 4449b17cdd..bdb33d3ef5 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -9,14 +9,14 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x (match with dockerfile: helsinkitest/node:16-slim) +- Node 18.x (match with dockerfile: helsinkitest/node:18-slim) - Yarn - Git - Docker ### install node with nvm - nvm install 16 --lts + nvm install 18 --lts ## Available Scripts diff --git a/frontend/benefit/README.md b/frontend/benefit/README.md index 1195083cea..8c5e20efe5 100644 --- a/frontend/benefit/README.md +++ b/frontend/benefit/README.md @@ -9,7 +9,7 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x +- Node 18.x - Lerna - Yarn - Git @@ -18,8 +18,8 @@ Project is automatically deployed to testing environment when pushing to develop ### Install NodeJS # Use node manager (n or nvm, for example) - n 16 - nvm install 16 --lts + n 18 + nvm install 18 --lts # Alternative methods https://nodejs.org/dist/ https://nodejs.org/en/download/package-manager diff --git a/frontend/kesaseteli/README.md b/frontend/kesaseteli/README.md index 9b0c8aaa8c..4819339fa1 100644 --- a/frontend/kesaseteli/README.md +++ b/frontend/kesaseteli/README.md @@ -19,7 +19,7 @@ Project is automatically deployed to testing environment when pushing to develop ## Requirements -- Node 16.x +- Node 18.x - Lerna - Yarn - Git @@ -27,7 +27,7 @@ Project is automatically deployed to testing environment when pushing to develop ### install node with nvm - nvm install 16 --lts + nvm install 18 --lts ## Available Scripts diff --git a/frontend/package.json b/frontend/package.json index b347873500..056830de02 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -10,17 +10,17 @@ "tet/*", "shared" ], - "engines" : { - "node" : ">=16.19.0 <17.0.0" + "engines": { + "node": ">=18.16.0 <19.0.0" }, "scripts": { "audit": "npx lerna-audit --level=high --groups=dependencies", "build": "npx lerna run build", - "ks-empl:build": "npx lerna run --scope @frontend/employer --stream build", - "ks-hdlr:build": "npx lerna run --scope @frontend/ks-handler --stream build", - "ks-youth:build": "npx lerna run --scope @frontend/youth --stream build", - "bf-appl:build": "npx lerna run --scope @frontend/applicant --stream build", - "bf-hdlr:build": "npx lerna run --scope @frontend/bf-handler --stream build", + "ks-empl:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/employer --stream build", + "ks-hdlr:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/ks-handler --stream build", + "ks-youth:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/youth --stream build", + "bf-appl:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/applicant --stream build", + "bf-hdlr:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/bf-handler --stream build", "ks-empl:dev": "npx lerna run --scope @frontend/employer --stream dev", "ks-hdlr:dev": "npx lerna run --scope @frontend/ks-handler --stream dev", "ks-youth:dev": "npx lerna run --scope @frontend/youth --stream dev", @@ -39,7 +39,7 @@ "test:staged": "npx lerna run test:staged", "test:coverage": "npx lerna run test:coverage --stream --concurrency 1", "bf-appl:test": "yarn --cwd benefit/applicant test", - "bf-hdlr:test": "yarn --cwd benefit/bf-handler test", + "bf-hdlr:test": "yarn --cwd benefit/handler test", "bf-appl:browser-test": "yarn --cwd benefit/applicant browser-test", "bf-appl:browser-test:ci": "yarn --cwd benefit/applicant browser-test:ci", "ks-empl:test": " yarn --cwd kesaseteli/employer test", @@ -50,13 +50,13 @@ "ks-youth:browser-test:ci": "yarn --cwd kesaseteli/youth browser-test:ci", "shared:test": " yarn --cwd shared test", "ks-shared:test": " yarn --cwd kesaseteli/shared test", - "te-admin:build": "npx lerna run --scope @frontend/te-admin --stream build", + "te-admin:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/te-admin --stream build", "te-admin:dev": "npx lerna run --scope @frontend/te-admin --stream dev", "te-admin:start": "npx lerna run --scope @frontend/te-admin --stream start", "te-admin:test": " yarn --cwd tet/admin test", "te-admin:browser-test": "yarn --cwd tet/admin browser-test", "te-admin:browser-test:ci": "yarn --cwd tet/admin browser-test:ci", - "te-youth:build": "npx lerna run --scope @frontend/te-youth --stream build", + "te-youth:build": "cross-env NODE_OPTIONS=--openssl-legacy-provider npx lerna run --scope @frontend/te-youth --stream build", "te-youth:dev": "npx lerna run --scope @frontend/te-youth --stream dev", "te-youth:start": "npx lerna run --scope @frontend/te-youth --stream start", "te-youth:test": " yarn --cwd tet/youth test", @@ -82,7 +82,7 @@ "@types/jest": "^27.4.0", "@types/jest-axe": "^3.5.3", "@types/leaflet": "^1.7.9", - "@types/node": "^17.0.43", + "@types/node": "^18.16.0", "@types/pretty": "^2.0.1", "@types/react-input-mask": "2.0.5", "@types/react-leaflet": "^2.8.2", diff --git a/frontend/tet/admin/src/components/editor/DateInput.tsx b/frontend/tet/admin/src/components/editor/DateInput.tsx index bb7703b7d4..ca89c6d12d 100644 --- a/frontend/tet/admin/src/components/editor/DateInput.tsx +++ b/frontend/tet/admin/src/components/editor/DateInput.tsx @@ -6,7 +6,12 @@ import { Language } from 'shared/i18n/i18n'; import Id from 'shared/types/id'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; label: string; registerOptions?: RegisterOptions; diff --git a/frontend/tet/admin/src/components/editor/Editor.tsx b/frontend/tet/admin/src/components/editor/Editor.tsx index 8ca77bdd05..cb8dfa3cd1 100644 --- a/frontend/tet/admin/src/components/editor/Editor.tsx +++ b/frontend/tet/admin/src/components/editor/Editor.tsx @@ -23,6 +23,14 @@ export type EditorSectionProps = { initialValue: TetPosting; }; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +const RenderHiddenIdInput = (id: string, value: string): JSXElement => ; + // add new posting / edit existing const Editor: React.FC = ({ initialValue, isNewPosting = false }) => { const { t } = useTranslation(); @@ -38,9 +46,9 @@ const Editor: React.FC = ({ initialValue, isNewPosting = false }) = return (
- - - + {RenderHiddenIdInput('id', initialValue?.id)} + {RenderHiddenIdInput('image_url', initialValue?.image_url)} + {RenderHiddenIdInput('image_id', initialValue?.image_id)}

* {t('common:editor.requiredInfo')}

diff --git a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx index 71f53a8e12..bfae1707fa 100644 --- a/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx +++ b/frontend/tet/admin/src/components/editor/HiddenIdInput.tsx @@ -3,6 +3,12 @@ import { useFormContext } from 'react-hook-form'; import InputProps from 'shared/types/input-props'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 + +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore const HiddenIdInput: React.FC> = ({ id, initialValue }) => { const { register } = useFormContext(); return ; diff --git a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx index 7a70e86fd7..60663bd276 100644 --- a/frontend/tet/admin/src/components/editor/SelectionGroup.tsx +++ b/frontend/tet/admin/src/components/editor/SelectionGroup.tsx @@ -34,6 +34,12 @@ const SelectionGroup: React.FC = ({ fieldId, label, options, required, ru }; return ( + // Known issue with react-hook-form library, errors out with: + // Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. + // More at: https://github.com/orgs/react-hook-form/discussions/7764 + + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore ; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; testId?: string; label: string; diff --git a/frontend/tet/admin/src/components/editor/TextInput.tsx b/frontend/tet/admin/src/components/editor/TextInput.tsx index 50172eaac0..8c974ccfc6 100644 --- a/frontend/tet/admin/src/components/editor/TextInput.tsx +++ b/frontend/tet/admin/src/components/editor/TextInput.tsx @@ -4,7 +4,12 @@ import { Controller, RegisterOptions, useFormContext } from 'react-hook-form'; import Id from 'shared/types/id'; import TetPosting from 'tet-shared/types/tetposting'; +// Known issue with react-hook-form library, errors out with: +// Type of property 'prototype' circularly references itself in mapped type '{ [K in keyof Blob]-?: PathImpl; }'. +// More at: https://github.com/orgs/react-hook-form/discussions/7764 type Props = { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore id: Id; label: string; placeholder: string; diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 4fde9cd69e..791e21d04f 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -3336,10 +3336,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.47.tgz#ca9237d51f2a2557419688511dab1c8daf475188" integrity sha512-BzcaRsnFuznzOItW1WpQrDHM7plAa7GIDMZ6b5pnMbkqEtM/6WCOhvZar39oeMQP79gwvFUWjjptE7/KGcNqFg== -"@types/node@^17.0.43": - version "17.0.43" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.43.tgz#7f16898cdd791c9d64069000ad448b47b3ca8353" - integrity sha512-jnUpgw8fL9kP2iszfIDyBQtw5Mf4/XSqy0Loc1J9pI14ejL83XcCEvSf50Gs/4ET0I9VCCDoOfufQysj0S66xA== +"@types/node@^18.16.0": + version "18.16.3" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.3.tgz#6bda7819aae6ea0b386ebc5b24bdf602f1b42b01" + integrity sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q== "@types/normalize-package-data@^2.4.0": version "2.4.1" diff --git a/package.json b/package.json index 484b0a4420..3f53dc9d16 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "cross-env": "^7.0.3", "husky": "^8.0.3" }, - "engines" : { - "node" : ">=16.19.0 <17.0.0" + "engines": { + "node": ">=18.16.0 <19.0.0" }, "scripts": { "prepare": "husky install", - "// clean: stop and remove docker containers and database volume" : "", + "// clean: stop and remove docker containers and database volume": "", "clean": "docker compose -f compose.handler.yml down --remove-orphans; docker compose -f compose.employer.yml down --remove-orphans; docker compose -f compose.benefit.yml down --remove-orphans; docker rm -f $(docker ps -a -q); docker volume rm $(docker volume ls -q);", "// partial docker compose commands per service, dont use these straight. Use :up, :build or :rebuild instead ": "", "benefit": "cross-env COMPOSE_HTTP_TIMEOUT=200 docker compose -f compose.benefit.yml",