From a3582c4b1b0766ae55d4162630794ad3d9632f83 Mon Sep 17 00:00:00 2001 From: vivek Date: Wed, 1 Nov 2023 17:25:21 +0530 Subject: [PATCH] replaced useDispatch in Shifting --- package-lock.json | 276 +++--------------- src/Components/Common/FacilitySelect.tsx | 2 +- src/Components/Facility/models.tsx | 8 +- src/Components/Resource/CommentSection.tsx | 1 - src/Components/Shifting/BadgesList.tsx | 109 +++---- src/Components/Shifting/CommentsSection.tsx | 126 ++++---- src/Components/Shifting/ListFilter.tsx | 109 +++---- src/Components/Shifting/ListView.tsx | 93 ++---- src/Components/Shifting/ShiftDetails.tsx | 131 ++++----- .../Shifting/ShiftDetailsUpdate.tsx | 102 +++---- src/Components/Shifting/ShiftingBoard.tsx | 99 ++----- src/Components/Shifting/models.ts | 48 +++ src/Redux/actions.tsx | 15 - src/Redux/api.tsx | 22 +- 14 files changed, 416 insertions(+), 725 deletions(-) create mode 100644 src/Components/Shifting/models.ts diff --git a/package-lock.json b/package-lock.json index baa3205a234..80e47519f87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14826,6 +14826,8 @@ }, "node_modules/npm/node_modules/@isaacs/cliui/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "inBundle": true, "license": "MIT", @@ -14860,8 +14862,6 @@ }, "node_modules/npm/node_modules/@isaacs/string-locale-compare": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@isaacs/string-locale-compare/-/string-locale-compare-1.1.0.tgz", - "integrity": "sha512-SQ7Kzhh9+D+ZW9MA0zkYv3VXhIDNx+LzM6EJ+/65I3QY+enU6Itte7E5XX7EWrqLW2FN4n06GWzBnPoC3th2aQ==", "dev": true, "inBundle": true, "license": "ISC" @@ -14934,8 +14934,6 @@ }, "node_modules/npm/node_modules/@npmcli/disparity-colors": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/disparity-colors/-/disparity-colors-3.0.0.tgz", - "integrity": "sha512-5R/z157/f20Fi0Ou4ZttL51V0xz0EdPEOauFtPCEYOLInDBRCj1/TxOJ5aGTrtShxEshN2d+hXb9ZKSi5RLBcg==", "dev": true, "inBundle": true, "license": "ISC", @@ -14948,8 +14946,6 @@ }, "node_modules/npm/node_modules/@npmcli/fs": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-3.1.0.tgz", - "integrity": "sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==", "dev": true, "inBundle": true, "license": "ISC", @@ -14962,8 +14958,6 @@ }, "node_modules/npm/node_modules/@npmcli/git": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-4.1.0.tgz", - "integrity": "sha512-9hwoB3gStVfa0N31ymBmrX+GuDGdVA/QWShZVqE0HK2Af+7QGGrCTbZia/SW0ImUTjTne7SP91qxDmtXvDHRPQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -14983,8 +14977,6 @@ }, "node_modules/npm/node_modules/@npmcli/installed-package-contents": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-2.0.2.tgz", - "integrity": "sha512-xACzLPhnfD51GKvTOOuNX2/V4G4mz9/1I2MfDoye9kBM3RYe5g2YbscsaGoTlaWqkxeiapBWyseULVKpSVHtKQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -15001,8 +14993,6 @@ }, "node_modules/npm/node_modules/@npmcli/map-workspaces": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.4.tgz", - "integrity": "sha512-Z0TbvXkRbacjFFLpVpV0e2mheCh+WzQpcqL+4xp49uNJOxOnIAPZyXtUxZ5Qn3QBTGKA11Exjd9a5411rBrhDg==", "dev": true, "inBundle": true, "license": "ISC", @@ -15018,8 +15008,6 @@ }, "node_modules/npm/node_modules/@npmcli/metavuln-calculator": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-5.0.1.tgz", - "integrity": "sha512-qb8Q9wIIlEPj3WeA1Lba91R4ZboPL0uspzV0F9uwP+9AYMVB2zOoa7Pbk12g6D2NHAinSbHh6QYmGuRyHZ874Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -15035,8 +15023,6 @@ }, "node_modules/npm/node_modules/@npmcli/name-from-folder": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/name-from-folder/-/name-from-folder-2.0.0.tgz", - "integrity": "sha512-pwK+BfEBZJbKdNYpHHRTNBwBoqrN/iIMO0AiGvYsp3Hoaq0WbgGSWQR6SCldZovoDpY3yje5lkFUe6gsDgJ2vg==", "dev": true, "inBundle": true, "license": "ISC", @@ -15046,8 +15032,6 @@ }, "node_modules/npm/node_modules/@npmcli/node-gyp": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/node-gyp/-/node-gyp-3.0.0.tgz", - "integrity": "sha512-gp8pRXC2oOxu0DUE1/M3bYtb1b3/DbJ5aM113+XJBgfXdussRAsX0YOrOhdd8WvnAR6auDBvJomGAkLKA5ydxA==", "dev": true, "inBundle": true, "license": "ISC", @@ -15057,8 +15041,6 @@ }, "node_modules/npm/node_modules/@npmcli/package-json": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-4.0.1.tgz", - "integrity": "sha512-lRCEGdHZomFsURroh522YvA/2cVb9oPIJrjHanCJZkiasz1BzcnLr3tBJhlV7S86MBJBuAQ33is2D60YitZL2Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -15077,8 +15059,6 @@ }, "node_modules/npm/node_modules/@npmcli/promise-spawn": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-6.0.2.tgz", - "integrity": "sha512-gGq0NJkIGSwdbUt4yhdF8ZrmkGKVz9vAdVzpOfnom+V8PLSmSOVhZwbNvZZS1EYcJN5hzzKBxmmVVAInM6HQLg==", "dev": true, "inBundle": true, "license": "ISC", @@ -15103,8 +15083,6 @@ }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz", - "integrity": "sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA==", "dev": true, "inBundle": true, "license": "ISC", @@ -15155,8 +15133,6 @@ }, "node_modules/npm/node_modules/@tootallnate/once": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", "dev": true, "inBundle": true, "license": "MIT", @@ -15166,8 +15142,6 @@ }, "node_modules/npm/node_modules/@tufjs/canonical-json": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz", - "integrity": "sha512-QTnf++uxunWvG2z3UFNzAoQPHxnSXOwtaI3iJ+AohhV+5vONuArPjJE7aPXPVXfXJsqrVbZBu9b81AJoSd09IQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -15177,8 +15151,6 @@ }, "node_modules/npm/node_modules/@tufjs/models": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@tufjs/models/-/models-1.0.4.tgz", - "integrity": "sha512-qaGV9ltJP0EO25YfFUPhxRVK0evXFIAGicsVXuRim4Ed9cjPxYhNnNJ49SFmbeLgtxpslIkX317IgpfcHPVj/A==", "dev": true, "inBundle": true, "license": "MIT", @@ -15192,8 +15164,6 @@ }, "node_modules/npm/node_modules/abbrev": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", - "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -15203,8 +15173,6 @@ }, "node_modules/npm/node_modules/abort-controller": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", - "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", "dev": true, "inBundle": true, "license": "MIT", @@ -15296,8 +15264,6 @@ }, "node_modules/npm/node_modules/archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", "dev": true, "inBundle": true, "license": "MIT" @@ -15362,8 +15328,6 @@ }, "node_modules/npm/node_modules/binary-extensions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true, "inBundle": true, "license": "MIT", @@ -15384,8 +15348,6 @@ }, "node_modules/npm/node_modules/buffer": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", - "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, "funding": [ { @@ -15410,8 +15372,6 @@ }, "node_modules/npm/node_modules/builtins": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", - "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -15444,8 +15404,6 @@ }, "node_modules/npm/node_modules/chalk": { "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "dev": true, "inBundle": true, "license": "MIT", @@ -15469,8 +15427,6 @@ }, "node_modules/npm/node_modules/ci-info": { "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", "dev": true, "funding": [ { @@ -15486,8 +15442,6 @@ }, "node_modules/npm/node_modules/cidr-regex": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/cidr-regex/-/cidr-regex-3.1.1.tgz", - "integrity": "sha512-RBqYd32aDwbCMFJRL6wHOlDNYJsPNTt8vC82ErHF5vKt8QQzxm1FrkW8s/R5pVrXMf17sba09Uoy91PKiddAsw==", "dev": true, "inBundle": true, "license": "BSD-2-Clause", @@ -15511,8 +15465,6 @@ }, "node_modules/npm/node_modules/cli-columns": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-columns/-/cli-columns-4.0.0.tgz", - "integrity": "sha512-XW2Vg+w+L9on9wtwKpyzluIPCWXjaBahI7mTcYjx+BVIYD9c3yqcv/yKC7CmdCZat4rq2yiE1UMSJC5ivKfMtQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -15526,8 +15478,6 @@ }, "node_modules/npm/node_modules/cli-table3": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", - "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", "dev": true, "inBundle": true, "license": "MIT", @@ -15554,8 +15504,6 @@ }, "node_modules/npm/node_modules/cmd-shim": { "version": "6.0.1", - "resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-6.0.1.tgz", - "integrity": "sha512-S9iI9y0nKR4hwEQsVWpyxld/6kRfGepGfzff83FcaiEBpmvlbA2nnGe7Cylgrx2f/p1P5S5wpRm9oL8z1PbS3Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -15587,8 +15535,6 @@ }, "node_modules/npm/node_modules/color-support": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", "dev": true, "inBundle": true, "license": "ISC", @@ -15598,8 +15544,6 @@ }, "node_modules/npm/node_modules/columnify": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/columnify/-/columnify-1.6.0.tgz", - "integrity": "sha512-lomjuFZKfM6MSAnV9aCZC9sc0qGbmZdfygNv+nCpqVkSKdCxCklLtd16O0EILGkImHw9ZpHkAnHaB+8Zxq5W6Q==", "dev": true, "inBundle": true, "license": "MIT", @@ -15613,8 +15557,6 @@ }, "node_modules/npm/node_modules/common-ancestor-path": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-1.0.1.tgz", - "integrity": "sha512-L3sHRo1pXXEqX8VU28kfgUY+YGsk09hPqZiZmLacNib6XNTCM8ubYeT7ryXQw8asB1sKgcU5lkB7ONug08aB8w==", "dev": true, "inBundle": true, "license": "ISC" @@ -15653,6 +15595,8 @@ }, "node_modules/npm/node_modules/cross-spawn/node_modules/which": { "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "inBundle": true, "license": "ISC", @@ -15701,6 +15645,8 @@ }, "node_modules/npm/node_modules/debug/node_modules/ms": { "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true, "inBundle": true, "license": "MIT" @@ -15738,8 +15684,6 @@ }, "node_modules/npm/node_modules/diff": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", - "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", "dev": true, "inBundle": true, "license": "BSD-3-Clause", @@ -15765,8 +15709,6 @@ }, "node_modules/npm/node_modules/encoding": { "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", "dev": true, "inBundle": true, "license": "MIT", @@ -15777,8 +15719,6 @@ }, "node_modules/npm/node_modules/env-paths": { "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", "dev": true, "inBundle": true, "license": "MIT", @@ -15788,16 +15728,12 @@ }, "node_modules/npm/node_modules/err-code": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/event-target-shim": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", - "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -15818,16 +15754,12 @@ }, "node_modules/npm/node_modules/exponential-backoff": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/exponential-backoff/-/exponential-backoff-3.1.1.tgz", - "integrity": "sha512-dX7e/LHVJ6W3DE1MHWi9S1EYzDESENfLrYohG2G++ovZrYOkm4Knwa0mc1cn84xJOR4KEU0WSchhLbd0UklbHw==", "dev": true, "inBundle": true, "license": "Apache-2.0" }, "node_modules/npm/node_modules/fastest-levenshtein": { "version": "1.0.16", - "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", - "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, "inBundle": true, "license": "MIT", @@ -15883,8 +15815,6 @@ }, "node_modules/npm/node_modules/gauge": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-5.0.1.tgz", - "integrity": "sha512-CmykPMJGuNan/3S4kZOpvvPYSNqSHANiWnh9XcMU2pSjtBfF0XzZ2p1bFAxTbnFxyBuPxQYHhzwaoOmUdqzvxQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -15926,8 +15856,6 @@ }, "node_modules/npm/node_modules/graceful-fs": { "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true, "inBundle": true, "license": "ISC" @@ -15956,8 +15884,6 @@ }, "node_modules/npm/node_modules/hosted-git-info": { "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", "dev": true, "inBundle": true, "license": "ISC", @@ -15970,16 +15896,12 @@ }, "node_modules/npm/node_modules/http-cache-semantics": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true, "inBundle": true, "license": "BSD-2-Clause" }, "node_modules/npm/node_modules/http-proxy-agent": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", "dev": true, "inBundle": true, "license": "MIT", @@ -16009,8 +15931,6 @@ }, "node_modules/npm/node_modules/humanize-ms": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -16020,8 +15940,6 @@ }, "node_modules/npm/node_modules/iconv-lite": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "inBundle": true, "license": "MIT", @@ -16035,8 +15953,6 @@ }, "node_modules/npm/node_modules/ieee754": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dev": true, "funding": [ { @@ -16057,8 +15973,6 @@ }, "node_modules/npm/node_modules/ignore-walk": { "version": "6.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.3.tgz", - "integrity": "sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16113,8 +16027,6 @@ }, "node_modules/npm/node_modules/ini": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.1.tgz", - "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", "dev": true, "inBundle": true, "license": "ISC", @@ -16124,8 +16036,6 @@ }, "node_modules/npm/node_modules/init-package-json": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-5.0.0.tgz", - "integrity": "sha512-kBhlSheBfYmq3e0L1ii+VKe3zBTLL5lDCDWR+f9dLmEGSB3MqLlMlsolubSsyI88Bg6EA+BIMlomAnQ1SwgQBw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16152,8 +16062,6 @@ }, "node_modules/npm/node_modules/ip-regex": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-4.3.0.tgz", - "integrity": "sha512-B9ZWJxHHOHUhUjCPrMpLD4xEq35bUTClHM1S6CBU5ixQnkZmwipwgc96vAd7AAGM9TGHvJR+Uss+/Ak6UphK+Q==", "dev": true, "inBundle": true, "license": "MIT", @@ -16163,8 +16071,6 @@ }, "node_modules/npm/node_modules/is-cidr": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/is-cidr/-/is-cidr-4.0.2.tgz", - "integrity": "sha512-z4a1ENUajDbEl/Q6/pVBpTR1nBjjEE1X7qb7bmWYanNnPoKAvUCPFKeXV6Fe4mgTkWKBqiHIcwsI3SndiO5FeA==", "dev": true, "inBundle": true, "license": "BSD-2-Clause", @@ -16200,8 +16106,6 @@ }, "node_modules/npm/node_modules/is-lambda": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", "dev": true, "inBundle": true, "license": "MIT" @@ -16234,8 +16138,6 @@ }, "node_modules/npm/node_modules/json-parse-even-better-errors": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.0.tgz", - "integrity": "sha512-iZbGHafX/59r39gPwVPRBGw0QQKnA7tte5pSMrhWOW7swGsVvVTjmfyAV9pNqk8YGT7tRCdxRu8uzcgZwoDooA==", "dev": true, "inBundle": true, "license": "MIT", @@ -16245,8 +16147,6 @@ }, "node_modules/npm/node_modules/json-stringify-nice": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz", - "integrity": "sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16256,8 +16156,6 @@ }, "node_modules/npm/node_modules/jsonparse": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", - "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", "dev": true, "engines": [ "node >= 0.2.0" @@ -16267,24 +16165,18 @@ }, "node_modules/npm/node_modules/just-diff": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/just-diff/-/just-diff-6.0.2.tgz", - "integrity": "sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/just-diff-apply": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/just-diff-apply/-/just-diff-apply-5.5.0.tgz", - "integrity": "sha512-OYTthRfSh55WOItVqwpefPtNt2VdKsq5AnAK6apdtR6yCH8pr0CmSr710J0Mf+WdQy7K/OzMy7K2MgAfdQURDw==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { "version": "7.0.2", - "resolved": "https://registry.npmjs.org/libnpmaccess/-/libnpmaccess-7.0.2.tgz", - "integrity": "sha512-vHBVMw1JFMTgEk15zRsJuSAg7QtGGHpUSEfnbcRL1/gTBag9iEfJbyjpDmdJmwMhvpoLoNBtdAUCdGnaP32hhw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16352,8 +16244,6 @@ }, "node_modules/npm/node_modules/libnpmhook": { "version": "9.0.3", - "resolved": "https://registry.npmjs.org/libnpmhook/-/libnpmhook-9.0.3.tgz", - "integrity": "sha512-wMZe58sI7KLhg0+nUWZW5KdMfjNNcOIIbkoP19BDHYoUF9El7eeUWkGNxUGzpHkPKiGoQ1z/v6CYin4deebeuw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16367,8 +16257,6 @@ }, "node_modules/npm/node_modules/libnpmorg": { "version": "5.0.4", - "resolved": "https://registry.npmjs.org/libnpmorg/-/libnpmorg-5.0.4.tgz", - "integrity": "sha512-YqYXLMAN0Y1eJH4w3hUFN9648xfSdvJANMsdeZTOWJOW4Pqp8qapJFzQdqCfUkg+tEuQmnaFQQKXvkMZC51+Mw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16397,8 +16285,6 @@ }, "node_modules/npm/node_modules/libnpmpublish": { "version": "7.5.0", - "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-7.5.0.tgz", - "integrity": "sha512-zctH6QcTJ093lpxmkufr2zr3AJ9V90hcRilDFNin6n91ODj+S28RdyMFFJpa9NwyztmyV2hlWLyZv0GaOQBDyA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16418,8 +16304,6 @@ }, "node_modules/npm/node_modules/libnpmsearch": { "version": "6.0.2", - "resolved": "https://registry.npmjs.org/libnpmsearch/-/libnpmsearch-6.0.2.tgz", - "integrity": "sha512-p+5BF19AvnVg8mcIQhy6yWhI6jHQRVMYaIaKeITEfYAffWsqbottA/WZdMtHL76hViC6SFM1WdclM1w5eAIa1g==", "dev": true, "inBundle": true, "license": "ISC", @@ -16432,8 +16316,6 @@ }, "node_modules/npm/node_modules/libnpmteam": { "version": "5.0.3", - "resolved": "https://registry.npmjs.org/libnpmteam/-/libnpmteam-5.0.3.tgz", - "integrity": "sha512-7XOGhi45s+ml6TyrhJUTyrErcoDMKGKfEtiTEco4ofU7BGGAUOalVztKMVLLJgJOOXdIAIlzCHqkTXEuSiyCiA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16447,8 +16329,6 @@ }, "node_modules/npm/node_modules/libnpmversion": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/libnpmversion/-/libnpmversion-4.0.2.tgz", - "integrity": "sha512-n1X70mFHv8Piy4yos+MFWUARSkTbyV5cdsHScaIkuwYvRAF/s2VtYScDzWB4Oe8uNEuGNdjiRR1E/Dh1tMvv6g==", "dev": true, "inBundle": true, "license": "ISC", @@ -16465,8 +16345,6 @@ }, "node_modules/npm/node_modules/lru-cache": { "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16476,8 +16354,6 @@ }, "node_modules/npm/node_modules/make-fetch-happen": { "version": "11.1.1", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-11.1.1.tgz", - "integrity": "sha512-rLWS7GCSTcEujjVBs2YqG7Y4643u8ucvCJeSRqiLYhesrDuzeuFIk37xREzAsfQaqzl8b9rNCE4m6J8tvX4Q8w==", "dev": true, "inBundle": true, "license": "ISC", @@ -16532,8 +16408,6 @@ }, "node_modules/npm/node_modules/minipass-collect": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16546,6 +16420,8 @@ }, "node_modules/npm/node_modules/minipass-collect/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16575,8 +16451,6 @@ }, "node_modules/npm/node_modules/minipass-flush": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16589,6 +16463,8 @@ }, "node_modules/npm/node_modules/minipass-flush/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16601,8 +16477,6 @@ }, "node_modules/npm/node_modules/minipass-json-stream": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minipass-json-stream/-/minipass-json-stream-1.0.1.tgz", - "integrity": "sha512-ODqY18UZt/I8k+b7rl2AENgbWE8IDYam+undIJONvigAz8KR5GWblsFTEfQs0WODsjbSXWlm+JHEv8Gr6Tfdbg==", "dev": true, "inBundle": true, "license": "MIT", @@ -16613,6 +16487,8 @@ }, "node_modules/npm/node_modules/minipass-json-stream/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16625,8 +16501,6 @@ }, "node_modules/npm/node_modules/minipass-pipeline": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", "dev": true, "inBundle": true, "license": "ISC", @@ -16639,6 +16513,8 @@ }, "node_modules/npm/node_modules/minipass-pipeline/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16651,8 +16527,6 @@ }, "node_modules/npm/node_modules/minipass-sized": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", "dev": true, "inBundle": true, "license": "ISC", @@ -16665,6 +16539,8 @@ }, "node_modules/npm/node_modules/minipass-sized/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16692,6 +16568,8 @@ }, "node_modules/npm/node_modules/minizlib/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16718,16 +16596,12 @@ }, "node_modules/npm/node_modules/ms": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/mute-stream": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz", - "integrity": "sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16737,8 +16611,6 @@ }, "node_modules/npm/node_modules/negotiator": { "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "inBundle": true, "license": "MIT", @@ -16748,8 +16620,6 @@ }, "node_modules/npm/node_modules/node-gyp": { "version": "9.4.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.4.0.tgz", - "integrity": "sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==", "dev": true, "inBundle": true, "license": "MIT", @@ -16775,16 +16645,12 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/node-gyp/node_modules/are-we-there-yet": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", "dev": true, "inBundle": true, "license": "ISC", @@ -16810,8 +16676,6 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/gauge": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", "dev": true, "inBundle": true, "license": "ISC", @@ -16831,6 +16695,8 @@ }, "node_modules/npm/node_modules/node-gyp/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -16934,8 +16800,6 @@ }, "node_modules/npm/node_modules/nopt": { "version": "7.2.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.0.tgz", - "integrity": "sha512-CVDtwCdhYIvnAzFoJ6NJ6dX3oga9/HyciQDnG1vQDjSLMeKLJ4A93ZqYKDrgYSr1FBY5/hMYC+2VCi24pgpkGA==", "dev": true, "inBundle": true, "license": "ISC", @@ -16951,8 +16815,6 @@ }, "node_modules/npm/node_modules/normalize-package-data": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, "inBundle": true, "license": "BSD-2-Clause", @@ -16968,8 +16830,6 @@ }, "node_modules/npm/node_modules/npm-audit-report": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/npm-audit-report/-/npm-audit-report-5.0.0.tgz", - "integrity": "sha512-EkXrzat7zERmUhHaoren1YhTxFwsOu5jypE84k6632SXTHcQE1z8V51GC6GVZt8LxkC+tbBcKMUBZAgk8SUSbw==", "dev": true, "inBundle": true, "license": "ISC", @@ -16979,8 +16839,6 @@ }, "node_modules/npm/node_modules/npm-bundled": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-3.0.0.tgz", - "integrity": "sha512-Vq0eyEQy+elFpzsKjMss9kxqb9tG3YHg4dsyWuUENuzvSUWe1TCnW/vV9FkhvBk/brEDoDiVd+M1Btosa6ImdQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17005,8 +16863,6 @@ }, "node_modules/npm/node_modules/npm-normalize-package-bin": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz", - "integrity": "sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17016,8 +16872,6 @@ }, "node_modules/npm/node_modules/npm-package-arg": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "inBundle": true, "license": "ISC", @@ -17033,8 +16887,6 @@ }, "node_modules/npm/node_modules/npm-packlist": { "version": "7.0.4", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz", - "integrity": "sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -17062,8 +16914,6 @@ }, "node_modules/npm/node_modules/npm-profile": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-7.0.1.tgz", - "integrity": "sha512-VReArOY/fCx5dWL66cbJ2OMogTQAVVQA//8jjmjkarboki3V7UJ0XbGFW+khRwiAJFQjuH0Bqr/yF7Y5RZdkMQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17077,8 +16927,6 @@ }, "node_modules/npm/node_modules/npm-registry-fetch": { "version": "14.0.5", - "resolved": "https://registry.npmjs.org/npm-registry-fetch/-/npm-registry-fetch-14.0.5.tgz", - "integrity": "sha512-kIDMIo4aBm6xg7jOttupWZamsZRkAqMqwqqbVXnUqstY5+tapvv6bkH/qMR76jdgV+YljEUCyWx3hRYMrJiAgA==", "dev": true, "inBundle": true, "license": "ISC", @@ -17097,8 +16945,6 @@ }, "node_modules/npm/node_modules/npm-user-validate": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-2.0.0.tgz", - "integrity": "sha512-sSWeqAYJ2dUPStJB+AEj0DyLRltr/f6YNcvCA7phkB8/RMLMnVsQ41GMwHo/ERZLYNDsyB2wPm7pZo1mqPOl7Q==", "dev": true, "inBundle": true, "license": "BSD-2-Clause", @@ -17108,8 +16954,6 @@ }, "node_modules/npm/node_modules/npmlog": { "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-7.0.1.tgz", - "integrity": "sha512-uJ0YFk/mCQpLBt+bxN88AKd+gyqZvZDbtiNxk6Waqcj2aPRyfVx8ITawkyQynxUagInjdYT1+qj4NfA5KJJUxg==", "dev": true, "inBundle": true, "license": "ISC", @@ -17153,8 +16997,6 @@ }, "node_modules/npm/node_modules/pacote": { "version": "15.2.0", - "resolved": "https://registry.npmjs.org/pacote/-/pacote-15.2.0.tgz", - "integrity": "sha512-rJVZeIwHTUta23sIZgEIM62WYwbmGbThdbnkt81ravBplQv+HjyroqnLRNH2+sLJHcGZmLRmhPwACqhfTcOmnA==", "dev": true, "inBundle": true, "license": "ISC", @@ -17187,8 +17029,6 @@ }, "node_modules/npm/node_modules/parse-conflict-json": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/parse-conflict-json/-/parse-conflict-json-3.0.1.tgz", - "integrity": "sha512-01TvEktc68vwbJOtWZluyWeVGWjP+bZwXtPDMQVbBKzbJ/vZBif0L69KH1+cHv1SZ6e0FKLvjyHe8mqsIqYOmw==", "dev": true, "inBundle": true, "license": "ISC", @@ -17250,8 +17090,6 @@ }, "node_modules/npm/node_modules/postcss-selector-parser": { "version": "6.0.13", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.13.tgz", - "integrity": "sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -17265,8 +17103,6 @@ }, "node_modules/npm/node_modules/proc-log": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-3.0.0.tgz", - "integrity": "sha512-++Vn7NS4Xf9NacaU9Xq3URUuqZETPsf8L4j5/ckhaRYsfPeRyzGw+iDjFhV/Jr3uNmTvvddEJFWh5R1gRgUH8A==", "dev": true, "inBundle": true, "license": "ISC", @@ -17287,8 +17123,6 @@ }, "node_modules/npm/node_modules/promise-all-reject-late": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-all-reject-late/-/promise-all-reject-late-1.0.1.tgz", - "integrity": "sha512-vuf0Lf0lOxyQREH7GDIOUMLS7kz+gs8i6B+Yi8dC68a2sychGrHTJYghMBD6k7eUcH0H5P73EckCA48xijWqXw==", "dev": true, "inBundle": true, "license": "ISC", @@ -17298,8 +17132,6 @@ }, "node_modules/npm/node_modules/promise-call-limit": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/promise-call-limit/-/promise-call-limit-1.0.2.tgz", - "integrity": "sha512-1vTUnfI2hzui8AEIixbdAJlFY4LFDXqQswy/2eOlThAscXCY4It8FdVuI0fMJGAB2aWGbdQf/gv0skKYXmdrHA==", "dev": true, "inBundle": true, "license": "ISC", @@ -17309,16 +17141,12 @@ }, "node_modules/npm/node_modules/promise-inflight": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/promise-retry": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "dev": true, "inBundle": true, "license": "MIT", @@ -17332,8 +17160,6 @@ }, "node_modules/npm/node_modules/promzard": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promzard/-/promzard-1.0.0.tgz", - "integrity": "sha512-KQVDEubSUHGSt5xLakaToDFrSoZhStB8dXLzk2xvwR67gJktrHFvpR63oZgHyK19WKbHFLXJqCPXdVR3aBP8Ig==", "dev": true, "inBundle": true, "license": "ISC", @@ -17346,8 +17172,6 @@ }, "node_modules/npm/node_modules/qrcode-terminal": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.12.0.tgz", - "integrity": "sha512-EXtzRZmC+YGmGlDFbXKxQiMZNwCLEO6BANKXG4iCtSIM0yqc/pappSx3RIKr4r0uh5JsBckOXeKrB3Iz7mdQpQ==", "dev": true, "inBundle": true, "bin": { @@ -17356,8 +17180,6 @@ }, "node_modules/npm/node_modules/read": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/read/-/read-2.1.0.tgz", - "integrity": "sha512-bvxi1QLJHcaywCAEsAk4DG3nVoqiY2Csps3qzWalhj5hFqRn1d/OixkFXtLO1PrgHUcAP0FNaSY/5GYNfENFFQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17370,8 +17192,6 @@ }, "node_modules/npm/node_modules/read-cmd-shim": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-4.0.0.tgz", - "integrity": "sha512-yILWifhaSEEytfXI76kB9xEEiG1AiozaCJZ83A87ytjRiN+jVibXjedjCRNjoZviinhG+4UkalO3mWTd8u5O0Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -17381,8 +17201,6 @@ }, "node_modules/npm/node_modules/read-package-json": { "version": "6.0.4", - "resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz", - "integrity": "sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw==", "dev": true, "inBundle": true, "license": "ISC", @@ -17398,8 +17216,6 @@ }, "node_modules/npm/node_modules/read-package-json-fast": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/read-package-json-fast/-/read-package-json-fast-3.0.2.tgz", - "integrity": "sha512-0J+Msgym3vrLOUB3hzQCuZHII0xkNGCtz/HJH9xZshwv9DbDwkw1KaE3gx/e2J5rpEY5rtOy6cyhKOPrkP7FZw==", "dev": true, "inBundle": true, "license": "ISC", @@ -17428,8 +17244,6 @@ }, "node_modules/npm/node_modules/retry": { "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "dev": true, "inBundle": true, "license": "MIT", @@ -17468,6 +17282,8 @@ }, "node_modules/npm/node_modules/rimraf/node_modules/glob": { "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, "inBundle": true, "license": "ISC", @@ -17524,8 +17340,6 @@ }, "node_modules/npm/node_modules/safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, "inBundle": true, "license": "MIT", @@ -17550,6 +17364,8 @@ }, "node_modules/npm/node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "dev": true, "inBundle": true, "license": "ISC", @@ -17626,8 +17442,6 @@ }, "node_modules/npm/node_modules/smart-buffer": { "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", "dev": true, "inBundle": true, "license": "MIT", @@ -17638,8 +17452,6 @@ }, "node_modules/npm/node_modules/socks": { "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "dev": true, "inBundle": true, "license": "MIT", @@ -17654,8 +17466,6 @@ }, "node_modules/npm/node_modules/socks-proxy-agent": { "version": "7.0.0", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", - "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", "dev": true, "inBundle": true, "license": "MIT", @@ -17795,8 +17605,6 @@ }, "node_modules/npm/node_modules/supports-color": { "version": "9.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz", - "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==", "dev": true, "inBundle": true, "license": "MIT", @@ -17828,6 +17636,8 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass": { "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, "inBundle": true, "license": "ISC", @@ -17840,6 +17650,8 @@ }, "node_modules/npm/node_modules/tar/node_modules/fs-minipass/node_modules/minipass": { "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", "dev": true, "inBundle": true, "license": "ISC", @@ -17852,24 +17664,18 @@ }, "node_modules/npm/node_modules/text-table": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/tiny-relative-date": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tiny-relative-date/-/tiny-relative-date-1.3.0.tgz", - "integrity": "sha512-MOQHpzllWxDCHHaDno30hhLfbouoYlOI8YlMNtvKe1zXbjEVhbcEovQxvZrPvtiYW630GQDoMMarCnjfyfHA+A==", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/npm/node_modules/treeverse": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/treeverse/-/treeverse-3.0.0.tgz", - "integrity": "sha512-gcANaAnd2QDZFmHFEOF4k7uc1J/6a6z3DJMd/QwEyxLoKGiptJRwid582r7QIsFlFMIZ3SnxfS52S4hm2DHkuQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17879,8 +17685,6 @@ }, "node_modules/npm/node_modules/tuf-js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-1.1.7.tgz", - "integrity": "sha512-i3P9Kgw3ytjELUfpuKVDNBJvk4u5bXL6gskv572mcevPbSKCV3zt3djhmlEQ65yERjIbOSncy7U4cQJaB1CBCg==", "dev": true, "inBundle": true, "license": "MIT", @@ -17895,8 +17699,6 @@ }, "node_modules/npm/node_modules/unique-filename": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-3.0.0.tgz", - "integrity": "sha512-afXhuC55wkAmZ0P18QsVE6kp8JaxrEokN2HGIoIVv2ijHQd419H0+6EigAFcIzXeMIkcIkNBpB3L/DXB3cTS/g==", "dev": true, "inBundle": true, "license": "ISC", @@ -17909,8 +17711,6 @@ }, "node_modules/npm/node_modules/unique-slug": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-4.0.0.tgz", - "integrity": "sha512-WrcA6AyEfqDX5bWige/4NQfPZMtASNVxdmWR76WESYQVAACSgWcR6e9i0mofqqBxYFtL4oAxPIptY73/0YE1DQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17931,8 +17731,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "inBundle": true, "license": "Apache-2.0", @@ -17943,8 +17741,6 @@ }, "node_modules/npm/node_modules/validate-npm-package-name": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", - "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "inBundle": true, "license": "ISC", @@ -17957,16 +17753,12 @@ }, "node_modules/npm/node_modules/walk-up-path": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/walk-up-path/-/walk-up-path-3.0.1.tgz", - "integrity": "sha512-9YlCL/ynK3CTlrSRrDxZvUauLzAswPCrsaCgilqFevUYpeEW0/3ScEjaa3kbW/T0ghhkEr7mv+fpjqn1Y1YuTA==", "dev": true, "inBundle": true, "license": "ISC" }, "node_modules/npm/node_modules/wcwidth": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", "dev": true, "inBundle": true, "license": "MIT", @@ -17976,8 +17768,6 @@ }, "node_modules/npm/node_modules/which": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/which/-/which-3.0.1.tgz", - "integrity": "sha512-XA1b62dzQzLfaEOSQFTCOd5KFf/1VSzZo7/7TUjnya6u0vGGKzU96UQBZTAThCb2j4/xjBAyii1OhRLJEivHvg==", "dev": true, "inBundle": true, "license": "ISC", @@ -17993,8 +17783,6 @@ }, "node_modules/npm/node_modules/wide-align": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, "inBundle": true, "license": "ISC", @@ -18057,6 +17845,8 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/ansi-styles": { "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", "dev": true, "inBundle": true, "license": "MIT", @@ -18077,6 +17867,8 @@ }, "node_modules/npm/node_modules/wrap-ansi/node_modules/string-width": { "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dev": true, "inBundle": true, "license": "MIT", @@ -18119,8 +17911,6 @@ }, "node_modules/npm/node_modules/write-file-atomic": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz", - "integrity": "sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw==", "dev": true, "inBundle": true, "license": "ISC", @@ -23708,4 +23498,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/Components/Common/FacilitySelect.tsx b/src/Components/Common/FacilitySelect.tsx index 19494081aa3..1aabc36013b 100644 --- a/src/Components/Common/FacilitySelect.tsx +++ b/src/Components/Common/FacilitySelect.tsx @@ -6,7 +6,7 @@ import { FacilityModel } from "../Facility/models"; interface FacilitySelectProps { name: string; - exclude_user: string; + exclude_user?: string; errors?: string | undefined; className?: string; searchAll?: boolean; diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index f5ddde19d2d..7bf6069a61a 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -52,10 +52,10 @@ export interface FacilityModel { ward_object?: WardModel; modified_date?: string; created_date?: string; - state: number; - district: number; - local_body: number; - ward: number; + state?: number; + district?: number; + local_body?: number; + ward?: number; } export interface CapacityModal { diff --git a/src/Components/Resource/CommentSection.tsx b/src/Components/Resource/CommentSection.tsx index 25d8142dae7..33ed68da45d 100644 --- a/src/Components/Resource/CommentSection.tsx +++ b/src/Components/Resource/CommentSection.tsx @@ -16,7 +16,6 @@ const CommentSection = (props: { id: string }) => { routes.getResourceComments, { pathParams: { id: props.id }, - query: { limit: 8, offset: 0 }, } ); diff --git a/src/Components/Shifting/BadgesList.tsx b/src/Components/Shifting/BadgesList.tsx index ce0a0cb5753..9531ff95a8d 100644 --- a/src/Components/Shifting/BadgesList.tsx +++ b/src/Components/Shifting/BadgesList.tsx @@ -1,17 +1,19 @@ -import { getAnyFacility, getUserList } from "../../Redux/actions"; -import { useEffect, useState } from "react"; - import { SHIFTING_FILTER_ORDER } from "../../Common/constants"; -import { useDispatch } from "react-redux"; + import { useTranslation } from "react-i18next"; +import useQuery from "../../Utils/request/useQuery"; +import routes from "../../Redux/api"; + +function useFacilityQuery(facilityId: string | undefined) { + return useQuery(routes.getAnyFacility, { + pathParams: { id: String(facilityId) }, + prefetch: facilityId !== undefined, + }); +} export default function BadgesList(props: any) { const { qParams, FilterBadges } = props; - const [assignedUsername, setAssignedUsername] = useState(""); - const [assignedFacilityName, setAssignedFacilityName] = useState(""); - const [originFacilityName, setOriginFacilityName] = useState(""); - const [approvingFacilityName, setApprovingFacilityName] = useState(""); - const dispatch: any = useDispatch(); + const { t } = useTranslation(); const booleanFilterOptions = { @@ -19,62 +21,21 @@ export default function BadgesList(props: any) { falseValue: t("no"), }; - useEffect(() => { - async function fetchData() { - if (!qParams.assigned_to) return setAssignedUsername(""); - const res = await dispatch( - getUserList({ id: qParams.assigned_to }, "assigned_user_name") - ); - const { first_name, last_name } = res?.data?.results[0] || {}; - setAssignedUsername(`${first_name} ${last_name}`); - } - fetchData(); - }, [dispatch, qParams.assigned_to]); - - useEffect(() => { - async function fetchData() { - if (!qParams.origin_facility) return setOriginFacilityName(""); - const res = await dispatch( - getAnyFacility(qParams.origin_facility, "origin_facility_name") - ); - setOriginFacilityName(res?.data?.name); - } - fetchData(); - }, [dispatch, qParams.origin_facility]); - - useEffect(() => { - async function fetchData() { - if (!qParams.shifting_approving_facility) - return setApprovingFacilityName(""); - const res = await dispatch( - getAnyFacility( - qParams.shifting_approving_facility, - "shifting_approving_facility_name" - ) - ); - setApprovingFacilityName(res?.data?.name); - } - fetchData(); - }, [dispatch, qParams.shifting_approving_facility]); + const { data: assignedUser } = useQuery(routes.userList, { + query: { id: qParams.assigned_to }, + prefetch: qParams.assigned_to ? true : false, + }); + const originFacility = useFacilityQuery(qParams.origin_facility); + const approvingFacility = useFacilityQuery( + qParams.shifting_approving_facility + ); + const assignedFacility = useFacilityQuery(qParams.assigned_facility); - useEffect(() => { - async function fetchData() { - if (!qParams.assigned_facility) return setAssignedFacilityName(""); - const res = await dispatch( - getAnyFacility(qParams.assigned_facility, "assigned_facility_name") - ); - setAssignedFacilityName(res?.data?.name); - } - fetchData(); - }, [dispatch, qParams.assigned_facility]); const getDescShiftingFilterOrder = (ordering: any) => { - let desc = ""; - SHIFTING_FILTER_ORDER.map((item: any) => { - if (item.text === ordering) { - desc = item.desc; - } - }); - return desc; + const foundItem = SHIFTING_FILTER_ORDER.find( + (item) => item.text === ordering + ); + return foundItem ? foundItem.desc : ""; }; return ( @@ -91,17 +52,31 @@ export default function BadgesList(props: any) { ...dateRange(t("modified"), "modified_date"), badge(t("disease_status"), "disease_status"), badge(t("breathlessness_level"), "breathlessness_level"), - value(t("assigned_to"), "assigned_to", assignedUsername), + value( + t("assigned_to"), + "assigned_to", + qParams.assigned_to + ? `${assignedUser?.results[0].first_name || ""} ${ + assignedUser?.results[0].last_name || "" + }` + : "" + ), value( t("assigned_facility"), "assigned_facility", - assignedFacilityName + qParams.assigned_facility ? assignedFacility?.data?.name || "" : "" + ), + value( + t("origin_facility"), + "origin_facility", + qParams.origin_facility ? originFacility?.data?.name || "" : "" ), - value(t("origin_facility"), "origin_facility", originFacilityName), value( t("shifting_approval_facility"), "shifting_approving_facility", - approvingFacilityName + qParams.shifting_approving_facility + ? approvingFacility?.data?.name || "" + : "" ), value( t("ordering"), diff --git a/src/Components/Shifting/CommentsSection.tsx b/src/Components/Shifting/CommentsSection.tsx index a1473832236..6bb6042ba72 100644 --- a/src/Components/Shifting/CommentsSection.tsx +++ b/src/Components/Shifting/CommentsSection.tsx @@ -1,46 +1,27 @@ -import { useCallback, useState } from "react"; -import { useDispatch } from "react-redux"; -import { statusType, useAbortableEffect } from "../../Common/utils"; -import { getShiftComments, addShiftComments } from "../../Redux/actions"; +import { useState } from "react"; import CircularProgress from "../Common/components/CircularProgress"; import * as Notification from "../../Utils/Notifications.js"; import { formatDateTime } from "../../Utils/utils"; import { useTranslation } from "react-i18next"; import ButtonV2 from "../Common/components/ButtonV2"; +import useQuery from "../../Utils/request/useQuery"; +import routes from "../../Redux/api"; +import { IComment } from "../Resource/models"; +import PaginatedList from "../../CAREUI/misc/PaginatedList"; +import request from "../../Utils/request/request"; interface CommentSectionProps { id: string; } const CommentSection = (props: CommentSectionProps) => { - const dispatch: any = useDispatch(); - const initialData: any = []; - const [comments, setComments] = useState(initialData); const [commentBox, setCommentBox] = useState(""); - const [isLoading, setIsLoading] = useState(true); const { t } = useTranslation(); - const fetchData = useCallback( - async (status: statusType = { aborted: false }) => { - setIsLoading(true); - const res = await dispatch(getShiftComments(props.id)); - if (!status.aborted) { - if (res && res.data) { - setComments(res.data?.results); - } - setIsLoading(false); - } - }, - [props.id, dispatch] - ); - - useAbortableEffect( - (status: statusType) => { - fetchData(status); - }, - [fetchData] - ); + const { loading, refetch: fetchData } = useQuery(routes.getShiftComments, { + pathParams: { id: props.id }, + }); - const onSubmitComment = () => { + const onSubmitComment = async () => { const payload = { comment: commentBox, }; @@ -50,11 +31,15 @@ const CommentSection = (props: CommentSectionProps) => { }); return; } - dispatch(addShiftComments(props.id, payload)).then((_: any) => { + const { res } = await request(routes.addShiftComments, { + pathParams: { id: props.id }, + body: payload, + }); + if (res?.ok) { Notification.Success({ msg: t("comment_added_successfully") }); fetchData(); setCommentBox(""); - }); + } }; return ( @@ -73,36 +58,30 @@ const CommentSection = (props: CommentSectionProps) => {
- {isLoading ? ( + {loading ? ( ) : ( - comments.map((comment: any) => ( -
-
-

{comment.comment}

-
-
- - {comment.modified_date - ? formatDateTime(comment.modified_date) - : "-"} - -
-
-
- {comment.created_by_object?.first_name?.charAt(0) || - t("unknown")} + + {() => ( +
+ + No comments available + + + + + > + {(item) => } + +
+
- - {comment.created_by_object?.first_name || t("unknown")}{" "} - {comment.created_by_object?.last_name} -
-
- )) + )} + )}
@@ -110,3 +89,36 @@ const CommentSection = (props: CommentSectionProps) => { }; export default CommentSection; + +export const Comment = ({ + id, + comment, + created_by_object, + modified_date, +}: IComment) => { + const { t } = useTranslation(); + return ( +
+
+

{comment}

+
+
+ + {modified_date ? formatDateTime(modified_date) : "-"} + +
+
+
+ {created_by_object?.first_name?.charAt(0) || t("unknown")} +
+ + {created_by_object?.first_name || t("unknown")}{" "} + {created_by_object?.last_name} + +
+
+ ); +}; diff --git a/src/Components/Shifting/ListFilter.tsx b/src/Components/Shifting/ListFilter.tsx index 5f2233c2263..903baf5c27d 100644 --- a/src/Components/Shifting/ListFilter.tsx +++ b/src/Components/Shifting/ListFilter.tsx @@ -4,12 +4,10 @@ import { SHIFTING_FILTER_ORDER, } from "../../Common/constants"; import { DateRange } from "../Common/DateRangeInputV2"; -import { useEffect, useState } from "react"; import { SHIFTING_CHOICES_PEACETIME, SHIFTING_CHOICES_WARTIME, } from "../../Common/constants"; -import { getAnyFacility, getUserList } from "../../Redux/actions"; import CircularProgress from "../Common/components/CircularProgress"; import { FacilitySelect } from "../Common/FacilitySelect"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; @@ -20,12 +18,13 @@ import { SelectFormField } from "../Form/FormFields/SelectFormField"; import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField"; import { navigate } from "raviger"; import useConfig from "../../Common/hooks/useConfig"; -import { useDispatch } from "react-redux"; import useMergeState from "../../Common/hooks/useMergeState"; import { useTranslation } from "react-i18next"; import UserAutocompleteFormField from "../Common/UserAutocompleteFormField"; import { dateQueryString, parsePhoneNumber } from "../../Utils/utils"; import dayjs from "dayjs"; +import useQuery from "../../Utils/request/useQuery"; +import routes from "../../Redux/api"; const clearFilterState = { origin_facility: "", @@ -57,9 +56,6 @@ const getDate = (value: any) => export default function ListFilter(props: any) { const { kasp_enabled, kasp_string, wartime_shifting } = useConfig(); const { filter, onChange, closeFilter } = props; - const [isOriginLoading, setOriginLoading] = useState(false); - const [isShiftingLoading, setShiftingLoading] = useState(false); - const [isAssignedLoading, setAssignedLoading] = useState(false); const { t } = useTranslation(); const shiftStatusOptions = ( @@ -89,73 +85,56 @@ export default function ListFilter(props: any) { is_antenatal: filter.is_antenatal || "", breathlessness_level: filter.breathlessness_level || "", }); - const dispatch: any = useDispatch(); - useEffect(() => { - async function fetchData() { - if (filter.origin_facility) { - setOriginLoading(true); - const res = await dispatch( - getAnyFacility(filter.origin_facility, "origin_facility") - ); - if (res && res.data) { - setFilterState({ origin_facility_ref: res.data }); - } - setOriginLoading(false); + const { loading: isOriginLoading } = useQuery(routes.getAnyFacility, { + prefetch: filter.origin_facility ? true : false, + pathParams: { id: filter.origin_facility }, + onResponse: ({ res, data }) => { + if (res && data) { + setFilterState({ + origin_facility_ref: filter.origin_facility ? "" : data, + }); } - } - fetchData(); - }, [dispatch]); + }, + }); - useEffect(() => { - async function fetchData() { - if (filter.shifting_approving_facility) { - setShiftingLoading(true); - const res = await dispatch( - getAnyFacility( - filter.shifting_approving_facility, - "shifting_approving_facility" - ) - ); - if (res && res.data) { - setFilterState({ shifting_approving_facility_ref: res.data }); - } - setShiftingLoading(false); + const { loading: isShiftingLoading } = useQuery(routes.getAnyFacility, { + prefetch: filter.shifting_approving_facility ? true : false, + pathParams: { id: filter.shifting_approving_facility }, + onResponse: ({ res, data }) => { + if (res && data) { + setFilterState({ + shifting_approving_facility_ref: filter.shifting_approving_facility + ? "" + : data, + }); } - } - fetchData(); - }, [dispatch]); + }, + }); - useEffect(() => { - async function fetchData() { - if (filter.assigned_facility) { - setAssignedLoading(true); - const res = await dispatch( - getAnyFacility(filter.assigned_facility, "assigned_facility") - ); - if (res && res.data) { - setFilterState({ assigned_facility_ref: res.data }); - } - setAssignedLoading(false); + const { loading: isAssignedLoading } = useQuery(routes.getAnyFacility, { + prefetch: filter.assigned_facility ? true : false, + pathParams: { id: filter.assigned_facility }, + onResponse: ({ res, data }) => { + if (res && data) { + setFilterState({ + assigned_facility_ref: filter.assigned_facility ? "" : data, + }); } - } - fetchData(); - }, [dispatch]); + }, + }); - useEffect(() => { - async function fetchData() { - if (filter.assigned_to) { - const res = await dispatch(getUserList({ id: filter.assigned_to })); - if (res && res.data && res.data.count) { - setFilterState({ - ...filterState, - assigned_user_ref: res.data.results[0], - }); - } + useQuery(routes.userList, { + query: { id: filter.assigned_to }, + prefetch: filter.assigned_to ? true : false, + onResponse: ({ res, data }) => { + if (res?.ok && data?.count) { + setFilterState({ + assigned_user_ref: filter.assigned_to ? "" : data.results[0], + }); } - } - fetchData(); - }, [dispatch]); + }, + }); const setFacility = (selected: any, name: string) => { const filterData: any = { ...filterState }; diff --git a/src/Components/Shifting/ListView.tsx b/src/Components/Shifting/ListView.tsx index f3fb14a4c0a..aa0a296f71c 100644 --- a/src/Components/Shifting/ListView.tsx +++ b/src/Components/Shifting/ListView.tsx @@ -1,9 +1,5 @@ -import { - completeTransfer, - downloadShiftRequests, - listShiftRequests, -} from "../../Redux/actions"; -import { lazy, useEffect, useState } from "react"; +import { downloadShiftRequests } from "../../Redux/actions"; +import { lazy, useState } from "react"; import BadgesList from "./BadgesList"; import ButtonV2 from "../Common/components/ButtonV2"; @@ -16,18 +12,19 @@ import { formatAge, formatDateTime } from "../../Utils/utils"; import { formatFilter } from "./Commons"; import { navigate } from "raviger"; import useConfig from "../../Common/hooks/useConfig"; -import { useDispatch } from "react-redux"; import useFilters from "../../Common/hooks/useFilters"; import { useTranslation } from "react-i18next"; import { AdvancedFilterButton } from "../../CAREUI/interactive/FiltersSlideover"; import CareIcon from "../../CAREUI/icons/CareIcon"; import dayjs from "../../Utils/dayjs"; import useAuthUser from "../../Common/hooks/useAuthUser"; +import request from "../../Utils/request/request"; +import routes from "../../Redux/api"; +import useQuery from "../../Utils/request/useQuery"; const Loading = lazy(() => import("../Common/Loading")); export default function ListView() { - const dispatch: any = useDispatch(); const { wartime_shifting } = useConfig(); const { qParams, @@ -37,9 +34,7 @@ export default function ListView() { advancedFilter, resultsPerPage, } = useFilters({}); - const [data, setData] = useState([]); - const [totalCount, setTotalCount] = useState(0); - const [isLoading, setIsLoading] = useState(false); + const [modalFor, setModalFor] = useState({ externalId: undefined, loading: false, @@ -47,62 +42,26 @@ export default function ListView() { const authUser = useAuthUser(); const { t } = useTranslation(); - const handleTransferComplete = (shift: any) => { + const handleTransferComplete = async (shift: any) => { setModalFor({ ...modalFor, loading: true }); - dispatch(completeTransfer({ externalId: modalFor })).then(() => { - navigate( - `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation` - ); - }); - }; - - const refreshList = () => { - fetchData(); - }; - - const fetchData = () => { - setIsLoading(true); - dispatch( - listShiftRequests( - formatFilter({ - ...qParams, - offset: (qParams.page ? qParams.page - 1 : 0) * resultsPerPage, - }), - "shift-list-call" - ) - ).then((res: any) => { - if (res && res.data) { - setData(res.data.results); - setTotalCount(res.data.count); - } - setIsLoading(false); + await request(routes.completeTransfer, { + pathParams: { externalId: shift.external_id }, }); + navigate( + `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation` + ); }; - useEffect(() => { - fetchData(); - }, [ - qParams.status, - qParams.facility, - qParams.origin_facility, - qParams.shifting_approving_facility, - qParams.assigned_facility, - qParams.emergency, - qParams.is_up_shift, - qParams.patient_name, - qParams.created_date_before, - qParams.created_date_after, - qParams.modified_date_before, - qParams.modified_date_after, - qParams.patient_phone_number, - qParams.ordering, - qParams.is_kasp, - qParams.assigned_to, - qParams.disease_status, - qParams.is_antenatal, - qParams.breathlessness_level, - qParams.page, - ]); + const { + data: shiftingData, + loading, + refetch: fetchData, + } = useQuery(routes.listShiftRequests, { + query: formatFilter({ + ...qParams, + offset: (qParams.page ? qParams.page - 1 : 0) * resultsPerPage, + }), + }); const showShiftingCardList = (data: any) => { if (data && !data.length) { @@ -327,14 +286,14 @@ export default function ListView() { >
- {isLoading ? ( + {loading ? ( ) : (
- {showShiftingCardList(data)} + {showShiftingCardList(shiftingData?.results || [])}
- +
)} diff --git a/src/Components/Shifting/ShiftDetails.tsx b/src/Components/Shifting/ShiftDetails.tsx index 7bffe429960..bfc73adab78 100644 --- a/src/Components/Shifting/ShiftDetails.tsx +++ b/src/Components/Shifting/ShiftDetails.tsx @@ -7,10 +7,7 @@ import { TEST_TYPE_CHOICES, } from "../../Common/constants"; import { Link, navigate } from "raviger"; -import { lazy, useCallback, useState } from "react"; -import { deleteShiftRecord, getShiftDetails } from "../../Redux/actions"; -import { statusType, useAbortableEffect } from "../../Common/utils"; - +import { lazy, useState } from "react"; import ButtonV2 from "../Common/components/ButtonV2"; import CommentSection from "./CommentsSection"; import ConfirmDialog from "../Common/ConfirmDialog.js"; @@ -20,18 +17,18 @@ import QRCode from "qrcode.react"; import RecordMeta from "../../CAREUI/display/RecordMeta"; import { formatAge, formatDateTime } from "../../Utils/utils"; import useConfig from "../../Common/hooks/useConfig"; -import { useDispatch } from "react-redux"; + import { useTranslation } from "react-i18next"; +import useQuery from "../../Utils/request/useQuery.js"; +import routes from "../../Redux/api.js"; +import request from "../../Utils/request/request.js"; const Loading = lazy(() => import("../Common/Loading")); export default function ShiftDetails(props: { id: string }) { const { header_logo, kasp_full_string, wartime_shifting, kasp_enabled } = useConfig(); - const dispatch: any = useDispatch(); - const initialData: any = {}; - const [data, setData] = useState(initialData); - const [isLoading, setIsLoading] = useState(true); + const [isPrintMode, setIsPrintMode] = useState(false); const [isCopied, setIsCopied] = useState(false); const [openDeleteShiftDialog, setOpenDeleteShiftDialog] = useState(false); @@ -41,38 +38,23 @@ export default function ShiftDetails(props: { id: string }) { ? SHIFTING_CHOICES_WARTIME : SHIFTING_CHOICES_PEACETIME; - const fetchData = useCallback( - async (status: statusType) => { - setIsLoading(true); - const res = await dispatch(getShiftDetails({ id: props.id })); - if (!status.aborted) { - if (res && res.data) { - setData(res.data); - } - setIsLoading(false); - } - }, - [props.id, dispatch] - ); - - useAbortableEffect( - (status: statusType) => { - fetchData(status); - }, - [fetchData] - ); + const { data, loading } = useQuery(routes.getShiftDetails, { + pathParams: { id: props.id }, + }); const handleShiftDelete = async () => { setOpenDeleteShiftDialog(true); - const res = await dispatch(deleteShiftRecord(props.id)); + const { res, data } = await request(routes.deleteShiftRecord, { + pathParams: { id: props.id }, + }); if (res?.status == 204) { Notification.Success({ msg: t("shifting_deleted"), }); } else { Notification.Error({ - msg: t("error_deleting_shifting") + (res?.data?.detail || ""), + msg: t("error_deleting_shifting") + (data?.detail || ""), }); } @@ -533,7 +515,7 @@ export default function ShiftDetails(props: { id: string }) { ); }; - if (isLoading) { + if (loading) { return ; } @@ -562,15 +544,17 @@ export default function ShiftDetails(props: { id: string }) {
+ navigate(`/shifting/${data?.external_id}/update`) } - onClick={() => navigate(`/shifting/${data.external_id}/update`)} > {t("update_status_details")} @@ -581,13 +565,13 @@ export default function ShiftDetails(props: { id: string }) {
} > - {data.assigned_to_object && ( + {data?.assigned_to_object && (

- {t("assigned_to")}: {data.assigned_to_object.first_name}{" "} + {t("assigned_to")}: {data?.assigned_to_object.first_name}{" "} {data.assigned_to_object.last_name} -{" "} {data.assigned_to_object.user_type} @@ -602,51 +586,51 @@ export default function ShiftDetails(props: { id: string }) { {t("patient_name")}:{" "} - - {data.patient_object?.name} + + {data?.patient_object?.name}

Status: {shiftStatusOptions.find( - (option) => data.status === option.text - )?.label || data.status} + (option) => data?.status === option.text + )?.label || data?.status}
{t("origin_facility")}:{" "} - {data.origin_facility_object?.name || "--"} + {data?.origin_facility_object?.name || "--"}
{wartime_shifting && (
{t("shifting_approving_facility")}:{" "} - {data.shifting_approving_facility_object?.name || "--"} + {data?.shifting_approving_facility_object?.name || "--"}
)}
{t("assigned_facility")}:{" "} - {data.assigned_facility_external || - data.assigned_facility_object?.name || + {data?.assigned_facility_external || + data?.assigned_facility_object?.name || "--"}
{t("contact_person_at_the_facility")}:{" "} - {data.refering_facility_contact_name || "--"} + {data?.refering_facility_contact_name || "--"}
{t("phone_number_at_current_facility")}:{" "} - {data.refering_facility_contact_number ? ( + {data?.refering_facility_contact_number ? ( {data.refering_facility_contact_number} @@ -661,7 +645,7 @@ export default function ShiftDetails(props: { id: string }) { {" "} - {data.emergency ? t("yes") : t("no")} + {data?.emergency ? t("yes") : t("no")}
@@ -670,7 +654,7 @@ export default function ShiftDetails(props: { id: string }) { {" "} - {data.is_up_shift ? t("yes") : t("no")} + {data?.is_up_shift ? t("yes") : t("no")}
@@ -679,9 +663,9 @@ export default function ShiftDetails(props: { id: string }) { {" "} - {data.patient_object.last_consultation?.last_daily_round + {data?.patient_object.last_consultation?.last_daily_round ?.patient_category ?? - data.patient_object.last_consultation?.category} + data?.patient_object.last_consultation?.category}
{kasp_enabled && ( @@ -691,7 +675,7 @@ export default function ShiftDetails(props: { id: string }) { {" "} - {data.is_kasp ? t("yes") : t("no")} + {data?.is_kasp ? t("yes") : t("no")}
)} @@ -703,26 +687,26 @@ export default function ShiftDetails(props: { id: string }) { {" "} - {data.is_kasp ? t("yes") : t("no")} + {data?.is_kasp ? t("yes") : t("no")}
{t("vehicle_preference")}:{" "} - {data.vehicle_preference || data.preferred_vehicle_choice} + {data?.vehicle_preference || data?.preferred_vehicle_choice}
{t("facility_preference")}:{" "} - {data.assigned_facility_type || "--"} + {data?.assigned_facility_type || "--"}
{t("severity_of_breathlessness")}:{" "} - {data.breathlessness_level || "--"} + {data?.breathlessness_level || "--"}
{" "} )} @@ -731,14 +715,14 @@ export default function ShiftDetails(props: { id: string }) { {t("reason")}:{" "} - {data.reason || "--"} + {data?.reason || "--"}
{t("ambulance_driver_name")}:{" "} - {data.ambulance_driver_name || "--"} + {data?.ambulance_driver_name || "--"}
@@ -746,9 +730,9 @@ export default function ShiftDetails(props: { id: string }) { {t("ambulance_phone_number")}:{" "} - {data.ambulance_phone_number ? ( - - {data.ambulance_phone_number} + {data?.ambulance_phone_number ? ( + + {data?.ambulance_phone_number} ) : ( "--" @@ -759,13 +743,13 @@ export default function ShiftDetails(props: { id: string }) { {t("ambulance_number")}:{" "} - {data.ambulance_number || "--"} + {data?.ambulance_number || "--"}
{t("comments")}:{" "} - {data.comments || "--"} + {data?.comments || "--"}
} - time={data.created_date} + time={data?.created_date} /> } - time={data.modified_date} + time={data?.modified_date} />
@@ -812,7 +796,7 @@ export default function ShiftDetails(props: { id: string }) {

{t("details_of_patient")} {showCopyToclipBoard(data)}

- {showPatientCard(data.patient_object)} + {showPatientCard(data?.patient_object)}

{t("comments")}

@@ -834,7 +818,7 @@ export default function ShiftDetails(props: { id: string }) { {data?.created_by_object?.last_name}
- {data.created_date && formatDateTime(data.created_date)} + {data?.created_date && formatDateTime(data?.created_date)}
@@ -848,7 +832,8 @@ export default function ShiftDetails(props: { id: string }) { {data?.last_edited_by_object?.last_name}
- {data.modified_date && formatDateTime(data.modified_date)} + {data?.modified_date && + formatDateTime(data?.modified_date)}
@@ -856,12 +841,12 @@ export default function ShiftDetails(props: { id: string }) {

{t("details_of_origin_facility")}

- {showFacilityCard(data.origin_facility_object)} + {showFacilityCard(data?.origin_facility_object)}
- {!data.assigned_facility_external && ( + {!data?.assigned_facility_external && (

{t("details_of_assigned_facility")}

- {showFacilityCard(data.assigned_facility_object)} + {showFacilityCard(data?.assigned_facility_object)}
)} {wartime_shifting && ( @@ -869,7 +854,7 @@ export default function ShiftDetails(props: { id: string }) {

{t("details_of_shifting_approving_facility")}

- {showFacilityCard(data.shifting_approving_facility_object)} + {showFacilityCard(data?.shifting_approving_facility_object)} )} diff --git a/src/Components/Shifting/ShiftDetailsUpdate.tsx b/src/Components/Shifting/ShiftDetailsUpdate.tsx index ec4eab661d9..9e8a9923f91 100644 --- a/src/Components/Shifting/ShiftDetailsUpdate.tsx +++ b/src/Components/Shifting/ShiftDetailsUpdate.tsx @@ -9,10 +9,9 @@ import { SHIFTING_VEHICLE_CHOICES, } from "../../Common/constants"; import { Cancel, Submit } from "../Common/components/ButtonV2"; -import { getShiftDetails, getUserList, updateShift } from "../../Redux/actions"; + import { navigate, useQueryParams } from "raviger"; -import { statusType, useAbortableEffect } from "../../Common/utils"; -import { lazy, useCallback, useEffect, useReducer, useState } from "react"; +import { lazy, useReducer, useState } from "react"; import { ConsultationModel } from "../Facility/models.js"; import DischargeModal from "../Facility/DischargeModal.js"; import { FacilitySelect } from "../Common/FacilitySelect"; @@ -26,7 +25,6 @@ import TextFormField from "../Form/FormFields/TextFormField"; import { parsePhoneNumber } from "../../Utils/utils.js"; import useAppHistory from "../../Common/hooks/useAppHistory"; import useConfig from "../../Common/hooks/useConfig"; -import { useDispatch } from "react-redux"; import { useTranslation } from "react-i18next"; import CircularProgress from "../Common/components/CircularProgress.js"; import Card from "../../CAREUI/display/Card"; @@ -34,6 +32,10 @@ import RadioFormField from "../Form/FormFields/RadioFormField.js"; import Page from "../Common/components/Page.js"; import UserAutocompleteFormField from "../Common/UserAutocompleteFormField.js"; import { UserModel } from "../Users/models.js"; +import useQuery from "../../Utils/request/useQuery.js"; +import routes from "../../Redux/api.js"; +import { IShift } from "./models.js"; +import request from "../../Utils/request/request.js"; const Loading = lazy(() => import("../Common/Loading")); @@ -44,11 +46,9 @@ interface patientShiftProps { export const ShiftDetailsUpdate = (props: patientShiftProps) => { const { goBack } = useAppHistory(); const { kasp_full_string, kasp_enabled, wartime_shifting } = useConfig(); - const dispatchAction: any = useDispatch(); const [qParams, _] = useQueryParams(); const [isLoading, setIsLoading] = useState(true); const [assignedUser, SetAssignedUser] = useState(); - const [assignedUserLoading, setAssignedUserLoading] = useState(false); const [consultationData, setConsultationData] = useState( {} as ConsultationModel ); @@ -126,23 +126,13 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { const [state, dispatch] = useReducer(shiftFormReducer, initialState); - useEffect(() => { - async function fetchData() { - if (state.form.assigned_to) { - setAssignedUserLoading(true); - - const res = await dispatchAction( - getUserList({ id: state.form.assigned_to }) - ); - - if (res && res.data && res.data.count) - SetAssignedUser(res.data.results[0]); - - setAssignedUserLoading(false); - } - } - fetchData(); - }, [dispatchAction, state.form.assigned_to]); + const { loading: assignedUserLoading } = useQuery(routes.userList, { + query: { id: state.form.assigned_to }, + prefetch: state.form.assigned_to ? true : false, + onResponse: ({ res, data }) => { + if (res?.ok && data?.count) SetAssignedUser(data.results[0]); + }, + }); const validateForm = () => { const errors = { ...initError }; @@ -196,8 +186,7 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { } setIsLoading(true); - - const data: any = { + const data: Partial = { origin_facility: state.form.origin_facility_object?.id, shifting_approving_facility: state.form?.shifting_approving_facility_object?.id, @@ -233,15 +222,16 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { data["status"] = state.form.status; } - const res = await dispatchAction(updateShift(props.id, data)); + const { res, data: shiftData } = await request(routes.updateShift, { + pathParams: { id: props.id }, + body: data, + }); setIsLoading(false); - - if (res && res.status == 200 && res.data) { - dispatch({ type: "set_form", form: res.data }); + if (res?.ok && shiftData) { + dispatch({ type: "set_form", form: shiftData }); Notification.Success({ msg: t("shift_request_updated_successfully"), }); - navigate(`/shifting/${props.id}`); } else { setIsLoading(false); @@ -249,41 +239,29 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { } }; - const fetchData = useCallback( - async (status: statusType) => { - setIsLoading(true); - const res = await dispatchAction(getShiftDetails({ id: props.id })); - if (!status.aborted) { - if (res && res.data) { - const d = res.data; - setConsultationData(d.patient.last_consultation); - if (d.assigned_facility_external) - d["assigned_facility_object"] = { - id: -1, - name: res.data.assigned_facility_external, - }; - d["initial_status"] = res.data.status; - d["status"] = qParams.status || res.data.status; - const patient_category = - d.patient.last_consultation?.last_daily_round?.patient_category ?? - d.patient.last_consultation?.category; - d["patient_category"] = PATIENT_CATEGORIES.find( - (c) => c.text === patient_category - )?.id; - dispatch({ type: "set_form", form: d }); - } + useQuery(routes.getShiftDetails, { + pathParams: { id: props.id }, + onResponse: ({ res, data }) => { + if (res?.ok && data) { + const d = data; + setConsultationData(d.patient.last_consultation as ConsultationModel); + if (d.assigned_facility_external) + d["assigned_facility_object"] = { + id: -1, + name: String(data.assigned_facility_external), + }; + d["initial_status"] = data.status; + d["status"] = qParams.status || data.status; + const patient_category = + d.patient.last_consultation?.last_daily_round?.patient_category ?? + d.patient.last_consultation?.category; + d["patient_category"] = + PATIENT_CATEGORIES.find((c) => c.text === patient_category)?.id ?? ""; + dispatch({ type: "set_form", form: d }); setIsLoading(false); } }, - [props.id, dispatchAction, qParams.status] - ); - - useAbortableEffect( - (status: statusType) => { - fetchData(status); - }, - [fetchData] - ); + }); const vehicleOptions = SHIFTING_VEHICLE_CHOICES.map((obj) => obj.text); const facilityOptions = FACILITY_TYPES.map((obj) => obj.text); diff --git a/src/Components/Shifting/ShiftingBoard.tsx b/src/Components/Shifting/ShiftingBoard.tsx index 7c065d0c0a8..bd2497ba2cb 100644 --- a/src/Components/Shifting/ShiftingBoard.tsx +++ b/src/Components/Shifting/ShiftingBoard.tsx @@ -1,21 +1,20 @@ -import { useEffect, useState } from "react"; +import { useState } from "react"; import { classNames, formatAge, formatDateTime } from "../../Utils/utils"; -import { - completeTransfer, - downloadShiftRequests, - listShiftRequests, -} from "../../Redux/actions"; +import { downloadShiftRequests } from "../../Redux/actions"; import { useDrag, useDrop } from "react-dnd"; import ButtonV2 from "../Common/components/ButtonV2"; import ConfirmDialog from "../Common/ConfirmDialog"; import { navigate } from "raviger"; import useConfig from "../../Common/hooks/useConfig"; -import { useDispatch } from "react-redux"; + import { useTranslation } from "react-i18next"; import { ExportButton } from "../Common/Export"; import dayjs from "../../Utils/dayjs"; import useAuthUser from "../../Common/hooks/useAuthUser"; +import request from "../../Utils/request/request"; +import routes from "../../Redux/api"; +import useQuery from "../../Utils/request/useQuery"; const limit = 14; @@ -38,7 +37,6 @@ const reduceLoading = (action: string, current: any) => { }; const ShiftCard = ({ shift, filter }: any) => { - const dispatch: any = useDispatch(); const { wartime_shifting } = useConfig(); const [modalFor, setModalFor] = useState({ externalId: undefined, @@ -52,13 +50,14 @@ const ShiftCard = ({ shift, filter }: any) => { const authUser = useAuthUser(); const { t } = useTranslation(); - const handleTransferComplete = (shift: any) => { + const handleTransferComplete = async (shift: any) => { setModalFor({ ...modalFor, loading: true }); - dispatch(completeTransfer({ externalId: modalFor })).then(() => { - navigate( - `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation` - ); + await request(routes.completeTransfer, { + pathParams: { externalId: shift.external_id }, }); + navigate( + `/facility/${shift.assigned_facility}/patient/${shift.patient}/consultation` + ); }; return (
@@ -259,11 +258,9 @@ export default function ShiftingBoard({ filterProp, formatFilter, }: boardProps) { - const dispatch: any = useDispatch(); - const [data, setData] = useState([]); - const [totalCount, setTotalCount] = useState(); const [currentPage, setCurrentPage] = useState(1); - const [isLoading, setIsLoading] = useState({ board: false, more: false }); + const [offset, setOffSet] = useState(0); + const [isLoading, setIsLoading] = useState({ board: true, more: true }); const [{ isOver }, drop] = useDrop(() => ({ accept: "shift-card", drop: (item: any) => { @@ -274,66 +271,32 @@ export default function ShiftingBoard({ collect: (monitor) => ({ isOver: !!monitor.isOver() }), })); - const fetchData = () => { - setIsLoading((loading) => reduceLoading("BOARD", loading)); - dispatch( - listShiftRequests(formatFilter({ ...filterProp, status: board }), board) - ).then((res: any) => { - if (res && res.data) { - setData(res.data.results); - setTotalCount(res.data.count); + const { data, refetch } = useQuery(routes.listShiftRequests, { + query: formatFilter({ + ...filterProp, + status: board, + offset: offset, + }), + onResponse: ({ res, data }) => { + if (res?.ok && data) { setCurrentPage(1); } setIsLoading((loading) => reduceLoading("COMPLETE", loading)); - }); - }; - - useEffect(() => { - fetchData(); - }, [ - board, - dispatch, - filterProp.facility, - filterProp.origin_facility, - filterProp.shifting_approving_facility, - filterProp.assigned_facility, - filterProp.emergency, - filterProp.is_up_shift, - filterProp.patient_name, - filterProp.created_date_before, - filterProp.created_date_after, - filterProp.modified_date_before, - filterProp.modified_date_after, - filterProp.patient_phone_number, - filterProp.ordering, - filterProp.is_kasp, - filterProp.assigned_to, - filterProp.disease_status, - filterProp.is_antenatal, - filterProp.breathlessness_level, - ]); + }, + }); const handlePagination = (page: number, limit: number) => { const offset = (page - 1) * limit; setCurrentPage(page); + setOffSet(offset); setIsLoading((loading) => reduceLoading("MORE", loading)); - dispatch( - listShiftRequests( - formatFilter({ ...filterProp, status: board, offset: offset }), - board - ) - ).then((res: any) => { - if (res && res.data) { - setData((data) => [...data, ...res.data.results]); - setTotalCount(res.data.count); - } - setIsLoading((loading) => reduceLoading("COMPLETE", loading)); - }); + refetch(); + setIsLoading((loading) => reduceLoading("COMPLETE", loading)); }; const { t } = useTranslation(); const patientFilter = (filter: string) => { - return data + return data?.results .filter(({ status }) => status === filter) .map((shift: any) => ( @@ -363,7 +326,7 @@ export default function ShiftingBoard({ /> - {totalCount || "0"} + {data?.count || "0"}
@@ -382,13 +345,13 @@ export default function ShiftingBoard({ - ) : data?.length > 0 ? ( + ) : data?.count ?? 0 > 0 ? ( patientFilter(board) ) : (

{t("no_patients_to_show")}

)} {!isLoading.board && - data?.length < (totalCount || 0) && + (data?.count ?? 0) < (data?.results.length || 0) && (isLoading.more ? (
{t("loading")} diff --git a/src/Components/Shifting/models.ts b/src/Components/Shifting/models.ts new file mode 100644 index 00000000000..76725bdfcc6 --- /dev/null +++ b/src/Components/Shifting/models.ts @@ -0,0 +1,48 @@ +import { FacilityModel } from "../Facility/models"; +import { PerformedByModel } from "../HCX/misc"; +import { AssignedToObjectModel, PatientModel } from "../Patient/models"; + +export interface IShift { + id: string; + patient_object: PatientModel; + emergency: boolean; + status: string; + origin_facility_object: FacilityModel; + origin_facility: string; + shifting_approving_facility: string; + assigned_facility_external: string | null; + assigned_facility: string | null; + is_up_shift: boolean; + assigned_to: number; + patient_category: string; + shifting_approving_facility_object: FacilityModel; + assigned_facility_object: FacilityModel; + assigned_facility_external_object: FacilityModel; + modified_date: string; + external_id: string; + assigned_to_object?: AssignedToObjectModel; + refering_facility_contact_name: string; + refering_facility_contact_number: string; + is_kasp: boolean; + vehicle_preference: string; + preferred_vehicle_choice: string; + assigned_facility_type: string; + breathlessness_level: string; + reason: string; + ambulance_driver_name: string; + ambulance_phone_number: string | undefined; + ambulance_number: string; + comments: string; + created_date: string; + created_by_object: PerformedByModel; + last_edited_by_object: PerformedByModel; + is_assigned_to_user: boolean; + created_by: number; + last_edited_by: number; + patient: string; + initial_status?: string; +} + +export interface IShiftDetails extends Omit { + patient: PatientModel; +} diff --git a/src/Redux/actions.tsx b/src/Redux/actions.tsx index 15934d0957d..6d95527ef4e 100644 --- a/src/Redux/actions.tsx +++ b/src/Redux/actions.tsx @@ -634,30 +634,15 @@ export const updateUserDetails = (username: string, data: object) => { export const createShift = (params: object) => { return fireRequest("createShift", [], params); }; -export const updateShift = (id: string, params: object) => { - return fireRequest("updateShift", [id], params); -}; -export const deleteShiftRecord = (id: string) => { - return fireRequest("deleteShiftRecord", [id], {}); -}; export const listShiftRequests = (params: object, key: string) => { return fireRequest("listShiftRequests", [], params, null, key); }; -export const getShiftDetails = (pathParam: object) => { - return fireRequest("getShiftDetails", [], {}, pathParam); -}; export const completeTransfer = (pathParams: object) => { return fireRequest("completeTransfer", [], {}, pathParams); }; export const downloadShiftRequests = (params: object) => { return fireRequest("downloadShiftRequests", [], params); }; -export const getShiftComments = (id: string) => { - return fireRequest("getShiftComments", [], {}, { id }); -}; -export const addShiftComments = (id: string, params: object) => { - return fireRequest("addShiftComments", [], params, { id }); -}; // External Results export const externalResultList = (params: object, altKey: string) => { return fireRequest("externalResultList", [], params, null, altKey); diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 01c356f6603..7bdc6471708 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -48,6 +48,7 @@ import { UserModel } from "../Components/Users/models"; import { PaginatedResponse } from "../Utils/request/types"; import { PatientModel } from "../Components/Patient/models"; import { IComment, IResource } from "../Components/Resource/models"; +import { IShift, IShiftDetails } from "../Components/Shifting/models"; /** * A fake function that returns an empty object casted to type T @@ -136,6 +137,12 @@ const routes = { TRes: Type>(), }, + getSpecificUser: { + path: "/api/v1/users/{id}", + method: "GET", + TRes: Type>(), + }, + userListSkill: { path: "/api/v1/users/{username}/skill/", }, @@ -739,23 +746,31 @@ const routes = { method: "POST", }, updateShift: { - path: "/api/v1/shift", + path: "/api/v1/shift/{id}", method: "PUT", + TBody: Type(), + TRes: Type(), }, deleteShiftRecord: { - path: "/api/v1/shift", + path: "/api/v1/shift/{id}", method: "DELETE", + TRes: Type<{ detail: string }>(), }, listShiftRequests: { path: "/api/v1/shift/", method: "GET", + TRes: Type>(), }, getShiftDetails: { path: "/api/v1/shift/{id}/", + method: "GET", + TRes: Type(), }, completeTransfer: { path: "/api/v1/shift/{externalId}/transfer/", method: "POST", + TBody: Type(), + TRes: Type>(), }, downloadShiftRequests: { path: "/api/v1/shift/", @@ -764,10 +779,13 @@ const routes = { getShiftComments: { path: "/api/v1/shift/{id}/comment/", method: "GET", + TRes: Type>(), }, addShiftComments: { path: "/api/v1/shift/{id}/comment/", method: "POST", + TBody: Type>(), + TRes: Type(), }, // Notifications getNotifications: {