diff --git a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png index 6cd06f92d..18b46fd6e 100644 Binary files a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png and b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png index f7d5a5814..bce61cfaf 100644 Binary files a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png and b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-form-errors-based-on-user-input-2-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-1-chromium-darwin.png b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-1-chromium-darwin.png index 4a4b6955a..62cdbad43 100644 Binary files a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-1-chromium-darwin.png and b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-1-chromium-darwin.png differ diff --git a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-2-chromium-darwin.png b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-2-chromium-darwin.png index 3f9e11acb..6033f07e9 100644 Binary files a/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-2-chromium-darwin.png and b/e2e/pages/filing-app/complete-user-profile/checkCupFormErrors.spec.ts-snapshots/Complete-the-User-Profile-Checking-for-input-length-restriction-2-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/Navigation.spec.ts b/e2e/pages/shared-lending-platform/Navigation.spec.ts index fe08ffed9..1ad6a3b91 100644 --- a/e2e/pages/shared-lending-platform/Navigation.spec.ts +++ b/e2e/pages/shared-lending-platform/Navigation.spec.ts @@ -170,7 +170,7 @@ test('Navigation', async ({ page, navigateToFilingHome }) => { .getByRole('link', { name: 'Diversity & Inclusion' }) .click(); await expect(page.locator('h1')).toContainText( - 'Diversity and inclusion at the Bureau', + 'Office of Minority and Women Inclusion at the Bureau', ); await page.goBack(); diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png index e282fefa3..cba56e21e 100644 Binary files a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png index 983a53178..deffe8df0 100644 Binary files a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile----No-Associations----process-2-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png index 5960d89ae..1ac4f005e 100644 Binary files a/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png and b/e2e/pages/shared-lending-platform/NonAssociatedUserProfile.spec.ts-snapshots/Complete-User-Profile-with-Bad-Unicode----No-Associations----process-1-chromium-darwin.png differ diff --git a/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png index 80ffa9b85..cfd8bf47e 100644 Binary files a/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png and b/e2e/pages/shared-lending-platform/unauthenticated-homepage/DeniedDomain.spec.ts-snapshots/Unauthenticated-homepage-Registering-with-an-invalid-email-domain-1-chromium-darwin.png differ diff --git a/src/App.tsx b/src/App.tsx index cee95d315..4571a3ce2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,9 +2,7 @@ import { useQuery } from '@tanstack/react-query'; import { MarkdownText } from 'MarkdownTest'; import { fetchUserProfile } from 'api/requests'; import useSblAuth from 'api/useSblAuth'; -import classNames from 'classnames'; import FooterCfGovWrapper from 'components/FooterCfGovWrapper'; -import { Link } from 'components/Link'; import { LoadingApp, LoadingContent } from 'components/Loading'; import ScrollToTop from 'components/ScrollToTop'; import { Alert, PageHeader, SkipNav } from 'design-system-react'; @@ -75,44 +73,6 @@ if (import.meta.env.DEV) { } if (!isRoutingEnabled) console.warn('Routing is disabled!'); -/** - * Determine if the current provided URL (href) is the current page - * @param href string - * @returns string - */ -const deriveClassname = (href: string): string => { - let cname = 'nav-item'; - const pattern = `${href}$`; - - const regex = new RegExp(pattern); - if (regex.test(window.location.href)) { - cname += ' selected'; - } - - return cname; -}; - -interface NavItemProperties { - className: string; - href: string; - label: string; -} - -export function NavItem({ - href, - label, - className, -}: NavItemProperties): JSX.Element { - return ( - - {label} - - ); -} - function BasicLayout(): ReactElement { const headerLinks = [...useHeaderAuthLinks()]; const location = useLocation(); diff --git a/src/components/Link.utils.tsx b/src/components/Link.utils.tsx index adda77d6a..0753c7015 100644 --- a/src/components/Link.utils.tsx +++ b/src/components/Link.utils.tsx @@ -29,12 +29,16 @@ export const isExternalLinkImplied = (targetUrl: string): boolean => { const internalProtocols = ['mailto:']; if (internalProtocols.includes(parsed.protocol)) return false; - // Any subdomain of consumerfinance.gov or the current host - const isInternalDomain = new RegExp( - `([\\S]*\\.)?(consumerfinance\\.gov|${window.location.host})`, - ).test(parsed.host); + // [Internal] Any subdomain of consumerfinance.gov or the current host + const internalHosts = [ + 'www.consumerfinance.gov', + 'sblhelp.consumerfinance.gov', + window.location.host, + ]; + + const isExternal = !internalHosts.includes(parsed.host); - return !isInternalDomain; + return isExternal; }; // External link icon w/ spacing diff --git a/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx b/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx index a4cbec41a..70dd27ad1 100644 --- a/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx +++ b/src/pages/Filing/FilingApp/FilingSteps.helpers.tsx @@ -6,9 +6,7 @@ import { FilingStatusAsNumber } from 'types/filingTypes'; // Does the current browser URL correspond to this Step? const isStepCurrent = (stepPath: string): boolean => { const { pathname } = window.location; - const matcher = new RegExp(stepPath); - if (matcher.test(pathname)) return true; - return false; + return pathname.includes(stepPath); }; const getUploadStatus = (