From 7dd206365e56ddc547745607051984fc913ad681 Mon Sep 17 00:00:00 2001 From: Ilya Date: Fri, 18 Oct 2024 13:49:47 +0400 Subject: [PATCH 01/30] Add modal loader tests (#1559) --- .../components/AdminPanel/AdminPanel.test.tsx | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/publisher/src/components/AdminPanel/AdminPanel.test.tsx b/publisher/src/components/AdminPanel/AdminPanel.test.tsx index defad3d2b..e3703e7ab 100644 --- a/publisher/src/components/AdminPanel/AdminPanel.test.tsx +++ b/publisher/src/components/AdminPanel/AdminPanel.test.tsx @@ -884,3 +884,70 @@ test("Deleting a user deletes a card to the list of team members", async () => { fireEvent.click(existingTeamMember1ChipToDelete); expect(existingTeamMember1Role).toBeDisabled(); }); + +test("Loading spinner works properly in Agency Provisioning", async () => { + runInAction(() => { + adminPanelStore.usersByID = usersByID; + adminPanelStore.agenciesByID = agenciesByID; + }); + + render( + + + + + + ); + + const agencyProvisioningTab = screen.getByText("Agency Provisioning"); + fireEvent.click(agencyProvisioningTab); + + const agency1Card = screen.getByText("Super Agency"); + fireEvent.click(agency1Card); + + const miniLoader = screen.getByText("dots anim"); + expect(miniLoader).toBeInTheDocument(); + + await waitFor(() => { + adminPanelStore.teamMemberListLoading = false; + }); + + const teamMemberRolesTab = screen.getByText("Team Members & Roles"); + fireEvent.click(teamMemberRolesTab); + + const existingTeamMember1 = screen.getByText("user1@email.org"); + expect(existingTeamMember1).toBeInTheDocument(); +}); + +test("Loading spinner works properly in User Provisioning", async () => { + runInAction(() => { + adminPanelStore.usersByID = usersByID; + }); + + render( + + + + + + ); + + const user1Card = screen.getByText("Anne Teak"); + /** Click on Anne Teak's card from the `UserProvisioningOverview` */ + fireEvent.click(user1Card); + + const miniLoader = screen.getByText("dots anim"); + expect(miniLoader).toBeInTheDocument(); + + await waitFor(() => { + adminPanelStore.userAgenciesLoading = false; + }); + + /** + * Note: since the `UserProvisioningOverview` and its corresponding modal have the same information + * in the DOM (e.g. name, email, ID, list of agencies, etc.), when using `getAllByText`, the information + * in the modal that we are testing is always the second item in the `getAllByText` array. + */ + const userEmail = screen.getAllByText("user1@email.org")[1]; + expect(userEmail).toBeInTheDocument(); +}); From b1da707de5974f8b37333ade65d75b50a1652108 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:02:54 +0000 Subject: [PATCH 02/30] Bump eslint-plugin-jsx-a11y from 6.10.0 to 6.10.1 (#1561) Bumps [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) from 6.10.0 to 6.10.1. - [Release notes](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/releases) - [Changelog](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/CHANGELOG.md) - [Commits](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/compare/v6.10.0...v6.10.1) --- updated-dependencies: - dependency-name: eslint-plugin-jsx-a11y dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- publisher/package.json | 2 +- yarn.lock | 69 +++++++++++++++++++++++------------------- 2 files changed, 39 insertions(+), 32 deletions(-) diff --git a/publisher/package.json b/publisher/package.json index 856b28891..7fe39cf20 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -96,7 +96,7 @@ "eslint-import-resolver-typescript": "^3.6.3", "eslint-plugin-header": "^3.1.1", "eslint-plugin-import": "^2.31.0", - "eslint-plugin-jsx-a11y": "^6.10.0", + "eslint-plugin-jsx-a11y": "^6.10.1", "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-react": "^7.35.0", "eslint-plugin-react-hooks": "^4.6.2", diff --git a/yarn.lock b/yarn.lock index 8e85fb0e7..88db2d546 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6494,19 +6494,17 @@ aria-hidden@^1.1.1: dependencies: tslib "^2.0.0" -aria-query@5.1.3, aria-query@~5.1.3: +aria-query@5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== dependencies: deep-equal "^2.0.5" -aria-query@^5.0.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" - integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== - dependencies: - dequal "^2.0.3" +aria-query@^5.0.0, aria-query@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.2.tgz#93f81a43480e33a338f19163a3d10a50c01dcd59" + integrity sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw== array-buffer-byte-length@^1.0.0: version "1.0.0" @@ -8469,7 +8467,7 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== -dequal@^2.0.2, dequal@^2.0.3: +dequal@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== @@ -9113,10 +9111,10 @@ es-get-iterator@^1.1.3: isarray "^2.0.5" stop-iteration-iterator "^1.0.0" -es-iterator-helpers@^1.0.19: - version "1.0.19" - resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz#117003d0e5fec237b4b5c08aded722e0c6d50ca8" - integrity sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw== +es-iterator-helpers@^1.0.19, es-iterator-helpers@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.1.0.tgz#f6d745d342aea214fe09497e7152170dc333a7a6" + integrity sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw== dependencies: call-bind "^1.0.7" define-properties "^1.2.1" @@ -9125,12 +9123,12 @@ es-iterator-helpers@^1.0.19: es-set-tostringtag "^2.0.3" function-bind "^1.1.2" get-intrinsic "^1.2.4" - globalthis "^1.0.3" + globalthis "^1.0.4" has-property-descriptors "^1.0.2" has-proto "^1.0.3" has-symbols "^1.0.3" internal-slot "^1.0.7" - iterator.prototype "^1.1.2" + iterator.prototype "^1.1.3" safe-array-concat "^1.1.2" es-module-lexer@^1.2.1: @@ -9401,12 +9399,12 @@ eslint-plugin-jest@^25.3.0: dependencies: "@typescript-eslint/experimental-utils" "^5.0.0" -eslint-plugin-jsx-a11y@^6.10.0, eslint-plugin-jsx-a11y@^6.5.1: - version "6.10.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.0.tgz#36fb9dead91cafd085ddbe3829602fb10ef28339" - integrity sha512-ySOHvXX8eSN6zz8Bywacm7CvGNhUtdjvqfQDVe6020TUK34Cywkw7m0KsCCk1Qtm9G1FayfTN1/7mMYnYO2Bhg== +eslint-plugin-jsx-a11y@^6.10.1, eslint-plugin-jsx-a11y@^6.5.1: + version "6.10.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.10.1.tgz#87003835bad8875e023aa5db26f41a0c9e6a8fa9" + integrity sha512-zHByM9WTUMnfsDTafGXRiqxp6lFtNoSOWBY6FonVRn3A+BUwN1L/tdBXT40BcBJi0cZjOGTXZ0eD/rTG9fEJ0g== dependencies: - aria-query "~5.1.3" + aria-query "^5.3.2" array-includes "^3.1.8" array.prototype.flatmap "^1.3.2" ast-types-flow "^0.0.8" @@ -9414,14 +9412,14 @@ eslint-plugin-jsx-a11y@^6.10.0, eslint-plugin-jsx-a11y@^6.5.1: axobject-query "^4.1.0" damerau-levenshtein "^1.0.8" emoji-regex "^9.2.2" - es-iterator-helpers "^1.0.19" + es-iterator-helpers "^1.1.0" hasown "^2.0.2" jsx-ast-utils "^3.3.5" language-tags "^1.0.9" minimatch "^3.1.2" object.fromentries "^2.0.8" safe-regex-test "^1.0.3" - string.prototype.includes "^2.0.0" + string.prototype.includes "^2.0.1" eslint-plugin-prettier@^4.2.1: version "4.2.1" @@ -10340,6 +10338,14 @@ globalthis@^1.0.3: dependencies: define-properties "^1.1.3" +globalthis@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" + integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== + dependencies: + define-properties "^1.2.1" + gopd "^1.0.1" + globby@^11.0.1, globby@^11.0.2, globby@^11.0.4, globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -11255,10 +11261,10 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -iterator.prototype@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.2.tgz#5e29c8924f01916cb9335f1ff80619dcff22b0c0" - integrity sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w== +iterator.prototype@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/iterator.prototype/-/iterator.prototype-1.1.3.tgz#016c2abe0be3bbdb8319852884f60908ac62bf9c" + integrity sha512-FW5iMbeQ6rBGm/oKgzq2aW4KvAGpxPzYES8N4g4xNXUKpL1mclMvOe+76AcLDTvD+Ze+sOpVhgdAQEKF4L9iGQ== dependencies: define-properties "^1.2.1" get-intrinsic "^1.2.1" @@ -15586,13 +15592,14 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string.prototype.includes@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string.prototype.includes/-/string.prototype.includes-2.0.0.tgz#8986d57aee66d5460c144620a6d873778ad7289f" - integrity sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg== +string.prototype.includes@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/string.prototype.includes/-/string.prototype.includes-2.0.1.tgz#eceef21283640761a81dbe16d6c7171a4edf7d92" + integrity sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg== dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.5" + call-bind "^1.0.7" + define-properties "^1.2.1" + es-abstract "^1.23.3" string.prototype.matchall@^4.0.11, string.prototype.matchall@^4.0.6: version "4.0.11" From 49ee03a9c76ce050272a6383e8b207005a0922fd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:03:24 +0000 Subject: [PATCH 03/30] Bump mobx from 6.13.2 to 6.13.5 (#1562) Bumps [mobx](https://github.com/mobxjs/mobx) from 6.13.2 to 6.13.5. - [Release notes](https://github.com/mobxjs/mobx/releases) - [Commits](https://github.com/mobxjs/mobx/compare/mobx@6.13.2...mobx@6.13.5) --- updated-dependencies: - dependency-name: mobx dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index e4a3daa5d..7de89be49 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -9,7 +9,7 @@ "bluebird": "^3.7.2", "file-saver": "^2.0.5", "http-proxy-middleware": "^2.0.6", - "mobx": "^6.13.2", + "mobx": "^6.13.5", "mobx-react-lite": "^4.0.7", "react": "^18.3.1", "react-dom": "^18.3.1", diff --git a/common/package.json b/common/package.json index df85e9982..8c90e4adb 100644 --- a/common/package.json +++ b/common/package.json @@ -19,7 +19,7 @@ "@types/react-dom": "^18.3.0", "@types/styled-components": "^5.1.34", "crypto-browserify": "^3.12.0", - "mobx": "^6.13.2", + "mobx": "^6.13.5", "react": "^18.3.1", "react-dom": "^18.3.1", "react-tooltip": "^5.28.0", diff --git a/publisher/package.json b/publisher/package.json index 7fe39cf20..742ab9891 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -18,7 +18,7 @@ "lodash.debounce": "^4.0.8", "lodash.mapvalues": "^4.6.0", "lodash.pickby": "^4.6.0", - "mobx": "^6.13.2", + "mobx": "^6.13.5", "mobx-persist-store": "^1.1.5", "mobx-react-lite": "^4.0.7", "polished": "^4.3.1", diff --git a/yarn.lock b/yarn.lock index 88db2d546..ba6c2afc6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12755,10 +12755,10 @@ mobx-react-lite@^4.0.7: dependencies: use-sync-external-store "^1.2.0" -mobx@^6.13.2: - version "6.13.2" - resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.13.2.tgz#e4514c983c41611d7008ac4cd21c7f3d1be3180d" - integrity sha512-GIubI2qf+P6lG6rSEG0T2pg3jV9/0+O0ncF09+0umRe75+Cbnh1KNLM1GvbTY9RSc7QuU+LcPNZfxDY8B+3XRg== +mobx@^6.13.5: + version "6.13.5" + resolved "https://registry.yarnpkg.com/mobx/-/mobx-6.13.5.tgz#957d9df88c7f8b4baa7c6f8bdcb6d68b432a6ed5" + integrity sha512-/HTWzW2s8J1Gqt+WmUj5Y0mddZk+LInejADc79NJadrWla3rHzmRHki/mnEUH1AvOmbNTZ1BRbKxr8DSgfdjMA== mri@^1.2.0: version "1.2.0" From a420331947b9a8c8ef61daf5cc666cde82fdc2e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:03:51 +0000 Subject: [PATCH 04/30] Bump @testing-library/jest-dom from 6.5.0 to 6.6.2 (#1564) Bumps [@testing-library/jest-dom](https://github.com/testing-library/jest-dom) from 6.5.0 to 6.6.2. - [Release notes](https://github.com/testing-library/jest-dom/releases) - [Changelog](https://github.com/testing-library/jest-dom/blob/main/CHANGELOG.md) - [Commits](https://github.com/testing-library/jest-dom/compare/v6.5.0...v6.6.2) --- updated-dependencies: - dependency-name: "@testing-library/jest-dom" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index 7de89be49..a2758a075 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -46,7 +46,7 @@ }, "devDependencies": { "@babel/core": "^7.24.3", - "@testing-library/jest-dom": "^6.5.0", + "@testing-library/jest-dom": "^6.6.2", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.13", diff --git a/common/package.json b/common/package.json index 8c90e4adb..4f0f720e6 100644 --- a/common/package.json +++ b/common/package.json @@ -9,7 +9,7 @@ "@justice-counts/agency-dashboard": "*", "@justice-counts/common": "*", "@recidiviz/design-system": "^5.7.0", - "@testing-library/jest-dom": "^6.5.0", + "@testing-library/jest-dom": "^6.6.2", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.13", diff --git a/publisher/package.json b/publisher/package.json index 742ab9891..907a73891 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -67,7 +67,7 @@ "@recidiviz/eslint-config": "^3.0.0", "@recidiviz/tsconfig": "^2.0.0", "@testing-library/dom": "^9.3.4", - "@testing-library/jest-dom": "^6.5.0", + "@testing-library/jest-dom": "^6.6.2", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", "@types/auth0": "^3.3.10", diff --git a/yarn.lock b/yarn.lock index ba6c2afc6..080d09330 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5368,10 +5368,10 @@ lz-string "^1.5.0" pretty-format "^27.0.2" -"@testing-library/jest-dom@^6.5.0": - version "6.5.0" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.5.0.tgz#50484da3f80fb222a853479f618a9ce5c47bfe54" - integrity sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA== +"@testing-library/jest-dom@^6.6.2": + version "6.6.2" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.6.2.tgz#8186aa9a07263adef9cc5a59a4772db8c31f4a5b" + integrity sha512-P6GJD4yqc9jZLbe98j/EkyQDTPgqftohZF5FBkHY5BUERZmcf4HeO2k0XaefEg329ux2p21i1A1DmyQ1kKw2Jw== dependencies: "@adobe/css-tools" "^4.4.0" aria-query "^5.0.0" From b69a19fc56f9de7262a62bf2eff938ce21d2e564 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Oct 2024 08:04:07 +0000 Subject: [PATCH 05/30] Bump eslint-plugin-react from 7.35.0 to 7.37.1 (#1563) Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.35.0 to 7.37.1. - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases) - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.35.0...v7.37.1) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- publisher/package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/publisher/package.json b/publisher/package.json index 907a73891..04fa3a452 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -98,7 +98,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.1", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-react": "^7.35.0", + "eslint-plugin-react": "^7.37.1", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-simple-import-sort": "^12.1.1", "file-saver": "^2.0.5", diff --git a/yarn.lock b/yarn.lock index 080d09330..08e8d19d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9441,10 +9441,10 @@ eslint-plugin-react-hooks@^4.3.0, eslint-plugin-react-hooks@^4.6.2: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596" integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ== -eslint-plugin-react@^7.27.1, eslint-plugin-react@^7.28.0, eslint-plugin-react@^7.35.0: - version "7.35.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.35.0.tgz#00b1e4559896710e58af6358898f2ff917ea4c41" - integrity sha512-v501SSMOWv8gerHkk+IIQBkcGRGrO2nfybfj5pLxuJNFTPxxA3PSryhXTK+9pNbtkggheDdsC0E9Q8CuPk6JKA== +eslint-plugin-react@^7.27.1, eslint-plugin-react@^7.28.0, eslint-plugin-react@^7.37.1: + version "7.37.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.1.tgz#56493d7d69174d0d828bc83afeffe96903fdadbd" + integrity sha512-xwTnwDqzbDRA8uJ7BMxPs/EXRB3i8ZfnOIp8BsxEQkT0nHPp+WWceqGgo6rKb9ctNi8GJLDT4Go5HAWELa/WMg== dependencies: array-includes "^3.1.8" array.prototype.findlast "^1.2.5" From 74cf3d1108250575f2c90d11c94927536b872675 Mon Sep 17 00:00:00 2001 From: Ilya Date: Tue, 22 Oct 2024 11:38:40 +0400 Subject: [PATCH 06/30] [Publisher][Admin Panel] Add team members search bar & sort them alphabetically (#1543) * Add team members search bar & sort them alphabetically * Fixes --- .../AdminPanel/AdminPanel.styles.tsx | 5 + .../AdminPanel/AgencyProvisioning.tsx | 188 ++++++++++++------ 2 files changed, 128 insertions(+), 65 deletions(-) diff --git a/publisher/src/components/AdminPanel/AdminPanel.styles.tsx b/publisher/src/components/AdminPanel/AdminPanel.styles.tsx index 3c1c963de..17608a21f 100644 --- a/publisher/src/components/AdminPanel/AdminPanel.styles.tsx +++ b/publisher/src/components/AdminPanel/AdminPanel.styles.tsx @@ -517,6 +517,11 @@ export const EmptyListMessage = styled.div` margin-left: 3px; `; +export const EmptySearchMessage = styled(EmptyListMessage)` + margin: auto; + margin-top: 48px; +`; + export const ChipContainerLabelAction = styled(ChipContainerLabel)` width: 100%; display: flex; diff --git a/publisher/src/components/AdminPanel/AgencyProvisioning.tsx b/publisher/src/components/AdminPanel/AgencyProvisioning.tsx index 2c1486516..26bb45d16 100644 --- a/publisher/src/components/AdminPanel/AgencyProvisioning.tsx +++ b/publisher/src/components/AdminPanel/AgencyProvisioning.tsx @@ -658,12 +658,21 @@ export const AgencyProvisioning: React.FC = observer( new Set(searchableMetrics.map((metric) => String(metric.id))) ); }, [searchableMetrics]); - const selectedChildAgencies = childAgencies.filter((agency) => selectedChildAgencyIDs.has(Number(agency.id)) ); const hasChildAgencyMetrics = metrics.length > 0; + /** Team members search bar logic */ + const [teamMembersSearchInput, setTeamMembersSearchInput] = + useState(""); + const filteredTeamMembers = AdminPanelStore.searchList( + currentTeamMembers, + teamMembersSearchInput, + ["id", "name", "email"] + ); + + /** Shows mini loader while fetching agency's team members */ // TODO(#1537) Ungate zipcode and agency data sharing fields // useEffect(() => { // setSelectedDataSharingTypes( @@ -1447,7 +1456,9 @@ export const AgencyProvisioning: React.FC = observer( {addOrDeleteUserAction === InteractiveSearchListActions.DELETE && ( + a.name.localeCompare(b.name) + )} boxActionType={InteractiveSearchListActions.DELETE} selections={selectedTeamMembersToDelete} buttons={getInteractiveSearchListSelectDeselectCloseButtons( @@ -1518,8 +1529,41 @@ export const AgencyProvisioning: React.FC = observer( )} - {/* Newly Added Team Members */} + {/* Search Team Members */} + + + setTeamMembersSearchInput(e.target.value) + } + /> + + + {teamMembersSearchInput && ( + { + setTeamMembersSearchInput(""); + }} + > + Clear + + )} + + {!filteredTeamMembers.length && ( + + No current team members found. Please modify your + search and try again. + + )} + + + {/* Newly Added Team Members */} {availableTeamMembers .filter((member) => selectedTeamMembersToAdd.has(+member.id) @@ -1574,70 +1618,84 @@ export const AgencyProvisioning: React.FC = observer( ))} {/* Existing Team Members */} - {currentTeamMembers.map((member) => ( - - - - - {member.name} - - - {member.email} - - - {member.invitation_status} - - - ID {member.user_account_id} - - - - - a.name.localeCompare(b.name)) + .map((member) => { + return ( + + + + + + {member.name} + + + + {member.email} + + + {member.invitation_status} + + + + ID {member.user_account_id} + + + + + + } - disabled={selectedTeamMembersToDelete.has( - +member.id - )} + options={userRoles.map((role) => ({ + key: role, + label: removeSnakeCase(role), + onClick: () => { + setTeamMemberRoleUpdates((prev) => { + if (role === member.role) { + const prevUpdates = { ...prev }; + delete prevUpdates[+member.id]; + return prevUpdates; + } + return { + ...prev, + [member.id]: role, + }; + }); + }, + }))} + fullWidth + lightBoxShadow /> - } - options={userRoles.map((role) => ({ - key: role, - label: removeSnakeCase(role), - onClick: () => { - setTeamMemberRoleUpdates((prev) => { - if (role === member.role) { - const prevUpdates = { ...prev }; - delete prevUpdates[+member.id]; - return prevUpdates; - } - return { - ...prev, - [member.id]: role, - }; - }); - }, - }))} - fullWidth - lightBoxShadow - /> - - - - - - ))} + + + + + + ); + })} )} From b9ff408ac3f2c565e7f99689cca518c84f9c4017 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 14:47:21 +0000 Subject: [PATCH 07/30] Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /agency-dashboard (#1566) Bumps [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware) from 2.0.6 to 2.0.7. - [Release notes](https://github.com/chimurai/http-proxy-middleware/releases) - [Changelog](https://github.com/chimurai/http-proxy-middleware/blob/v2.0.7/CHANGELOG.md) - [Commits](https://github.com/chimurai/http-proxy-middleware/compare/v2.0.6...v2.0.7) --- updated-dependencies: - dependency-name: http-proxy-middleware dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index a2758a075..1312eb351 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -8,7 +8,7 @@ "@types/bluebird": "^3.5.42", "bluebird": "^3.7.2", "file-saver": "^2.0.5", - "http-proxy-middleware": "^2.0.6", + "http-proxy-middleware": "^2.0.7", "mobx": "^6.13.5", "mobx-react-lite": "^4.0.7", "react": "^18.3.1", From 229a63b4488ba246cc0ce461b7579769e6db3ead Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:50:11 +0000 Subject: [PATCH 08/30] Bump react-intersection-observer from 9.10.2 to 9.13.1 (#1568) Bumps [react-intersection-observer](https://github.com/thebuilder/react-intersection-observer) from 9.10.2 to 9.13.1. - [Release notes](https://github.com/thebuilder/react-intersection-observer/releases) - [Commits](https://github.com/thebuilder/react-intersection-observer/compare/v9.10.2...v9.13.1) --- updated-dependencies: - dependency-name: react-intersection-observer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- publisher/package.json | 2 +- yarn.lock | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/publisher/package.json b/publisher/package.json index 04fa3a452..4cd4490a1 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -24,7 +24,7 @@ "polished": "^4.3.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-intersection-observer": "^9.10.2", + "react-intersection-observer": "^9.13.1", "react-is": "^18.3.1", "react-router-dom": "^6", "react-tooltip": "^5.28.0", diff --git a/yarn.lock b/yarn.lock index 08e8d19d8..fa768aef9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10661,6 +10661,17 @@ http-proxy-middleware@^2.0.3, http-proxy-middleware@^2.0.6: is-plain-obj "^3.0.0" micromatch "^4.0.2" +http-proxy-middleware@^2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" + integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== + dependencies: + "@types/http-proxy" "^1.17.8" + http-proxy "^1.18.1" + is-glob "^4.0.1" + is-plain-obj "^3.0.0" + micromatch "^4.0.2" + http-proxy@^1.18.1: version "1.18.1" resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549" @@ -14329,10 +14340,10 @@ react-error-overlay@^6.0.11: resolved "https://registry.yarnpkg.com/react-error-overlay/-/react-error-overlay-6.0.11.tgz#92835de5841c5cf08ba00ddd2d677b6d17ff9adb" integrity sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg== -react-intersection-observer@^9.10.2: - version "9.10.2" - resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.10.2.tgz#d5b14f80c9a6bed525becc228db7dccac5d0ec1c" - integrity sha512-j2hGADK2hCbAlfaq6L3tVLb4iqngoN7B1fT16MwJ4J16YW/vWLcmAIinLsw0lgpZeMi4UDUWtHC9QDde0/P1yQ== +react-intersection-observer@^9.13.1: + version "9.13.1" + resolved "https://registry.yarnpkg.com/react-intersection-observer/-/react-intersection-observer-9.13.1.tgz#6c61a75801162491c6348bad09967f2caf445584" + integrity sha512-tSzDaTy0qwNPLJHg8XZhlyHTgGW6drFKTtvjdL+p6um12rcnp8Z5XstE+QNBJ7c64n5o0Lj4ilUleA41bmDoMw== react-is@18.1.0: version "18.1.0" From 64148ef37321a6d5a4f0fdaed4494d9b6e7f2661 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Oct 2024 07:50:44 +0000 Subject: [PATCH 09/30] Bump @types/jest from 29.5.13 to 29.5.14 (#1569) Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 29.5.13 to 29.5.14. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest) --- updated-dependencies: - dependency-name: "@types/jest" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index 1312eb351..899ff6bbd 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -49,7 +49,7 @@ "@testing-library/jest-dom": "^6.6.2", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.13", + "@types/jest": "^29.5.14", "@types/node": "^22.7.4", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", diff --git a/common/package.json b/common/package.json index 4f0f720e6..83322b4ac 100644 --- a/common/package.json +++ b/common/package.json @@ -12,7 +12,7 @@ "@testing-library/jest-dom": "^6.6.2", "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", - "@types/jest": "^29.5.13", + "@types/jest": "^29.5.14", "@types/lodash": "^4.17.7", "@types/node": "^22.7.4", "@types/react": "^18.3.3", diff --git a/publisher/package.json b/publisher/package.json index 4cd4490a1..2993a37ec 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -72,7 +72,7 @@ "@testing-library/user-event": "^14.5.2", "@types/auth0": "^3.3.10", "@types/file-saver": "^2.0.7", - "@types/jest": "^29.5.13", + "@types/jest": "^29.5.14", "@types/lodash": "^4.17.7", "@types/lodash.debounce": "^4.0.9", "@types/node": "^22.7.4", diff --git a/yarn.lock b/yarn.lock index fa768aef9..47a6782f5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5711,10 +5711,10 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^29.5.13": - version "29.5.13" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.13.tgz#8bc571659f401e6a719a7bf0dbcb8b78c71a8adc" - integrity sha512-wd+MVEZCHt23V0/L642O5APvspWply/rGY5BcW4SUETo2UzPU3Z26qr8jC2qxpimI2jjx9h7+2cj2FwIr01bXg== +"@types/jest@^29.5.14": + version "29.5.14" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" + integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== dependencies: expect "^29.0.0" pretty-format "^29.0.0" From 7e05a749d595765a4d0443cc25e6519ee1f1467d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 02:25:21 +0000 Subject: [PATCH 10/30] Bump elliptic from 6.5.7 to 6.6.0 (#1573) Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.7 to 6.6.0. - [Commits](https://github.com/indutny/elliptic/compare/v6.5.7...v6.6.0) --- updated-dependencies: - dependency-name: elliptic dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 47a6782f5..6c00540a9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8748,9 +8748,9 @@ electron-to-chromium@^1.5.28: integrity sha512-M+7ph0VGBQqqpTT2YrabjNKSQ2fEl9PVx6AK3N558gDH9NO8O6XN9SXXFWRo9u9PbEg/bWq+tjXQr+eXmxubCw== elliptic@^6.5.3, elliptic@^6.5.4: - version "6.5.7" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b" - integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q== + version "6.6.0" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.0.tgz#5919ec723286c1edf28685aa89261d4761afa210" + integrity sha512-dpwoQcLc/2WLQvJvLRHKZ+f9FgOdjnq11rurqwekGQygGPsYSK29OMMD2WalatiqQ+XGFDglTNixpPfI+lpaAA== dependencies: bn.js "^4.11.9" brorand "^1.1.0" From 85d702cfdda498f7def4139b6d6fa9356c608bd9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 08:04:13 +0000 Subject: [PATCH 11/30] Bump @types/react from 18.3.3 to 18.3.12 (#1579) Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.3.3 to 18.3.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: "@types/react" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 93 ++++++++++++++++++++++++++--------- 4 files changed, 74 insertions(+), 25 deletions(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index 899ff6bbd..df1302e7c 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -51,7 +51,7 @@ "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", "@types/node": "^22.7.4", - "@types/react": "^18.3.3", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", "@types/react-router-dom": "^5.3.3", "customize-cra": "^1.0.0", diff --git a/common/package.json b/common/package.json index 83322b4ac..564cfdf5a 100644 --- a/common/package.json +++ b/common/package.json @@ -15,7 +15,7 @@ "@types/jest": "^29.5.14", "@types/lodash": "^4.17.7", "@types/node": "^22.7.4", - "@types/react": "^18.3.3", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", "@types/styled-components": "^5.1.34", "crypto-browserify": "^3.12.0", diff --git a/publisher/package.json b/publisher/package.json index 2993a37ec..6842e7719 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -78,7 +78,7 @@ "@types/node": "^22.7.4", "@types/qs": "^6.9.16", "@types/reach__router": "^1.3.15", - "@types/react": "^18.3.3", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", "@types/react-modal": "^3.16.3", "@types/react-router-dom": "^5.3.3", diff --git a/yarn.lock b/yarn.lock index 6c00540a9..5698ddba9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5583,6 +5583,22 @@ resolved "https://registry.yarnpkg.com/@types/escodegen/-/escodegen-0.0.6.tgz#5230a9ce796e042cda6f086dbf19f22ea330659c" integrity sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "9.6.1" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" + integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + "@types/eslint@^7.29.0 || ^8.4.1": version "8.4.6" resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.4.6.tgz#7976f054c1bccfcf514bff0564c0c41df5c08207" @@ -5606,10 +5622,10 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== -"@types/estree@^1.0.5": - version "1.0.5" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" - integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": version "4.17.31" @@ -5868,10 +5884,10 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@>=16", "@types/react@^18.3.3": - version "18.3.3" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f" - integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw== +"@types/react@*", "@types/react@>=16", "@types/react@^18.3.12": + version "18.3.12" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.12.tgz#99419f182ccd69151813b7ee24b792fe08774f60" + integrity sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw== dependencies: "@types/prop-types" "*" csstype "^3.0.2" @@ -6305,11 +6321,6 @@ acorn-globals@^6.0.0: acorn "^7.1.1" acorn-walk "^7.1.1" -acorn-import-attributes@^1.9.5: - version "1.9.5" - resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" - integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== - acorn-jsx@^5.3.1, acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -6334,11 +6345,16 @@ acorn@^7.0.0, acorn@^7.1.1, acorn@^7.4.1: resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.4.1.tgz#feaed255973d2e77555b83dbc08851a6c63520fa" integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== -acorn@^8.11.3, acorn@^8.2.4, acorn@^8.5.0, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: +acorn@^8.11.3, acorn@^8.2.4, acorn@^8.5.0, acorn@^8.8.2, acorn@^8.9.0: version "8.11.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== +acorn@^8.14.0: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== + address@^1.0.1, address@^1.1.2: version "1.2.1" resolved "https://registry.yarnpkg.com/address/-/address-1.2.1.tgz#25bb61095b7522d65b357baa11bc05492d4c8acd" @@ -7270,7 +7286,7 @@ browserify-zlib@^0.1.4: dependencies: pako "~0.2.0" -browserslist@^4.0.0, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.3, browserslist@^4.21.10, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.21.9, browserslist@^4.22.1, browserslist@^4.22.2, browserslist@^4.23.3: +browserslist@^4.0.0, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.3, browserslist@^4.21.3, browserslist@^4.21.4, browserslist@^4.21.9, browserslist@^4.22.1, browserslist@^4.22.2, browserslist@^4.23.3: version "4.24.0" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.0.tgz#a1325fe4bc80b64fda169629fc01b3d6cecd38d4" integrity sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A== @@ -7280,6 +7296,16 @@ browserslist@^4.0.0, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4 node-releases "^2.0.18" update-browserslist-db "^1.1.0" +browserslist@^4.24.0: + version "4.24.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" + integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + dependencies: + caniuse-lite "^1.0.30001669" + electron-to-chromium "^1.5.41" + node-releases "^2.0.18" + update-browserslist-db "^1.1.1" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -7392,6 +7418,11 @@ caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001663: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz#99fc5ea0d9c6e96897a104a8352604378377f949" integrity sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw== +caniuse-lite@^1.0.30001669: + version "1.0.30001677" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001677.tgz#27c2e2c637e007cfa864a16f7dfe7cde66b38b5f" + integrity sha512-fmfjsOlJUpMWu+mAAtZZZHz7UEwsUxIIvu1TJfO1HqFQvB/B+ii0xr9B5HpbZY/mC4XZ8SvjHJqtAY6pDPQEog== + case-sensitive-paths-webpack-plugin@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz#db64066c6422eed2e08cc14b986ca43796dbc6d4" @@ -8747,6 +8778,11 @@ electron-to-chromium@^1.5.28: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.32.tgz#4a05ee78e29e240aabaf73a67ce9fe73f52e1bc7" integrity sha512-M+7ph0VGBQqqpTT2YrabjNKSQ2fEl9PVx6AK3N558gDH9NO8O6XN9SXXFWRo9u9PbEg/bWq+tjXQr+eXmxubCw== +electron-to-chromium@^1.5.41: + version "1.5.50" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.50.tgz#d9ba818da7b2b5ef1f3dd32bce7046feb7e93234" + integrity sha512-eMVObiUQ2LdgeO1F/ySTXsvqvxb6ZH2zPGaMYsWzRDdOddUa77tdmI0ltg+L16UpbWdhPmuF3wIQYyQq65WfZw== + elliptic@^6.5.3, elliptic@^6.5.4: version "6.6.0" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.0.tgz#5919ec723286c1edf28685aa89261d4761afa210" @@ -9244,6 +9280,11 @@ escalade@^3.1.2: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -16525,6 +16566,14 @@ update-browserslist-db@^1.1.0: escalade "^3.1.2" picocolors "^1.0.1" +update-browserslist-db@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz#80846fba1d79e82547fb661f8d141e0945755fe5" + integrity sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A== + dependencies: + escalade "^3.2.0" + picocolors "^1.1.0" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" @@ -16868,17 +16917,17 @@ webpack-virtual-modules@^0.6.1: integrity sha512-poXpCylU7ExuvZK8z+On3kX+S8o/2dQ/SVYueKA0D4WEMXROXgY8Ez50/bQEUmvoSMMrWcrJqCHuhAbsiwg7Dg== webpack@5, webpack@^5.64.4: - version "5.95.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.95.0.tgz#8fd8c454fa60dad186fbe36c400a55848307b4c0" - integrity sha512-2t3XstrKULz41MNMBF+cJ97TyHdyQ8HCt//pqErqDvNjU9YQBnZxIHa11VXsi7F3mb5/aO2tuDxdeTPdU7xu9Q== + version "5.96.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.96.1.tgz#3676d1626d8312b6b10d0c18cc049fba7ac01f0c" + integrity sha512-l2LlBSvVZGhL4ZrPwyr8+37AunkcYj5qh8o6u2/2rzoPc8gxFJkLj1WxNgooi9pnoc06jh0BjuXnamM4qlujZA== dependencies: - "@types/estree" "^1.0.5" + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" "@webassemblyjs/ast" "^1.12.1" "@webassemblyjs/wasm-edit" "^1.12.1" "@webassemblyjs/wasm-parser" "^1.12.1" - acorn "^8.7.1" - acorn-import-attributes "^1.9.5" - browserslist "^4.21.10" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" enhanced-resolve "^5.17.1" es-module-lexer "^1.2.1" From 158818c57470ce1fe7ae45dbd336f4197134ec72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 08:04:39 +0000 Subject: [PATCH 12/30] Bump @types/lodash from 4.17.7 to 4.17.13 (#1580) Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.17.7 to 4.17.13. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/lodash) --- updated-dependencies: - dependency-name: "@types/lodash" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/package.json b/common/package.json index 564cfdf5a..5e41f3b7c 100644 --- a/common/package.json +++ b/common/package.json @@ -13,7 +13,7 @@ "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", - "@types/lodash": "^4.17.7", + "@types/lodash": "^4.17.13", "@types/node": "^22.7.4", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", diff --git a/publisher/package.json b/publisher/package.json index 6842e7719..41e3fcee7 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -73,7 +73,7 @@ "@types/auth0": "^3.3.10", "@types/file-saver": "^2.0.7", "@types/jest": "^29.5.14", - "@types/lodash": "^4.17.7", + "@types/lodash": "^4.17.13", "@types/lodash.debounce": "^4.0.9", "@types/node": "^22.7.4", "@types/qs": "^6.9.16", diff --git a/yarn.lock b/yarn.lock index 5698ddba9..2e9b34e0a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5752,10 +5752,10 @@ dependencies: "@types/lodash" "*" -"@types/lodash@*", "@types/lodash@^4.14.167", "@types/lodash@^4.17.7": - version "4.17.7" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.7.tgz#2f776bcb53adc9e13b2c0dfd493dfcbd7de43612" - integrity sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA== +"@types/lodash@*", "@types/lodash@^4.14.167", "@types/lodash@^4.17.13": + version "4.17.13" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.17.13.tgz#786e2d67cfd95e32862143abe7463a7f90c300eb" + integrity sha512-lfx+dftrEZcdBPczf9d0Qv0x+j/rfNCMuC6OcfXmO8gkfeNAY88PgKUbvG56whcN23gc27yenwF6oJZXGFpYxg== "@types/mdx@^2.0.0": version "2.0.5" From 4594b73791f1ec617350f5cb5b6fa4ee4d988167 Mon Sep 17 00:00:00 2001 From: Ilya Date: Mon, 4 Nov 2024 13:38:26 +0400 Subject: [PATCH 13/30] [Publisher] Filter out disabled metrics and dimensions (#1488) * Filter out disabled metrics from review page * Filter out disabled dimensions from review page * Properly filter out disabled dimensions & metrics from Explore Data & Review pages * Add unit test for datapointMatchingEnabledDimension * Fixes * Update initialize call --- common/components/DataViz/utils.test.ts | 159 +++++++++++++++++- common/components/DataViz/utils.ts | 22 +++ common/stores/BaseDatapointsStore.ts | 2 +- .../ReviewMetrics/ReviewMetrics.tsx | 2 +- publisher/src/stores/DatapointsStore.ts | 12 +- publisher/src/stores/FormStore.ts | 6 +- publisher/src/stores/ReportStore.ts | 17 +- 7 files changed, 211 insertions(+), 9 deletions(-) diff --git a/common/components/DataViz/utils.test.ts b/common/components/DataViz/utils.test.ts index a717fde20..5c6353511 100644 --- a/common/components/DataViz/utils.test.ts +++ b/common/components/DataViz/utils.test.ts @@ -15,8 +15,9 @@ // along with this program. If not, see . // ============================================================================= -import { Datapoint } from "../../types"; +import { Datapoint, Metric, RawDatapoint } from "../../types"; import { + datapointMatchingEnabledDimension, fillTimeGapsBetweenDatapoints, filterByTimeRange, filterNullDatapoints, @@ -1909,6 +1910,150 @@ const testDatapoints5Transformed: Datapoint[] = [ }, ]; +const mockTestMetric: Metric[] = [ + { + key: "TEST_METRIC", + system: { + key: "PROSECUTION", + display_name: "Prosecution", + }, + display_name: "Test display name", + description: "Test description", + reporting_note: "Test note", + enabled: true, + value: 1000, + unit: "test", + category: "TEST_CATEGORY", + label: "Test label", + is_includes_excludes_configured: null, + filenames: ["test"], + definitions: [ + { + term: "test term", + definition: "test definition", + }, + ], + contexts: [ + { + key: "TEST_CONTEXTS", + display_name: "test contexts display name", + reporting_note: null, + required: true, + type: "MULTIPLE_CHOICE", + multiple_choice_options: ["YES", "NO"], + value: "YES", + }, + ], + disaggregations: [ + { + key: "TEST_TYPE", + display_name: "Test Types", + dimensions: [ + { + key: "TEST DIMENSION 1", + label: "Test dimension 1", + value: 120, + enabled: true, + reporting_note: "Test note", + is_dimension_includes_excludes_configured: null, + }, + { + key: "TEST DIMENSION 2", + label: "Test dimension 2", + value: 0, + enabled: true, + reporting_note: "Test note", + is_dimension_includes_excludes_configured: null, + }, + { + key: "TEST DIMENSION 3", + label: "Test dimension 3", + value: 0, + enabled: false, + reporting_note: "Test note", + is_dimension_includes_excludes_configured: null, + }, + { + key: "TEST DIMENSION 4", + label: "Test dimension 4", + value: 0, + enabled: undefined, + reporting_note: "Test note", + is_dimension_includes_excludes_configured: null, + }, + ], + required: false, + helper_text: "Test helper text.", + should_sum_to_total: false, + is_breakdown_configured: null, + }, + ], + }, +]; + +const testMetricDatapoints: RawDatapoint[] = [ + { + agency_name: "Test Agency", + dimension_display_name: "TEST DIMENSION 1", + disaggregation_display_name: "Test Types", + end_date: "Sun, 01 Oct 2023 00:00:00 GMT", + frequency: "MONTHLY", + id: 123, + is_published: false, + metric_definition_key: "TEST_METRIC", + metric_display_name: "Test display name", + old_value: null, + report_id: 65, + start_date: "Fri, 01 Sep 2023 00:00:00 GMT", + value: 120, + }, + { + agency_name: "Test Agency", + dimension_display_name: "TEST DIMENSION 2", + disaggregation_display_name: "Test Types", + end_date: "Sun, 01 Oct 2023 00:00:00 GMT", + frequency: "MONTHLY", + id: 234, + is_published: false, + metric_definition_key: "TEST_METRIC", + metric_display_name: "Test display name", + old_value: null, + report_id: 654, + start_date: "Fri, 01 Sep 2023 00:00:00 GMT", + value: 0, + }, + { + agency_name: "Test Agency", + dimension_display_name: "TEST DIMENSION 3", + disaggregation_display_name: "Test Types", + end_date: "Sun, 01 Oct 2023 00:00:00 GMT", + frequency: "MONTHLY", + id: 345, + is_published: false, + metric_definition_key: "TEST_METRIC", + metric_display_name: "Test display name", + old_value: null, + report_id: 98, + start_date: "Fri, 01 Sep 2023 00:00:00 GMT", + value: 0, + }, + { + agency_name: "Test Agency", + dimension_display_name: "TEST DIMENSION 4", + disaggregation_display_name: "Test Types", + end_date: "Sun, 01 Oct 2023 00:00:00 GMT", + frequency: "MONTHLY", + id: 3425, + is_published: false, + metric_definition_key: "TEST_METRIC", + metric_display_name: "Test display name", + old_value: null, + report_id: 9128, + start_date: "Fri, 01 Sep 2023 00:00:00 GMT", + value: 0, + }, +]; + beforeAll(() => { jest.useFakeTimers("modern"); jest.setSystemTime(new Date(2022, 7, 23)); @@ -2037,3 +2182,15 @@ describe("getShortStartDateStrFromDisplayDate", () => { expect(nonCalendarYearStartDate).toBe("Mar 2023"); }); }); + +describe("datapointMatchingEnabledDimension", () => { + test("returns only datapoints that match the metric's enabled dimensions", () => { + const result = testMetricDatapoints.filter((dp: RawDatapoint) => + datapointMatchingEnabledDimension(dp, mockTestMetric) + ); + expect(result).toStrictEqual([ + testMetricDatapoints[0], + testMetricDatapoints[1], + ]); + }); +}); diff --git a/common/components/DataViz/utils.ts b/common/components/DataViz/utils.ts index ef401e11b..b70207e5b 100644 --- a/common/components/DataViz/utils.ts +++ b/common/components/DataViz/utils.ts @@ -730,6 +730,28 @@ export const getMetricKeyToFrequencyMap = ( }, {} as MetricKeyToFrequency); }; +/** + * Used to filter out datapoints that do not match the metric's enabled dimension + * @returns `true` or `false` based on whether the datapoint matches the metric's enabled dimension + */ +export const datapointMatchingEnabledDimension = ( + dp: Datapoint | RawDatapoint, + metrics: Metric[] +) => { + if (dp.dimension_display_name) { + return metrics.find((metric) => + metric.disaggregations.find((disaggregation) => + disaggregation.dimensions + .filter((dimension) => dimension.enabled) + .map((dimension) => dimension.key) + .includes(dp.dimension_display_name as string) + ) + ); + } + + return true; +}; + /** * Used to filter out datapoints that do not match the metric's current frequency * @returns `true` or `false` based on whether the datapoint matches the metric's frequency diff --git a/common/stores/BaseDatapointsStore.ts b/common/stores/BaseDatapointsStore.ts index 8fe22a83f..6e83610e3 100644 --- a/common/stores/BaseDatapointsStore.ts +++ b/common/stores/BaseDatapointsStore.ts @@ -90,7 +90,7 @@ abstract class DatapointsStore { }); // the res object could be overwritten based on the datapoint order since the logic is grouping by start_date // and this check essentially skips all null datapoints and writes correct data - } else if (dp.value) { + } else if (dp.value || dp.value === 0) { if ( !res[dp.metric_definition_key].disaggregations[ dp.disaggregation_display_name diff --git a/publisher/src/components/ReviewMetrics/ReviewMetrics.tsx b/publisher/src/components/ReviewMetrics/ReviewMetrics.tsx index 6986a8fe7..164b39640 100644 --- a/publisher/src/components/ReviewMetrics/ReviewMetrics.tsx +++ b/publisher/src/components/ReviewMetrics/ReviewMetrics.tsx @@ -251,7 +251,7 @@ export const ReviewMetrics: React.FC = ({ isPublishButton, isPublishInProgress, }) => ( - + {isPublishInProgress && ( diff --git a/publisher/src/stores/DatapointsStore.ts b/publisher/src/stores/DatapointsStore.ts index 3b64d837e..fde3b7623 100644 --- a/publisher/src/stores/DatapointsStore.ts +++ b/publisher/src/stores/DatapointsStore.ts @@ -16,11 +16,12 @@ // ============================================================================= import { + datapointMatchingEnabledDimension, datapointMatchingMetricFrequency, getMetricKeyToFrequencyMap, } from "@justice-counts/common/components/DataViz/utils"; import BaseDatapointsStore from "@justice-counts/common/stores/BaseDatapointsStore"; -import { Datapoint, Metric } from "@justice-counts/common/types"; +import { Metric, RawDatapoint } from "@justice-counts/common/types"; import { IReactionDisposer, makeObservable, @@ -81,8 +82,13 @@ class DatapointsStore extends BaseDatapointsStore { const metricKeyToFrequency = getMetricKeyToFrequencyMap( this.reportStore.agencyMetrics ); - this.rawDatapoints = result.datapoints.filter((dp: Datapoint) => - datapointMatchingMetricFrequency(dp, metricKeyToFrequency) + this.rawDatapoints = result.datapoints.filter( + (dp: RawDatapoint) => + datapointMatchingMetricFrequency(dp, metricKeyToFrequency) && + datapointMatchingEnabledDimension( + dp, + this.reportStore.agencyMetrics + ) ); this.dimensionNamesByMetricAndDisaggregation = result.dimension_names_by_metric_and_disaggregation; diff --git a/publisher/src/stores/FormStore.ts b/publisher/src/stores/FormStore.ts index 7b001f985..6ec912f2f 100644 --- a/publisher/src/stores/FormStore.ts +++ b/publisher/src/stores/FormStore.ts @@ -69,7 +69,11 @@ class FormStore { metric.disaggregations.forEach((disaggregation) => { disaggregation.dimensions.forEach((dimension) => { - if (dimension.value !== null && dimension.value !== undefined) { + if ( + dimension.value !== null && + dimension.value !== undefined && + dimension.enabled + ) { this.updateDisaggregationDimensionValue( reportID, metric.key, diff --git a/publisher/src/stores/ReportStore.ts b/publisher/src/stores/ReportStore.ts index a33bbb85b..cf6db8f99 100644 --- a/publisher/src/stores/ReportStore.ts +++ b/publisher/src/stores/ReportStore.ts @@ -15,6 +15,7 @@ // along with this program. If not, see . // ============================================================================= +import { datapointMatchingEnabledDimension } from "@justice-counts/common/components/DataViz/utils"; import { AgencySystem, Metric, @@ -300,14 +301,26 @@ class ReportStore { return acc; }, {} as PublishReviewMetricErrors); + if (!this.agencyMetrics.length) { + await this.initializeReportSettings(currentAgencyId); + } + const filteredDatapoints = combinedFilteredDatapointsFromAllReports.filter( - (dp) => dp.value || dp.value === 0 // Filter out null values + (dp) => + (dp.value || dp.value === 0) && // Filter out null values + datapointMatchingEnabledDimension(dp, this.agencyMetrics) // Filter out disabled dimensions ); const datapointsByMetric = DatapointsStore.keyRawDatapointsByMetric(filteredDatapoints); - const datapointsEntries = Object.entries(datapointsByMetric); + + const datapointsEntries = Object.entries(datapointsByMetric).filter( + ([metricKey]) => + this.agencyMetrics.find( + (metric) => metric.enabled && metric.key === metricKey + ) + ); const metricsToDisplay = datapointsEntries.map( ([metricKey, metricDatapoints]) => { From 1f9660a3e7c017d398580f8a4c27d39b896eb59e Mon Sep 17 00:00:00 2001 From: Ilya Date: Thu, 7 Nov 2024 21:49:01 +0400 Subject: [PATCH 14/30] Hide users search feature when creating new agency (#1581) --- .../AdminPanel/AgencyProvisioning.tsx | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/publisher/src/components/AdminPanel/AgencyProvisioning.tsx b/publisher/src/components/AdminPanel/AgencyProvisioning.tsx index 26bb45d16..dd051f2be 100644 --- a/publisher/src/components/AdminPanel/AgencyProvisioning.tsx +++ b/publisher/src/components/AdminPanel/AgencyProvisioning.tsx @@ -1530,37 +1530,39 @@ export const AgencyProvisioning: React.FC = observer( )} {/* Search Team Members */} - - - setTeamMembersSearchInput(e.target.value) - } - /> - - - {teamMembersSearchInput && ( - { - setTeamMembersSearchInput(""); - }} - > - Clear - + {selectedIDToEdit && ( + + + setTeamMembersSearchInput(e.target.value) + } + /> + + + {teamMembersSearchInput && ( + { + setTeamMembersSearchInput(""); + }} + > + Clear + + )} + + {!filteredTeamMembers.length && ( + + No current team members found. Please modify your + search and try again. + )} - - {!filteredTeamMembers.length && ( - - No current team members found. Please modify your - search and try again. - - )} - + + )} {/* Newly Added Team Members */} From e52902a086f5e37d08b21ddbe862060bceabda37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:00:14 +0000 Subject: [PATCH 15/30] Bump eslint-plugin-react from 7.37.1 to 7.37.2 (#1584) Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.37.1 to 7.37.2. - [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases) - [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.37.1...v7.37.2) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- publisher/package.json | 2 +- yarn.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/publisher/package.json b/publisher/package.json index 41e3fcee7..a0ab00888 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -98,7 +98,7 @@ "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsx-a11y": "^6.10.1", "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-react": "^7.37.1", + "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^4.6.2", "eslint-plugin-simple-import-sort": "^12.1.1", "file-saver": "^2.0.5", diff --git a/yarn.lock b/yarn.lock index 2e9b34e0a..d3eb73aaf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9147,7 +9147,7 @@ es-get-iterator@^1.1.3: isarray "^2.0.5" stop-iteration-iterator "^1.0.0" -es-iterator-helpers@^1.0.19, es-iterator-helpers@^1.1.0: +es-iterator-helpers@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.1.0.tgz#f6d745d342aea214fe09497e7152170dc333a7a6" integrity sha512-/SurEfycdyssORP/E+bj4sEu1CWw4EmLDsHynHwSXQ7utgbrMRWW195pTrCjFgFCddf/UkYm3oqKPRq5i8bJbw== @@ -9482,17 +9482,17 @@ eslint-plugin-react-hooks@^4.3.0, eslint-plugin-react-hooks@^4.6.2: resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz#c829eb06c0e6f484b3fbb85a97e57784f328c596" integrity sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ== -eslint-plugin-react@^7.27.1, eslint-plugin-react@^7.28.0, eslint-plugin-react@^7.37.1: - version "7.37.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.1.tgz#56493d7d69174d0d828bc83afeffe96903fdadbd" - integrity sha512-xwTnwDqzbDRA8uJ7BMxPs/EXRB3i8ZfnOIp8BsxEQkT0nHPp+WWceqGgo6rKb9ctNi8GJLDT4Go5HAWELa/WMg== +eslint-plugin-react@^7.27.1, eslint-plugin-react@^7.28.0, eslint-plugin-react@^7.37.2: + version "7.37.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz#cd0935987876ba2900df2f58339f6d92305acc7a" + integrity sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w== dependencies: array-includes "^3.1.8" array.prototype.findlast "^1.2.5" array.prototype.flatmap "^1.3.2" array.prototype.tosorted "^1.1.4" doctrine "^2.1.0" - es-iterator-helpers "^1.0.19" + es-iterator-helpers "^1.1.0" estraverse "^5.3.0" hasown "^2.0.2" jsx-ast-utils "^2.4.1 || ^3.0.0" From 58b837adb3cfc63d2734847880bd39f3086f9af6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 08:05:48 +0000 Subject: [PATCH 16/30] Bump @types/node from 22.7.4 to 22.9.0 (#1587) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 22.7.4 to 22.9.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- agency-dashboard/package.json | 2 +- common/package.json | 2 +- publisher/package.json | 2 +- yarn.lock | 18 +++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/agency-dashboard/package.json b/agency-dashboard/package.json index df1302e7c..56fb02661 100644 --- a/agency-dashboard/package.json +++ b/agency-dashboard/package.json @@ -50,7 +50,7 @@ "@testing-library/react": "^13.4.0", "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", - "@types/node": "^22.7.4", + "@types/node": "^22.9.0", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", "@types/react-router-dom": "^5.3.3", diff --git a/common/package.json b/common/package.json index 5e41f3b7c..4bce3566d 100644 --- a/common/package.json +++ b/common/package.json @@ -14,7 +14,7 @@ "@testing-library/user-event": "^14.5.2", "@types/jest": "^29.5.14", "@types/lodash": "^4.17.13", - "@types/node": "^22.7.4", + "@types/node": "^22.9.0", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.0", "@types/styled-components": "^5.1.34", diff --git a/publisher/package.json b/publisher/package.json index a0ab00888..91231236d 100644 --- a/publisher/package.json +++ b/publisher/package.json @@ -75,7 +75,7 @@ "@types/jest": "^29.5.14", "@types/lodash": "^4.17.13", "@types/lodash.debounce": "^4.0.9", - "@types/node": "^22.7.4", + "@types/node": "^22.9.0", "@types/qs": "^6.9.16", "@types/reach__router": "^1.3.15", "@types/react": "^18.3.12", diff --git a/yarn.lock b/yarn.lock index d3eb73aaf..a9d7bfbcd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5785,12 +5785,12 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^22.7.4": - version "22.7.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-22.7.4.tgz#e35d6f48dca3255ce44256ddc05dee1c23353fcc" - integrity sha512-y+NPi1rFzDs1NdQHHToqeiX2TIS79SWEAw9GYhkkx8bD0ChpfqC+n2j5OXOCpzfojBEBt6DnEnnG9MY0zk1XLg== +"@types/node@*", "@types/node@^22.9.0": + version "22.9.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.9.0.tgz#b7f16e5c3384788542c72dc3d561a7ceae2c0365" + integrity sha512-vuyHg81vvWA1Z1ELfvLko2c8f34gyA0zaic0+Rllc5lbCnbSyuvb2Oxpm6TAUAC/2xZN3QGqxBNggD1nNR2AfQ== dependencies: - undici-types "~6.19.2" + undici-types "~6.19.8" "@types/node@^18.0.0": version "18.18.9" @@ -16451,10 +16451,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~6.19.2: - version "6.19.6" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.6.tgz#e218c3df0987f4c0e0008ca00d6b6472d9b89b36" - integrity sha512-e/vggGopEfTKSvj4ihnOLTsqhrKRN3LeO6qSN/GxohhuRv8qH9bNQ4B8W7e/vFL+0XTnmHPB4/kegunZGA4Org== +undici-types@~6.19.8: + version "6.19.8" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.19.8.tgz#35111c9d1437ab83a7cdc0abae2f26d88eda0a02" + integrity sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw== unfetch@^4.2.0: version "4.2.0" From 22635dc10ecf465ebbbb5ed2ccc5affa277e038d Mon Sep 17 00:00:00 2001 From: Ilya Date: Wed, 13 Nov 2024 15:48:04 +0400 Subject: [PATCH 17/30] [Publisher][Admin Panel] Fix create new users via secondary flow bugs (#1558) * Fix new user auto-add bug * Fix not adding more than one user bug * Implementing tests * test update * Revert testing changes --- common/components/Modal/Modal.tsx | 1 + .../AdminPanel/AgencyProvisioning.tsx | 17 +++++++++-------- .../AdminPanel/AgencyProvisioningOverview.tsx | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/common/components/Modal/Modal.tsx b/common/components/Modal/Modal.tsx index 205fbbd47..6c837bd9f 100644 --- a/common/components/Modal/Modal.tsx +++ b/common/components/Modal/Modal.tsx @@ -112,6 +112,7 @@ export function Modal({ {buttons?.map((button, index) => (