From f76118ced9fb7d2f0431d00719bdeecb0a4313a5 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Wed, 4 Dec 2024 12:30:28 -0500 Subject: [PATCH 01/11] upgrade route setup --- package.json | 6 +++- .../app-entry.jsx | 6 ++-- .../package.json | 8 +++++ .../routes.jsx | 34 ++++++++++++------- 4 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 src/applications/accredited-representative-portal/package.json diff --git a/package.json b/package.json index c80839407e78..1451927ceb42 100644 --- a/package.json +++ b/package.json @@ -397,9 +397,13 @@ "src/platform/mhv", "src/applications/check-in", "src/applications/vaos", - "src/applications/claims-status" + "src/applications/claims-status", + "src/applications/accredited-representative-portal/accreditation/21a", + "src/applications/accredited-representative-portal" + ], "nohoist": [ + "**/applications-accredited-representative-portal/react-router-dom", "**/applications-check-in/i18next-resources-to-backend", "**/applications-check-in/react-i18next", "**/applications-claims-status/@department-of-veterans-affairs/component-library", diff --git a/src/applications/accredited-representative-portal/app-entry.jsx b/src/applications/accredited-representative-portal/app-entry.jsx index f8f89b644be2..e62adbd14707 100644 --- a/src/applications/accredited-representative-portal/app-entry.jsx +++ b/src/applications/accredited-representative-portal/app-entry.jsx @@ -2,7 +2,7 @@ import '@department-of-veterans-affairs/platform-polyfills'; import React from 'react'; import { Provider } from 'react-redux'; -import { BrowserRouter } from 'react-router-dom-v5-compat'; +import { RouterProvider } from 'react-router-dom'; import startReactApp from '@department-of-veterans-affairs/platform-startup/react'; import { connectFeatureToggle } from 'platform/utilities/feature-toggles'; @@ -11,7 +11,7 @@ import './sass/accredited-representative-portal.scss'; import './sass/POARequestsTable.scss'; import manifest from './manifest.json'; -import routes from './routes'; +import router from './routes'; import createReduxStore from './store'; import rootReducer from './reducers'; @@ -21,6 +21,6 @@ connectFeatureToggle(store.dispatch); startReactApp( - {routes} + , ); diff --git a/src/applications/accredited-representative-portal/package.json b/src/applications/accredited-representative-portal/package.json new file mode 100644 index 000000000000..4c1e7a758be8 --- /dev/null +++ b/src/applications/accredited-representative-portal/package.json @@ -0,0 +1,8 @@ +{ + "name": "@department-of-veterans-affairs/applications-accredited-representative-portal", + "version": "1.0.0", + "private": true, + "dependencies": { + "react-router-dom": "^6.28.0" + } +} diff --git a/src/applications/accredited-representative-portal/routes.jsx b/src/applications/accredited-representative-portal/routes.jsx index 56b4f1bdfc1d..ee58512b1ec0 100644 --- a/src/applications/accredited-representative-portal/routes.jsx +++ b/src/applications/accredited-representative-portal/routes.jsx @@ -1,20 +1,30 @@ import React from 'react'; -import { Route, Routes } from 'react-router-dom-v5-compat'; +import { createBrowserRouter } from 'react-router-dom'; import App from './containers/App'; import LandingPage from './containers/LandingPage'; import POARequestsPage from './containers/POARequestsPage'; import SignedInLayoutWrapper from './containers/SignedInLayoutWrapper'; -const routes = ( - - }> - } /> - }> - } /> - - - -); +const router = createBrowserRouter([ + { + element: , + children: [ + { + index: true, + element: , + }, + { + element: , + children: [ + { + path: 'poa-requests', + element: , + }, + ], + }, + ], + }, +]); -export default routes; +export default router; From 6ff5117cf59191054e094da3c3736effd7f4e53f Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Wed, 4 Dec 2024 13:12:28 -0500 Subject: [PATCH 02/11] fixing merge issue --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 3f6d3af44487..62bde2460277 100644 --- a/package.json +++ b/package.json @@ -404,6 +404,7 @@ ], "nohoist": [ + "**/applications/accredited-representative-portal/accreditation/21a/react-router", "**/applications-accredited-representative-portal/react-router-dom", "**/applications-check-in/i18next-resources-to-backend", "**/applications-check-in/react-i18next", From 203a89da1867ac347865f5573a891e16563728e9 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Thu, 5 Dec 2024 12:53:25 -0500 Subject: [PATCH 03/11] setting path --- src/applications/accredited-representative-portal/routes.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/applications/accredited-representative-portal/routes.jsx b/src/applications/accredited-representative-portal/routes.jsx index ee58512b1ec0..6c5f9a2711b0 100644 --- a/src/applications/accredited-representative-portal/routes.jsx +++ b/src/applications/accredited-representative-portal/routes.jsx @@ -8,6 +8,7 @@ import SignedInLayoutWrapper from './containers/SignedInLayoutWrapper'; const router = createBrowserRouter([ { + path: '/representative', element: , children: [ { From 20b073532f9c9261595382173906c9013ea9118e Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Thu, 5 Dec 2024 14:29:10 -0500 Subject: [PATCH 04/11] getting rid of v5 compatible stuff --- .../components/LandingPageWelcome/LandingPageWelcome.jsx | 2 +- .../components/POARequestsCard/POARequestsCard.jsx | 2 +- .../components/common/Breadcrumbs.jsx | 2 +- .../accredited-representative-portal/containers/App.jsx | 2 +- .../containers/SignedInLayout.jsx | 2 +- .../tests/unit/helpers/index.jsx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx index e8f8620dcdcd..8b03cbb809d5 100644 --- a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx +++ b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Link } from 'react-router-dom-v5-compat'; +import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; const LandingPageWelcome = ({ firstName = '', children }) => ( diff --git a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx index 60bb956c4a7d..43df18de8eda 100644 --- a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx +++ b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Link } from 'react-router-dom-v5-compat'; +import { Link } from 'react-router-dom'; import { formatDateParsedZoneLong, timeFromNow, diff --git a/src/applications/accredited-representative-portal/components/common/Breadcrumbs.jsx b/src/applications/accredited-representative-portal/components/common/Breadcrumbs.jsx index 3d91c213f51f..194f16a698f9 100644 --- a/src/applications/accredited-representative-portal/components/common/Breadcrumbs.jsx +++ b/src/applications/accredited-representative-portal/components/common/Breadcrumbs.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { useLocation } from 'react-router-dom-v5-compat'; +import { useLocation } from 'react-router-dom'; import upperFirst from 'lodash/upperFirst'; import lowerCase from 'lodash/lowerCase'; diff --git a/src/applications/accredited-representative-portal/containers/App.jsx b/src/applications/accredited-representative-portal/containers/App.jsx index c4b8cbc249df..d7ef04d313f7 100644 --- a/src/applications/accredited-representative-portal/containers/App.jsx +++ b/src/applications/accredited-representative-portal/containers/App.jsx @@ -1,6 +1,6 @@ import React, { useEffect } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import { Outlet } from 'react-router-dom-v5-compat'; +import { Outlet } from 'react-router'; import { VaLoadingIndicator } from '@department-of-veterans-affairs/component-library/dist/react-bindings'; import environment from '@department-of-veterans-affairs/platform-utilities/environment'; diff --git a/src/applications/accredited-representative-portal/containers/SignedInLayout.jsx b/src/applications/accredited-representative-portal/containers/SignedInLayout.jsx index 7022b74b9796..0276d4aa7033 100644 --- a/src/applications/accredited-representative-portal/containers/SignedInLayout.jsx +++ b/src/applications/accredited-representative-portal/containers/SignedInLayout.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { Outlet } from 'react-router-dom-v5-compat'; +import { Outlet } from 'react-router-dom'; import { VaLoadingIndicator } from '@department-of-veterans-affairs/component-library/dist/react-bindings'; diff --git a/src/applications/accredited-representative-portal/tests/unit/helpers/index.jsx b/src/applications/accredited-representative-portal/tests/unit/helpers/index.jsx index ee5863be336f..1c5af1f09e7d 100644 --- a/src/applications/accredited-representative-portal/tests/unit/helpers/index.jsx +++ b/src/applications/accredited-representative-portal/tests/unit/helpers/index.jsx @@ -1,6 +1,6 @@ import React from 'react'; import { Provider } from 'react-redux'; -import { MemoryRouter } from 'react-router-dom-v5-compat'; +import { MemoryRouter } from 'react-router-dom'; import { render } from '@testing-library/react'; import createReduxStore from '../../../store'; From 6ac162e385d84d665c5e894fafb4ff204d24675d Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Fri, 6 Dec 2024 10:49:15 -0500 Subject: [PATCH 05/11] link behavior --- .../components/LandingPageWelcome/LandingPageWelcome.jsx | 2 +- .../components/POARequestsCard/POARequestsCard.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx index 8b03cbb809d5..d3d8a38a4de5 100644 --- a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx +++ b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx @@ -28,7 +28,7 @@ const LandingPageWelcome = ({ firstName = '', children }) => (

Until sign in is added use this to simulate sign in diff --git a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx index 43df18de8eda..9ccc84807106 100644 --- a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx +++ b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx @@ -50,7 +50,7 @@ const POARequestsCard = ({ poaRequests }) => { > {poaRequest.status} - + View details for

Date: Fri, 6 Dec 2024 11:30:05 -0500 Subject: [PATCH 06/11] routes file improve --- .../routes.jsx | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/src/applications/accredited-representative-portal/routes.jsx b/src/applications/accredited-representative-portal/routes.jsx index 6c5f9a2711b0..1a39f82e34bc 100644 --- a/src/applications/accredited-representative-portal/routes.jsx +++ b/src/applications/accredited-representative-portal/routes.jsx @@ -6,26 +6,30 @@ import LandingPage from './containers/LandingPage'; import POARequestsPage from './containers/POARequestsPage'; import SignedInLayoutWrapper from './containers/SignedInLayoutWrapper'; -const router = createBrowserRouter([ +const router = createBrowserRouter( + [ + { + element: , + children: [ + { + index: true, + element: , + }, + { + element: , + children: [ + { + path: 'poa-requests', + element: , + }, + ], + }, + ], + }, + ], { - path: '/representative', - element: , - children: [ - { - index: true, - element: , - }, - { - element: , - children: [ - { - path: 'poa-requests', - element: , - }, - ], - }, - ], + basename: '/representative', }, -]); +); export default router; From 2df09f1d2cd56483745b84dfac2bf45b41a5999a Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Fri, 6 Dec 2024 11:35:27 -0500 Subject: [PATCH 07/11] Revert "link behavior" This reverts commit 6ac162e385d84d665c5e894fafb4ff204d24675d. --- .../components/LandingPageWelcome/LandingPageWelcome.jsx | 2 +- .../components/POARequestsCard/POARequestsCard.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx index d3d8a38a4de5..8b03cbb809d5 100644 --- a/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx +++ b/src/applications/accredited-representative-portal/components/LandingPageWelcome/LandingPageWelcome.jsx @@ -28,7 +28,7 @@ const LandingPageWelcome = ({ firstName = '', children }) => (

Until sign in is added use this to simulate sign in diff --git a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx index 9ccc84807106..43df18de8eda 100644 --- a/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx +++ b/src/applications/accredited-representative-portal/components/POARequestsCard/POARequestsCard.jsx @@ -50,7 +50,7 @@ const POARequestsCard = ({ poaRequests }) => { > {poaRequest.status} - + View details for

Date: Fri, 6 Dec 2024 13:09:46 -0500 Subject: [PATCH 08/11] remove bad nooist entry --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 62bde2460277..3f6d3af44487 100644 --- a/package.json +++ b/package.json @@ -404,7 +404,6 @@ ], "nohoist": [ - "**/applications/accredited-representative-portal/accreditation/21a/react-router", "**/applications-accredited-representative-portal/react-router-dom", "**/applications-check-in/i18next-resources-to-backend", "**/applications-check-in/react-i18next", From 76c052d50ed7dedaba68b5b7a18bec7c56956594 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Fri, 6 Dec 2024 13:43:50 -0500 Subject: [PATCH 09/11] fixing details page for upgrade --- .../containers/POARequestDetailsPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/accredited-representative-portal/containers/POARequestDetailsPage.jsx b/src/applications/accredited-representative-portal/containers/POARequestDetailsPage.jsx index c9127c5856b8..8beb6fb07360 100644 --- a/src/applications/accredited-representative-portal/containers/POARequestDetailsPage.jsx +++ b/src/applications/accredited-representative-portal/containers/POARequestDetailsPage.jsx @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; -import { useParams, Link } from 'react-router-dom-v5-compat'; +import { useParams, Link } from 'react-router-dom'; import { formatDateShort } from 'platform/utilities/date/index'; import usePOARequests from '../hooks/usePOARequests'; From fdca8c0121a737632d001cc785d5ab6657a8cd37 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Fri, 6 Dec 2024 14:34:01 -0500 Subject: [PATCH 10/11] nohoist for 21a --- package.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package.json b/package.json index 38226f870d0b..a705b61a1849 100644 --- a/package.json +++ b/package.json @@ -404,6 +404,8 @@ ], "nohoist": [ + "**/applications-accredited-representative-portal/accreditation/21a/react-router", + "**/applications-accredited-representative-portal/accreditation/21a/history", "**/applications-accredited-representative-portal/react-router-dom", "**/applications-check-in/i18next-resources-to-backend", "**/applications-check-in/react-i18next", From 79df8b1a4ef36f96183d7cfc6814de09d7bf33a2 Mon Sep 17 00:00:00 2001 From: Kevin Beddingfield Date: Fri, 6 Dec 2024 18:20:08 -0500 Subject: [PATCH 11/11] extra line break --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index a705b61a1849..b1d25010eaa2 100644 --- a/package.json +++ b/package.json @@ -401,7 +401,6 @@ "src/applications/claims-status", "src/applications/accredited-representative-portal/accreditation/21a", "src/applications/accredited-representative-portal" - ], "nohoist": [ "**/applications-accredited-representative-portal/accreditation/21a/react-router",