Skip to content

Commit

Permalink
Merge pull request #17026 from CDCgov/deployment/2025-01-09
Browse files Browse the repository at this point in the history
Deployment of 2025-01-09
jalbinson authored Jan 9, 2025
2 parents 11fde0e + aeb20c7 commit b02c5da
Showing 30 changed files with 456 additions and 902 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,
26 changes: 13 additions & 13 deletions frontend-react/package.json
Original file line number Diff line number Diff line change
@@ -8,10 +8,10 @@
"@microsoft/applicationinsights-react-js": "^17.3.4",
"@microsoft/applicationinsights-web": "^3.3.4",
"@okta/okta-react": "^6.9.0",
"@okta/okta-signin-widget": "^7.26.1",
"@okta/okta-signin-widget": "^7.27.1",
"@rest-hooks/rest": "^3.0.3",
"@tanstack/react-query": "^5.62.11",
"@tanstack/react-query-devtools": "^5.62.11",
"@tanstack/react-query": "^5.62.16",
"@tanstack/react-query-devtools": "^5.62.16",
"@trussworks/react-uswds": "^9.1.0",
"@uswds/uswds": "3.7.1",
"axios": "^1.7.9",
@@ -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",
@@ -30,19 +30,19 @@
"react-helmet-async": "^2.0.5",
"react-idle-timer": "^5.7.2",
"react-loader-spinner": "^6.1.6",
"react-markdown": "^9.0.1",
"react-markdown": "^9.0.3",
"react-query-kit": "^3.3.1",
"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",
"sanitize-html": "^2.14.0",
"tsx": "^4.19.2",
"use-deep-compare-effect": "^1.8.1",
"uuid": "^11.0.3",
"uuid": "^11.0.4",
"web-vitals": "^3.4.0"
},
"scripts": {
@@ -137,7 +137,7 @@
"@types/eslint__js": "^8.42.3",
"@types/github-slugger": "^2.0.0",
"@types/html-to-text": "^9.0.4",
"@types/lodash": "^4.17.13",
"@types/lodash": "^4.17.14",
"@types/mdx": "^2.0.13",
"@types/node": "^20.12.5",
"@types/react": "^18.3.11",
@@ -151,7 +151,7 @@
"autoprefixer": "^10.4.20",
"browserslist": "^4.24.3",
"browserslist-useragent-regexp": "^4.1.3",
"chromatic": "^11.20.2",
"chromatic": "^11.22.0",
"cross-env": "^7.0.3",
"dotenv-flow": "^4.1.0",
"eslint": "^9.17.0",
@@ -164,7 +164,7 @@
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.16",
"eslint-plugin-storybook": "^0.11.1",
"eslint-plugin-storybook": "^0.11.2",
"eslint-plugin-testing-library": "^7.1.1",
"eslint-plugin-vitest": "^0.5.4",
"globals": "^15.14.0",
@@ -178,19 +178,19 @@
"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",
"sass": "^1.83.0",
"sass": "^1.83.1",
"storybook": "^8.4.7",
"storybook-addon-remix-react-router": "^3.0.2",
"ts-node": "^10.9.2",
"tslib": "^2.8.1",
"typescript": "^5.7.2",
"typescript-eslint": "^8.19.0",
"undici": "^6.20.1",
"vite": "^6.0.6",
"vite": "^6.0.7",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-svgr": "^4.3.0",
"vitest": "^2.1.8"
58 changes: 11 additions & 47 deletions frontend-react/src/components/App/App.tsx
Original file line number Diff line number Diff line change
@@ -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";
@@ -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 {
@@ -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" />, []);
@@ -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";
}
}
@@ -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>
Loading

0 comments on commit b02c5da

Please sign in to comment.