Skip to content

Commit

Permalink
Merge pull request #16985 from CDCgov/deployment/2025-01-07
Browse files Browse the repository at this point in the history
Deployment of 2025-01-07
  • Loading branch information
jalbinson authored Jan 7, 2025
2 parents 22e26c1 + 554b405 commit 11fde0e
Show file tree
Hide file tree
Showing 36 changed files with 7,823 additions and 2,218 deletions.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,29 @@ updates:
time: "00:17"
timezone: "US/Eastern"
rebase-strategy: "disabled"
# Remove ignore entries when frontend is manually migrated for these libraries
ignore:
- dependency-name: "react"
update-types:
- version-update:semver-major
- dependency-name: "react-dom"
update-types:
- version-update:semver-major
- dependency-name: "@types/react"
update-types:
- version-update:semver-major
- dependency-name: "@types/react-dom"
update-types:
- version-update:semver-major
- dependency-name: "react-router"
update-types:
- version-update:semver-major
- dependency-name: "react-router-dom"
update-types:
- version-update:semver-major
- dependency-name: "undici"
update-types:
- version-update:semver-major
groups:
project:
patterns:
Expand Down
5 changes: 1 addition & 4 deletions frontend-react/.storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { initialize, mswLoader } from "msw-storybook-addon";
import { CacheProvider } from "rest-hooks";
import { HelmetProvider } from "react-helmet-async";
import MockDate from "mockdate";
Expand All @@ -25,8 +24,6 @@ export const parameters = {
},
};

initialize();

function withRestHooksCacheProvider(Story) {
return (
<CacheProvider>
Expand All @@ -45,4 +42,4 @@ function withHelmet(Story) {

export const decorators = [withHelmet, withRestHooksCacheProvider];

export const loaders = [mswLoader];
export const loaders = [];
45 changes: 22 additions & 23 deletions frontend-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"@okta/okta-react": "^6.9.0",
"@okta/okta-signin-widget": "^7.26.1",
"@rest-hooks/rest": "^3.0.3",
"@tanstack/react-query": "^5.62.2",
"@tanstack/react-query-devtools": "^5.62.2",
"@tanstack/react-query": "^5.62.11",
"@tanstack/react-query-devtools": "^5.62.11",
"@trussworks/react-uswds": "^9.1.0",
"@uswds/uswds": "3.7.1",
"axios": "^1.7.8",
"axios": "^1.7.9",
"classnames": "^2.5.1",
"date-fns": "^4.1.0",
"date-fns-tz": "^3.2.0",
Expand All @@ -24,22 +24,22 @@
"history": "^5.3.0",
"html-to-text": "^9.0.5",
"lodash": "^4.17.21",
"p-limit": "^6.1.0",
"p-limit": "^6.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet-async": "^2.0.5",
"react-idle-timer": "^5.7.2",
"react-loader-spinner": "^6.1.6",
"react-markdown": "^9.0.1",
"react-query-kit": "^3.3.1",
"react-router": "~6.28.0",
"react-router-dom": "~6.28.0",
"react-router": "^6.28.0",
"react-router-dom": "^6.28.0",
"react-scroll-sync": "^0.11.2",
"react-toastify": "^10.0.6",
"rehype-raw": "^7.0.0",
"rehype-slug": "^5.1.0",
"rest-hooks": "^6.1.7",
"sanitize-html": "^2.13.1",
"sanitize-html": "^2.14.0",
"tsx": "^4.19.2",
"use-deep-compare-effect": "^1.8.1",
"uuid": "^11.0.3",
Expand Down Expand Up @@ -130,7 +130,7 @@
"@storybook/theming": "^8.4.7",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.0.1",
"@testing-library/react": "^16.1.0",
"@testing-library/user-event": "^14.5.2",
"@types/dompurify": "^3.2.0",
"@types/dotenv-flow": "^3.3.3",
Expand All @@ -140,7 +140,7 @@
"@types/lodash": "^4.17.13",
"@types/mdx": "^2.0.13",
"@types/node": "^20.12.5",
"@types/react": "18.3.11",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@types/react-scroll-sync": "^0.9.0",
Expand All @@ -154,26 +154,25 @@
"chromatic": "^11.20.2",
"cross-env": "^7.0.3",
"dotenv-flow": "^4.1.0",
"eslint": "9.17.0",
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-import-resolver-typescript": "^3.7.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest-dom": "^5.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-playwright": "^2.1.0",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"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-testing-library": "^7.1.1",
"eslint-plugin-vitest": "^0.5.4",
"globals": "^15.13.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"jsdom": "^25.0.1",
"lint-staged": "^15.2.11",
"lint-staged": "^15.3.0",
"mockdate": "^3.0.5",
"msw": "^2.6.8",
"msw-storybook-addon": "^2.0.4",
"msw": "^2.7.0",
"npm-run-all": "^4.1.5",
"otpauth": "^9.3.6",
"patch-package": "^8.0.0",
Expand All @@ -183,21 +182,21 @@
"remark-frontmatter": "^5.0.0",
"remark-mdx-frontmatter": "^5.0.0",
"remark-mdx-toc": "^0.3.1",
"sass": "^1.81.0",
"sass": "^1.83.0",
"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.16.0",
"undici": "~6.20.1",
"vite": "^6.0.3",
"typescript-eslint": "^8.19.0",
"undici": "^6.20.1",
"vite": "^6.0.6",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-svgr": "^4.3.0",
"vitest": "^2.1.8"
},
"resolutions": {
"@types/react": "18.3.11",
"@types/react": "^18.3.11",
"@okta/okta-auth-js": ">=7.8.1",
"cookie": ">=0.7.0",
"send": ">=0.19.0"
Expand Down
37 changes: 8 additions & 29 deletions frontend-react/src/contexts/Toast/index.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
import {
createContext,
PropsWithChildren,
ReactNode,
useCallback,
useContext,
useMemo,
} from "react";
import { createContext, PropsWithChildren, ReactNode, useCallback, useContext, useMemo } from "react";
import { toast } from "react-toastify";

import useSessionContext from "../Session/useSessionContext";

export interface ToastCtx {
toast: (
msgOrErr: Error | ReactNode,
type: "success" | "warning" | "error" | "info",
) => void;
toast: (msgOrErr: Error | ReactNode, type: "success" | "warning" | "error" | "info") => void;
}

export const ToastContext = createContext<ToastCtx>({ toast: () => void 0 });

export const showToast = (
message: ReactNode,
type: "success" | "warning" | "error" | "info",
) => {
const toastId = `id_${message?.toString()}`
.replace(/\W/gi, "_")
.substring(0, 512);
export const showToast = (message: ReactNode, type: "success" | "warning" | "error" | "info") => {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
const toastId = `id_${message?.toString()}`.replace(/\W/gi, "_").substring(0, 512);
const msg = message instanceof Error ? message.message : message;

// basically the USWDS Alert UI
Expand All @@ -34,9 +20,7 @@ export const showToast = (
className={`usa-alert usa-alert--slim usa-alert--no-icon usa-alert--${type} rs-alert-toast`}
data-testid="alerttoast"
>
<div className="usa-alert__body">
{msg && <h2 className="usa-alert__heading">{msg}</h2>}
</div>
<div className="usa-alert__body">{msg && <h2 className="usa-alert__heading">{msg}</h2>}</div>
</div>,
{
toastId,
Expand All @@ -55,10 +39,7 @@ export const useToast = () => useContext(ToastContext);
function ToastProvider({ children }: PropsWithChildren) {
const { rsConsole } = useSessionContext();
const fn = useCallback(
(
msgOrErr: Error | ReactNode,
type: "success" | "warning" | "error" | "info",
) => {
(msgOrErr: Error | ReactNode, type: "success" | "warning" | "error" | "info") => {
let message: ReactNode;
if (msgOrErr instanceof Error) {
message = msgOrErr.message;
Expand Down Expand Up @@ -88,9 +69,7 @@ function ToastProvider({ children }: PropsWithChildren) {
[fn],
);

return (
<ToastContext.Provider value={ctx}>{children}</ToastContext.Provider>
);
return <ToastContext.Provider value={ctx}>{children}</ToastContext.Provider>;
}

export default ToastProvider;
Loading

0 comments on commit 11fde0e

Please sign in to comment.