diff --git a/README.md b/README.md index 4037d2edf..55d09727a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ _This project is still in early stages. For a more mature user interface of Open This project is based on React. To learn React, check out the [React documentation](https://reactjs.org/). To install the project dependencies, issue: - - npm i + npm i **It has to be done before any of the following activities** @@ -29,29 +29,32 @@ Examples: - you want to develop using real api instead of mocked: use this `.env.local` file - ``` - # .env.local - REACT_APP_USE_MOCK_API= - ``` +``` + # .env.local + REACT_APP_USE_MOCK_API= +``` - - then: `npm start` +then `npm start` - you want to connect your local dev environment to docker api: - ``` - # .env.local - REACT_APP_USE_MOCK_API= - REACT_APP_BASE_PATH=http://localhost:8080/oh-api - ``` - - then: `docker-compose up && npm start` + +``` + # .env.local + REACT_APP_USE_MOCK_API= + REACT_APP_BASE_PATH=http://localhost:8080/oh-api +``` + +then `docker-compose up database backend && npm start` ## Run local development environment - - npm start + npm start ## Run full stack environment locally You can run a full OH2 stack locally using [Docker](https://www.docker.com/) (required) using this command: -( - docker-compose up + + docker-compose up Then you can access to: @@ -61,7 +64,7 @@ Then you can access to: ## How to publish on Web Server - - npm run build:staging + npm run build:staging Then connect to the Intesys VPN and open FileZilla. @@ -82,39 +85,39 @@ Once you are logged in, go under /home/httpd/open-hospital/shared/public and rep Easy step: - - git push intesys-remote develop + git push intesys-remote develop Old method: - - npm run build:gh-pages - - git commit + npm run build:gh-pages + git commit - then +then - - git subtree push --prefix build intesys-oh gh-pages + git subtree push --prefix build intesys-oh gh-pages - or +or - - git subtree split --prefix build develop - - git push intesys-oh GIT_ID:gh-pages --force + git subtree split --prefix build develop + git push intesys-oh GIT_ID:gh-pages --force ## How to launch the application You can run a development build of the application by issuing: - - npm start + npm start ## How to run unit tests To run unit tests, issue: - - npm test + npm test ## How to launch the e2e tests Run: - - npm run e2e + npm run e2e it launches application in development mode and starts cypress, in a single process. @@ -123,10 +126,10 @@ it launches application in development mode and starts cypress, in a single proc If you want more control over **Cypress e2e tests**, use two different processes: one for serving the app (**process #1**) and one for running the Cypress Test Runner (**process #2**). You can launch it by issuing the following commands in two different intances of your terminal: //process #1 - - npm start + npm start //process #2 - - npm run cypress:open + npm run cypress:open Once the app is compiled and served, and the Cypress Test Runner is launched, click on _Run all specs_ diff --git a/docker-compose.yaml b/docker-compose.yaml index ed5559afe..ce28cd43e 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,7 @@ x-mariadb: &mariadb-env MARIADB_ROOT_PASSWORD: root MARIADB_USER: isf MARIADB_PASSWORD: isf123 - OH_DEMO_LANG: en + OH_DB_LANG: en x-ui: &ui-env <<: *repository-args PUBLIC_URL: / diff --git a/docker/Dockerfile.backend b/docker/Dockerfile.backend index 12fed0e4a..ebe3576f2 100644 --- a/docker/Dockerfile.backend +++ b/docker/Dockerfile.backend @@ -29,4 +29,4 @@ RUN --mount=type=cache,target=/root/.m2 mvn clean install -DskipTests=true # CMD mvn spring-boot:run WORKDIR /openhospital-api/target -CMD java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.JarLauncher \ No newline at end of file +CMD java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.launch.JarLauncher \ No newline at end of file diff --git a/docker/Dockerfile.database b/docker/Dockerfile.database index d14edf71b..ff1ed5940 100644 --- a/docker/Dockerfile.database +++ b/docker/Dockerfile.database @@ -1,5 +1,7 @@ FROM mariadb:10.6.11 +ARG OH_DB_LANG=en + ARG GITHUB_ORG=informatici ARG OH_CORE_BRANCH=develop ARG MARIADB_PORT @@ -7,11 +9,6 @@ ARG MARIADB_DATABASE ARG MARIADB_ROOT_PASSWORD ARG MARIADB_USER ARG MARIADB_PASSWORD -ARG OH_DEMO_LANG -# ENV MYSQL_DATABASE=oh -# ENV MYSQL_ROOT_PASSWORD=root -# ENV MYSQL_USER=isf -# ENV MYSQL_PASSWORD=isf123 RUN apt-get update RUN apt-get install git -y @@ -22,8 +19,8 @@ EXPOSE 3306 RUN cp sql/step_01_create_structure.sql /docker-entrypoint-initdb.d/ RUN cp sql/step_02_dump_menu.sql /docker-entrypoint-initdb.d/ -RUN cp sql/step_03_dump_default_data_en.sql /docker-entrypoint-initdb.d/ -#RUN cp sql/step_04_all_following_steps.sql /docker-entrypoint-initdb.d/ +RUN cp sql/step_03_dump_default_data_${OH_DB_LANG}.sql /docker-entrypoint-initdb.d/ +#COPY sql/step_04_all_following_steps.sql /docker-entrypoint-initdb.d/ RUN cp sql/step_05_update_menu_i18n.sql /docker-entrypoint-initdb.d/ RUN cp sql/step_06_opd_extended.sql /docker-entrypoint-initdb.d/ RUN cp sql/step_07_modifiche_matiri.sql /docker-entrypoint-initdb.d/ @@ -39,7 +36,11 @@ RUN cp sql/step_7* /docker-entrypoint-initdb.d/ RUN cp sql/step_8* /docker-entrypoint-initdb.d/ RUN cp sql/step_9* /docker-entrypoint-initdb.d/ RUN cp sql/step_a1* /docker-entrypoint-initdb.d/ -RUN mkdir data_en && cp sql/data_en/* data_en/ +RUN mkdir data_${OH_DB_LANG} && cp sql/data_${OH_DB_LANG}/* data_${OH_DB_LANG}/ +RUN cp sql/step_03_dump_vaccine_data_${OH_DB_LANG}.sql /docker-entrypoint-initdb.d/step_z100_dump_vaccine_data_${OH_DB_LANG}.sql +RUN cp sql/step_03_dump_dicomtype_data_${OH_DB_LANG}.sql /docker-entrypoint-initdb.d/step_z101_dump_dicomtype_data_${OH_DB_LANG}.sql + +# optional steps #RUN cp sql/delete_all_data.sql /docker-entrypoint-initdb.d/step_9990_delete_all_data.sql #RUN cp sql/load_demo_data.sql /docker-entrypoint-initdb.d/step_9991_load_demo_data.sql #RUN cp sql/extra/reset_admin_password_strong.sql /docker-entrypoint-initdb.d/step_9992_reset_admin_password_strong.sql \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 286d83a23..543cdc7c4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -105,7 +105,7 @@ "storybook": "^7.6.15", "storybook-addon-material-ui": "^0.9.0-alpha.24", "typescript": "^5.2.2", - "webpack": "^5.76.0" + "webpack": "^5.94.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -4710,33 +4710,33 @@ } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" @@ -4749,9 +4749,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -7549,12 +7549,6 @@ "node": ">=0.10.0" } }, - "node_modules/@storybook/builder-webpack5/node_modules/es-module-lexer": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", - "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==", - "dev": true - }, "node_modules/@storybook/builder-webpack5/node_modules/fork-ts-checker-webpack-plugin": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/fork-ts-checker-webpack-plugin/-/fork-ts-checker-webpack-plugin-8.0.0.tgz", @@ -10182,20 +10176,10 @@ "@types/json-schema": "*" } }, - "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", - "dev": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.0.tgz", - "integrity": "sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, "node_modules/@types/express": { @@ -11072,148 +11056,148 @@ } }, "node_modules/@webassemblyjs/ast": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.1.tgz", - "integrity": "sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.12.1.tgz", + "integrity": "sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg==", "dev": true, "dependencies": { - "@webassemblyjs/helper-numbers": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1" + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" } }, "node_modules/@webassemblyjs/floating-point-hex-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz", - "integrity": "sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", "dev": true }, "node_modules/@webassemblyjs/helper-api-error": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz", - "integrity": "sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", "dev": true }, "node_modules/@webassemblyjs/helper-buffer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz", - "integrity": "sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz", + "integrity": "sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw==", "dev": true }, "node_modules/@webassemblyjs/helper-numbers": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz", - "integrity": "sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", "dev": true, "dependencies": { - "@webassemblyjs/floating-point-hex-parser": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/helper-wasm-bytecode": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz", - "integrity": "sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", "dev": true }, "node_modules/@webassemblyjs/helper-wasm-section": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz", - "integrity": "sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz", + "integrity": "sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.12.1" } }, "node_modules/@webassemblyjs/ieee754": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz", - "integrity": "sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", "dev": true, "dependencies": { "@xtuc/ieee754": "^1.2.0" } }, "node_modules/@webassemblyjs/leb128": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.1.tgz", - "integrity": "sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", "dev": true, "dependencies": { "@xtuc/long": "4.2.2" } }, "node_modules/@webassemblyjs/utf8": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.1.tgz", - "integrity": "sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==", + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", "dev": true }, "node_modules/@webassemblyjs/wasm-edit": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz", - "integrity": "sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz", + "integrity": "sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/helper-wasm-section": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-opt": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", - "@webassemblyjs/wast-printer": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-opt": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1", + "@webassemblyjs/wast-printer": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-gen": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz", - "integrity": "sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz", + "integrity": "sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wasm-opt": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz", - "integrity": "sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz", + "integrity": "sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-buffer": "1.11.1", - "@webassemblyjs/wasm-gen": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-buffer": "1.12.1", + "@webassemblyjs/wasm-gen": "1.12.1", + "@webassemblyjs/wasm-parser": "1.12.1" } }, "node_modules/@webassemblyjs/wasm-parser": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz", - "integrity": "sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz", + "integrity": "sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/helper-api-error": "1.11.1", - "@webassemblyjs/helper-wasm-bytecode": "1.11.1", - "@webassemblyjs/ieee754": "1.11.1", - "@webassemblyjs/leb128": "1.11.1", - "@webassemblyjs/utf8": "1.11.1" + "@webassemblyjs/ast": "1.12.1", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" } }, "node_modules/@webassemblyjs/wast-printer": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz", - "integrity": "sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==", + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz", + "integrity": "sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA==", "dev": true, "dependencies": { - "@webassemblyjs/ast": "1.11.1", + "@webassemblyjs/ast": "1.12.1", "@xtuc/long": "4.2.2" } }, @@ -11336,10 +11320,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz", - "integrity": "sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peerDependencies": { "acorn": "^8" @@ -11968,12 +11952,12 @@ } }, "node_modules/axios": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", - "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dev": true, "dependencies": { - "follow-redirects": "^1.15.4", + "follow-redirects": "^1.15.6", "form-data": "^4.0.0", "proxy-from-env": "^1.1.0" } @@ -12670,11 +12654,11 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -14895,9 +14879,9 @@ } }, "node_modules/editorconfig/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, "bin": { "semver": "bin/semver" @@ -14989,9 +14973,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.10.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", - "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "dependencies": { "graceful-fs": "^4.2.4", @@ -15201,9 +15185,9 @@ } }, "node_modules/es-module-lexer": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", - "integrity": "sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true }, "node_modules/es-set-tostringtag": { @@ -16740,9 +16724,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -16857,9 +16841,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.5", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", - "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==", "dev": true, "funding": [ { @@ -17211,6 +17195,19 @@ "dev": true, "license": "ISC" }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -17564,9 +17561,9 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, "node_modules/graphemer": { @@ -18899,9 +18896,9 @@ } }, "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -23384,16 +23381,6 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, - "node_modules/lru-cache": { - "version": "6.0.0", - "license": "ISC", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", @@ -23428,9 +23415,9 @@ } }, "node_modules/make-dir/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, "bin": { "semver": "bin/semver.js" @@ -23555,12 +23542,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -28248,9 +28235,9 @@ } }, "node_modules/schema-utils": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.1.1.tgz", - "integrity": "sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", "dependencies": { "@types/json-schema": "^7.0.8", "ajv": "^6.12.5", @@ -28284,12 +28271,9 @@ } }, "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.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", "bin": { "semver": "bin/semver.js" }, @@ -28355,9 +28339,9 @@ "dev": true }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -29849,13 +29833,13 @@ } }, "node_modules/terser": { - "version": "5.14.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz", - "integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==", + "version": "5.31.6", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.6.tgz", + "integrity": "sha512-PQ4DAriWzKj+qgehQ7LK5bQqCFNMmlhjR2PFFLuqGCpuCAauxemVBWwWOxo3UIwWQx8+Pr61Df++r76wDmkQBg==", "dev": true, "dependencies": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, @@ -29867,16 +29851,16 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.5", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.5.tgz", - "integrity": "sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA==", + "version": "5.3.10", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz", + "integrity": "sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.14", + "@jridgewell/trace-mapping": "^0.3.20", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", - "serialize-javascript": "^6.0.0", - "terser": "^5.14.1" + "serialize-javascript": "^6.0.1", + "terser": "^5.26.0" }, "engines": { "node": ">= 10.13.0" @@ -30895,9 +30879,9 @@ } }, "node_modules/watchpack": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", - "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", + "integrity": "sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==", "dev": true, "dependencies": { "glob-to-regexp": "^0.4.1", @@ -30935,34 +30919,33 @@ } }, "node_modules/webpack": { - "version": "5.76.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.0.tgz", - "integrity": "sha512-l5sOdYBDunyf72HW8dF23rFtWq/7Zgvt/9ftMof71E/yUb1YLOBmTgA2K4vQthB3kotMrSj609txVE0dnr2fjA==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", - "@types/estree": "^0.0.51", - "@webassemblyjs/ast": "1.11.1", - "@webassemblyjs/wasm-edit": "1.11.1", - "@webassemblyjs/wasm-parser": "1.11.1", + "@types/estree": "^1.0.5", + "@webassemblyjs/ast": "^1.12.1", + "@webassemblyjs/wasm-edit": "^1.12.1", + "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.7.6", - "browserslist": "^4.14.5", + "acorn-import-attributes": "^1.9.5", + "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.10.0", - "es-module-lexer": "^0.9.0", + "enhanced-resolve": "^5.17.1", + "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", - "graceful-fs": "^4.2.9", + "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", - "schema-utils": "^3.1.0", + "schema-utils": "^3.2.0", "tapable": "^2.1.1", - "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.4.0", + "terser-webpack-plugin": "^5.3.10", + "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { @@ -31239,12 +31222,6 @@ "node": ">=10.13.0" } }, - "node_modules/webpack/node_modules/@types/estree": { - "version": "0.0.51", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.51.tgz", - "integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==", - "dev": true - }, "node_modules/webpack/node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -31900,6 +31877,7 @@ }, "node_modules/yallist": { "version": "4.0.0", + "dev": true, "license": "ISC" }, "node_modules/yaml": { diff --git a/package.json b/package.json index 617ef226f..56fa027a7 100644 --- a/package.json +++ b/package.json @@ -143,7 +143,7 @@ "storybook": "^7.6.15", "storybook-addon-material-ui": "^0.9.0-alpha.24", "typescript": "^5.2.2", - "webpack": "^5.76.0" + "webpack": "^5.94.0" }, "_moduleAliases": { "@": "./dist" diff --git a/src/components/accessories/admin/users/newUser/validation.test.ts b/src/components/accessories/admin/users/newUser/validation.test.ts index d10e4597f..cf00897e9 100644 --- a/src/components/accessories/admin/users/newUser/validation.test.ts +++ b/src/components/accessories/admin/users/newUser/validation.test.ts @@ -1,8 +1,8 @@ -import { passwordRules } from "./validation"; +import { passwordRules, userNameRules } from "./validation"; describe("password rules", () => { it("should pass when all rules are matched", () => { - expect(passwordRules.test("ThisPassw0rdIsCorrect")); + expect(passwordRules.test("ThisPassw0rdIsCorrect")).toBeTruthy(); }); it("should be 5 characters long", () => { expect(passwordRules.test("aA4")).toBeFalsy(); @@ -17,3 +17,22 @@ describe("password rules", () => { expect(passwordRules.test("ThisPasswordIsNotCorrect")).toBeFalsy(); }); }); + +describe("userName rules", () => { + it("should pass", () => { + expect(userNameRules.test("johndoe")).toBeTruthy(); + expect(userNameRules.test("johndoe42")).toBeTruthy(); + expect(userNameRules.test("42")).toBeTruthy(); + expect(userNameRules.test("john.doe")).toBeTruthy(); + expect(userNameRules.test("john-doe")).toBeTruthy(); + expect(userNameRules.test("john_doe")).toBeTruthy(); + }); + it("should filter out", () => { + expect(userNameRules.test("Johndoe")).toBeFalsy(); + expect(userNameRules.test("johnDoe")).toBeFalsy(); + expect(userNameRules.test("john doe")).toBeFalsy(); + expect(userNameRules.test("john/doe")).toBeFalsy(); + expect(userNameRules.test("すず")).toBeFalsy(); + expect(userNameRules.test("j̵̨̨̧͖̠̩̤̗̟̲̯̭̫̰͆͛̏͛͒́̂̔̅͘͘̚̕͝͝ȯ̵̫̭̮̖̀̓̾̉͋͋̌̇͘h̶̡̢̡̜̻̥͙̳͉̰̟̬͚̍̃̽̎͒̋̄̔͋͘͝͝ͅn̷̜̠̰͍̤̰̺̠͌̌̒͑̓̌̂̒͗͒͗̐͝͝͠")).toBeFalsy(); + }); +}); diff --git a/src/components/accessories/admin/users/newUser/validation.ts b/src/components/accessories/admin/users/newUser/validation.ts index 54b219eb7..3e13775c8 100644 --- a/src/components/accessories/admin/users/newUser/validation.ts +++ b/src/components/accessories/admin/users/newUser/validation.ts @@ -1,13 +1,19 @@ -import { object, string, ref } from "yup"; -import { UserGroupDTO } from "../../../../../generated"; import { TFunction } from "react-i18next"; +import { object, ref, string } from "yup"; +import { UserGroupDTO } from "../../../../../generated"; import { FormProps } from "./NewUser"; // min 5 characters, 1 upper case letter, 1 lower case letter, 1 numeric digit. export const passwordRules = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{5,}$/; +export const userNameRules = /^[a-z0-9-._]+$/; + export const userSchema = (t: TFunction<"translation">) => object().shape({ - userName: string().min(2).required(t("user.validateUserName")), + userName: string() + .min(2) + .max(50) + .matches(userNameRules, t("user.validateUserNameRegex")) + .required(t("user.validateUserName")), userGroupName: object({ code: string().required(t("user.validateUserNeedsGroup")), desc: string(), diff --git a/src/components/accessories/admission/PatientAdmission.tsx b/src/components/accessories/admission/PatientAdmission.tsx index 60923f644..3c36cedc0 100644 --- a/src/components/accessories/admission/PatientAdmission.tsx +++ b/src/components/accessories/admission/PatientAdmission.tsx @@ -1,7 +1,9 @@ import { useAppDispatch, useAppSelector } from "libraries/hooks/redux"; import { isEmpty } from "lodash"; -import React, { FC, useEffect, useMemo, useRef, useState } from "react"; +import React, { FC, useEffect, useRef, useState } from "react"; import { useTranslation } from "react-i18next"; +import { useParams } from "react-router"; +import { getPatient } from "state/patients"; import checkIcon from "../../../assets/check-icon.png"; import { AdmissionDTO, PatientDTOStatusEnum } from "../../../generated"; import { usePermission } from "../../../libraries/permissionUtils/usePermission"; @@ -10,11 +12,11 @@ import { createAdmission, createAdmissionReset, getCurrentAdmission, + getCurrentAdmissionReset, updateAdmission, updateAdmissionReset, } from "../../../state/admissions"; import { getLastOpd } from "../../../state/opds"; -import { getPatient } from "../../../state/patients"; import { IState } from "../../../types"; import ConfirmationDialog from "../confirmationDialog/ConfirmationDialog"; import { CurrentAdmission } from "../currentAdmission/CurrentAdmission"; @@ -29,6 +31,8 @@ const PatientAdmission: FC = () => { const { t } = useTranslation(); const dispatch = useAppDispatch(); const canCreate = usePermission("admissions.create"); + const canUpdate = usePermission("admissions.update"); + const { id } = useParams(); const infoBoxRef = useRef(null); const [shouldResetForm, setShouldResetForm] = useState(false); const [creationMode, setCreationMode] = useState(true); @@ -52,10 +56,6 @@ const PatientAdmission: FC = () => { (state: IState) => state.admissions.currentAdmissionByPatientId.data ); - const currentAdmissionStatus = useAppSelector( - (state: IState) => state.admissions.currentAdmissionByPatientId.status - ); - const createStatus = useAppSelector( (state) => state.admissions.createAdmission.status ); @@ -81,15 +81,10 @@ const PatientAdmission: FC = () => { useEffect(() => { if (patientCode && creationMode) { - dispatch(getLastOpd(patientCode ?? -1)); + dispatch(getLastOpd(parseInt(id!!))); } }, [dispatch, patientCode, creationMode]); - const open = useMemo(() => { - if (creationMode) return showForm && canCreate; - return showForm; - }, [showForm, canCreate, creationMode]); - const fields = useFields(admissionToEdit, lastOpd?.disease); const onSubmit = (adm: AdmissionDTO) => { @@ -143,31 +138,27 @@ const PatientAdmission: FC = () => { }, [dispatch]); useEffect(() => { - if (!creationMode) { - setShowForm(true); - } else if ( - creationMode && - currentAdmissionStatus !== "SUCCESS" && - currentAdmissionStatus !== "IDLE" && - !currentAdmission - ) { - setShowForm(true); - } else setShowForm(false); - }, [currentAdmissionStatus, currentAdmission, creationMode]); + if (creationMode && !!currentAdmission) { + setShowForm(false); + } else setShowForm(true); + }, [currentAdmission, creationMode]); useEffect(() => { if (activityTransitionState === "TO_RESET") { - dispatch(getPatient((patient?.code ?? 0).toString())); - setCreationMode(true); - setAdmissionToEdit(undefined); dispatch(createAdmissionReset()); dispatch(updateAdmissionReset()); - dispatch(getCurrentAdmission(patient?.code)); setShouldUpdateTable(true); setShouldResetForm(true); } }, [dispatch, patient, activityTransitionState]); + useEffect(() => { + if (createStatus === "SUCCESS" || updateStatus === "SUCCESS") { + dispatch(getPatient(id!!)); + dispatch(getCurrentAdmission(parseInt(id!!))); + } + }, [createStatus, updateStatus]); + const resetFormCallback = () => { setCreationMode(true); setShouldResetForm(false); @@ -178,8 +169,11 @@ const PatientAdmission: FC = () => { }; useEffect(() => { - dispatch(getCurrentAdmission(patient?.code)); - }, [patient, dispatch]); + dispatch(getCurrentAdmission(parseInt(id!!))); + return () => { + dispatch(getCurrentAdmissionReset()); + }; + }, [dispatch]); const onEdit = (row: AdmissionDTO) => { setAdmissionToEdit(row); @@ -196,8 +190,10 @@ const PatientAdmission: FC = () => { {patient?.status === PatientDTOStatusEnum.I && ( )} - {!open && } - {open && ( + {!showForm && currentAdmission && ( + + )} + {showForm && (creationMode ? canCreate : canUpdate) && ( { let breakpointConfig = input1[breakpoint].filter((layout) => { - return !input2[breakpoint].some((layout1) => layout1.i == layout.i); + return !input2[breakpoint].some((layout1) => layout1.i === layout.i); }); cleanInput[breakpoint] = breakpointConfig; @@ -211,7 +211,7 @@ export function isEmptyLayout(input: Layouts): boolean { nbWidgets += input[breakpoint] ? input[breakpoint].length : 0; }); - return nbWidgets == 0; + return nbWidgets === 0; } /** @@ -332,7 +332,7 @@ export function generateLayout( breakpoint: LayoutBreakpoints, dashboards?: string[] ): Layout[] { - if (!dashboards || dashboards.length == 0) { + if (!dashboards || dashboards.length === 0) { dashboards = allowedDashboards(); } @@ -345,8 +345,8 @@ export function generateLayout( i: dashboardKey, w: 6, h: 3, - x: index % 2 == 0 ? 0 : 6, - y: index % 2 == 0 ? 0 : 2, + x: index % 2 === 0 ? 0 : 6, + y: index % 2 === 0 ? 0 : 2, minW: 4, minH: 3, //maxW: 12, @@ -361,8 +361,8 @@ export function generateLayout( i: dashboardKey, w: 6, h: 3, - x: index % 2 == 0 ? 0 : 6, - y: index % 2 == 0 ? 0 : 2, + x: index % 2 === 0 ? 0 : 6, + y: index % 2 === 0 ? 0 : 2, minW: 6, minH: 3, //maxW: 12, @@ -377,8 +377,8 @@ export function generateLayout( i: dashboardKey, w: 6, h: 3, - x: index % 2 == 0 ? 0 : 6, - y: index % 2 == 0 ? 0 : 2, + x: index % 2 === 0 ? 0 : 6, + y: index % 2 === 0 ? 0 : 2, minW: 6, minH: 3, //maxW: 2, @@ -394,7 +394,7 @@ export function generateLayout( w: 12, h: 3, x: 0, - y: index % 2 == 0 ? 0 : 2, + y: index % 2 === 0 ? 0 : 2, minW: 12, minH: 3, //maxW: 2, @@ -410,8 +410,8 @@ export function generateLayout( i: dashboardKey, w: 4, h: 3, - x: index % 3 == 0 ? 8 : index % 2 == 0 ? 0 : 4, - y: index % 2 == 0 ? 0 : 2, + x: index % 3 === 0 ? 8 : index % 2 === 0 ? 0 : 4, + y: index % 2 === 0 ? 0 : 2, minW: 3, minH: 3, //maxW: 12, diff --git a/src/components/accessories/patientExams/PatientExams.tsx b/src/components/accessories/patientExams/PatientExams.tsx index 190faef5f..f72c82961 100644 --- a/src/components/accessories/patientExams/PatientExams.tsx +++ b/src/components/accessories/patientExams/PatientExams.tsx @@ -33,8 +33,8 @@ import ConfirmationDialog from "../confirmationDialog/ConfirmationDialog"; import InfoBox from "../infoBox/InfoBox"; import { initialRequestFields } from "../laboratory/consts"; import ExamRequestForm from "../laboratory/examRequestForm/ExamRequestForm"; -import { initialFields } from "./consts"; import ExamForm from "./ExamForm/ExamForm"; +import { initialFields } from "./consts"; import PatientExamRequestsTable from "./patientExamRequestsTable/PatientExamRequestsTable"; import PatientExamsTable from "./patientExamsTable/PatientExamsTable"; import "./styles.scss"; diff --git a/src/components/accessories/patientOPD/patientOPDTable/PatientOPDTable.tsx b/src/components/accessories/patientOPD/patientOPDTable/PatientOPDTable.tsx index bf700c0b4..088f1b735 100644 --- a/src/components/accessories/patientOPD/patientOPDTable/PatientOPDTable.tsx +++ b/src/components/accessories/patientOPD/patientOPDTable/PatientOPDTable.tsx @@ -8,6 +8,7 @@ import { usePermission } from "../../../../libraries/permissionUtils/usePermissi import { getOpdsWithOperationRows } from "../../../../state/opds"; import InfoBox from "../../infoBox/InfoBox"; import Table from "../../table/Table"; + interface IOwnProps { shouldUpdateTable: boolean; handleEdit: (row: any) => void; diff --git a/src/components/activities/newPatientActivity/NewPatientActivity.tsx b/src/components/activities/newPatientActivity/NewPatientActivity.tsx index 72b298d56..aa5e501c6 100644 --- a/src/components/activities/newPatientActivity/NewPatientActivity.tsx +++ b/src/components/activities/newPatientActivity/NewPatientActivity.tsx @@ -68,17 +68,17 @@ const NewPatientActivity: FunctionComponent = ({ activityTransitionState === "TO_DASHBOARD" || activityTransitionState === "TO_PATIENT_DASHBOARD" ) { + const code = patient?.code; dispatch(createPatientReset()); setShouldResetForm(true); + if (activityTransitionState === "TO_PATIENT_DASHBOARD" && !!code) { + navigate(`${PATHS.patients_details}/${code}`, { + replace: true, + }); + } } }, [activityTransitionState, createPatientReset]); - useEffect(() => { - if (activityTransitionState === "TO_PATIENT_DASHBOARD" && patient?.code) { - navigate(`/patients/details/${patient?.code}`, { replace: true }); - } - }, [patient, activityTransitionState, createPatientReset]); - const infoBoxRef = useRef(null); useEffect(() => { if (hasFailed) { @@ -97,8 +97,6 @@ const NewPatientActivity: FunctionComponent = ({ switch (activityTransitionState) { case "TO_DASHBOARD": return ; - case "TO_PATIENT_DASHBOARD": - return ; default: return (
diff --git a/src/components/activities/patientDetailsActivity/PatientDetailsActivity.tsx b/src/components/activities/patientDetailsActivity/PatientDetailsActivity.tsx index 0b3507712..9401185de 100644 --- a/src/components/activities/patientDetailsActivity/PatientDetailsActivity.tsx +++ b/src/components/activities/patientDetailsActivity/PatientDetailsActivity.tsx @@ -17,7 +17,7 @@ import { PatientDTOStatusEnum } from "../../../generated"; import { renderDate } from "../../../libraries/formatUtils/dataFormatting"; import { Permission } from "../../../libraries/permissionUtils/Permission"; import { scrollToElement } from "../../../libraries/uiUtils/scrollToElement"; -import { getPatient } from "../../../state/patients"; +import { getPatient, getPatientReset } from "../../../state/patients"; import { Accordion, AccordionDetails, @@ -57,6 +57,12 @@ const PatientDetailsActivity = () => { } }, [patient, id, dispatch]); + useEffect(() => { + return () => { + dispatch(getPatientReset()); + }; + }, [dispatch]); + const breadcrumbMap = { [t("nav.patients")]: PATHS.patients, [t("nav.searchpatient")]: PATHS.patients_search, diff --git a/src/mockServer/routes/patients.js b/src/mockServer/routes/patients.js index d5b8d44ee..5cfb2b8d6 100644 --- a/src/mockServer/routes/patients.js +++ b/src/mockServer/routes/patients.js @@ -26,10 +26,10 @@ export const patientRoutes = (server) => { res.body = null; break; case "1234563": - res.status(200).json(patientDTOOut); + res.status(200).json({ ...patientDTOOut, code }); break; default: - res.status(200).json(patientDTO); + res.status(200).json({ ...patientDTO, code }); } }); diff --git a/src/resources/i18n/en.json b/src/resources/i18n/en.json index 670e60752..a76d34040 100644 --- a/src/resources/i18n/en.json +++ b/src/resources/i18n/en.json @@ -46,7 +46,8 @@ "validatePasswordTooWeak": "Please create a stronger password: 1 upper case letter, 1 lower case letter, 1 numeric digit", "validateGroupCode": "Invalid group code", "validatePasswordMustMatch": "Passwords must match", - "validateUserName": "You need to specify a user name" + "validateUserName": "You need to specify a user name", + "validateUserNameRegex": "Allowed characters: lowercase letters(abc), numbers(123), dot(.), dash (-) and underscore (_)" }, "hospital": { "address": "Address", diff --git a/src/state/admissions/slice.ts b/src/state/admissions/slice.ts index ad3c30b4c..1a371f993 100644 --- a/src/state/admissions/slice.ts +++ b/src/state/admissions/slice.ts @@ -1,8 +1,8 @@ import { createSlice } from "@reduxjs/toolkit"; +import { isEmpty } from "lodash"; +import { ApiResponse } from "state/types"; import { initial } from "./initial"; import * as thunks from "./thunk"; -import { ApiResponse } from "state/types"; -import { isEmpty } from "lodash"; export const admissionSlice = createSlice({ name: "admissions", @@ -17,6 +17,9 @@ export const admissionSlice = createSlice({ dischargePatientReset: (state) => { state.dischargePatient = initial.dischargePatient; }, + getCurrentAdmissionReset: (state) => { + state.currentAdmissionByPatientId = initial.currentAdmissionByPatientId; + }, }, extraReducers: (builder) => builder @@ -82,7 +85,8 @@ export const admissionSlice = createSlice({ }) .addCase(thunks.getPatientAdmissions.fulfilled, (state, action) => { state.getPatientAdmissions = isEmpty(action.payload) - ? ApiResponse.empty() : ApiResponse.value(action.payload); + ? ApiResponse.empty() + : ApiResponse.value(action.payload); }) .addCase(thunks.getPatientAdmissions.rejected, (state, action) => { state.getPatientAdmissions = ApiResponse.error(action.payload); @@ -93,7 +97,8 @@ export const admissionSlice = createSlice({ }) .addCase(thunks.getAdmittedPatients.fulfilled, (state, action) => { state.getAdmittedPatients = isEmpty(action.payload) - ? ApiResponse.empty() : ApiResponse.value(action.payload); + ? ApiResponse.empty() + : ApiResponse.value(action.payload); }) .addCase(thunks.getAdmittedPatients.rejected, (state, action) => { state.getAdmittedPatients = ApiResponse.error(action.payload); @@ -114,4 +119,5 @@ export const { createAdmissionReset, updateAdmissionReset, dischargePatientReset, + getCurrentAdmissionReset, } = admissionSlice.actions; diff --git a/src/state/laboratories/slice.ts b/src/state/laboratories/slice.ts index 7ab25443c..fdb62fc1d 100644 --- a/src/state/laboratories/slice.ts +++ b/src/state/laboratories/slice.ts @@ -1,8 +1,8 @@ import { createSlice } from "@reduxjs/toolkit"; +import { isEmpty } from "lodash"; +import { ApiResponse } from "state/types"; import { initial } from "./initial"; import * as thunks from "./thunk"; -import { ApiResponse } from "state/types"; -import { isEmpty } from "lodash"; export const laboratorySlice = createSlice({ name: "laboratories", @@ -46,8 +46,7 @@ export const laboratorySlice = createSlice({ state.searchLabs = ApiResponse.loading(); }) .addCase(thunks.searchLabs.fulfilled, (state, action) => { - state.searchLabs = - ApiResponse.value(action.payload); + state.searchLabs = ApiResponse.value(action.payload); }) .addCase(thunks.searchLabs.rejected, (state, action) => { state.searchLabs = ApiResponse.error(action.payload); @@ -65,6 +64,19 @@ export const laboratorySlice = createSlice({ .addCase(thunks.getLabsByPatientId.rejected, (state, action) => { state.labsByPatientId = ApiResponse.error(action.payload); }) + // Get Lab Requests By Patient ID + .addCase(thunks.getLabsRequestByPatientId.pending, (state) => { + state.labsRequestByPatientId = ApiResponse.loading(); + }) + .addCase(thunks.getLabsRequestByPatientId.fulfilled, (state, action) => { + state.labsRequestByPatientId.status = isEmpty(action.payload) + ? "SUCCESS_EMPTY" + : "SUCCESS"; + state.labsRequestByPatientId.data = action.payload as any; + }) + .addCase(thunks.getLabsRequestByPatientId.rejected, (state, action) => { + state.labsRequestByPatientId = ApiResponse.error(action.payload); + }) // Get Lab By Code .addCase(thunks.getLabByCode.pending, (state) => { state.getLabByCode = ApiResponse.loading(); diff --git a/src/state/laboratories/thunk.ts b/src/state/laboratories/thunk.ts index 65f4ea7d5..782a34eab 100644 --- a/src/state/laboratories/thunk.ts +++ b/src/state/laboratories/thunk.ts @@ -35,7 +35,7 @@ export const getLabsByPatientId = createAsyncThunk( .getLaboratory1({ patId: patId ?? -1 }) .toPromise() .then((result) => - result.map((item) => + (result ?? []).map((item) => item.laboratoryDTO ? item : { laboratoryDTO: item } ) ) diff --git a/src/state/opds/thunk.ts b/src/state/opds/thunk.ts index 32676eb3a..20843e630 100644 --- a/src/state/opds/thunk.ts +++ b/src/state/opds/thunk.ts @@ -1,4 +1,6 @@ import { createAsyncThunk } from "@reduxjs/toolkit"; +import { isEmpty } from "lodash"; +import moment from "moment"; import { OpdDTO, OpdWithOperationRowDTO, @@ -6,8 +8,6 @@ import { UpdateOpdWithOperationRowRequest, } from "../../generated"; import { customConfiguration } from "../../libraries/apiUtils/configuration"; -import { isEmpty } from "lodash"; -import moment from "moment"; const api = new OpdsApi(customConfiguration()); @@ -31,7 +31,7 @@ export const getOpdsWithOperationRows = createAsyncThunk( }) .toPromise() .then((result) => - result.map((item) => + (result ?? []).map((item) => item.opdDTO ? item : ({ opdDTO: item } as OpdWithOperationRowDTO) ) ) diff --git a/src/state/patients/thunk.ts b/src/state/patients/thunk.ts index 4644b52e6..3e759204c 100644 --- a/src/state/patients/thunk.ts +++ b/src/state/patients/thunk.ts @@ -1,8 +1,8 @@ import { createAsyncThunk } from "@reduxjs/toolkit"; -import { PatientDTO, PatientsApi, UpdatePatientRequest } from "../../generated"; -import { customConfiguration } from "../../libraries/apiUtils/configuration"; import moment from "moment"; import { TValues } from "../../components/activities/searchPatientActivity/types"; +import { PatientDTO, PatientsApi, UpdatePatientRequest } from "../../generated"; +import { customConfiguration } from "../../libraries/apiUtils/configuration"; const api = new PatientsApi(customConfiguration()); @@ -13,7 +13,7 @@ export const searchPatient = createAsyncThunk( return api .getPatient({ code: parseInt(values.id) }) .toPromise() - .then((result) => [result]) + .then((result) => (result ? [result] : [])) .catch((error) => thunkApi.rejectWithValue(error.response)); } return api