diff --git a/services/ui-src/src/components/app/App.tsx b/services/ui-src/src/components/app/App.tsx index df2836fb..0b0173d9 100644 --- a/services/ui-src/src/components/app/App.tsx +++ b/services/ui-src/src/components/app/App.tsx @@ -1,13 +1,6 @@ -import { useLocation, Routes, Route } from "react-router-dom"; -import { - LoginCognito, - LoginIDM, - PostLogoutRedirect, -} from "components"; -import { - UserContext, - useStore, -} from "utils"; +import { Routes, Route } from "react-router-dom"; +import { LoginCognito, LoginIDM, PostLogoutRedirect } from "components"; +import { useStore } from "utils"; import { makeMediaQueryClasses } from "utils/other/useBreakpoint"; import { Container, Divider, Heading, Stack } from "@chakra-ui/react"; @@ -15,23 +8,23 @@ export const App = () => { const mqClasses = makeMediaQueryClasses(); // const context = useContext(UserContext); const { user, showLocalLogins } = useStore(); - const { pathname } = useLocation(); + // const { pathname } = useLocation(); // TODO: fire tealium page view on route change - // useEffect(() => { - // fireTealiumPageView( - // user, - // window.location.href, - // pathname, - // isApparentReportPage(pathname) - // ); - // }, [key]); + /* + * useEffect(() => { + * fireTealiumPageView( + * user, + * window.location.href, + * pathname, + * isApparentReportPage(pathname) + * ); + * }, [key]); + */ const authenticatedRoutes = ( <> - {user && ( -

Hello World

- )} + {user &&

Hello World

} {!user && showLocalLogins && (
diff --git a/services/ui-src/src/components/index.ts b/services/ui-src/src/components/index.ts index 02b1357c..2c48b2df 100644 --- a/services/ui-src/src/components/index.ts +++ b/services/ui-src/src/components/index.ts @@ -1,4 +1,3 @@ - // alerts export { Alert } from "./alerts/Alert"; export { ErrorAlert } from "./alerts/ErrorAlert"; @@ -11,4 +10,4 @@ export { LoginIDM } from "./logins/LoginIDM"; // layout export { PageTemplate } from "./layout/PageTemplate"; // Redirects -export { PostLogoutRedirect } from "./PostLogoutRedirect/index"; \ No newline at end of file +export { PostLogoutRedirect } from "./PostLogoutRedirect/index"; diff --git a/services/ui-src/src/types/index.ts b/services/ui-src/src/types/index.ts index 900923f6..39b6426f 100644 --- a/services/ui-src/src/types/index.ts +++ b/services/ui-src/src/types/index.ts @@ -1,3 +1,3 @@ export * from "./users"; export * from "./states"; -export * from "./other"; \ No newline at end of file +export * from "./other"; diff --git a/services/ui-src/src/types/other.ts b/services/ui-src/src/types/other.ts index 2d6f77ab..7612cef3 100644 --- a/services/ui-src/src/types/other.ts +++ b/services/ui-src/src/types/other.ts @@ -1,23 +1,23 @@ // ALERTS export enum AlertTypes { - ERROR = "error", - INFO = "info", - SUCCESS = "success", - WARNING = "warning", - } - + ERROR = "error", + INFO = "info", + SUCCESS = "success", + WARNING = "warning", +} + // OTHER export interface CustomHtmlElement { - type: string; - content: string | any; - as?: string; - props?: {[key: string]: any}; - children?: CustomHtmlElement[]; - } + type: string; + content: string | any; + as?: string; + props?: { [key: string]: any }; + children?: CustomHtmlElement[]; +} export interface ErrorVerbiage { - title: string; - description: string | CustomHtmlElement[]; + title: string; + description: string | CustomHtmlElement[]; } diff --git a/services/ui-src/src/types/states.ts b/services/ui-src/src/types/states.ts index a395d9ff..4b208218 100644 --- a/services/ui-src/src/types/states.ts +++ b/services/ui-src/src/types/states.ts @@ -1,6 +1,4 @@ -import { - HcbsUser, -} from "types"; +import { HcbsUser } from "types"; // initial user state export interface HcbsUserState { @@ -10,4 +8,4 @@ export interface HcbsUserState { // ACTIONS setUser: (newUser?: HcbsUser) => void; setShowLocalLogins: (showLocalLogins: boolean) => void; -} \ No newline at end of file +} diff --git a/services/ui-src/src/utils/auth/userProvider.test.tsx b/services/ui-src/src/utils/auth/userProvider.test.tsx index 148fd1d3..2dd27e62 100644 --- a/services/ui-src/src/utils/auth/userProvider.test.tsx +++ b/services/ui-src/src/utils/auth/userProvider.test.tsx @@ -112,8 +112,7 @@ describe("", () => { describe("Test UserProvider", () => { beforeEach(async () => { await act(async () => { - mockedUseStore - .mockReturnValue(mockStateUserStore); + mockedUseStore.mockReturnValue(mockStateUserStore); render(testComponent); }); }); diff --git a/services/ui-src/src/utils/index.ts b/services/ui-src/src/utils/index.ts index 3c36e59e..26e46443 100644 --- a/services/ui-src/src/utils/index.ts +++ b/services/ui-src/src/utils/index.ts @@ -8,4 +8,4 @@ export * from "./state/useStore"; // tracking export * from "./tracking/tealium"; //other -export * from "./other/parsing" \ No newline at end of file +export * from "./other/parsing"; diff --git a/services/ui-src/src/utils/state/useStore.ts b/services/ui-src/src/utils/state/useStore.ts index 181cd9bf..51a248c4 100644 --- a/services/ui-src/src/utils/state/useStore.ts +++ b/services/ui-src/src/utils/state/useStore.ts @@ -1,9 +1,6 @@ import { create } from "zustand"; import { devtools, persist } from "zustand/middleware"; -import { - HcbsUserState, - HcbsUser, -} from "types"; +import { HcbsUserState, HcbsUser } from "types"; // USER STORE const userStore = (set: Function) => ({ @@ -19,18 +16,15 @@ const userStore = (set: Function) => ({ set(() => ({ showLocalLogins: true }), false, { type: "showLocalLogins" }), }); - export const useStore = create( // devtools is being used for debugging state persist( - devtools( - (set) => ({ - ...userStore(set), - }) - ), + devtools((set) => ({ + ...userStore(set), + })), { name: "hcbs-store", - partialize: (state) => ({}), + partialize: () => ({}), } ) ); diff --git a/services/ui-src/src/utils/testing/setupJest.tsx b/services/ui-src/src/utils/testing/setupJest.tsx index 63bf9168..ce8bb8b3 100644 --- a/services/ui-src/src/utils/testing/setupJest.tsx +++ b/services/ui-src/src/utils/testing/setupJest.tsx @@ -3,11 +3,7 @@ import { BrowserRouter as Router } from "react-router-dom"; import "@testing-library/jest-dom"; import "jest-axe/extend-expect"; import { mockFlags, resetLDMocks } from "jest-launchdarkly-mock"; -import { - UserRoles, - HcbsUserState, - UserContextShape, -} from "types"; +import { UserRoles, HcbsUserState, UserContextShape } from "types"; // GLOBALS global.React = React; @@ -154,12 +150,10 @@ export const mockUseStore: HcbsUserState = { ...mockStateUserStore, }; -export const mockUseAdminStore: HcbsUserState = -{ - ...mockAdminUserStore +export const mockUseAdminStore: HcbsUserState = { + ...mockAdminUserStore, }; - // ROUTER export const RouterWrappedComponent: React.FC = ({ children }) => ( diff --git a/services/ui-src/src/verbiage/errors.ts b/services/ui-src/src/verbiage/errors.ts index a684cb04..37ffe776 100644 --- a/services/ui-src/src/verbiage/errors.ts +++ b/services/ui-src/src/verbiage/errors.ts @@ -18,4 +18,4 @@ export const genericErrorContent = [ type: "span", content: ".", }, -]; \ No newline at end of file +];