Skip to content

Commit

Permalink
Bump the ui group across 1 directory with 3 updates (#16952)
Browse files Browse the repository at this point in the history
* Bump the ui group across 1 directory with 3 updates

Bumps the ui group with 3 updates in the /frontend-react directory: [focus-trap-react](https://github.com/focus-trap/focus-trap-react), [react-toastify](https://github.com/fkhadra/react-toastify) and [react-error-boundary](https://github.com/bvaughn/react-error-boundary).


Updates `focus-trap-react` from 10.3.1 to 11.0.2
- [Release notes](https://github.com/focus-trap/focus-trap-react/releases)
- [Changelog](https://github.com/focus-trap/focus-trap-react/blob/master/CHANGELOG.md)
- [Commits](focus-trap/focus-trap-react@v10.3.1...v11.0.2)

Updates `react-toastify` from 10.0.6 to 11.0.2
- [Release notes](https://github.com/fkhadra/react-toastify/releases)
- [Commits](fkhadra/react-toastify@v10.0.6...v11.0.2)

Updates `react-error-boundary` from 4.1.2 to 5.0.0
- [Release notes](https://github.com/bvaughn/react-error-boundary/releases)
- [Commits](bvaughn/react-error-boundary@4.1.2...5.0.0)

---
updated-dependencies:
- dependency-name: focus-trap-react
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ui
- dependency-name: react-toastify
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: ui
- dependency-name: react-error-boundary
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: ui
...

Signed-off-by: dependabot[bot] <[email protected]>

* focus trap type fix, toastify css no longer manually loaded

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joseph Andersen <[email protected]>
  • Loading branch information
dependabot[bot] and jpandersen87 authored Jan 7, 2025
1 parent dd62868 commit ba46ef8
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 84 deletions.
10 changes: 3 additions & 7 deletions frontend-react/__mocks__/focus-trap-react.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
import type * as FocusTrapType from "focus-trap-react";
import { FocusTrapProps } from "focus-trap-react";
import React from "react";
import { vi } from "vitest";

const FocusTrap = (await vi.importActual("focus-trap-react"))
.default as React.ComponentType<FocusTrapType.Props>;
const FocusTrap = (await vi.importActual("focus-trap-react")).default as React.ComponentType<FocusTrapProps>;

/**
* Override displayCheck for testing. See: https://github.com/focus-trap/tabbable#testing-in-jsdom
*/
const FixedComponent = ({
focusTrapOptions,
...props
}: FocusTrapType.Props) => {
const FixedComponent = ({ focusTrapOptions, ...props }: FocusTrapProps) => {
const fixedOptions = { ...focusTrapOptions };
fixedOptions.tabbableOptions = {
...fixedOptions.tabbableOptions,
Expand Down
6 changes: 3 additions & 3 deletions frontend-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"date-fns-tz": "^3.2.0",
"dompurify": "^3.2.3",
"export-to-csv-fix-source-map": "^0.2.1",
"focus-trap-react": "^10.3.1",
"focus-trap-react": "^11.0.2",
"history": "^5.3.0",
"html-to-text": "^9.0.5",
"lodash": "^4.17.21",
Expand All @@ -35,7 +35,7 @@
"react-router": "^6.28.0",
"react-router-dom": "^6.28.0",
"react-scroll-sync": "^0.11.2",
"react-toastify": "^10.0.6",
"react-toastify": "^11.0.2",
"rehype-raw": "^7.0.0",
"rehype-slug": "^5.1.0",
"rest-hooks": "^6.1.7",
Expand Down Expand Up @@ -178,7 +178,7 @@
"patch-package": "^8.0.0",
"postcss": "^8.4.49",
"prettier": "^3.4.2",
"react-error-boundary": "^4.1.2",
"react-error-boundary": "^5.0.0",
"remark-frontmatter": "^5.0.0",
"remark-mdx-frontmatter": "^5.0.0",
"remark-mdx-toc": "^0.3.1",
Expand Down
58 changes: 11 additions & 47 deletions frontend-react/src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { Suspense, useCallback, useMemo } from "react";
import { HelmetProvider } from "react-helmet-async";
import {
createBrowserRouter,
RouteObject,
RouterProvider,
} from "react-router-dom";
import { createBrowserRouter, RouteObject, RouterProvider } from "react-router-dom";
import { CacheProvider, NetworkErrorBoundary } from "rest-hooks";

import AuthStateGate from "./AuthStateGate";
Expand All @@ -25,7 +21,6 @@ import { RSConsole } from "../../utils/rsConsole/rsConsole";
import { createTelemetryService } from "../../utils/TelemetryService/TelemetryService";
import { PERMISSIONS } from "../../utils/UsefulTypes";

import "react-toastify/dist/ReactToastify.css";
import RSErrorBoundary from "../RSErrorBoundary/RSErrorBoundary";

export interface AppProps {
Expand All @@ -48,10 +43,7 @@ function App({ config, routes }: AppProps) {
() => new RSConsole({ ai: aiReactPlugin, ...config.RSCONSOLE }),
[aiReactPlugin, config.RSCONSOLE],
);
const oktaAuth = useMemo(
() => new OktaAuth(config.OKTA_AUTH),
[config.OKTA_AUTH],
);
const oktaAuth = useMemo(() => new OktaAuth(config.OKTA_AUTH), [config.OKTA_AUTH]);
const router = useMemo(() => createBrowserRouter(routes), [routes]);

const Fallback = useCallback(() => <ErrorPage type="page" />, []);
Expand All @@ -67,25 +59,13 @@ function App({ config, routes }: AppProps) {
let url = originalUri;
if (originalUri === "/") {
/* PERMISSIONS REFACTOR: Redirect URL should be determined by active membership type */
if (
authState?.accessToken &&
permissionCheck(
PERMISSIONS.PRIME_ADMIN,
authState.accessToken,
)
) {
if (authState?.accessToken && permissionCheck(PERMISSIONS.PRIME_ADMIN, authState.accessToken)) {
url = "/admin/settings";
}
if (
authState?.accessToken &&
permissionCheck(PERMISSIONS.SENDER, authState.accessToken)
) {
if (authState?.accessToken && permissionCheck(PERMISSIONS.SENDER, authState.accessToken)) {
url = "/submissions";
}
if (
authState?.accessToken &&
permissionCheck(PERMISSIONS.RECEIVER, authState.accessToken)
) {
if (authState?.accessToken && permissionCheck(PERMISSIONS.RECEIVER, authState.accessToken)) {
url = "/daily-data";
}
}
Expand All @@ -101,36 +81,20 @@ function App({ config, routes }: AppProps) {
return (
<RSErrorBoundary rsConsole={rsConsole}>
<AppInsightsContext.Provider value={aiReactPlugin}>
<Security
restoreOriginalUri={restoreOriginalUri}
oktaAuth={oktaAuth}
>
<Security restoreOriginalUri={restoreOriginalUri} oktaAuth={oktaAuth}>
<AuthStateGate>
<QueryClientProvider client={appQueryClient}>
<SessionProvider
config={config}
rsConsole={rsConsole}
>
<SessionProvider config={config} rsConsole={rsConsole}>
<HelmetProvider>
<FeatureFlagProvider>
<NetworkErrorBoundary
fallbackComponent={Fallback}
>
<NetworkErrorBoundary fallbackComponent={Fallback}>
<CacheProvider>
<ToastProvider>
<DAPScript
pathname={
location.pathname
}
/>
<DAPScript pathname={location.pathname} />
<Suspense>
<RouterProvider
router={router}
/>
<RouterProvider router={router} />
</Suspense>
<ReactQueryDevtools
initialIsOpen={false}
/>
<ReactQueryDevtools initialIsOpen={false} />
</ToastProvider>
</CacheProvider>
</NetworkErrorBoundary>
Expand Down
55 changes: 28 additions & 27 deletions frontend-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4339,10 +4339,10 @@ __metadata:
languageName: node
linkType: hard

"clsx@npm:^2.1.0":
version: 2.1.0
resolution: "clsx@npm:2.1.0"
checksum: 43fefc29b6b49c9476fbce4f8b1cc75c27b67747738e598e6651dd40d63692135dc60b18fa1c5b78a2a9ba8ae6fd2055a068924b94e20b42039bd53b78b98e1d
"clsx@npm:^2.1.1":
version: 2.1.1
resolution: "clsx@npm:2.1.1"
checksum: acd3e1ab9d8a433ecb3cc2f6a05ab95fe50b4a3cfc5ba47abb6cbf3754585fcb87b84e90c822a1f256c4198e3b41c7f6c391577ffc8678ad587fc0976b24fd57
languageName: node
linkType: hard

Expand Down Expand Up @@ -6162,21 +6162,22 @@ __metadata:
languageName: node
linkType: hard

"focus-trap-react@npm:^10.3.1":
version: 10.3.1
resolution: "focus-trap-react@npm:10.3.1"
"focus-trap-react@npm:^11.0.2":
version: 11.0.2
resolution: "focus-trap-react@npm:11.0.2"
dependencies:
focus-trap: ^7.6.1
focus-trap: ^7.6.2
tabbable: ^6.2.0
peerDependencies:
prop-types: ^15.8.1
react: ">=16.3.0"
react-dom: ">=16.3.0"
checksum: 7992402b86a2ebada9232f36388fe7997e395365f1ca89927114caf84c53c546940c066b0a60417b01b4b366d97d0ac313d7c65ef69b74d188fc0863f850f480
"@types/react": ^18.0.0 || ^19.0.0
"@types/react-dom": ^18.0.0 || ^19.0.0
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
checksum: 992b6330101ff71abba01c0ea0c85104a0bbf3bf91f335ca004776e77c7d700d8f1e8a12425cb7a1bc8a041169c2b0d4c25c9ac0db5b5bdf8d17c21d66085ab8
languageName: node
linkType: hard

"focus-trap@npm:^7.6.1":
"focus-trap@npm:^7.6.2":
version: 7.6.2
resolution: "focus-trap@npm:7.6.2"
dependencies:
Expand Down Expand Up @@ -9781,14 +9782,14 @@ __metadata:
languageName: node
linkType: hard

"react-error-boundary@npm:^4.1.2":
version: 4.1.2
resolution: "react-error-boundary@npm:4.1.2"
"react-error-boundary@npm:^5.0.0":
version: 5.0.0
resolution: "react-error-boundary@npm:5.0.0"
dependencies:
"@babel/runtime": ^7.12.5
peerDependencies:
react: ">=16.13.1"
checksum: afe692f1bbbfb5998b49e1001d7682a3cbfdc623dca1318b408e738606f3450d925c28fbbfa5dc84d2cf285d17c2e7f079d59386a27da354dea9c902a935149b
checksum: 4fa78890bb254fe1f0ee1eed893ac161a27482c4567f7667ef83a8339432eb99e323ee69757f01f4864e0037b01a9b6822735ea122f02e749d0bf7a781d9ea53
languageName: node
linkType: hard

Expand Down Expand Up @@ -9876,7 +9877,7 @@ __metadata:
eslint-plugin-testing-library: ^7.1.1
eslint-plugin-vitest: ^0.5.4
export-to-csv-fix-source-map: ^0.2.1
focus-trap-react: ^10.3.1
focus-trap-react: ^11.0.2
globals: ^15.14.0
history: ^5.3.0
html-to-text: ^9.0.5
Expand All @@ -9894,7 +9895,7 @@ __metadata:
prettier: ^3.4.2
react: ^18.3.1
react-dom: ^18.3.1
react-error-boundary: ^4.1.2
react-error-boundary: ^5.0.0
react-helmet-async: ^2.0.5
react-idle-timer: ^5.7.2
react-loader-spinner: ^6.1.6
Expand All @@ -9903,7 +9904,7 @@ __metadata:
react-router: ^6.28.0
react-router-dom: ^6.28.0
react-scroll-sync: ^0.11.2
react-toastify: ^10.0.6
react-toastify: ^11.0.2
rehype-raw: ^7.0.0
rehype-slug: ^5.1.0
remark-frontmatter: ^5.0.0
Expand Down Expand Up @@ -10070,15 +10071,15 @@ __metadata:
languageName: node
linkType: hard

"react-toastify@npm:^10.0.6":
version: 10.0.6
resolution: "react-toastify@npm:10.0.6"
"react-toastify@npm:^11.0.2":
version: 11.0.2
resolution: "react-toastify@npm:11.0.2"
dependencies:
clsx: ^2.1.0
clsx: ^2.1.1
peerDependencies:
react: ">=18"
react-dom: ">=18"
checksum: 89fa24718eba0800e2bc1f88121a6e119efd87df26344d5b3c86442d4a13fbd65b67932e01bd6442758f4fe3f5eca6c8fc80c1dfb51c8dc2a4ec06bdaf9762da
react: ^18 || ^19
react-dom: ^18 || ^19
checksum: b951638b517e110f09a60f8164d759d29d480132832d574a57b5724ed6887ec728401f6fe9bf00d4a70ec5edb5a7871fc45f18ddeffdecf677b1dbbdddc55b2c
languageName: node
linkType: hard

Expand Down

0 comments on commit ba46ef8

Please sign in to comment.