From 1804300eba26522057735b32babc3409be7d9fd0 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 19 Jun 2023 11:29:22 +0200 Subject: [PATCH 01/37] build: upgrade @dhis2/ui version to get calendar --- package.json | 7 +- yarn.lock | 1050 +++++++++++++++++++++++--------------------------- 2 files changed, 482 insertions(+), 575 deletions(-) diff --git a/package.json b/package.json index 2a0da5ab73..49702f2087 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "100.32.13", "@dhis2/app-runtime": "^3.8.0", "@dhis2/d2-i18n": "^1.1.0", "@dhis2/d2-icons": "^1.0.1", @@ -18,7 +17,8 @@ "@dhis2/d2-ui-org-unit-tree": "^7.3.3", "@dhis2/d2-ui-rich-text": "^7.4.0", "@dhis2/d2-ui-sharing-dialog": "^7.3.3", - "@dhis2/ui": "^8.7.7", + "@dhis2/rules-engine-javascript": "100.32.13", + "@dhis2/ui": "8.12.2", "@joakim_sm/react-infinite-calendar": "^2.4.2", "@material-ui/core": "3.9.4", "@material-ui/icons": "3", @@ -130,7 +130,8 @@ "wait-on": "^6.0.1" }, "resolutions": { - "@babel/preset-react": "7.16.7" + "@babel/preset-react": "7.16.7", + "@js-temporal/polyfill": "0.4.3" }, "browserslist": { "production": [ diff --git a/yarn.lock b/yarn.lock index 1f1c4411cf..e868786f22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -47,14 +47,7 @@ dependencies: "@babel/highlight" "^7.10.4" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.5.5": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - -"@babel/code-frame@^7.18.6": +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.5.5": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== @@ -118,16 +111,7 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.12.1", "@babel/generator@^7.17.3", "@babel/generator@^7.17.7", "@babel/generator@^7.7.2": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" - integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== - dependencies: - "@babel/types" "^7.17.0" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.20.1", "@babel/generator@^7.7.4": +"@babel/generator@^7.12.1", "@babel/generator@^7.17.7", "@babel/generator@^7.20.1", "@babel/generator@^7.7.2", "@babel/generator@^7.7.4": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.1.tgz#ef32ecd426222624cbd94871a7024639cf61a9fa" integrity sha512-u1dMdBUmA7Z0rBB97xh8pIhviK7oItYOkjbsCxTWMknyvbQRBwX7/gn4JXurRdirWMFh+ZtYARqkA6ydogVZpg== @@ -196,14 +180,7 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-environment-visitor@^7.18.9": +"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.9": version "7.18.9" resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== @@ -215,16 +192,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" - integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== - dependencies: - "@babel/helper-get-function-arity" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.19.0": +"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.19.0": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== @@ -232,21 +200,7 @@ "@babel/template" "^7.18.10" "@babel/types" "^7.19.0" -"@babel/helper-get-function-arity@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" - integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-hoist-variables@^7.18.6": +"@babel/helper-hoist-variables@^7.16.7", "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== @@ -288,12 +242,7 @@ dependencies: "@babel/types" "^7.16.7" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" - integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== - -"@babel/helper-plugin-utils@^7.18.6": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": version "7.19.0" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== @@ -332,14 +281,7 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-split-export-declaration@^7.18.6": +"@babel/helper-split-export-declaration@^7.16.7", "@babel/helper-split-export-declaration@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== @@ -351,12 +293,7 @@ resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== -"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - -"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": +"@babel/helper-validator-identifier@^7.14.9", "@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== @@ -385,16 +322,7 @@ "@babel/traverse" "^7.17.3" "@babel/types" "^7.17.0" -"@babel/highlight@^7.10.4", "@babel/highlight@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.7.tgz#81a01d7d675046f0d96f82450d9d9578bdfd6b0b" - integrity sha512-aKpPMfLvGO3Q97V0qhw/V2SWNWlwfJknuwAunU7wZLSfrM4xTBvg7E5opUVi1kJTBKihE38CPg4nBiqX83PWYw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/highlight@^7.18.6": +"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== @@ -403,12 +331,7 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.12.3", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2", "@babel/parser@^7.9.4": - version "7.17.8" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" - integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== - -"@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.7.5": +"@babel/parser@^7.1.0", "@babel/parser@^7.1.6", "@babel/parser@^7.12.3", "@babel/parser@^7.17.8", "@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.7.0", "@babel/parser@^7.7.2", "@babel/parser@^7.7.5", "@babel/parser@^7.9.4": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.1.tgz#3e045a92f7b4623cafc2425eddcb8cf2e54f9cc5" integrity sha512-hp0AYxaZJhxULfM1zyp7Wgr+pSUKBcP3M+PHnSzWGdXOzg/kHWIgiUWARvubhUKGOEw3xqY4x+lyZ9ytBVcELw== @@ -656,14 +579,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-flow@^7.12.1", "@babel/plugin-syntax-flow@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.16.7.tgz#202b147e5892b8452bbb0bb269c7ed2539ab8832" - integrity sha512-UDo3YGQO0jH6ytzVwgSLv9i/CzMcUjbKenL67dTrAZPPv6GFAtDhe6jqnvmoKzC/7htNTohhos+onPtDMqJwaQ== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-syntax-flow@^7.7.4": +"@babel/plugin-syntax-flow@^7.12.1", "@babel/plugin-syntax-flow@^7.16.7", "@babel/plugin-syntax-flow@^7.7.4": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.18.6.tgz#774d825256f2379d06139be0c723c4dd444f3ca1" integrity sha512-LUbR+KNTBWCUAqRG9ex5Gnzu2IOkt8jRJbHHXFT9q+L9zm7M/QQbEqXyw1n1pohYvOyWC8CjeyjrSaIwiYjK7A== @@ -1354,16 +1270,7 @@ dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.10.4", "@babel/template@^7.16.7", "@babel/template@^7.3.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/template@^7.18.10": +"@babel/template@^7.10.4", "@babel/template@^7.16.7", "@babel/template@^7.18.10", "@babel/template@^7.3.3": version "7.18.10" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== @@ -1372,23 +1279,7 @@ "@babel/parser" "^7.18.10" "@babel/types" "^7.18.10" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2": - version "7.17.3" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" - integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.3" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.3" - "@babel/types" "^7.17.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.7.4": +"@babel/traverse@^7.1.0", "@babel/traverse@^7.12.1", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3", "@babel/traverse@^7.7.0", "@babel/traverse@^7.7.2", "@babel/traverse@^7.7.4": version "7.20.1" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== @@ -1412,15 +1303,7 @@ "@babel/helper-validator-identifier" "^7.14.9" to-fast-properties "^2.0.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" - integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" - -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.7.4": +"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4", "@babel/types@^7.7.0", "@babel/types@^7.7.4": version "7.20.0" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.0.tgz#52c94cf8a7e24e89d2a194c25c35b17a64871479" integrity sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg== @@ -1645,566 +1528,583 @@ debug "^3.1.0" lodash.once "^4.1.1" -"@dhis2-ui/alert@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/alert/-/alert-8.7.7.tgz#a909c6182b3c7f6a421e70d8f356a8053ca67a01" - integrity sha512-kAqG+/q1E9ZxOs7D8nw58bq8Q0A9Lle/1Y03qIWLWzz+TDZt5m/YkVzWhEwUQv+uFynZXh6QPROIbH5/a9Yg2Q== +"@dhis2-ui/alert@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/alert/-/alert-8.12.2.tgz#6a49369e466c22f522fa5ecf3c0bbde0376b65b9" + integrity sha512-u/NGmM1LSxCqiGTE6+tLss+CT89IH2Y9srGy8/y0zshHKH4jQVfMsIq3eFQIqUeQ55c6SNwQ5hlYQuUVWF9S6w== dependencies: - "@dhis2-ui/portal" "8.7.7" + "@dhis2-ui/portal" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/box@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/box/-/box-8.7.7.tgz#0ba4cb61fa087e80ef67fec8043cf509ef61f3c5" - integrity sha512-inS/ymN/xQH79rPlUGnFEslLiWmHXXicFy192imQD6TaGTmdvsxOU8kF4jzic9Qbwf8pYC8bwsxmvxBqVupJCg== +"@dhis2-ui/box@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/box/-/box-8.12.2.tgz#618f34fdda4b413169b274e94c81bf2cc8532ff4" + integrity sha512-20R1XDzCC3AaWRlhthJHInNDCPcz7pYlCS/HvPmHsa85uxkpC9o2P8O3H+7ETMWfp/HJh5cdz2SYRjXYQ6xSpg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/button@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/button/-/button-8.7.7.tgz#7ddeb2b6e1d38ac5fe49f1cc688ea497e0c726d1" - integrity sha512-1BB+hFS2mdc0hc1F4FMgbH1Z8cQVT5193ibCNB1oaeT/lCtgGgpfplYAwKG7UriNI/WbDQMAmmW++QHan3+0Rg== +"@dhis2-ui/button@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/button/-/button-8.12.2.tgz#92af3db146271870965e62215081c3a570922736" + integrity sha512-XQl3brJFPUr7HEY7eRzF8U+70MQMK8yV/Fh+MCNc1S2wVkOh60SrQ0VDPH1IZUHYy0kDJpqE2NiSvXM6OHC6pg== dependencies: - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/popper" "8.7.7" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2/prop-types" "^3.1.2" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" + classnames "^2.3.1" + prop-types "^15.7.2" + +"@dhis2-ui/calendar@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/calendar/-/calendar-8.12.2.tgz#5bc65dd9cea1c05664355c05f915df3c0ac803df" + integrity sha512-diMPqyRbPHaa4MxTDJUJkY1wWx4QWG+LPh3nJtHsaamJHYImfuVcUr+m5LK+7tX8HL6MXJpNBgkP/bstL4x97Q== + dependencies: + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2/multi-calendar-dates" "1.0.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/card@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/card/-/card-8.7.7.tgz#cc0d953575aae4b0f8a669c2fe73ceaea5e6130e" - integrity sha512-mDDAhTqOIHy+pVNTp0NOyVR0nk2vE1oFaDWqacVZ+7mJFydjg7CMEQlZ4yZ5XmVl57D997pr8jSh/cnzyAATVQ== +"@dhis2-ui/card@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/card/-/card-8.12.2.tgz#ca730dbf3d5304fe87b7fa8f74b6aa199f379934" + integrity sha512-VVn/hK9n2DpyTKb2STA+GqRBHBHUYHVuheCU/eT6TIdD/QxTrs8Ojt8Ean1ZLIR8/IZ8m/djo+Svvs9vC37Zfg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/center@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/center/-/center-8.7.7.tgz#f61ae07ef8a296922d91a35c04d39ce5deed0e00" - integrity sha512-3kPgCpmjO1kdexoooemM2e4jg98QPPFa6aypka+I4q+cQba5D/tYKVwIZAYN+QjzC15hCSbhf0k4yIZ9hs3M4A== +"@dhis2-ui/center@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/center/-/center-8.12.2.tgz#3643b87238c4a69bde1ce8286a1bedd5078b916e" + integrity sha512-v/Nb3nPevH1F8nORIz/cJt8gohOuAKTqbdox8MLxLA9kzsYL4EIhxp1Jq0BnT2SbRQJH68bJG7x5puuk1u2P3w== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/checkbox@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/checkbox/-/checkbox-8.7.7.tgz#ad333b7201c7bbf1ae554d571c6b03e5e3094484" - integrity sha512-Oc2fFH85Xcc7qqJIlBgUbeA7TTFLKvnSeMv2VcLZpv8ApQG2Onm8MtlVK86T72ZvXj529ejex6XRCjYWdbp+dQ== +"@dhis2-ui/checkbox@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/checkbox/-/checkbox-8.12.2.tgz#6a0c441a9ddcef636242ba0215f0489b2e23245c" + integrity sha512-ItAlsyZiA2C1jK3gsjPqmueBBhQL5sdBvZzlEnayS/zcAdfpmPH95sgiDGXRACK5iJMb+4LZT4HOZ1CVJVGIGQ== dependencies: - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/required" "8.7.7" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/required" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/chip@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/chip/-/chip-8.7.7.tgz#76ef229e8c452c2c8812666120be1128710f0614" - integrity sha512-fhfAg+y4gWKc7rntqGgNVD6Wth70sMybqrB11qykEhKLrZIPzqgYkfOTZmgS/ClV1ultnWXWOL+YZt3ak2FKqg== +"@dhis2-ui/chip@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/chip/-/chip-8.12.2.tgz#bcdcd4a85250d6b177faa9ce36acf9608be4f7d6" + integrity sha512-6GEkf71HPmjqQnQCTviFaRmny/NNhodhGP0T3vsXumfomrUMSll4ITOOp0Ux6QcXZ/j0l2Rk65kzaPjGlsznrQ== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/cover@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/cover/-/cover-8.7.7.tgz#7d244c3505d98184504d9363add87b4a55d15a84" - integrity sha512-tibwsokBCVUufKdtpgTzD/+Kaw2o7/dwIQmfeF+gJ+18a7yxaXu3taXIqPegtKNz6xnQYkDixyTu1QJsolidHQ== +"@dhis2-ui/cover@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/cover/-/cover-8.12.2.tgz#4df7159e7b9b45e50a024aabf15dbbc5d30dc63f" + integrity sha512-T0crIjleYekz4tLFdCA6YaLHmvntNnxnUJ7gBKHM1bbTvB6yfSQrU6GOmkf1Tos+HLB032qMvKI4AHF3Lf4gWA== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/css@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/css/-/css-8.7.7.tgz#d014d7a5e2380b7d58e10eaf890a8867a8c8ed5e" - integrity sha512-lRjXrIaxvc6wCRJMcK14ksNR53s1wNej10DBtOZCJRANltXR4Uf2inwEJhNzWtR7m6Wufv4tKYZ67LtN3GMSjw== +"@dhis2-ui/css@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/css/-/css-8.12.2.tgz#97f5f3f214ad588aa34403d4de1c4b7d581c4ff8" + integrity sha512-YgQp5maOh4Ju2Qpl7wxrMol7z02aOFBsy+b6Pcb5fxxAv6c0rjd1ZvUctle52Djpib8x6VA/w1SErzZxxYqh0A== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/divider@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/divider/-/divider-8.7.7.tgz#7f5c3f39fbda5a25d1b764bdb572ae642910a81d" - integrity sha512-DTAuBpnfsDZbvIIfPAfu/7oURL74ezNQQs+F09ad9EszJECKG24A49daKCXzdYr+ytsM7krl8WF2a0NoG/v8uA== +"@dhis2-ui/divider@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/divider/-/divider-8.12.2.tgz#2b911e587387009ea183913e249ccb529a24f3ce" + integrity sha512-av8ClUCaioK8qTT8WSyz1QghZ/ookYW9zB3RFLfdBeo2uVtIo8iZAec7TMUiRlIahDcYZ6RVla4QgC2ixukfdQ== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/field@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/field/-/field-8.7.7.tgz#31363edac1715035d6fd1358f1f1c6bc819c0a0e" - integrity sha512-9TzJGzddbLqWBWTcHBZaXimPMAfSsa9c6kTMBZUJVtgZE3y1E8SsoiVEMY35e+ZAiij2cmJHjg2h0++DTLJvlA== +"@dhis2-ui/field@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/field/-/field-8.12.2.tgz#284cf08584ba36a781459f75470eb1104d3d2508" + integrity sha512-kLoq+e8audolXXiq3ALhbK4LBMjgfGHW2+z9TM9MzIBJ0g2YXVOlDQxFc6cyETkQgaQwNDSsdBay6xFrSav/oA== dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/help" "8.7.7" - "@dhis2-ui/label" "8.7.7" + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/help" "8.12.2" + "@dhis2-ui/label" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/file-input@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/file-input/-/file-input-8.7.7.tgz#809983cc1b91bfc2488fcf2c287ae3d8ab50cffa" - integrity sha512-hgFS1UQbTM2EFPca/UluBoYdTqkIP1FNlsdCqDyI2OgiPsT5X0a0wgjfTLDPOy7HPHhalkOCz7xOxgyB9IbWOw== +"@dhis2-ui/file-input@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/file-input/-/file-input-8.12.2.tgz#e88f82032ceeb6844c180aafdcac38bf38a6e45a" + integrity sha512-zruII+y2IJAI7VGwUe37GbJ7prrMQnnauG2pg02t9YcRQRsFvRJ9Hl/+zhNgMkv0MmMiaaA2u6vXKt1EiLeDzQ== dependencies: - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/label" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/status-icon" "8.7.7" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/label" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/status-icon" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/header-bar@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/header-bar/-/header-bar-8.7.7.tgz#4850f9c1b760762ec9ba06fe165fc996f66de37a" - integrity sha512-S/Alqi4CCXIG49NorOCF3ItCGjZtHw6qS6J42yV7WNNMicDdz0y4bnQWZEibFrUSneVHbWLI/LE6afKKwZ+WHg== - dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/center" "8.7.7" - "@dhis2-ui/divider" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/logo" "8.7.7" - "@dhis2-ui/menu" "8.7.7" - "@dhis2-ui/modal" "8.7.7" - "@dhis2-ui/user-avatar" "8.7.7" +"@dhis2-ui/header-bar@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/header-bar/-/header-bar-8.12.2.tgz#d1bee5a8dfe886a4a8811ba661e1f6385c4054c1" + integrity sha512-VnFxI9z3NjRQnfHRBiR0sfkSTE3clAk98+SJrTyLSWzIGGAhKl2fm9S3Umk7ra1ad3oLk9JGUoGHW5tCdxWq6A== + dependencies: + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/center" "8.12.2" + "@dhis2-ui/divider" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/logo" "8.12.2" + "@dhis2-ui/menu" "8.12.2" + "@dhis2-ui/modal" "8.12.2" + "@dhis2-ui/user-avatar" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" moment "^2.29.1" prop-types "^15.7.2" -"@dhis2-ui/help@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/help/-/help-8.7.7.tgz#344e624c1fd42c2fdedac1271e7e9b1bc65ed465" - integrity sha512-r74kUbMdJbYviCJTpF56T2c1n+JohXEcd9886ArknSLQ2+zrtyzg2Imr32tHSHHyhjGRJN1oOZSghiWlfXu0Cw== +"@dhis2-ui/help@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/help/-/help-8.12.2.tgz#c9da5226e69d3540fa3a1420ea037112b514cafd" + integrity sha512-hms46YadFrgHAJGZh+b+9lLT3ScNh9h8cOSYbJqd+PDCudIYgZwQbkRjo+1wNgENtoGkc5PPFUt+d40i/9Y4Tw== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/input@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/input/-/input-8.7.7.tgz#e01e0407452d31fcb4df48c7ae74ef2e55c54d6f" - integrity sha512-AohkES9IEimDLKNyt/Ov2V0XUToW8QAmx1uPo0EucsStBeNvYb+4B7H5CKZrmRyKCd+BUh3ot2ZK/oaSnvUmEA== +"@dhis2-ui/input@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/input/-/input-8.12.2.tgz#7f7ec33620a57387202a9f1fa5779ba0e2785064" + integrity sha512-Rh9myqokwZoRwHY6tIR5VtHNL0yurL3H4+3cHmI2aZjkyPiJ0zkw6ZZzQjIl5Rw0NJonHB2zUgmxpCc+Z+NozA== dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/status-icon" "8.7.7" + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/status-icon" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/intersection-detector@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/intersection-detector/-/intersection-detector-8.7.7.tgz#58f0a864c02e9abd0f6e8f0592c53e5b47f0ad0f" - integrity sha512-GvoGxVvmb/fsh4G+e42w4LZQ6qyMayRljDTwWfRUbgadwcK+3pTc4o2P3Oi39+fH9g5CDg44gjUEvb0d9wRj8g== +"@dhis2-ui/intersection-detector@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/intersection-detector/-/intersection-detector-8.12.2.tgz#28ba5563c61f26921eebc60e3ed66dddab956f95" + integrity sha512-FGUFCjMwjt1JrsFxR2IQvdwnZFT5tonVwOoN16MNIcO9if5t7OYXGj+CBwkHc2/VcEuI0PIzeZpLvrsJZHBNpg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/label@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/label/-/label-8.7.7.tgz#d64ece6409e5091c0435b680fad360946a3b966b" - integrity sha512-H0UoiPeLy2eku74NQbbBQVc6ly1eXHUmP3JSPOb/utfPag4E2sVm4f8mMjbCvRJP37lOmVvoZP3nrkDJevWllw== +"@dhis2-ui/label@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/label/-/label-8.12.2.tgz#658109afc3cc88b555aeb0fcf09ee476fcbe9aeb" + integrity sha512-XQ3zfXX/cBp1TLITp1mOaIYc7Ub1715AZW/a6mjg3kmM4looKCkQrbGTgROle7PJcH3YrgwaLMhr+6tefKcZpw== dependencies: - "@dhis2-ui/required" "8.7.7" + "@dhis2-ui/required" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/layer@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/layer/-/layer-8.7.7.tgz#dd2c538885db52486a2da9c5cb1a35f4f91f1b04" - integrity sha512-hhZEL+iO1Tm6sdVuOUyjgXs20Bi8idpv4Grw8lMGUHVCTIAOzD0FoHReV7lmUYFK/aKWQHhr6s7wKOugv4wBng== +"@dhis2-ui/layer@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/layer/-/layer-8.12.2.tgz#50818217d618d50af33a92f218657d66464c1dc9" + integrity sha512-Vwj4HFeeO6BSJu0DiLb84vqeQ+6wHhCcHth9stMRvZizXX2CSy81u1spYDkVxAatIc4zPLfqqXIMyFgHxV1PSQ== dependencies: - "@dhis2-ui/portal" "8.7.7" + "@dhis2-ui/portal" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/legend@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/legend/-/legend-8.7.7.tgz#e66afa0d973e68c0d0166cc089e5258a333faf01" - integrity sha512-a2E+rdgGn6VNHXS0+OVu8V26kWaZ8HNnK7eo/o1swaKaEVQHC4jzQLPwWWBiZTDHxj6A5tevoMV1FduG1M2a6g== +"@dhis2-ui/legend@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/legend/-/legend-8.12.2.tgz#074c775bff958706bfe357f14c85b4677ed5cfb3" + integrity sha512-LbRQmmnVDSta5lCOGNfQcIBMe2USEEklsOSrEJprGzjgvyT6MBkj1+HQqy87WFtfMpQo9Ey4+3z+Ga2RsBPnvw== dependencies: - "@dhis2-ui/required" "8.7.7" + "@dhis2-ui/required" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/loader@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/loader/-/loader-8.7.7.tgz#478b5290223e5b02669820ebb48301163313b45d" - integrity sha512-IA3AJMCkVj4G3mBIYvdzij1AsPYATI4ToMGhvOdwwTc0uGMbXU6yFs9GRXRB9DaR2qrSgsCO94f7cfRe31HR6g== +"@dhis2-ui/loader@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/loader/-/loader-8.12.2.tgz#f121610fcc0304f7fbdfd67539f3f7cd0e932f1b" + integrity sha512-C5U/8BfloDdnvZr/WBpAWmgV+DJjtwJ3yxra6zWbIIWlyMsda/YnQWI1EtywNZxecIn+zlyzEqibphCyJ8bXWw== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/logo@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/logo/-/logo-8.7.7.tgz#775850958b967111b7b9f6a2ac676fea7babe238" - integrity sha512-Dv3ui2Pcf2L9F42AyodgcFqEM/0P95WNEtJ3vnKSK1vaiNRIDyxPPLJQmmOMSS+fUx0WKoW+SzB5e4MYdK7k4g== +"@dhis2-ui/logo@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/logo/-/logo-8.12.2.tgz#6ac78a112b9eec0c030a98ecb33ac65669818f75" + integrity sha512-+DYKc8PrSlZ++Tou5unszxmOVAXnMgBBrxMGheo6PPcRZhpMgsymO+3R22ysfCw7axiqleyL4Y3//4vZmA1vjA== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/menu@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/menu/-/menu-8.7.7.tgz#8d35e0d55e111842b3aec64d80043ce2841927f5" - integrity sha512-wQo4LfMpIs6c87O20ix2PVeCfHBexSGFq5KMcNNlG9IFMuOgkfinCA3+Irw6AZ4a3iBGmABdqdszuFWo622Rvw== +"@dhis2-ui/menu@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/menu/-/menu-8.12.2.tgz#8d9b74ace3e794fd0d6605339e32759d891135b3" + integrity sha512-FMYs2tvebLp0dIB14ef/EoPgflltWElQzqfvqht3ADqC+Jyyifw3VOAillQNNrX6kPkS1vnkXySozv5BgsdWiQ== dependencies: - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/divider" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/popper" "8.7.7" - "@dhis2-ui/portal" "8.7.7" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/divider" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2-ui/portal" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/modal@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/modal/-/modal-8.7.7.tgz#06de96053d46d29417cf091dac7a6daf6fb9e4a0" - integrity sha512-yCVHLzNixz/o65BAs9hjEddk7WQUEFVhEj1FswY0x7P0Jfnmkxf4jFAZ09GS18h4l3Df60x03s/vu558f7gW2w== +"@dhis2-ui/modal@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/modal/-/modal-8.12.2.tgz#7894e423fc9bd63b520570b1dd00372e98b196a7" + integrity sha512-Uml8HNU9/G3EhTDR2uPgD+fmF9Yxw6y30M2SP6n/i7wnqvfUcowXsMUG6UHocJhqnhGgUzgfcBR7cI/7nU+WzQ== dependencies: - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/center" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/portal" "8.7.7" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/center" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/portal" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/node@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/node/-/node-8.7.7.tgz#398aa8d512310daa15b36ad1335e10121dd22bb4" - integrity sha512-RMidPD3ZqQ0e7Tm59Yhq7brylh9VdsqYZ7iv+NR+B+nCPJ6gylDb1HoiSekpCZjLlXFBHvS65l4HNAGsgmiNqA== +"@dhis2-ui/node@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/node/-/node-8.12.2.tgz#4a0c45ebc2be2f944789f49c5e252af967842b25" + integrity sha512-XmVXqNopIQDFx55fBcRLXQcPogo7e4FFY7Nliqw2jBSHymc/9vM02eQVIMJGOapYEdDyj5owlufBK39ombk1iw== dependencies: - "@dhis2-ui/loader" "8.7.7" + "@dhis2-ui/loader" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/notice-box@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/notice-box/-/notice-box-8.7.7.tgz#86fc47914c068dfc53c28db0857b81a961d1e10f" - integrity sha512-H3X54BP7HzBXk/2DJvQMd3Sv4hG367WtGq6KTbx38puviYSWxcU8L3sbeaeGR1w6tQ5TK4szzehN7rsWKQB+Nw== +"@dhis2-ui/notice-box@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/notice-box/-/notice-box-8.12.2.tgz#a23ac681788342e2ef624c3ebb8f73850c17eaad" + integrity sha512-MdEH/xt48yLsAd6z59X5jSNgu/GefWJN8InKA8/wwqZ1LyUoLfXVYDUbpMxlOCjP1oG3VlXJb4b5Zli1oyc99g== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/organisation-unit-tree@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/organisation-unit-tree/-/organisation-unit-tree-8.7.7.tgz#ad9cab66f7833bcc7c65e883539713c791d4a440" - integrity sha512-g84/VWnxaMMHNfrq80xBDp6/NVJqb/7MCtp+vfP3/cRzj6BW3/P6Ts0fM1gzr2Hvo4D8rGv9JPtECKa7Z0d5ow== +"@dhis2-ui/organisation-unit-tree@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/organisation-unit-tree/-/organisation-unit-tree-8.12.2.tgz#d3bafd402d92117f5c52299a53975657484a2449" + integrity sha512-LMq9l130l2S006rMXxNrS0fbP0gSnr+lNzgnzCLhy4apcd3QfERGIwxWMgCVkcpzP7Y6IxQTKcWIk2FZEGZriw== dependencies: - "@dhis2-ui/checkbox" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/node" "8.7.7" + "@dhis2-ui/checkbox" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/node" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/pagination@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/pagination/-/pagination-8.7.7.tgz#efa73285abfee67f21768be9175ffc4c44f88dd3" - integrity sha512-2jXs6XaatGR+Q77dNJWduguLytayYi2vmNdBkovTcfXMznuTQdIOY5uS5FIUWo2vb1nsr7LPcErNzo8r2Nf8Hw== +"@dhis2-ui/pagination@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/pagination/-/pagination-8.12.2.tgz#d12ca4d386a21763b9d3c3f41d2016d8a1b70b38" + integrity sha512-pABcLXrWYxWYYqIyVKdW1z/2Ej2ZIFEdapep0+ajh6uMPPkkDVHjcMInxqoEzf9+B40rQ0gmeXY9YdFOXQnbTA== dependencies: - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/select" "8.7.7" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/select" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/popover@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/popover/-/popover-8.7.7.tgz#e31d24bd9b7ac68ed1ee51d4781e0a8142551224" - integrity sha512-aeLAQx9Jy7PxJzC98fQo4s0MPKYqqLnFInLDgy5gDT6hI6IxkA3K1LRYS/2fVD/Hy1NB+UYIbyVr+8hFZz1UtA== +"@dhis2-ui/popover@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/popover/-/popover-8.12.2.tgz#f635f21f3d23c24b1f5681b224e1bf043f959e94" + integrity sha512-64021+n3uNygaZeZBz1Jmp6qOjyOCKa43TLfeE81+qzOBK6u8NZI9DTG8E800bCbP0f1X0nDMi2QPMOe4pZLbQ== dependencies: - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/popper" "8.7.7" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/popper" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/popper@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/popper/-/popper-8.7.7.tgz#9a31ab9509aee31988b568333c8c3c5ec0c5edde" - integrity sha512-FOJR7+SB6iOr28O/KDrm4cczv1IeQs7aX0NrbSH28vNzbjLMfT4YkkSSWV/dQbbu9FtMKaSLktOHfFTmB89ilw== +"@dhis2-ui/popper@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/popper/-/popper-8.12.2.tgz#5413ee3e17c37d2330c0295f2c7569e1c5d43c5e" + integrity sha512-wWyOw+dwgTXmjZxf8HtqRI3RTZAdY+hGSagAcnkSLbJ2wltq9tw35i33aT3a8X724wBOQ7kTMxPgppQqiu4efw== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" "@popperjs/core" "^2.10.1" classnames "^2.3.1" prop-types "^15.7.2" react-popper "^2.2.5" resize-observer-polyfill "^1.5.1" -"@dhis2-ui/portal@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/portal/-/portal-8.7.7.tgz#0b25bbb39f4b63d4080bd77173b74e86d19af5c6" - integrity sha512-DAr62e5GLapTtftv6tkio8mDFDOmuNinkl72UuVJ75XIa2S+F2yIDN33bbABRZLN6Hi62h0Cei4oDxjQWpcdCw== +"@dhis2-ui/portal@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/portal/-/portal-8.12.2.tgz#ebcf4214dad17220d6c220a5e0cbf612b89dc955" + integrity sha512-Hv3ZKIvjN9/2QZLBEQWGMtk+lIRkdtGtolYvI4AugrUcypvdtbqTUlb32XLqaSLWEn168sbHayE5hAIX6deGQA== dependencies: classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/radio@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/radio/-/radio-8.7.7.tgz#6550048c17b52fbfabb01e737570bfa0c3788342" - integrity sha512-6/age99SmT9vi8Yg7fZFq6oKeEYMwZNrdLaTF/5fDZ7cuLOz+0YwR/H2rfn1WLqcCAmfJuOQVxFcFEHMDeRxAQ== +"@dhis2-ui/radio@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/radio/-/radio-8.12.2.tgz#1904e5f3fe8c17e700358fb207a31b8a8c0a98f0" + integrity sha512-2fbimjmzwL/2xj/MB3h0e3JMsfYDfEbjP5bpRqrECEY/DBQyXUPB2NUOUoob6sarmjKULtjMspcSIsWJdkyiLg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/required@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/required/-/required-8.7.7.tgz#bdd810b4386e09df412f6d71e1434edb7ccbe985" - integrity sha512-Ro1UgXGqRZizRKrPnDSoXAOzzLOmR//905JBthRO7CtQV7Uqyn/Vh2+dKnJ3Z8g6ee8zt/zLMh3sUzILSFUzgg== +"@dhis2-ui/required@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/required/-/required-8.12.2.tgz#99f2b31694808991deb4945dea44e36cc8b575d0" + integrity sha512-zFJdRSl4a3XunLPAic/o12M25cEnz9WkSrnF2kZfRkGTC9cfK75Md8erK8XoM10fLKSNSov+cCoqKpQOsoRChw== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/segmented-control@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/segmented-control/-/segmented-control-8.7.7.tgz#0a8607a08b6eea0277afb393f93301c427e976b1" - integrity sha512-gRnYKSKd2eAtuyIBLyQRtu7Y+A7L4k1wx63rNVDn5NQ5Kb6ObjAGKDpFC7zBq+WFOTavR0CH2t48Nyhhqlz/pQ== +"@dhis2-ui/segmented-control@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/segmented-control/-/segmented-control-8.12.2.tgz#a4c835b1332539e50e6e8747908ff05b9924a413" + integrity sha512-sSucI39FxpXzCDqrgYTzckNL+uRwpgTw2hqmGzlXQ14Nr4KaIiA7C31GwtL4Han7BsZTTG65qJ4TsCaR5GJpYg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/select@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/select/-/select-8.7.7.tgz#3268624ea3f9bab29b3489143d615e31b1ce6d46" - integrity sha512-sP1xlhtUtlsbEZFV3BVipI6EDDEvIKbKB4LnXwfkhlI9aJM9n/f3gIpLVWENqdH4nh+tOSm2kBXLJIzfUDYoTw== - dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/checkbox" "8.7.7" - "@dhis2-ui/chip" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/popper" "8.7.7" - "@dhis2-ui/status-icon" "8.7.7" +"@dhis2-ui/select@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/select/-/select-8.12.2.tgz#e3dc127a744de64df4b826afb78eb858d448eefc" + integrity sha512-pFVCRf8h6zrHI7nv8PG9M4eSJu3kJj3s9fcfsCVet3ajZ380Qxh34rP+6wO42+lG6tBIuA5QwpOcbWeWp5v0og== + dependencies: + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/checkbox" "8.12.2" + "@dhis2-ui/chip" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2-ui/status-icon" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/selector-bar@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/selector-bar/-/selector-bar-8.7.7.tgz#f18466831742d3a97e11c38b378c8014f680295c" - integrity sha512-fSNyrl0xijrIzCRKFHbHM1X2d5VkoOOEX2FhsXE0V4KY+nXGUzdF3Nxm84mrOjfVUjwZk09ilDY+stQhBCmbeg== - dependencies: - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/popper" "8.7.7" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" +"@dhis2-ui/selector-bar@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/selector-bar/-/selector-bar-8.12.2.tgz#824fad0f6894cb1f368ea27f25cb43824eb1618f" + integrity sha512-3/UCNSk0l2HSa98+7VM5xs+m7sdeD4/ju8s8b7ODlIslGOnCKEmQM0fEaUPh19jQ2fWoR3uWkRiZxVe83AC0iA== + dependencies: + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" "@testing-library/react" "^12.1.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/sharing-dialog@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/sharing-dialog/-/sharing-dialog-8.7.7.tgz#19ae6f15985ca002782030833ddb659bb210513b" - integrity sha512-pxmzKODQ/AYSks7gYDKjmAq+Sr4TJfsYJksPpGViHc4Qoa/ym7Yez4vTaYyC3FlBRUEs0tj9qATXcD+kAT8f4w== - dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/divider" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/menu" "8.7.7" - "@dhis2-ui/modal" "8.7.7" - "@dhis2-ui/notice-box" "8.7.7" - "@dhis2-ui/popper" "8.7.7" - "@dhis2-ui/select" "8.7.7" - "@dhis2-ui/tab" "8.7.7" - "@dhis2-ui/tooltip" "8.7.7" - "@dhis2-ui/user-avatar" "8.7.7" +"@dhis2-ui/sharing-dialog@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/sharing-dialog/-/sharing-dialog-8.12.2.tgz#bb92b92985d56ffe6d38a27185a4d903d7369176" + integrity sha512-rT+CNYLbve+PsIbN1THtFIcIJwq/k1byOd4eYtszYinR6vpuRtg7pX/pGETqJhJ2ix+ApvlxvHg6OxOzsSeqTA== + dependencies: + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/divider" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/menu" "8.12.2" + "@dhis2-ui/modal" "8.12.2" + "@dhis2-ui/notice-box" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2-ui/select" "8.12.2" + "@dhis2-ui/tab" "8.12.2" + "@dhis2-ui/tooltip" "8.12.2" + "@dhis2-ui/user-avatar" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" "@react-hook/size" "^2.1.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/status-icon@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/status-icon/-/status-icon-8.7.7.tgz#ab4f0094c6c5a287d54bed1a88416a2ca763c154" - integrity sha512-HMxry7oJWVnrgJsg7cCRkqy+46suRL1JlIGc7r4UNWCK5WMROsqrTAbbBJpI6r8fgGzKHVbLPjbP15WK7kMNIA== +"@dhis2-ui/status-icon@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/status-icon/-/status-icon-8.12.2.tgz#f07197d6eaa8e5ecd4467ccca44d3969c271d63e" + integrity sha512-SHz4zWw4i5NmfWw2PoCNvTc2LSD2p38+g9MwzIXnNWKMzwbjYZ8+vFrigJs2wGdOZda3JEShktxt2fI3zdIUbg== dependencies: - "@dhis2-ui/loader" "8.7.7" + "@dhis2-ui/loader" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/switch@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/switch/-/switch-8.7.7.tgz#fadb692913aaeb1989696cbb439f44ddcac85a13" - integrity sha512-tb0J0XUusztt4vN8ZRs4EOyvuiAHwSLJvfRcZ0XUNAjfeJwhsZMGRL8hUM7rDE40LP5s2dF+SLeZ4oUv/ytF5Q== +"@dhis2-ui/switch@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/switch/-/switch-8.12.2.tgz#b70d2d7d72c16787b46c61e624cba4b5fc739c82" + integrity sha512-kULAtFBKDdZG4ZAQjtZ9n14J5HK1MLGpw9NlkJxhyo/yV2sLHifQX+Y5wIhVkVotWx69YwXvxiSwO5eZm4cd5w== dependencies: - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/required" "8.7.7" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/required" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/tab@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/tab/-/tab-8.7.7.tgz#91168ba3510d7932e01098a5b487ad16920a3267" - integrity sha512-R6UwJa87a1KByz9MY9XzIdiVYCDICwlRHdgSgu/iBq+LNhbFnKHq7oQuExI24SzDicYYJwcdBkB5fR07AKz5mQ== +"@dhis2-ui/tab@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/tab/-/tab-8.12.2.tgz#db086138a17768150536c680a6320bbb4bfdf8e2" + integrity sha512-ukYEwPJqryGn0vXXPezEdP8CMVrPT/PTZC8q7hhIea5RbIpK3qOJ43U/7HojWjRriyvq6qp+lW2ePAfHaTMOxA== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/table@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/table/-/table-8.7.7.tgz#77cab7d0357e92137c3dcc6ad38107ec5c3ee2a6" - integrity sha512-D9Le3DvsZd6D3P+rgmaom5pL1rhNKFH7iwhL/8k38ifsoI0xiTxrK9g9aD5W/0rxfSH0rjOcjb9U/fNg8rp10g== +"@dhis2-ui/table@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/table/-/table-8.12.2.tgz#7d86b825bcb048bec7dd163882bb04bae4cc61d0" + integrity sha512-HDuP7D7+l5GlEO2BCtBFp85CgIxYJ3utICLxj6se3chaBO5tdHBx9NoRN3OPeC+7bqxZMmGzgp/nbk2vO39sEQ== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/tag@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/tag/-/tag-8.7.7.tgz#8f6b81ef2f54ed8e6749552871f559d2870397df" - integrity sha512-B7oU/wvZ/4TSxXVQr5OQWx4bB9dZ+TrTrjZigLbTRLf7L4Kl4wdyciCMBIIPHvvLaJPKGUItuKCJSDk4y7IuEQ== +"@dhis2-ui/tag@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/tag/-/tag-8.12.2.tgz#03bd50b467da940de9698a64ccab0e5eb738d483" + integrity sha512-d/d1zZnetS5z2ZP+Tvx6UEfAJZVCI0qK4CZ9uelA8mFrvNSr9V7CdRriphbcW2x3dIteQ0qJMLgLFxKLd/u5aA== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/text-area@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/text-area/-/text-area-8.7.7.tgz#031da32c454cffaa590dcc75377fae58026ddd3f" - integrity sha512-Ux36zKW+w0fgk1WANrtWldqfolnqP8/065dvyp2HG+Uvvr30oGIvCGWd8eZq8wpmGEYR4tBbVQl9kLqRdr/gpA== +"@dhis2-ui/text-area@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/text-area/-/text-area-8.12.2.tgz#00cae57b7bf7f0f81db8cc52229d3096e333443b" + integrity sha512-hMols6jlk0MSqhI8b+hZDfMTsOFsyD9FsQg5jf0iFPSi4S1KcNA4XGQaIHm+H6pnfg2c59fkNSiM0zJAqOL6DQ== dependencies: - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/status-icon" "8.7.7" + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/status-icon" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-icons" "8.7.7" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-icons" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/tooltip@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/tooltip/-/tooltip-8.7.7.tgz#25b62ddb4ccb465435f036b49f8b1ac239b5bab3" - integrity sha512-n5dmLI+boMXH8O569SaYcf/F337TDtR0SnCXCC4aIkpb9wtFpxTtx7FeHERxkwiiC3Z3QyRx5oott2tcmIaxVw== +"@dhis2-ui/tooltip@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/tooltip/-/tooltip-8.12.2.tgz#bcf9a2c8f1ad624901211a8cba5fbfb74c8dcb3e" + integrity sha512-VySqPKRYTvSLXyEHW8WTerzWqeRwi+3SXY41e3EErb2+7hyy/F63Z2LXroCnMRUBgBbQa5gznHB5L+6+STUjkw== dependencies: - "@dhis2-ui/popper" "8.7.7" - "@dhis2-ui/portal" "8.7.7" + "@dhis2-ui/popper" "8.12.2" + "@dhis2-ui/portal" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/transfer@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/transfer/-/transfer-8.7.7.tgz#05bcd0a86121296dced7d76a0dcea634bc3600d1" - integrity sha512-vEYXG2innjdBUa3tD+Rab83ZxYt9mOwnYKw94dUbdSdGQkdeXaJI4Iw8ept4AvBrwLtZej3wWdWsGGXGiEOMIA== +"@dhis2-ui/transfer@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/transfer/-/transfer-8.12.2.tgz#592b6491a142450637a9dd2308759eb7ecdbf5f2" + integrity sha512-sQedVto3K4MtJH4BHC3dGlE3/JebqzxVj/+dskHTg/z/1IZDrudV/o59tFJpQdNTYXjcX1TKe2DDGTl8ZzKqTA== dependencies: - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/intersection-detector" "8.7.7" - "@dhis2-ui/loader" "8.7.7" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/intersection-detector" "8.12.2" + "@dhis2-ui/loader" "8.12.2" "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" -"@dhis2-ui/user-avatar@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2-ui/user-avatar/-/user-avatar-8.7.7.tgz#865e5d157b4292c70dd7d699c9f0bac7ee76c83f" - integrity sha512-NJM1gBMH2dh2HMmRkC0t4HKBjO5oyPW2GRRnae5VpSYxv+lKmak/0YF8Zw/1lgoJ+TN+dg3e4NFxJi2FzO4hlA== +"@dhis2-ui/user-avatar@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2-ui/user-avatar/-/user-avatar-8.12.2.tgz#e120090ecad7d0c10e22ade848dccd423f599c9a" + integrity sha512-TBXGATlJJOs6cxg555eBzhD3NS4H0FPu59xXxcMW0+CSp9dMxBY55LDq7FkOqYeQhr9FxEye+eNFo9cJTvIIKg== dependencies: "@dhis2/prop-types" "^3.1.2" - "@dhis2/ui-constants" "8.7.7" + "@dhis2/ui-constants" "8.12.2" classnames "^2.3.1" prop-types "^15.7.2" @@ -2460,6 +2360,14 @@ recompose "^0.26.0" rxjs "^5.5.7" +"@dhis2/multi-calendar-dates@1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@dhis2/multi-calendar-dates/-/multi-calendar-dates-1.0.2.tgz#e54dc85e512aba93fceef3004e67e199077f3ba8" + integrity sha512-oQZ7PFMwHFpt4ygDN9DmAeYO3g07L7AHJW6diZ37mzpkEF/DyMafhsZHnJWNlTH5HDp8nYuO3EjBiM7fZN6C0g== + dependencies: + "@js-temporal/polyfill" "^0.4.2" + classnames "^2.3.2" + "@dhis2/prop-types@^3.1.2": version "3.1.2" resolved "https://registry.yarnpkg.com/@dhis2/prop-types/-/prop-types-3.1.2.tgz#65b8ad2da8cd2f72bc8b951049a6c9d1b97af3e9" @@ -2476,90 +2384,91 @@ workbox-routing "^6.1.5" workbox-strategies "^6.1.5" -"@dhis2/ui-constants@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2/ui-constants/-/ui-constants-8.7.7.tgz#cbdc548ddc2dc0f98fe9d8541afe0efd247adf3e" - integrity sha512-SgvtBULPvu3/kZwrzKu55sLeWYnoWgLdiBLacScpXgGYXifHmsNtFVOB/31t2Gl01+JVO1MrQ1ANtGRNdzjF/w== +"@dhis2/ui-constants@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2/ui-constants/-/ui-constants-8.12.2.tgz#73cd817818eab8c0ee73a83479c97ac10140591c" + integrity sha512-+Fz3G9H0fbQSNFQbY4gaKmzvp+RAHbYSxK3wNzMS1fSyVhtQMfDKdlxNN0o4qGe4jayPJfxd+7lNCMzjniNoIA== dependencies: prop-types "^15.7.2" -"@dhis2/ui-forms@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2/ui-forms/-/ui-forms-8.7.7.tgz#b90c3253a69a169e1d5185c51783eb892f3ecb15" - integrity sha512-7ILC6CzKIM8F1bFdvUkBQ/GFwotA+f+jgoSRM68HPFYkPU5jVZUfZ/Dk9Z0WMy+E1t8cps7sLyjyFuhiR/T9Yw== - dependencies: - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/checkbox" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/file-input" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/radio" "8.7.7" - "@dhis2-ui/select" "8.7.7" - "@dhis2-ui/switch" "8.7.7" - "@dhis2-ui/text-area" "8.7.7" +"@dhis2/ui-forms@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2/ui-forms/-/ui-forms-8.12.2.tgz#238ef36d31a5173220c6749195fa079a80bca5e5" + integrity sha512-gWPoE1y9X39C52uz5S9HOUc+gwhLpBD+l+5EEaZPT50bdsJfCkyo7JzGmrSi2ysdqAn2FOxl2wfDGh2NgDTjQw== + dependencies: + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/checkbox" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/file-input" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/radio" "8.12.2" + "@dhis2-ui/select" "8.12.2" + "@dhis2-ui/switch" "8.12.2" + "@dhis2-ui/text-area" "8.12.2" "@dhis2/prop-types" "^3.1.2" classnames "^2.3.1" final-form "^4.20.2" prop-types "^15.7.2" react-final-form "^6.5.3" -"@dhis2/ui-icons@8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2/ui-icons/-/ui-icons-8.7.7.tgz#8138aebb46723cc82168663eb0f06a6659ab2a8c" - integrity sha512-appRE/9TmJ8oa0B+Zb4g2W5nD+KMmdmgIAktRDKa6zRwiUvEPHLRoydm92kn38oDIg7oS9wsAHGMN1eff67cNg== - -"@dhis2/ui@^8.0.0", "@dhis2/ui@^8.7.7": - version "8.7.7" - resolved "https://registry.yarnpkg.com/@dhis2/ui/-/ui-8.7.7.tgz#07c29bbbf83bdeacc27660e4dbd70b917b30a2d6" - integrity sha512-e5laICpQD0MU4aUZzkGCGAvAbuigpCuqzQg4o8gOzR/tv1K78QnY/eMyF/vv7FBKFX9b0AyfKge0YTXPxXYPUQ== - dependencies: - "@dhis2-ui/alert" "8.7.7" - "@dhis2-ui/box" "8.7.7" - "@dhis2-ui/button" "8.7.7" - "@dhis2-ui/card" "8.7.7" - "@dhis2-ui/center" "8.7.7" - "@dhis2-ui/checkbox" "8.7.7" - "@dhis2-ui/chip" "8.7.7" - "@dhis2-ui/cover" "8.7.7" - "@dhis2-ui/css" "8.7.7" - "@dhis2-ui/divider" "8.7.7" - "@dhis2-ui/field" "8.7.7" - "@dhis2-ui/file-input" "8.7.7" - "@dhis2-ui/header-bar" "8.7.7" - "@dhis2-ui/help" "8.7.7" - "@dhis2-ui/input" "8.7.7" - "@dhis2-ui/intersection-detector" "8.7.7" - "@dhis2-ui/label" "8.7.7" - "@dhis2-ui/layer" "8.7.7" - "@dhis2-ui/legend" "8.7.7" - "@dhis2-ui/loader" "8.7.7" - "@dhis2-ui/logo" "8.7.7" - "@dhis2-ui/menu" "8.7.7" - "@dhis2-ui/modal" "8.7.7" - "@dhis2-ui/node" "8.7.7" - "@dhis2-ui/notice-box" "8.7.7" - "@dhis2-ui/organisation-unit-tree" "8.7.7" - "@dhis2-ui/pagination" "8.7.7" - "@dhis2-ui/popover" "8.7.7" - "@dhis2-ui/popper" "8.7.7" - "@dhis2-ui/portal" "8.7.7" - "@dhis2-ui/radio" "8.7.7" - "@dhis2-ui/required" "8.7.7" - "@dhis2-ui/segmented-control" "8.7.7" - "@dhis2-ui/select" "8.7.7" - "@dhis2-ui/selector-bar" "8.7.7" - "@dhis2-ui/sharing-dialog" "8.7.7" - "@dhis2-ui/switch" "8.7.7" - "@dhis2-ui/tab" "8.7.7" - "@dhis2-ui/table" "8.7.7" - "@dhis2-ui/tag" "8.7.7" - "@dhis2-ui/text-area" "8.7.7" - "@dhis2-ui/tooltip" "8.7.7" - "@dhis2-ui/transfer" "8.7.7" - "@dhis2-ui/user-avatar" "8.7.7" - "@dhis2/ui-constants" "8.7.7" - "@dhis2/ui-forms" "8.7.7" - "@dhis2/ui-icons" "8.7.7" +"@dhis2/ui-icons@8.12.2": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2/ui-icons/-/ui-icons-8.12.2.tgz#1710d57b20a1729718e7399562f084d6d6c47179" + integrity sha512-bJcjpvkcIV3oV2GQIUd9Ha1rjz1vjT1gvzomA/vjgAWKmdD98sveJi+lMPgBLbhJXDrrxcMyXH8uLUotTwVBBA== + +"@dhis2/ui@8.12.2", "@dhis2/ui@^8.0.0": + version "8.12.2" + resolved "https://registry.yarnpkg.com/@dhis2/ui/-/ui-8.12.2.tgz#ae4695eb187028be9b383045c1f53e2230283b3f" + integrity sha512-m/xEWMmdxqQCA++GdpSmxcjLqfDc6KtxuxC5gyfWOaz1LH3LK/m0Oa4JKuI5wJ6+ExFrfC4p1pgCStna4mXAFQ== + dependencies: + "@dhis2-ui/alert" "8.12.2" + "@dhis2-ui/box" "8.12.2" + "@dhis2-ui/button" "8.12.2" + "@dhis2-ui/calendar" "8.12.2" + "@dhis2-ui/card" "8.12.2" + "@dhis2-ui/center" "8.12.2" + "@dhis2-ui/checkbox" "8.12.2" + "@dhis2-ui/chip" "8.12.2" + "@dhis2-ui/cover" "8.12.2" + "@dhis2-ui/css" "8.12.2" + "@dhis2-ui/divider" "8.12.2" + "@dhis2-ui/field" "8.12.2" + "@dhis2-ui/file-input" "8.12.2" + "@dhis2-ui/header-bar" "8.12.2" + "@dhis2-ui/help" "8.12.2" + "@dhis2-ui/input" "8.12.2" + "@dhis2-ui/intersection-detector" "8.12.2" + "@dhis2-ui/label" "8.12.2" + "@dhis2-ui/layer" "8.12.2" + "@dhis2-ui/legend" "8.12.2" + "@dhis2-ui/loader" "8.12.2" + "@dhis2-ui/logo" "8.12.2" + "@dhis2-ui/menu" "8.12.2" + "@dhis2-ui/modal" "8.12.2" + "@dhis2-ui/node" "8.12.2" + "@dhis2-ui/notice-box" "8.12.2" + "@dhis2-ui/organisation-unit-tree" "8.12.2" + "@dhis2-ui/pagination" "8.12.2" + "@dhis2-ui/popover" "8.12.2" + "@dhis2-ui/popper" "8.12.2" + "@dhis2-ui/portal" "8.12.2" + "@dhis2-ui/radio" "8.12.2" + "@dhis2-ui/required" "8.12.2" + "@dhis2-ui/segmented-control" "8.12.2" + "@dhis2-ui/select" "8.12.2" + "@dhis2-ui/selector-bar" "8.12.2" + "@dhis2-ui/sharing-dialog" "8.12.2" + "@dhis2-ui/switch" "8.12.2" + "@dhis2-ui/tab" "8.12.2" + "@dhis2-ui/table" "8.12.2" + "@dhis2-ui/tag" "8.12.2" + "@dhis2-ui/text-area" "8.12.2" + "@dhis2-ui/tooltip" "8.12.2" + "@dhis2-ui/transfer" "8.12.2" + "@dhis2-ui/user-avatar" "8.12.2" + "@dhis2/ui-constants" "8.12.2" + "@dhis2/ui-forms" "8.12.2" + "@dhis2/ui-icons" "8.12.2" prop-types "^15.7.2" "@emotion/is-prop-valid@^0.7.3": @@ -3036,35 +2945,17 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.4" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.4.tgz#b876e3feefb9c8d3aa84014da28b5e52a0640d72" - integrity sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg== - "@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14": +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.11" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" - integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== - -"@jridgewell/trace-mapping@^0.3.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" - integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.9": version "0.3.17" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== @@ -3072,6 +2963,14 @@ "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" +"@js-temporal/polyfill@0.4.3", "@js-temporal/polyfill@^0.4.2": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@js-temporal/polyfill/-/polyfill-0.4.3.tgz#e8f8cf86745eb5050679c46a5ebedb9a9cc1f09b" + integrity sha512-6Fmjo/HlkyVCmJzAPnvtEWlcbQUSRhi8qlN9EtJA/wP7FqXsevLLrlojR44kzNzrRkpf7eDJ+z7b4xQD/Ycypw== + dependencies: + jsbi "^4.1.0" + tslib "^2.3.1" + "@juggle/resize-observer@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.3.1.tgz#b50a781709c81e10701004214340f25475a171a0" @@ -6053,10 +5952,10 @@ class-utils@^0.3.5: isobject "^3.0.0" static-extend "^0.1.1" -classnames@^2.2.4, classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" - integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== +classnames@^2.2.4, classnames@^2.2.5, classnames@^2.2.6, classnames@^2.3.1, classnames@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.2.tgz#351d813bf0137fcc6a76a16b88208d2560a0d924" + integrity sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw== clean-css@^4.2.3: version "4.2.3" @@ -11653,6 +11552,11 @@ js2xmlparser@^4.0.2: dependencies: xmlcreate "^2.0.4" +jsbi@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/jsbi/-/jsbi-4.3.0.tgz#b54ee074fb6fcbc00619559305c8f7e912b04741" + integrity sha512-SnZNcinB4RIcnEyZqFPdGPVgrg2AcnykiBy0sHVJQKHYeaLUvi3Exj+iaPpLnFVkDPZIV4U0yvgC9/R4uEAZ9g== + jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" @@ -17659,10 +17563,10 @@ tslib@^1.10.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35" integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA== -tslib@^2.0.1, tslib@^2.1.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" - integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== +tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.1: + version "2.5.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" + integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== tslib@~2.1.0: version "2.1.0" @@ -18305,8 +18209,10 @@ watchpack@^1.7.4: resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.7.5.tgz#1267e6c55e0b9b5be44c2023aed5437a2c26c453" integrity sha512-9P3MWk6SrKjHsGkLT2KHXdQ/9SNkyoJbabxnKOoJepsvJjJG8uYTR3yTPxPQvNDI3w4Nz1xnE0TLHK4RIVe/MQ== dependencies: + chokidar "^3.4.1" graceful-fs "^4.1.2" neo-async "^2.5.0" + watchpack-chokidar2 "^2.0.1" optionalDependencies: chokidar "^3.4.1" watchpack-chokidar2 "^2.0.1" From febf74bb19b90a002f3e71bf85a2afd65d175d41 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 9 Jun 2023 11:30:17 +0200 Subject: [PATCH 02/37] feat: basic editable enrollment date component Todo: - Run program rules after updating enrollment date - Hide edit button if user lacks data capture access to selected program - Show warning message if selected program has auto generated events - Proper recreation of the designed UI layout - Validate date before posting to server --- .../EnrollmentDate.component.js | 113 ++++++++++++++++++ .../EnrollmentDate.container.js | 53 ++++++++ .../WidgetEnrollment/EnrollmentDate/index.js | 2 + .../WidgetEnrollment.component.js | 23 ++-- 4 files changed, 181 insertions(+), 10 deletions(-) create mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js create mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js create mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/index.js diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js new file mode 100644 index 0000000000..d588b007f8 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -0,0 +1,113 @@ +// @flow +import React, { useState, useCallback, type ComponentType } from 'react'; +import { + Button, + ButtonStrip, + CalendarInput, + InputField, + IconCalendar16, + IconEdit16, + colors, +} from '@dhis2/ui'; +import i18n from '@dhis2/d2-i18n'; +import { DateField } from 'capture-core/components/FormFields/New'; +import { convertValue as convertValueClientToView } from '../../../converters/clientToView'; +import { convertValue as convertFormToClient } from '../../../converters/formToClient'; +import { dataElementTypes } from '../../../metaData'; + +type Props = { + enrollmentDateLabel: string, + enrollmentDate: string, + editEnabled: boolean, + onSave: (?string) => void, + ...CssClasses, +} + +export const EnrollmentDateComponent = ({ + enrollmentDateLabel, + enrollmentDate, + editEnabled, + onSave, + classes, +}: Props) => { + const [editMode, setEditMode] = useState(false); + const [selectedDate, setSelectedDate] = useState(); + const dateChangeHandler = useCallback(({ value }) => { + setSelectedDate(value); + }, [setSelectedDate]); + const displayEnrollmentDate = String(convertValueClientToView(enrollmentDate, dataElementTypes.DATE)); + + const onOpenEdit = () => { + setSelectedDate(displayEnrollmentDate); + setEditMode(true); + }; + const saveHandler = () => { + if (selectedDate === displayEnrollmentDate) { + setEditMode(false); + return; + } + + // [input validation] + + onSave(String(convertFormToClient(selectedDate, dataElementTypes.DATE))); + setEditMode(false); + } + + return editMode ? ( +
+
+ {enrollmentDateLabel} +
+ {/* {}} + onFocus={() => {}} + onRemoveFocus={() => {}} + onBlur={(e) => { setSelectedDate(e) }} + /> */} +
+ +
+
+ + + + +
+
+ ) : ( +
+ + + + {enrollmentDateLabel}{' '} + {displayEnrollmentDate} + {editEnabled && + +
+ ); +}; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js new file mode 100644 index 0000000000..5524157820 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -0,0 +1,53 @@ +// @flow +import React, { useState, useCallback } from 'react'; +import { useDataMutation, type QueryRefetchFunction } from '@dhis2/app-runtime'; +import { EnrollmentDateComponent } from './EnrollmentDate.component'; +import { convertValue as convertValueServerToClient } from '../../../converters/serverToClient'; +import { convertValue as convertValueClientToServer } from '../../../converters/clientToServer'; +import { dataElementTypes } from '../../../metaData'; + +type Props = { + enrollmentDateLabel: string, + enrollment: any, + editEnabled: boolean, + executeRules?: void => void, + ...CssClasses, +} + +const enrollmentUpdate = { + resource: 'tracker?async=false&importStrategy=UPDATE', + type: 'create', + data: enrollment => ({ + enrollments: [enrollment], + }), +}; + +export const EnrollmentDate = ({ + enrollmentDateLabel, + enrollment, + editEnabled, + executeRules, + classes, +}: Props) => { + const [updateMutation] = useDataMutation( + enrollmentUpdate, + { + onComplete: () => { + executeRules && executeRules(); + }, + }, + ); + const saveHandler = (selectedDate) => { + enrollment.enrolledAt = convertValueClientToServer(selectedDate, dataElementTypes.DATE); + updateMutation(enrollment); + }; + const clientDate = String(convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE)); + + return +}; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/index.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/index.js new file mode 100644 index 0000000000..e34b932210 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/index.js @@ -0,0 +1,2 @@ +// @flow +export { EnrollmentDate } from './EnrollmentDate.container'; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 977793676c..70362d98ad 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -20,6 +20,7 @@ import { Status } from './Status'; import { convertValue as convertValueServerToClient } from '../../converters/serverToClient'; import { convertValue as convertValueClientToView } from '../../converters/clientToView'; import { dataElementTypes } from '../../metaData'; +import { EnrollmentDate } from './EnrollmentDate/'; import { Actions } from './Actions'; const styles = { @@ -34,6 +35,11 @@ const styles = { color: colors.grey900, gap: `${spacersNum.dp4}px`, }, + column: { + margin: `${spacersNum.dp8}px 0`, + fontSize: '14px', + gap: `${spacersNum.dp4}px`, + }, statuses: { display: 'flex', gap: `${spacersNum.dp4}px`, @@ -89,16 +95,13 @@ export const WidgetEnrollmentPlain = ({ -
- - - - {getEnrollmentDateLabel(program)}{' '} - {convertValueClientToView( - convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE), - dataElementTypes.DATE, - )} -
+ {program.displayIncidentDate && (
From 51c1ee3dd0ceb51f83d30ad68d55bb072f219e6f Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 9 Jun 2023 13:18:16 +0200 Subject: [PATCH 03/37] feat: run rules after updating enrollment date --- .../EnrollmentPageDefault.component.js | 2 ++ .../EnrollmentPageDefault.container.js | 6 ++++++ .../EnrollmentPageDefault.types.js | 1 + .../enrollment.actions.js | 6 ++++++ .../common/EnrollmentOverviewDomain/index.js | 1 + .../EnrollmentDate/EnrollmentDate.component.js | 2 +- .../EnrollmentDate/EnrollmentDate.container.js | 17 ++++++----------- .../WidgetEnrollment.component.js | 3 ++- .../WidgetEnrollment.container.js | 3 ++- .../WidgetEnrollment/enrollment.types.js | 2 ++ .../enrollmentDomain.reducerDescription.js | 8 ++++++++ 11 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js index d2b5b6f091..0ecd0e2c52 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js @@ -60,6 +60,7 @@ export const EnrollmentPageDefaultPlain = ({ classes, onEventClick, onUpdateTeiAttributeValues, + onUpdateEnrollmentDate, onEnrollmentError, }: PlainProps) => ( <> @@ -108,6 +109,7 @@ export const EnrollmentPageDefaultPlain = ({ programId={program.id} onDelete={onDelete} onAddNew={onAddNew} + onUpdateDate={onUpdateEnrollmentDate} onError={onEnrollmentError} />}
diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js index 976e03492a..4a138d8e16 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js @@ -8,6 +8,7 @@ import { useHistory } from 'react-router-dom'; import { useCommonEnrollmentDomainData, updateEnrollmentAttributeValues, + updateEnrollmentDate, showEnrollmentError, } from '../../common/EnrollmentOverviewDomain'; import { useTrackerProgram } from '../../../../hooks/useTrackerProgram'; @@ -74,6 +75,7 @@ export const EnrollmentPageDefault = () => { const onEventClick = (eventId: string) => { history.push(`/enrollmentEventEdit?${buildUrlQueryString({ orgUnitId, eventId })}`); }; + const onUpdateTeiAttributeValues = useCallback((updatedAttributeValues, teiDisplayName) => { dispatch(updateEnrollmentAttributeValues(updatedAttributeValues .map(({ attribute, value }) => ({ id: attribute, value })), @@ -81,6 +83,9 @@ export const EnrollmentPageDefault = () => { dispatch(updateTeiDisplayName(teiDisplayName)); }, [dispatch]); + const onUpdateEnrollmentDate = useCallback((enrollmentDate) => + dispatch(updateEnrollmentDate(enrollmentDate)), [dispatch]); + const onAddNew = () => { history.push(`/new?${buildUrlQueryString({ orgUnitId, programId, teiId })}`); }; @@ -107,6 +112,7 @@ export const EnrollmentPageDefault = () => { hideWidgets={hideWidgets} onEventClick={onEventClick} onUpdateTeiAttributeValues={onUpdateTeiAttributeValues} + onUpdateEnrollmentDate={onUpdateEnrollmentDate} onEnrollmentError={onEnrollmentError} /> ); diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js index 3822b286a0..d9f091d1f7 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js @@ -19,6 +19,7 @@ export type Props = {| onCreateNew: (stageId: string) => void, onEventClick: (eventId: string) => void, onUpdateTeiAttributeValues: (attributes: Array<{ [key: string]: string }>, teiDisplayName: string) => void, + onUpdateEnrollmentDate: (enrollmentDate: string) => void, onEnrollmentError: (message: string) => void, |}; diff --git a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js index 6cdbe894ba..cc665c2709 100644 --- a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js +++ b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js @@ -4,6 +4,7 @@ import { actionCreator } from '../../../../actions/actions.utils'; export const enrollmentSiteActionTypes = { COMMON_ENROLLMENT_SITE_DATA_SET: 'EnrollmentSite.SetCommonData', + UPDATE_ENROLLMENT_DATE: 'Enrollment.UpdateEnrollmentDate', UPDATE_ENROLLMENT_EVENTS: 'Enrollment.UpdateEnrollmentEvents', UPDATE_ENROLLMENT_EVENTS_WITHOUT_ID: 'Enrollment.UpdateEnrollmentEventsWithoutId', UPDATE_ENROLLMENT_ATTRIBUTE_VALUES: 'Enrollment.UpdateEnrollmentAttributeValues', @@ -18,6 +19,11 @@ export const enrollmentSiteActionTypes = { export const setCommonEnrollmentSiteData = (enrollment: ApiEnrollment, attributeValues: ApiAttributeValues) => actionCreator(enrollmentSiteActionTypes.COMMON_ENROLLMENT_SITE_DATA_SET)({ enrollment, attributeValues }); +export const updateEnrollmentDate = (enrollmentDate: string) => + actionCreator(enrollmentSiteActionTypes.UPDATE_ENROLLMENT_DATE)({ + enrollmentDate, + }); + export const updateEnrollmentEvents = (eventId: string, eventData: Object) => actionCreator(enrollmentSiteActionTypes.UPDATE_ENROLLMENT_EVENTS)({ eventId, diff --git a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js index e7a9b66f5b..2606209721 100644 --- a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js +++ b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js @@ -2,6 +2,7 @@ export type { HideWidgets, WidgetEffects } from './enrollmentOverviewDomain.types'; export { enrollmentSiteActionTypes, + updateEnrollmentDate, updateEnrollmentEvents, commitEnrollmentEvent, rollbackEnrollmentEvent, diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index d588b007f8..0f50dda49a 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -19,7 +19,7 @@ type Props = { enrollmentDateLabel: string, enrollmentDate: string, editEnabled: boolean, - onSave: (?string) => void, + onSave: (string) => void, ...CssClasses, } diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index 5524157820..6be6f2b8bc 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -10,7 +10,7 @@ type Props = { enrollmentDateLabel: string, enrollment: any, editEnabled: boolean, - executeRules?: void => void, + onUpdateDate?: (enrollmentDate: string) => void, ...CssClasses, } @@ -26,20 +26,15 @@ export const EnrollmentDate = ({ enrollmentDateLabel, enrollment, editEnabled, - executeRules, + onUpdateDate, classes, }: Props) => { - const [updateMutation] = useDataMutation( - enrollmentUpdate, - { - onComplete: () => { - executeRules && executeRules(); - }, - }, - ); - const saveHandler = (selectedDate) => { + const [updateMutation] = useDataMutation(enrollmentUpdate); + + const saveHandler = (selectedDate: string) => { enrollment.enrolledAt = convertValueClientToServer(selectedDate, dataElementTypes.DATE); updateMutation(enrollment); + onUpdateDate && onUpdateDate(enrollment.enrolledAt); }; const clientDate = String(convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE)); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 70362d98ad..19100b98c9 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -63,6 +63,7 @@ export const WidgetEnrollmentPlain = ({ canAddNew, onDelete, onAddNew, + onUpdateDate, onError, onSuccess, }: PlainProps) => { @@ -99,7 +100,7 @@ export const WidgetEnrollmentPlain = ({ enrollmentDateLabel={getEnrollmentDateLabel(program)} enrollment={enrollment} editEnabled={true} - refetchEnrollment={refetchEnrollment} + onUpdateDate={onUpdateDate} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index 8660f704f4..cbc68f5115 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -10,7 +10,7 @@ import { useProgram } from './hooks/useProgram'; import type { Props } from './enrollment.types'; import { plainStatus } from './constants/status.const'; -export const WidgetEnrollment = ({ teiId, enrollmentId, programId, onDelete, onAddNew, onError, onSuccess }: Props) => { +export const WidgetEnrollment = ({ teiId, enrollmentId, programId, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { @@ -40,6 +40,7 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, onDelete, onA loading={!(enrollment && program && displayName)} onDelete={onDelete} onAddNew={onAddNew} + onUpdateDate={onUpdateDate} error={error} onError={onError} onSuccess={onSuccess} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index a3eacd0fdb..e2c2ade566 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -7,6 +7,7 @@ export type Props = {| programId: string, onDelete: () => void, onAddNew: () => void, + onUpdateDate?: (enrollmentDate: string) => void, onError?: (message: string) => void, onSuccess?: () => void, |}; @@ -22,6 +23,7 @@ export type PlainProps = {| canAddNew: boolean, onDelete: () => void, onAddNew: () => void, + onUpdateDate?: (enrollmentDate: string) => void, onError?: (message: string) => void, onSuccess?: () => void, ...CssClasses, diff --git a/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js b/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js index b3470cbe24..9c0c7193ea 100644 --- a/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js +++ b/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js @@ -8,6 +8,7 @@ import { actionTypes as editEventActionTypes } from '../../components/WidgetEven const initialReducerValue = {}; const { COMMON_ENROLLMENT_SITE_DATA_SET, + UPDATE_ENROLLMENT_DATE, UPDATE_ENROLLMENT_EVENTS, UPDATE_ENROLLMENT_EVENTS_WITHOUT_ID, UPDATE_ENROLLMENT_ATTRIBUTE_VALUES, @@ -25,6 +26,13 @@ export const enrollmentDomainDesc = createReducerDescription( attributeValues, enrollmentId: enrollment?.enrollment, }), + [UPDATE_ENROLLMENT_DATE]: (state, { payload: { enrollmentDate } }) => ({ + ...state, + enrollment: { + ...state.enrollment, + enrolledAt: enrollmentDate, + }, + }), [UPDATE_ENROLLMENT_EVENTS]: ( state, { payload: { eventId, eventData } }, From 3a7907b42711821bcb2f6751e131e6e56307df66 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 9 Jun 2023 14:16:49 +0200 Subject: [PATCH 04/37] feat: enrollment date edit button enable condition --- .../EnrollmentPageDefault/EnrollmentPageDefault.component.js | 1 + .../EnrollmentAddEventPageDefault.component.js | 1 + .../EnrollmentEditEvent/EnrollmentEditEventPage.component.js | 1 + .../components/WidgetEnrollment/WidgetEnrollment.component.js | 3 ++- .../components/WidgetEnrollment/WidgetEnrollment.container.js | 3 ++- .../components/WidgetEnrollment/enrollment.types.js | 2 ++ .../components/WidgetEnrollment/hooks/useProgram.js | 2 +- 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js index 0ecd0e2c52..426f4e9e6a 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js @@ -107,6 +107,7 @@ export const EnrollmentPageDefaultPlain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={program.id} + mayEditDate={true} onDelete={onDelete} onAddNew={onAddNew} onUpdateDate={onUpdateEnrollmentDate} diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js b/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js index e741014b20..1653807619 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js @@ -126,6 +126,7 @@ const EnrollmentAddEventPagePain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={programId} + mayEditDate={false} onDelete={onDelete} onAddNew={onAddNew} onError={onEnrollmentError} diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js index d2cf2dc3e9..26be58b56a 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js @@ -137,6 +137,7 @@ const EnrollmentEditEventPagePain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={programId} + mayEditDate={false} onDelete={onDelete} onAddNew={onAddNew} onError={onEnrollmentError} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 19100b98c9..2b42edca57 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -61,6 +61,7 @@ export const WidgetEnrollmentPlain = ({ error, loading, canAddNew, + editDateEnabled, onDelete, onAddNew, onUpdateDate, @@ -99,7 +100,7 @@ export const WidgetEnrollmentPlain = ({ diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index cbc68f5115..1ae45fd15d 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -10,7 +10,7 @@ import { useProgram } from './hooks/useProgram'; import type { Props } from './enrollment.types'; import { plainStatus } from './constants/status.const'; -export const WidgetEnrollment = ({ teiId, enrollmentId, programId, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { +export const WidgetEnrollment = ({ teiId, enrollmentId, programId, mayEditDate, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { @@ -33,6 +33,7 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, onDelete, onA void, onAddNew: () => void, onUpdateDate?: (enrollmentDate: string) => void, @@ -21,6 +22,7 @@ export type PlainProps = {| error?: FetchError, loading: boolean, canAddNew: boolean, + editDateEnabled: boolean, onDelete: () => void, onAddNew: () => void, onUpdateDate?: (enrollmentDate: string) => void, diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js index 937f5644c6..a0c6c560dc 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js @@ -10,7 +10,7 @@ export const useProgram = (programId: string) => { resource: `programs/${programId}`, params: { fields: [ - 'displayIncidentDate,incidentDateLabel,enrollmentDateLabel,onlyEnrollOnce,trackedEntityType[displayName]', + 'displayIncidentDate,incidentDateLabel,enrollmentDateLabel,onlyEnrollOnce,trackedEntityType[displayName],access', ], }, }, From 9907855d830959ad5979eafecafc2d7b31fd2183 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 9 Jun 2023 14:49:15 +0200 Subject: [PATCH 05/37] feat: auto generated event warning message --- .../EnrollmentDate/EnrollmentDate.component.js | 7 +++++++ .../EnrollmentDate/EnrollmentDate.container.js | 3 +++ .../WidgetEnrollment/WidgetEnrollment.component.js | 6 ++++++ .../WidgetEnrollment/WidgetEnrollment.container.js | 2 ++ .../components/WidgetEnrollment/enrollment.types.js | 1 + .../components/WidgetEnrollment/hooks/useProgram.js | 2 +- 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index 0f50dda49a..c11722f81e 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -19,6 +19,7 @@ type Props = { enrollmentDateLabel: string, enrollmentDate: string, editEnabled: boolean, + displayAutoGeneratedEventWarning: boolean, onSave: (string) => void, ...CssClasses, } @@ -27,6 +28,7 @@ export const EnrollmentDateComponent = ({ enrollmentDateLabel, enrollmentDate, editEnabled, + displayAutoGeneratedEventWarning, onSave, classes, }: Props) => { @@ -91,6 +93,11 @@ export const EnrollmentDateComponent = ({ + {displayAutoGeneratedEventWarning && ( +
+ {i18n.t('Existing dates for auto-generated events will not be updated.')} +
+ )} ) : (
diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index 6be6f2b8bc..381dd6894f 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -10,6 +10,7 @@ type Props = { enrollmentDateLabel: string, enrollment: any, editEnabled: boolean, + displayAutoGeneratedEventWarning: boolean, onUpdateDate?: (enrollmentDate: string) => void, ...CssClasses, } @@ -26,6 +27,7 @@ export const EnrollmentDate = ({ enrollmentDateLabel, enrollment, editEnabled, + displayAutoGeneratedEventWarning, onUpdateDate, classes, }: Props) => { @@ -42,6 +44,7 @@ export const EnrollmentDate = ({ enrollmentDateLabel={enrollmentDateLabel} enrollmentDate={clientDate} editEnabled={editEnabled} + displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} onSave={saveHandler} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 2b42edca57..04a1b7ebdb 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -40,6 +40,10 @@ const styles = { fontSize: '14px', gap: `${spacersNum.dp4}px`, }, + note: { + fontSize: '12px', + color: colors.grey600, + }, statuses: { display: 'flex', gap: `${spacersNum.dp4}px`, @@ -62,6 +66,7 @@ export const WidgetEnrollmentPlain = ({ loading, canAddNew, editDateEnabled, + displayAutoGeneratedEventWarning, onDelete, onAddNew, onUpdateDate, @@ -101,6 +106,7 @@ export const WidgetEnrollmentPlain = ({ enrollmentDateLabel={getEnrollmentDateLabel(program)} enrollment={enrollment} editEnabled={editDateEnabled} + displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} onUpdateDate={onUpdateDate} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index 1ae45fd15d..f6591e3b7e 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -23,6 +23,7 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, mayEditDate, const canAddNew = enrollments .filter(item => item.program === programId) .every(item => item.status !== plainStatus.ACTIVE); + const containsAutoGeneratedEvent = program && program.programStages.some(autoGeneratedEvent => autoGeneratedEvent); const error = errorEnrollment || errorProgram || errorOwnerOrgUnit || errorOrgUnit; if (error) { @@ -34,6 +35,7 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, mayEditDate, enrollment={enrollment} canAddNew={canAddNew} editDateEnabled={mayEditDate && program && program.access.data.write} + displayAutoGeneratedEventWarning={containsAutoGeneratedEvent} program={program} refetchEnrollment={refetchEnrollment} refetchTEI={refetchTEI} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index c02f6c4c59..de1e219754 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -23,6 +23,7 @@ export type PlainProps = {| loading: boolean, canAddNew: boolean, editDateEnabled: boolean, + displayAutoGeneratedEventWarning: boolean, onDelete: () => void, onAddNew: () => void, onUpdateDate?: (enrollmentDate: string) => void, diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js index a0c6c560dc..fec7939f6d 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useProgram.js @@ -10,7 +10,7 @@ export const useProgram = (programId: string) => { resource: `programs/${programId}`, params: { fields: [ - 'displayIncidentDate,incidentDateLabel,enrollmentDateLabel,onlyEnrollOnce,trackedEntityType[displayName],access', + 'displayIncidentDate,incidentDateLabel,enrollmentDateLabel,onlyEnrollOnce,trackedEntityType[displayName],programStages[autoGenerateEvent],access', ], }, }, From 732ee9f4a0c8f706df8aefd0ec8144bb035b7fd2 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 19 Jun 2023 11:31:00 +0200 Subject: [PATCH 06/37] feat: use CalendarInput component from @dhis2/ui --- .../EnrollmentDate/EnrollmentDate.component.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index c11722f81e..fae085fe05 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -69,13 +69,21 @@ export const EnrollmentDateComponent = ({ onRemoveFocus={() => {}} onBlur={(e) => { setSelectedDate(e) }} /> */} -
+ {/*
-
+
*/} +
-
{displayAutoGeneratedEventWarning && (
@@ -109,20 +131,22 @@ export const EnrollmentDateComponent = ({
) : (
- + - {enrollmentDateLabel}{' '} + {enrollmentDateLabel}{': '} {displayEnrollmentDate} {editEnabled && - - }
); }; + +export const EnrollmentDateComponent = withStyles(styles)(EnrollmentDateComponentPlain); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 04a1b7ebdb..fc9fe179a2 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -35,15 +35,6 @@ const styles = { color: colors.grey900, gap: `${spacersNum.dp4}px`, }, - column: { - margin: `${spacersNum.dp8}px 0`, - fontSize: '14px', - gap: `${spacersNum.dp4}px`, - }, - note: { - fontSize: '12px', - color: colors.grey600, - }, statuses: { display: 'flex', gap: `${spacersNum.dp4}px`, @@ -116,7 +107,7 @@ export const WidgetEnrollmentPlain = ({ - {getIncidentDateLabel(program)}{' '} + {getIncidentDateLabel(program)}{': '} {convertValueClientToView( convertValueServerToClient(enrollment.occurredAt, dataElementTypes.DATE), dataElementTypes.DATE, From e3addc1c84c1d1ca2075af9a2f97101264cc777c Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 26 Jun 2023 18:07:10 +0200 Subject: [PATCH 08/37] fix: always use input format YYYY-MM-DD in CalendarInput --- .../EnrollmentDate/EnrollmentDate.component.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index b1bb77b5c2..cdcb1aab67 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -1,5 +1,6 @@ // @flow import React, { useState, useCallback, type ComponentType } from 'react'; +import moment from 'moment'; import { Button, CalendarInput, @@ -12,8 +13,8 @@ import { import i18n from '@dhis2/d2-i18n'; import { withStyles } from '@material-ui/core'; import { DateField } from 'capture-core/components/FormFields/New'; +import { parseDate } from 'capture-core-utils/parsers'; import { convertValue as convertValueClientToView } from '../../../converters/clientToView'; -import { convertValue as convertFormToClient } from '../../../converters/formToClient'; import { dataElementTypes } from '../../../metaData'; type Props = { @@ -83,16 +84,17 @@ const EnrollmentDateComponentPlain = ({ const displayEnrollmentDate = String(convertValueClientToView(enrollmentDate, dataElementTypes.DATE)); const onOpenEdit = () => { - setSelectedDate(displayEnrollmentDate); + // CalendarInput component only supports the YYYY-MM-DD format + setSelectedDate(moment(enrollmentDate).format('YYYY-MM-DD')); setEditMode(true); }; const saveHandler = () => { - if (selectedDate === displayEnrollmentDate) { - setEditMode(false); - return; + // CalendarInput component only supports the YYYY-MM-DD format + // $FlowFixMe[incompatible-use] + const date = selectedDate ? parseDate(selectedDate, 'YYYY-MM-DD').momentDate.toISOString() : enrollmentDate; + if (date !== enrollmentDate) { + onSave(date); } - - onSave(String(convertFormToClient(selectedDate, dataElementTypes.DATE))); setEditMode(false); } From d275c0f25645b021cf549ebe201671c2fe8a1fdb Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 26 Jun 2023 18:08:19 +0200 Subject: [PATCH 09/37] chore: add translation string --- i18n/en.pot | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/i18n/en.pot b/i18n/en.pot index 9441c4e5ea..df91866f0e 100644 --- a/i18n/en.pot +++ b/i18n/en.pot @@ -5,9 +5,8 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" -"POT-Creation-Date: 2023-06-08T11:11:29.783Z\n" -"PO-Revision-Date: 2023-06-08T11:11:29.783Z\n" - +"POT-Creation-Date: 2023-06-19T09:32:52.277Z\n" +"PO-Revision-Date: 2023-06-19T09:32:52.277Z\n" msgid "Choose one or more dates..." msgstr "Choose one or more dates..." @@ -1145,6 +1144,9 @@ msgstr "Remove mark for follow-up" msgid "Mark for follow-up" msgstr "Mark for follow-up" +msgid "Existing dates for auto-generated events will not be updated." +msgstr "Existing dates for auto-generated events will not be updated." + msgid "Enrollment date" msgstr "Enrollment date" From da78f8bc046f03a463693c3eb8607a319926b408 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 26 Jun 2023 18:16:52 +0200 Subject: [PATCH 10/37] chore: linter errors --- .../EnrollmentPageDefault.component.js | 2 +- .../EnrollmentPageDefault.container.js | 2 +- .../EnrollmentDate/EnrollmentDate.component.js | 10 ++++------ .../EnrollmentDate/EnrollmentDate.container.js | 8 ++++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js index 426f4e9e6a..1b8042c7b9 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js @@ -107,7 +107,7 @@ export const EnrollmentPageDefaultPlain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={program.id} - mayEditDate={true} + mayEditDate onDelete={onDelete} onAddNew={onAddNew} onUpdateDate={onUpdateEnrollmentDate} diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js index 4a138d8e16..d1418948f6 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js @@ -83,7 +83,7 @@ export const EnrollmentPageDefault = () => { dispatch(updateTeiDisplayName(teiDisplayName)); }, [dispatch]); - const onUpdateEnrollmentDate = useCallback((enrollmentDate) => + const onUpdateEnrollmentDate = useCallback(enrollmentDate => dispatch(updateEnrollmentDate(enrollmentDate)), [dispatch]); const onAddNew = () => { diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index cdcb1aab67..835f75e189 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -1,10 +1,9 @@ // @flow -import React, { useState, useCallback, type ComponentType } from 'react'; +import React, { useState, useCallback } from 'react'; import moment from 'moment'; import { Button, CalendarInput, - InputField, IconCalendar16, IconEdit16, colors, @@ -12,7 +11,6 @@ import { } from '@dhis2/ui'; import i18n from '@dhis2/d2-i18n'; import { withStyles } from '@material-ui/core'; -import { DateField } from 'capture-core/components/FormFields/New'; import { parseDate } from 'capture-core-utils/parsers'; import { convertValue as convertValueClientToView } from '../../../converters/clientToView'; import { dataElementTypes } from '../../../metaData'; @@ -55,7 +53,7 @@ const styles = { gap: `${spacersNum.dp2}px`, }, calendar: { - paddingTop: `6px`, + paddingTop: '6px', }, buttonStrip: { display: 'flex', @@ -96,8 +94,8 @@ const EnrollmentDateComponentPlain = ({ onSave(date); } setEditMode(false); - } - + }; + return editMode ? (
+ />); }; From 8afb762edf6e68846ad7d53cd4e581c912712a2d Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Mon, 26 Jun 2023 20:01:21 +0200 Subject: [PATCH 11/37] fix: cypress tests --- .../WidgetsForEnrollmentPages/WidgetEnrollment/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js b/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js index 26146624d7..8b1ce10dca 100644 --- a/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js +++ b/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js @@ -22,7 +22,7 @@ Then('the user sees the enrollment date', () => { cy.get('[data-test="widget-enrollment"]').within(() => { cy.get('[data-test="widget-enrollment-icon-calendar"]').should('exist'); cy.get('[data-test="widget-enrollment-enrollment-date"]') - .contains(`Date of enrollment ${getCurrentYear()}-08-01`) + .contains(`Date of enrollment: ${getCurrentYear()}-08-01`) .should('exist'); }); }); @@ -30,7 +30,7 @@ Then('the user sees the enrollment date', () => { Then('the user sees the incident date', () => { cy.get('[data-test="widget-enrollment"]').within(() => { cy.get('[data-test="widget-enrollment-incident-date"]') - .contains(`Date of birth ${getCurrentYear()}-08-01`) + .contains(`Date of birth: ${getCurrentYear()}-08-01`) .should('exist'); }); }); From 983988ddf042f77e5c70899c7b9ce2db92f3e18e Mon Sep 17 00:00:00 2001 From: Tony Valle <79843014+superskip@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:45:42 +0200 Subject: [PATCH 12/37] fix: missing comma --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4c769733a0..59dbff9cb0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "packages/rules-engine" ], "dependencies": { - "@dhis2/rules-engine-javascript": "100.32.16" + "@dhis2/rules-engine-javascript": "100.32.16", "@dhis2/app-runtime": "^3.8.0", "@dhis2/d2-i18n": "^1.1.0", "@dhis2/d2-icons": "^1.0.1", From 3827ee9a3ef9ca4189889496b3f1e233eedf224f Mon Sep 17 00:00:00 2001 From: Tony Valle <79843014+superskip@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:53:07 +0200 Subject: [PATCH 13/37] refactor: remove unused class name --- .../EnrollmentDate/EnrollmentDate.component.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index 835f75e189..af395c56b8 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -47,11 +47,6 @@ const styles = { color: colors.grey800, }, }, - row2: { - margin: `${spacersNum.dp4}px 0`, - fontSize: '14px', - gap: `${spacersNum.dp2}px`, - }, calendar: { paddingTop: '6px', }, From 7102bf3f97173719639384227116968d89890900 Mon Sep 17 00:00:00 2001 From: Tony Valle <79843014+superskip@users.noreply.github.com> Date: Tue, 27 Jun 2023 20:38:17 +0200 Subject: [PATCH 14/37] fix: change color Co-authored-by: Joe Cooper --- .../WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index af395c56b8..837c07aa54 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -57,7 +57,7 @@ const styles = { }, note: { fontSize: '12px', - color: colors.grey600, + color: colors.grey700, }, }; From 1743436d7ceda7951849fad0c53c63000db86c58 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 30 Jun 2023 12:24:24 +0200 Subject: [PATCH 15/37] fix: update enrollment date in top bar --- .../Pages/Enrollment/EnrollmentPage.actions.js | 4 ++++ .../EnrollmentPageDefault.container.js | 12 +++++++++--- .../enrollmentPage.reducerDescription.js | 11 +++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPage.actions.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPage.actions.js index a1f8c3250a..5f29c4daac 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPage.actions.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPage.actions.js @@ -22,6 +22,7 @@ export const enrollmentPageActionTypes = { DELETE_ENROLLMENT: 'EnrollmentPage.DeleteEnrollment', UPDATE_TEI_DISPLAY_NAME: 'EnrollmentPage.UpdateTeiDisplayName', + UPDATE_ENROLLMENT_DATE: 'EnrollmentPage.UpdateEnrollmentDate', }; export const fetchEnrollmentPageInformation = () => @@ -73,3 +74,6 @@ export const updateTeiDisplayName = (teiDisplayName: string) => actionCreator(enrollmentPageActionTypes.UPDATE_TEI_DISPLAY_NAME)({ teiDisplayName, }); + +export const updateEnrollmentDate = ({ enrollmentId, enrollmentDate }: { enrollmentId: string, enrollmentDate: string }) => + actionCreator(enrollmentPageActionTypes.UPDATE_ENROLLMENT_DATE)({ enrollmentId, enrollmentDate }); diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js index d1418948f6..de05a9c39a 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js @@ -11,6 +11,11 @@ import { updateEnrollmentDate, showEnrollmentError, } from '../../common/EnrollmentOverviewDomain'; +import { + updateEnrollmentDate as updateTopBarEnrollmentDate, + deleteEnrollment, + updateTeiDisplayName, +} from '../EnrollmentPage.actions'; import { useTrackerProgram } from '../../../../hooks/useTrackerProgram'; import { useRulesEngineOrgUnit } from '../../../../hooks/useRulesEngineOrgUnit'; import { EnrollmentPageDefaultComponent } from './EnrollmentPageDefault.component'; @@ -21,7 +26,6 @@ import { useRuleEffects, } from './hooks'; import { buildUrlQueryString, useLocationQuery } from '../../../../utils/routing'; -import { deleteEnrollment, updateTeiDisplayName } from '../EnrollmentPage.actions'; import { useFilteredWidgetData } from './hooks/useFilteredWidgetData'; export const EnrollmentPageDefault = () => { @@ -83,8 +87,10 @@ export const EnrollmentPageDefault = () => { dispatch(updateTeiDisplayName(teiDisplayName)); }, [dispatch]); - const onUpdateEnrollmentDate = useCallback(enrollmentDate => - dispatch(updateEnrollmentDate(enrollmentDate)), [dispatch]); + const onUpdateEnrollmentDate = useCallback((enrollmentDate) => { + dispatch(updateEnrollmentDate(enrollmentDate)); + dispatch(updateTopBarEnrollmentDate({ enrollmentId, enrollmentDate })); + }, [dispatch, enrollmentId]); const onAddNew = () => { history.push(`/new?${buildUrlQueryString({ orgUnitId, programId, teiId })}`); diff --git a/src/core_modules/capture-core/reducers/descriptions/enrollmentPage.reducerDescription.js b/src/core_modules/capture-core/reducers/descriptions/enrollmentPage.reducerDescription.js index bfff16fabb..87827640b1 100644 --- a/src/core_modules/capture-core/reducers/descriptions/enrollmentPage.reducerDescription.js +++ b/src/core_modules/capture-core/reducers/descriptions/enrollmentPage.reducerDescription.js @@ -20,6 +20,7 @@ const { MISSING_MESSAGE_VIEW, DELETE_ENROLLMENT, UPDATE_TEI_DISPLAY_NAME, + UPDATE_ENROLLMENT_DATE, } = enrollmentPageActionTypes; export const enrollmentPageDesc = createReducerDescription({ @@ -73,6 +74,16 @@ export const enrollmentPageDesc = createReducerDescription({ ...state, teiDisplayName, }), + [UPDATE_ENROLLMENT_DATE]: + (state, { payload: { enrollmentId, enrollmentDate } }) => ({ + ...state, + enrollments: state.enrollments.map((enrollment) => { + if (enrollment.enrollment === enrollmentId) { + enrollment.enrolledAt = enrollmentDate; + } + return enrollment; + }), + }), [PAGE_CLEAN]: () => initialReducerValue, [DELETE_ENROLLMENT]: (state, { payload: { enrollmentId } }) => ({ ...state, From a17138b5b0e488c0e0c4de86d6e65c4d1d5e2795 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Wed, 9 Aug 2023 15:12:55 +0200 Subject: [PATCH 16/37] feat: simple error handling --- .../Actions/Actions.container.js | 8 +---- .../EnrollmentDate.component.js | 6 +++- .../EnrollmentDate.container.js | 36 +++++++++++++++---- .../WidgetEnrollment.component.js | 1 + .../WidgetEnrollment/processErrorReports.js | 8 +++++ 5 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/processErrorReports.js diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/Actions/Actions.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/Actions/Actions.container.js index e83fdfda17..2ce98fcb38 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/Actions/Actions.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/Actions/Actions.container.js @@ -3,6 +3,7 @@ import { useDataMutation } from '@dhis2/app-runtime'; import React from 'react'; import { ActionsComponent } from './Actions.component'; import type { Props } from './actions.types'; +import { processErrorReports } from '../processErrorReports'; const enrollmentUpdate = { resource: 'tracker?async=false&importStrategy=UPDATE', @@ -18,13 +19,6 @@ const enrollmentDelete = { enrollments: [enrollment], }), }; -const processErrorReports = (error) => { - // $FlowFixMe[prop-missing] - const errorReports = error?.details?.validationReport?.errorReports; - return errorReports?.length > 0 - ? errorReports.reduce((acc, errorReport) => `${acc} ${errorReport.message}`, '') - : error.message; -}; export const Actions = ({ enrollment = {}, diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index 837c07aa54..f344adc432 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -20,6 +20,7 @@ type Props = { enrollmentDate: string, editEnabled: boolean, displayAutoGeneratedEventWarning: boolean, + saveInProgress: boolean, onSave: (string) => void, ...CssClasses, } @@ -66,6 +67,7 @@ const EnrollmentDateComponentPlain = ({ enrollmentDate, editEnabled, displayAutoGeneratedEventWarning, + saveInProgress, onSave, classes, }: Props) => { @@ -91,7 +93,7 @@ const EnrollmentDateComponentPlain = ({ setEditMode(false); }; - return editMode ? ( + return editMode || saveInProgress ? (
{i18n.t('Save')} @@ -114,6 +117,7 @@ const EnrollmentDateComponentPlain = ({ secondary small onClick={() => setEditMode(false)} + disabled={saveInProgress} > {i18n.t('Cancel')} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index d9ac321157..331f33ae34 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -1,10 +1,11 @@ // @flow -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { useDataMutation } from '@dhis2/app-runtime'; import { EnrollmentDateComponent } from './EnrollmentDate.component'; import { convertValue as convertValueServerToClient } from '../../../converters/serverToClient'; import { convertValue as convertValueClientToServer } from '../../../converters/clientToServer'; import { dataElementTypes } from '../../../metaData'; +import { processErrorReports } from '../processErrorReports'; type Props = { enrollmentDateLabel: string, @@ -12,6 +13,7 @@ type Props = { editEnabled: boolean, displayAutoGeneratedEventWarning: boolean, onUpdateDate?: (enrollmentDate: string) => void, + onError?: (errorReport: any) => void, ...CssClasses, } @@ -29,22 +31,42 @@ export const EnrollmentDate = ({ editEnabled, displayAutoGeneratedEventWarning, onUpdateDate, + onError, classes, }: Props) => { - const [updateMutation] = useDataMutation(enrollmentUpdate); + const [enrollmentDate, setEnrollmentDate] = useState(String(convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE))); + const [newEnrollmentDate, setNewEnrollmentDate] = useState(enrollmentDate); + + const [updateMutation] = useDataMutation(enrollmentUpdate, { + onComplete: () => { + setEnrollmentDate(newEnrollmentDate); + onUpdateDate && onUpdateDate(newEnrollmentDate); + }, + onError: (e) => { + setNewEnrollmentDate(enrollmentDate); + onError && onError(processErrorReports(e)); + }, + }); const saveHandler = (selectedDate: string) => { - enrollment.enrolledAt = convertValueClientToServer(selectedDate, dataElementTypes.DATE); - updateMutation(enrollment); - onUpdateDate && onUpdateDate(enrollment.enrolledAt); + setNewEnrollmentDate(selectedDate); }; - const clientDate = String(convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE)); + + useEffect(() => { + if (newEnrollmentDate !== enrollmentDate) { + updateMutation({ + ...enrollment, + enrolledAt: convertValueClientToServer(newEnrollmentDate, dataElementTypes.DATE), + }); + } + }, [newEnrollmentDate, enrollmentDate, updateMutation, enrollment]); return (); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index fc9fe179a2..99270b1dd5 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -99,6 +99,7 @@ export const WidgetEnrollmentPlain = ({ editEnabled={editDateEnabled} displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} onUpdateDate={onUpdateDate} + onError={onError} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/processErrorReports.js b/src/core_modules/capture-core/components/WidgetEnrollment/processErrorReports.js new file mode 100644 index 0000000000..d60fa40b31 --- /dev/null +++ b/src/core_modules/capture-core/components/WidgetEnrollment/processErrorReports.js @@ -0,0 +1,8 @@ +// @flow +export const processErrorReports = (error: any) => { + // $FlowFixMe[prop-missing] + const errorReports = error?.details?.validationReport?.errorReports; + return errorReports?.length > 0 + ? errorReports.reduce((acc, errorReport) => `${acc} ${errorReport.message}`, '') + : error.message; +}; From 4da0ea73371c3d7224e1380261697bc51e4dde0e Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Wed, 9 Aug 2023 15:16:25 +0200 Subject: [PATCH 17/37] fix: adjust width of input field --- .../WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index f344adc432..f8e60062c4 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -100,7 +100,7 @@ const EnrollmentDateComponentPlain = ({ dense className={classes.calendar} label={enrollmentDateLabel} - inputWidth="50%" + inputWidth="180px" date={selectedDate} onDateSelect={dateChangeHandler} /> From a2b4f0db80ee79ef0aadcb83fb01ff3bb72a5f40 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Wed, 9 Aug 2023 15:58:07 +0200 Subject: [PATCH 18/37] refactor: rename `mayEditDate` -> `readOnlyMode` --- .../EnrollmentPageDefault/EnrollmentPageDefault.component.js | 1 - .../EnrollmentAddEventPageDefault.component.js | 2 +- .../EnrollmentEditEvent/EnrollmentEditEventPage.component.js | 2 +- .../components/WidgetEnrollment/WidgetEnrollment.container.js | 4 ++-- .../components/WidgetEnrollment/enrollment.types.js | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js index 1b8042c7b9..0ecd0e2c52 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js @@ -107,7 +107,6 @@ export const EnrollmentPageDefaultPlain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={program.id} - mayEditDate onDelete={onDelete} onAddNew={onAddNew} onUpdateDate={onUpdateEnrollmentDate} diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js b/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js index 1653807619..f7abac3990 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentAddEvent/EnrollmentAddEventPageDefault/EnrollmentAddEventPageDefault.component.js @@ -126,7 +126,7 @@ const EnrollmentAddEventPagePain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={programId} - mayEditDate={false} + readOnlyMode onDelete={onDelete} onAddNew={onAddNew} onError={onEnrollmentError} diff --git a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js index b0287bde09..1add434b21 100644 --- a/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js +++ b/src/core_modules/capture-core/components/Pages/EnrollmentEditEvent/EnrollmentEditEventPage.component.js @@ -138,7 +138,7 @@ const EnrollmentEditEventPagePain = ({ teiId={teiId} enrollmentId={enrollmentId} programId={programId} - mayEditDate={false} + readOnlyMode onDelete={onDelete} onAddNew={onAddNew} onError={onEnrollmentError} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index f6591e3b7e..6ab6c6381b 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -10,7 +10,7 @@ import { useProgram } from './hooks/useProgram'; import type { Props } from './enrollment.types'; import { plainStatus } from './constants/status.const'; -export const WidgetEnrollment = ({ teiId, enrollmentId, programId, mayEditDate, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { +export const WidgetEnrollment = ({ teiId, enrollmentId, programId, readOnlyMode = false, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { @@ -34,7 +34,7 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, mayEditDate, void, onAddNew: () => void, onUpdateDate?: (enrollmentDate: string) => void, From 05e8d2baf50afbd008afb2c537a0c1ac33c27fec Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 10 Aug 2023 10:30:57 +0200 Subject: [PATCH 19/37] feat: editable incident date --- .../EnrollmentPageDefault.component.js | 4 ++- .../EnrollmentPageDefault.types.js | 1 + .../EnrollmentDate.container.js | 19 ++++++------ .../WidgetEnrollment.component.js | 31 ++++++++++--------- .../WidgetEnrollment.container.js | 16 ++++++++-- .../WidgetEnrollment/enrollment.types.js | 6 ++-- 6 files changed, 48 insertions(+), 29 deletions(-) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js index 0ecd0e2c52..dac5ca2c8a 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.component.js @@ -61,6 +61,7 @@ export const EnrollmentPageDefaultPlain = ({ onEventClick, onUpdateTeiAttributeValues, onUpdateEnrollmentDate, + onUpdateIncidentDate, onEnrollmentError, }: PlainProps) => ( <> @@ -109,7 +110,8 @@ export const EnrollmentPageDefaultPlain = ({ programId={program.id} onDelete={onDelete} onAddNew={onAddNew} - onUpdateDate={onUpdateEnrollmentDate} + onUpdateEnrollmentDate={onUpdateEnrollmentDate} + onUpdateIncidentDate={onUpdateIncidentDate} onError={onEnrollmentError} />}
diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js index d9f091d1f7..b8e3dbd4dd 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.types.js @@ -20,6 +20,7 @@ export type Props = {| onEventClick: (eventId: string) => void, onUpdateTeiAttributeValues: (attributes: Array<{ [key: string]: string }>, teiDisplayName: string) => void, onUpdateEnrollmentDate: (enrollmentDate: string) => void, + onUpdateIncidentDate: (incidentDate: string) => void, onEnrollmentError: (message: string) => void, |}; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index 331f33ae34..34fd30cfd8 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -8,10 +8,11 @@ import { dataElementTypes } from '../../../metaData'; import { processErrorReports } from '../processErrorReports'; type Props = { + serverDate: string, enrollmentDateLabel: string, - enrollment: any, editEnabled: boolean, displayAutoGeneratedEventWarning: boolean, + createPayload: (date: string) => any, onUpdateDate?: (enrollmentDate: string) => void, onError?: (errorReport: any) => void, ...CssClasses, @@ -26,18 +27,19 @@ const enrollmentUpdate = { }; export const EnrollmentDate = ({ + serverDate, enrollmentDateLabel, - enrollment, editEnabled, displayAutoGeneratedEventWarning, + createPayload, onUpdateDate, onError, classes, }: Props) => { - const [enrollmentDate, setEnrollmentDate] = useState(String(convertValueServerToClient(enrollment.enrolledAt, dataElementTypes.DATE))); + const [enrollmentDate, setEnrollmentDate] = useState(String(convertValueServerToClient(serverDate, dataElementTypes.DATE))); const [newEnrollmentDate, setNewEnrollmentDate] = useState(enrollmentDate); - const [updateMutation] = useDataMutation(enrollmentUpdate, { + const [updateMutation, { loading }] = useDataMutation(enrollmentUpdate, { onComplete: () => { setEnrollmentDate(newEnrollmentDate); onUpdateDate && onUpdateDate(newEnrollmentDate); @@ -53,13 +55,10 @@ export const EnrollmentDate = ({ }; useEffect(() => { - if (newEnrollmentDate !== enrollmentDate) { - updateMutation({ - ...enrollment, - enrolledAt: convertValueClientToServer(newEnrollmentDate, dataElementTypes.DATE), - }); + if (newEnrollmentDate !== enrollmentDate && !loading) { + updateMutation(createPayload(String(convertValueClientToServer(newEnrollmentDate, dataElementTypes.DATE)))); } - }, [newEnrollmentDate, enrollmentDate, updateMutation, enrollment]); + }, [newEnrollmentDate, enrollmentDate, updateMutation, createPayload, loading]); return ( { const [open, setOpenStatus] = useState(true); const { fromServerDate } = useTimeZoneConversion(); const geometryType = getGeometryType(enrollment?.geometry?.type); + const updateEnrolledAt = useCallback((date: string) => ({ ...enrollment, enrolledAt: date }), [enrollment]); + const updateOccurredAt = useCallback((date: string) => ({ ...enrollment, occurredAt: date }), [enrollment]); return (
@@ -94,26 +96,27 @@ export const WidgetEnrollmentPlain = ({
{program.displayIncidentDate && ( -
- - - - {getIncidentDateLabel(program)}{': '} - {convertValueClientToView( - convertValueServerToClient(enrollment.occurredAt, dataElementTypes.DATE), - dataElementTypes.DATE, - )} -
+ )}
diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index 6ab6c6381b..511faaa400 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -10,7 +10,18 @@ import { useProgram } from './hooks/useProgram'; import type { Props } from './enrollment.types'; import { plainStatus } from './constants/status.const'; -export const WidgetEnrollment = ({ teiId, enrollmentId, programId, readOnlyMode = false, onDelete, onAddNew, onUpdateDate, onError, onSuccess }: Props) => { +export const WidgetEnrollment = ({ + teiId, + enrollmentId, + programId, + readOnlyMode = false, + onDelete, + onAddNew, + onUpdateEnrollmentDate, + onUpdateIncidentDate, + onError, + onSuccess, +}: Props) => { const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { @@ -43,7 +54,8 @@ export const WidgetEnrollment = ({ teiId, enrollmentId, programId, readOnlyMode loading={!(enrollment && program && displayName)} onDelete={onDelete} onAddNew={onAddNew} - onUpdateDate={onUpdateDate} + onUpdateEnrollmentDate={onUpdateEnrollmentDate} + onUpdateIncidentDate={onUpdateIncidentDate} error={error} onError={onError} onSuccess={onSuccess} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index e0c5116ff3..e7fccd9375 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -8,7 +8,8 @@ export type Props = {| readOnlyMode?: boolean, onDelete: () => void, onAddNew: () => void, - onUpdateDate?: (enrollmentDate: string) => void, + onUpdateEnrollmentDate?: (enrollmentDate: string) => void, + onUpdateIncidentDate?: (enrollmentDate: string) => void, onError?: (message: string) => void, onSuccess?: () => void, |}; @@ -26,7 +27,8 @@ export type PlainProps = {| displayAutoGeneratedEventWarning: boolean, onDelete: () => void, onAddNew: () => void, - onUpdateDate?: (enrollmentDate: string) => void, + onUpdateEnrollmentDate?: (enrollmentDate: string) => void, + onUpdateIncidentDate?: (incidentDate: string) => void, onError?: (message: string) => void, onSuccess?: () => void, ...CssClasses, From dcaeaac9ddb5a2a036f768ccfc481bf8e185a453 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 10 Aug 2023 10:31:49 +0200 Subject: [PATCH 20/37] fix: update incident date in redux store Updates the program rule variable V{incident_date}. --- .../EnrollmentPageDefault.container.js | 6 ++++++ .../common/EnrollmentOverviewDomain/enrollment.actions.js | 6 ++++++ .../Pages/common/EnrollmentOverviewDomain/index.js | 1 + .../descriptions/enrollmentDomain.reducerDescription.js | 8 ++++++++ 4 files changed, 21 insertions(+) diff --git a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js index de05a9c39a..12eb12de18 100644 --- a/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js +++ b/src/core_modules/capture-core/components/Pages/Enrollment/EnrollmentPageDefault/EnrollmentPageDefault.container.js @@ -9,6 +9,7 @@ import { useCommonEnrollmentDomainData, updateEnrollmentAttributeValues, updateEnrollmentDate, + updateIncidentDate, showEnrollmentError, } from '../../common/EnrollmentOverviewDomain'; import { @@ -92,6 +93,10 @@ export const EnrollmentPageDefault = () => { dispatch(updateTopBarEnrollmentDate({ enrollmentId, enrollmentDate })); }, [dispatch, enrollmentId]); + const onUpdateIncidentDate = useCallback((incidentDate) => { + dispatch(updateIncidentDate(incidentDate)); + }, [dispatch]); + const onAddNew = () => { history.push(`/new?${buildUrlQueryString({ orgUnitId, programId, teiId })}`); }; @@ -119,6 +124,7 @@ export const EnrollmentPageDefault = () => { onEventClick={onEventClick} onUpdateTeiAttributeValues={onUpdateTeiAttributeValues} onUpdateEnrollmentDate={onUpdateEnrollmentDate} + onUpdateIncidentDate={onUpdateIncidentDate} onEnrollmentError={onEnrollmentError} /> ); diff --git a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js index cc665c2709..beb3832f89 100644 --- a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js +++ b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/enrollment.actions.js @@ -5,6 +5,7 @@ import { actionCreator } from '../../../../actions/actions.utils'; export const enrollmentSiteActionTypes = { COMMON_ENROLLMENT_SITE_DATA_SET: 'EnrollmentSite.SetCommonData', UPDATE_ENROLLMENT_DATE: 'Enrollment.UpdateEnrollmentDate', + UPDATE_INCIDENT_DATE: 'Enrollment.UpdateIncidentDate', UPDATE_ENROLLMENT_EVENTS: 'Enrollment.UpdateEnrollmentEvents', UPDATE_ENROLLMENT_EVENTS_WITHOUT_ID: 'Enrollment.UpdateEnrollmentEventsWithoutId', UPDATE_ENROLLMENT_ATTRIBUTE_VALUES: 'Enrollment.UpdateEnrollmentAttributeValues', @@ -24,6 +25,11 @@ export const updateEnrollmentDate = (enrollmentDate: string) => enrollmentDate, }); +export const updateIncidentDate = (incidentDate: string) => + actionCreator(enrollmentSiteActionTypes.UPDATE_INCIDENT_DATE)({ + incidentDate, + }); + export const updateEnrollmentEvents = (eventId: string, eventData: Object) => actionCreator(enrollmentSiteActionTypes.UPDATE_ENROLLMENT_EVENTS)({ eventId, diff --git a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js index 2606209721..f79612916d 100644 --- a/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js +++ b/src/core_modules/capture-core/components/Pages/common/EnrollmentOverviewDomain/index.js @@ -3,6 +3,7 @@ export type { HideWidgets, WidgetEffects } from './enrollmentOverviewDomain.type export { enrollmentSiteActionTypes, updateEnrollmentDate, + updateIncidentDate, updateEnrollmentEvents, commitEnrollmentEvent, rollbackEnrollmentEvent, diff --git a/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js b/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js index 9c0c7193ea..9e0745fa5b 100644 --- a/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js +++ b/src/core_modules/capture-core/reducers/descriptions/enrollmentDomain.reducerDescription.js @@ -9,6 +9,7 @@ const initialReducerValue = {}; const { COMMON_ENROLLMENT_SITE_DATA_SET, UPDATE_ENROLLMENT_DATE, + UPDATE_INCIDENT_DATE, UPDATE_ENROLLMENT_EVENTS, UPDATE_ENROLLMENT_EVENTS_WITHOUT_ID, UPDATE_ENROLLMENT_ATTRIBUTE_VALUES, @@ -33,6 +34,13 @@ export const enrollmentDomainDesc = createReducerDescription( enrolledAt: enrollmentDate, }, }), + [UPDATE_INCIDENT_DATE]: (state, { payload: { incidentDate } }) => ({ + ...state, + enrollment: { + ...state.enrollment, + occurredAt: incidentDate, + }, + }), [UPDATE_ENROLLMENT_EVENTS]: ( state, { payload: { eventId, eventData } }, From 65b7f4d4fe507b6076f19789362e44f3158128c2 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 10 Aug 2023 13:01:49 +0200 Subject: [PATCH 21/37] fix: prevent UTC conversion on the selected date For the rule engine, which prefers non-UTC formatted values as input to enrollment_date and incident_date. --- .../WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index f8e60062c4..acab05037c 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -86,7 +86,7 @@ const EnrollmentDateComponentPlain = ({ const saveHandler = () => { // CalendarInput component only supports the YYYY-MM-DD format // $FlowFixMe[incompatible-use] - const date = selectedDate ? parseDate(selectedDate, 'YYYY-MM-DD').momentDate.toISOString() : enrollmentDate; + const date = selectedDate ? parseDate(selectedDate, 'YYYY-MM-DD').momentDate.toISOString(true) : enrollmentDate; if (date !== enrollmentDate) { onSave(date); } From 259e5a2e3d1a0e902e48417174f97f996d44af48 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 10 Aug 2023 14:20:56 +0200 Subject: [PATCH 22/37] fix: failing cypress tests --- .../WidgetsForEnrollmentPages/WidgetEnrollment/index.js | 8 ++++---- .../EnrollmentDate/EnrollmentDate.component.js | 6 +++--- .../WidgetEnrollment/WidgetEnrollment.component.js | 2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js b/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js index 8b1ce10dca..4584e1ba2a 100644 --- a/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js +++ b/cypress/integration/WidgetsForEnrollmentPages/WidgetEnrollment/index.js @@ -19,17 +19,17 @@ Then('the enrollment widget should be opened', () => { }); Then('the user sees the enrollment date', () => { - cy.get('[data-test="widget-enrollment"]').within(() => { + cy.get('[data-test="widget-enrollment-enrollment-date"]').within(() => { cy.get('[data-test="widget-enrollment-icon-calendar"]').should('exist'); - cy.get('[data-test="widget-enrollment-enrollment-date"]') + cy.get('[data-test="widget-enrollment-date"]') .contains(`Date of enrollment: ${getCurrentYear()}-08-01`) .should('exist'); }); }); Then('the user sees the incident date', () => { - cy.get('[data-test="widget-enrollment"]').within(() => { - cy.get('[data-test="widget-enrollment-incident-date"]') + cy.get('[data-test="widget-enrollment-incident-date"]').within(() => { + cy.get('[data-test="widget-enrollment-date"]') .contains(`Date of birth: ${getCurrentYear()}-08-01`) .should('exist'); }); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index acab05037c..2c3cfa1cae 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -94,7 +94,7 @@ const EnrollmentDateComponentPlain = ({ }; return editMode || saveInProgress ? ( -
+
) : ( -
+
@@ -138,7 +138,7 @@ const EnrollmentDateComponentPlain = ({ {editEnabled &&
Date: Thu, 10 Aug 2023 16:25:33 +0200 Subject: [PATCH 23/37] fix: rename TEI "Launchpad McQuack" -> "Breaking TheGlass" --- .../EnrollmentPage/BreakingTheGlass/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cypress/integration/EnrollmentPage/BreakingTheGlass/index.js b/cypress/integration/EnrollmentPage/BreakingTheGlass/index.js index b460d47b33..45ad92f517 100644 --- a/cypress/integration/EnrollmentPage/BreakingTheGlass/index.js +++ b/cypress/integration/EnrollmentPage/BreakingTheGlass/index.js @@ -1,7 +1,7 @@ import '../sharedSteps'; Given('the tei created by this test is cleared from the database', () => { - cy.buildApiUrl('tracker', 'trackedEntities?filter=w75KJ2mc4zz:like:Launchpad&filter=zDhUuAYrxNC:like:McQuack&trackedEntityType=nEenWmSyUEp&page=1&pageSize=5&ouMode=ACCESSIBLE') + cy.buildApiUrl('tracker', 'trackedEntities?filter=w75KJ2mc4zz:like:Breaking&filter=zDhUuAYrxNC:like:TheGlass&trackedEntityType=nEenWmSyUEp&page=1&pageSize=5&ouMode=ACCESSIBLE') .then(url => cy.request(url)) .then(({ body }) => body.instances.forEach(({ trackedEntity }) => @@ -24,12 +24,12 @@ And('you create a new tei in Child programme from Ngelehun CHC', () => { cy.get('[data-test="d2-form-component"]') .find('[data-test="capture-ui-input"]') .eq(0) - .type('Launchpad') + .type('Breaking') .blur(); cy.get('[data-test="d2-form-component"]') .find('[data-test="capture-ui-input"]') .eq(1) - .type('McQuack') + .type('TheGlass') .blur(); clickSave(); @@ -61,7 +61,7 @@ And('you enroll the tei from Njandama MCHP', () => { .click(); cy.get('[data-test="enrollment-page-content"]') - .contains('Enroll Launchpad McQuack in this program') + .contains('Enroll Breaking TheGlass in this program') .click(); cy.get('[data-test="d2-form-component"]') @@ -97,7 +97,7 @@ And('you log in as tracker2 user', () => { And('you select the new tei', () => { cy.visit('/#/?orgUnitId=DiszpKrYNg8&programId=IpHINAT79UW'); - cy.contains('Launchpad') + cy.contains('Breaking') .click(); // Wait for enrollment dashboard cy.get('[data-test="profile-widget"]') From d7f5aa3c2c1215fc31cdef62408a050c52dda0f3 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Fri, 11 Aug 2023 10:05:00 +0200 Subject: [PATCH 24/37] fix: data-test only works for html elements --- .../WidgetEnrollment.component.js | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index ff0ad813c2..5659ab65e7 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -95,30 +95,32 @@ export const WidgetEnrollmentPlain = ({
- - - {program.displayIncidentDate && ( + + + + {program.displayIncidentDate && ( + + + )}
From 71c4cc4bd1842bd3e60d96ac9d3a38d9e443a39d Mon Sep 17 00:00:00 2001 From: Tony Valle <79843014+superskip@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:54:34 +0200 Subject: [PATCH 25/37] fix: remove double dependency on rules engine --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 5c94b5f959..fcaf2583a5 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "@dhis2/d2-ui-org-unit-tree": "^7.3.3", "@dhis2/d2-ui-rich-text": "^7.4.0", "@dhis2/d2-ui-sharing-dialog": "^7.3.3", - "@dhis2/rules-engine-javascript": "100.35.5", "@dhis2/ui": "8.13.11", "@joakim_sm/react-infinite-calendar": "^2.4.2", "@material-ui/core": "3.9.4", From 449577bbae3bc60e876c647db7f295523be4f4ea Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Wed, 30 Aug 2023 11:15:45 +0200 Subject: [PATCH 26/37] refactor: rename prop `error` -> `initError` --- .../WidgetEnrollment/WidgetEnrollment.component.js | 6 +++--- .../WidgetEnrollment/WidgetEnrollment.container.js | 2 +- .../components/WidgetEnrollment/enrollment.types.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 5659ab65e7..49f23ec92f 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -52,7 +52,7 @@ export const WidgetEnrollmentPlain = ({ ownerOrgUnit = {}, refetchEnrollment, refetchTEI, - error, + initError, loading, canAddNew, editDateEnabled, @@ -78,13 +78,13 @@ export const WidgetEnrollmentPlain = ({ onClose={useCallback(() => setOpenStatus(false), [setOpenStatus])} open={open} > - {error && ( + {initError && (
{i18n.t('Enrollment widget could not be loaded. Please try again later')}
)} {loading && } - {!error && !loading && ( + {!initError && !loading && (
{enrollment.followUp && ( diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index 511faaa400..e3e94b66e3 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -56,7 +56,7 @@ export const WidgetEnrollment = ({ onAddNew={onAddNew} onUpdateEnrollmentDate={onUpdateEnrollmentDate} onUpdateIncidentDate={onUpdateIncidentDate} - error={error} + initError={error} onError={onError} onSuccess={onSuccess} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index e7fccd9375..95a54b810a 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -20,7 +20,7 @@ export type PlainProps = {| ownerOrgUnit: Object, refetchEnrollment: QueryRefetchFunction, refetchTEI: QueryRefetchFunction, - error?: FetchError, + initError?: FetchError, loading: boolean, canAddNew: boolean, editDateEnabled: boolean, From 62a2578e7529b4050f5a7bb09f0f83c81e73ea7b Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 31 Aug 2023 15:58:44 +0200 Subject: [PATCH 27/37] refactor: change to optimistic gui --- .../EnrollmentDate.component.js | 6 +-- .../EnrollmentDate.container.js | 37 +++++++------------ .../WidgetEnrollment.component.js | 23 +++++++++--- .../WidgetEnrollment.container.js | 3 +- .../WidgetEnrollment/enrollment.types.js | 7 ++++ .../WidgetEnrollment/hooks/useEnrollment.js | 13 ++++++- 6 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js index 2c3cfa1cae..0f07fc32b8 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js @@ -20,7 +20,6 @@ type Props = { enrollmentDate: string, editEnabled: boolean, displayAutoGeneratedEventWarning: boolean, - saveInProgress: boolean, onSave: (string) => void, ...CssClasses, } @@ -67,7 +66,6 @@ const EnrollmentDateComponentPlain = ({ enrollmentDate, editEnabled, displayAutoGeneratedEventWarning, - saveInProgress, onSave, classes, }: Props) => { @@ -93,7 +91,7 @@ const EnrollmentDateComponentPlain = ({ setEditMode(false); }; - return editMode || saveInProgress ? ( + return editMode ? (
{i18n.t('Save')} @@ -117,7 +114,6 @@ const EnrollmentDateComponentPlain = ({ secondary small onClick={() => setEditMode(false)} - disabled={saveInProgress} > {i18n.t('Cancel')} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index 34fd30cfd8..0fe8d42335 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -1,9 +1,8 @@ // @flow -import React, { useState, useEffect } from 'react'; +import React from 'react'; import { useDataMutation } from '@dhis2/app-runtime'; import { EnrollmentDateComponent } from './EnrollmentDate.component'; import { convertValue as convertValueServerToClient } from '../../../converters/serverToClient'; -import { convertValue as convertValueClientToServer } from '../../../converters/clientToServer'; import { dataElementTypes } from '../../../metaData'; import { processErrorReports } from '../processErrorReports'; @@ -12,8 +11,10 @@ type Props = { enrollmentDateLabel: string, editEnabled: boolean, displayAutoGeneratedEventWarning: boolean, - createPayload: (date: string) => any, - onUpdateDate?: (enrollmentDate: string) => void, + updateDate: ({ + date: string, + updateMutation?: (enrollment: any) => void, + }) => void, onError?: (errorReport: any) => void, ...CssClasses, } @@ -31,41 +32,31 @@ export const EnrollmentDate = ({ enrollmentDateLabel, editEnabled, displayAutoGeneratedEventWarning, - createPayload, - onUpdateDate, + updateDate, onError, classes, }: Props) => { - const [enrollmentDate, setEnrollmentDate] = useState(String(convertValueServerToClient(serverDate, dataElementTypes.DATE))); - const [newEnrollmentDate, setNewEnrollmentDate] = useState(enrollmentDate); + const enrollmentDate = String(convertValueServerToClient(serverDate, dataElementTypes.DATE)); - const [updateMutation, { loading }] = useDataMutation(enrollmentUpdate, { - onComplete: () => { - setEnrollmentDate(newEnrollmentDate); - onUpdateDate && onUpdateDate(newEnrollmentDate); - }, + const [updateMutation] = useDataMutation(enrollmentUpdate, { onError: (e) => { - setNewEnrollmentDate(enrollmentDate); + updateDate({ date: serverDate }); onError && onError(processErrorReports(e)); }, }); - const saveHandler = (selectedDate: string) => { - setNewEnrollmentDate(selectedDate); + const saveHandler = (date: string) => { + updateDate({ + date, + updateMutation, + }); }; - useEffect(() => { - if (newEnrollmentDate !== enrollmentDate && !loading) { - updateMutation(createPayload(String(convertValueClientToServer(newEnrollmentDate, dataElementTypes.DATE)))); - } - }, [newEnrollmentDate, enrollmentDate, updateMutation, createPayload, loading]); - return (); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index 49f23ec92f..b88c3b6c60 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -50,6 +50,7 @@ export const WidgetEnrollmentPlain = ({ enrollment = {}, program = {}, ownerOrgUnit = {}, + setEnrollment, refetchEnrollment, refetchTEI, initError, @@ -67,8 +68,20 @@ export const WidgetEnrollmentPlain = ({ const [open, setOpenStatus] = useState(true); const { fromServerDate } = useTimeZoneConversion(); const geometryType = getGeometryType(enrollment?.geometry?.type); - const updateEnrolledAt = useCallback((date: string) => ({ ...enrollment, enrolledAt: date }), [enrollment]); - const updateOccurredAt = useCallback((date: string) => ({ ...enrollment, occurredAt: date }), [enrollment]); + + const updateEnrolledAt = useCallback(({ date, updateMutation }) => { + const updatedEnrollment = { ...enrollment, enrolledAt: date }; + setEnrollment(updatedEnrollment); + onUpdateEnrollmentDate && onUpdateEnrollmentDate(date); + updateMutation && updateMutation(updatedEnrollment); + }, [enrollment, setEnrollment, onUpdateEnrollmentDate]); + + const updateOccurredAt = useCallback(({ date, updateMutation }) => { + const updatedEnrollment = { ...enrollment, occurredAt: date }; + setEnrollment(updatedEnrollment); + onUpdateIncidentDate && onUpdateIncidentDate(date); + updateMutation && updateMutation(updatedEnrollment); + }, [enrollment, setEnrollment, onUpdateIncidentDate]); return (
@@ -101,8 +114,7 @@ export const WidgetEnrollmentPlain = ({ enrollmentDateLabel={getEnrollmentDateLabel(program)} editEnabled={editDateEnabled} displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} - createPayload={updateEnrolledAt} - onUpdateDate={onUpdateEnrollmentDate} + updateDate={updateEnrolledAt} onError={onError} classes={classes} /> @@ -115,8 +127,7 @@ export const WidgetEnrollmentPlain = ({ enrollmentDateLabel={getIncidentDateLabel(program)} editEnabled={editDateEnabled} displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} - createPayload={updateOccurredAt} - onUpdateDate={onUpdateIncidentDate} + updateDate={updateOccurredAt} onError={onError} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index e3e94b66e3..df2dc7c08b 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -22,7 +22,7 @@ export const WidgetEnrollment = ({ onError, onSuccess, }: Props) => { - const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); + const { error: errorEnrollment, enrollment, refetch: refetchEnrollment, setEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { error: errorOwnerOrgUnit, @@ -48,6 +48,7 @@ export const WidgetEnrollment = ({ editDateEnabled={!readOnlyMode && program && program.access.data.write} displayAutoGeneratedEventWarning={containsAutoGeneratedEvent} program={program} + setEnrollment={setEnrollment} refetchEnrollment={refetchEnrollment} refetchTEI={refetchTEI} ownerOrgUnit={{ id: ownerOrgUnit, displayName }} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index 95a54b810a..e536f558b1 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -18,6 +18,7 @@ export type PlainProps = {| enrollment: Object, program: Object, ownerOrgUnit: Object, + setEnrollment: EnrollmentData => void, refetchEnrollment: QueryRefetchFunction, refetchTEI: QueryRefetchFunction, initError?: FetchError, @@ -33,3 +34,9 @@ export type PlainProps = {| onSuccess?: () => void, ...CssClasses, |}; + +export type EnrollmentData = { + enrollment: string, + enrolledAt: string, + occurredAt: string, +}; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js index 87ae5120c4..c54448fe3a 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js @@ -1,6 +1,7 @@ // @flow -import { useMemo, useEffect } from 'react'; +import { useMemo, useEffect, useState } from 'react'; import { useDataQuery } from '@dhis2/app-runtime'; +import type { EnrollmentData } from '../enrollment.types'; export const useEnrollment = (enrollmentId: string) => { const { error, loading, data, refetch } = useDataQuery( @@ -16,9 +17,17 @@ export const useEnrollment = (enrollmentId: string) => { { lazy: true }, ); + const [enrollment, setEnrollment] = useState(); + + useEffect(() => { + if (data) { + setEnrollment(data.enrollment); + } + }, [setEnrollment, data]); + useEffect(() => { enrollmentId && refetch({ variables: { enrollmentId } }); }, [refetch, enrollmentId]); - return { error, refetch, enrollment: !loading && data?.enrollment }; + return { error, refetch, enrollment: !loading && enrollment, setEnrollment }; }; From 82d3e94216fd426e5449c38b7d7e5512f7bae571 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 31 Aug 2023 16:04:36 +0200 Subject: [PATCH 28/37] refactor: refetch enrollment from api rather than maintaining it locally --- .../EnrollmentDate/EnrollmentDate.container.js | 5 +++++ .../WidgetEnrollment.component.js | 15 ++++++--------- .../WidgetEnrollment.container.js | 3 +-- .../WidgetEnrollment/enrollment.types.js | 7 ------- .../WidgetEnrollment/hooks/useEnrollment.js | 13 ++----------- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js index 0fe8d42335..418e69f5a9 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js @@ -15,6 +15,7 @@ type Props = { date: string, updateMutation?: (enrollment: any) => void, }) => void, + onSuccess: () => any, onError?: (errorReport: any) => void, ...CssClasses, } @@ -33,12 +34,16 @@ export const EnrollmentDate = ({ editEnabled, displayAutoGeneratedEventWarning, updateDate, + onSuccess, onError, classes, }: Props) => { const enrollmentDate = String(convertValueServerToClient(serverDate, dataElementTypes.DATE)); const [updateMutation] = useDataMutation(enrollmentUpdate, { + onComplete: () => { + onSuccess && onSuccess(); + }, onError: (e) => { updateDate({ date: serverDate }); onError && onError(processErrorReports(e)); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js index b88c3b6c60..b8c26b65f3 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.component.js @@ -50,7 +50,6 @@ export const WidgetEnrollmentPlain = ({ enrollment = {}, program = {}, ownerOrgUnit = {}, - setEnrollment, refetchEnrollment, refetchTEI, initError, @@ -70,18 +69,14 @@ export const WidgetEnrollmentPlain = ({ const geometryType = getGeometryType(enrollment?.geometry?.type); const updateEnrolledAt = useCallback(({ date, updateMutation }) => { - const updatedEnrollment = { ...enrollment, enrolledAt: date }; - setEnrollment(updatedEnrollment); onUpdateEnrollmentDate && onUpdateEnrollmentDate(date); - updateMutation && updateMutation(updatedEnrollment); - }, [enrollment, setEnrollment, onUpdateEnrollmentDate]); + updateMutation && updateMutation({ ...enrollment, enrolledAt: date }); + }, [enrollment, onUpdateEnrollmentDate]); const updateOccurredAt = useCallback(({ date, updateMutation }) => { - const updatedEnrollment = { ...enrollment, occurredAt: date }; - setEnrollment(updatedEnrollment); onUpdateIncidentDate && onUpdateIncidentDate(date); - updateMutation && updateMutation(updatedEnrollment); - }, [enrollment, setEnrollment, onUpdateIncidentDate]); + updateMutation && updateMutation({ ...enrollment, occurredAt: date }); + }, [enrollment, onUpdateIncidentDate]); return (
@@ -116,6 +111,7 @@ export const WidgetEnrollmentPlain = ({ displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} updateDate={updateEnrolledAt} onError={onError} + onSuccess={refetchEnrollment} classes={classes} /> @@ -129,6 +125,7 @@ export const WidgetEnrollmentPlain = ({ displayAutoGeneratedEventWarning={displayAutoGeneratedEventWarning} updateDate={updateOccurredAt} onError={onError} + onSuccess={refetchEnrollment} classes={classes} /> diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js index df2dc7c08b..e3e94b66e3 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/WidgetEnrollment.container.js @@ -22,7 +22,7 @@ export const WidgetEnrollment = ({ onError, onSuccess, }: Props) => { - const { error: errorEnrollment, enrollment, refetch: refetchEnrollment, setEnrollment } = useEnrollment(enrollmentId); + const { error: errorEnrollment, enrollment, refetch: refetchEnrollment } = useEnrollment(enrollmentId); const { error: errorProgram, program } = useProgram(programId); const { error: errorOwnerOrgUnit, @@ -48,7 +48,6 @@ export const WidgetEnrollment = ({ editDateEnabled={!readOnlyMode && program && program.access.data.write} displayAutoGeneratedEventWarning={containsAutoGeneratedEvent} program={program} - setEnrollment={setEnrollment} refetchEnrollment={refetchEnrollment} refetchTEI={refetchTEI} ownerOrgUnit={{ id: ownerOrgUnit, displayName }} diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js index e536f558b1..95a54b810a 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/enrollment.types.js @@ -18,7 +18,6 @@ export type PlainProps = {| enrollment: Object, program: Object, ownerOrgUnit: Object, - setEnrollment: EnrollmentData => void, refetchEnrollment: QueryRefetchFunction, refetchTEI: QueryRefetchFunction, initError?: FetchError, @@ -34,9 +33,3 @@ export type PlainProps = {| onSuccess?: () => void, ...CssClasses, |}; - -export type EnrollmentData = { - enrollment: string, - enrolledAt: string, - occurredAt: string, -}; diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js index c54448fe3a..87ae5120c4 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/hooks/useEnrollment.js @@ -1,7 +1,6 @@ // @flow -import { useMemo, useEffect, useState } from 'react'; +import { useMemo, useEffect } from 'react'; import { useDataQuery } from '@dhis2/app-runtime'; -import type { EnrollmentData } from '../enrollment.types'; export const useEnrollment = (enrollmentId: string) => { const { error, loading, data, refetch } = useDataQuery( @@ -17,17 +16,9 @@ export const useEnrollment = (enrollmentId: string) => { { lazy: true }, ); - const [enrollment, setEnrollment] = useState(); - - useEffect(() => { - if (data) { - setEnrollment(data.enrollment); - } - }, [setEnrollment, data]); - useEffect(() => { enrollmentId && refetch({ variables: { enrollmentId } }); }, [refetch, enrollmentId]); - return { error, refetch, enrollment: !loading && enrollment, setEnrollment }; + return { error, refetch, enrollment: !loading && data?.enrollment }; }; From 6125de45dbabce71f145eec672ec8926ec937680 Mon Sep 17 00:00:00 2001 From: Tony Valle Date: Thu, 31 Aug 2023 16:58:44 +0200 Subject: [PATCH 29/37] refactor: rename EnrollmentDate -> Date --- .../EnrollmentDate.component.js => Date/Date.component.js} | 4 ++-- .../EnrollmentDate.container.js => Date/Date.container.js} | 6 +++--- .../capture-core/components/WidgetEnrollment/Date/index.js | 2 ++ .../components/WidgetEnrollment/EnrollmentDate/index.js | 2 -- .../WidgetEnrollment/WidgetEnrollment.component.js | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) rename src/core_modules/capture-core/components/WidgetEnrollment/{EnrollmentDate/EnrollmentDate.component.js => Date/Date.component.js} (97%) rename src/core_modules/capture-core/components/WidgetEnrollment/{EnrollmentDate/EnrollmentDate.container.js => Date/Date.container.js} (92%) create mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/Date/index.js delete mode 100644 src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/index.js diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js similarity index 97% rename from src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js rename to src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js index 0f07fc32b8..e73566ba6d 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js @@ -61,7 +61,7 @@ const styles = { }, }; -const EnrollmentDateComponentPlain = ({ +const DateComponentPlain = ({ enrollmentDateLabel, enrollmentDate, editEnabled, @@ -144,4 +144,4 @@ const EnrollmentDateComponentPlain = ({ ); }; -export const EnrollmentDateComponent = withStyles(styles)(EnrollmentDateComponentPlain); +export const DateComponent = withStyles(styles)(DateComponentPlain); diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.container.js similarity index 92% rename from src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js rename to src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.container.js index 418e69f5a9..50205c787c 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/EnrollmentDate/EnrollmentDate.container.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.container.js @@ -1,7 +1,7 @@ // @flow import React from 'react'; import { useDataMutation } from '@dhis2/app-runtime'; -import { EnrollmentDateComponent } from './EnrollmentDate.component'; +import { DateComponent } from './Date.component'; import { convertValue as convertValueServerToClient } from '../../../converters/serverToClient'; import { dataElementTypes } from '../../../metaData'; import { processErrorReports } from '../processErrorReports'; @@ -28,7 +28,7 @@ const enrollmentUpdate = { }), }; -export const EnrollmentDate = ({ +export const Date = ({ serverDate, enrollmentDateLabel, editEnabled, @@ -57,7 +57,7 @@ export const EnrollmentDate = ({ }); }; - return ( - - Date: Thu, 31 Aug 2023 17:42:30 +0200 Subject: [PATCH 30/37] feat: use maxWidth --- .../WidgetEnrollment/Date/Date.component.js | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js index e73566ba6d..2b3673d44c 100644 --- a/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js +++ b/src/core_modules/capture-core/components/WidgetEnrollment/Date/Date.component.js @@ -50,6 +50,9 @@ const styles = { calendar: { paddingTop: '6px', }, + inputField: { + maxWidth: '200px', + }, buttonStrip: { display: 'flex', gap: `${spacersNum.dp4}px`, @@ -93,15 +96,16 @@ const DateComponentPlain = ({ return editMode ? (
- +
+ +