Skip to content

Commit

Permalink
vebt-898 fixed route and pthame
Browse files Browse the repository at this point in the history
  • Loading branch information
wafimohamed committed Jan 31, 2025
1 parent 64e51bc commit ed525ce
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 17 deletions.
5 changes: 4 additions & 1 deletion src/applications/edu-benefits/10215/components/AboutPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const AboutPage = ({ props }) => {
return (
<div className="vads-l-grid-container vads-u-margin-top--4">
<div className="vads-u-margin-top--neg2p5">
<Breadcrumbs />
<Breadcrumbs pathname={props?.router?.location?.pathname} />

Check warning on line 21 in src/applications/edu-benefits/10215/components/AboutPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/AboutPage.jsx:21:39:'router' is missing in props validation

Check warning on line 21 in src/applications/edu-benefits/10215/components/AboutPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/AboutPage.jsx:21:47:'router.location' is missing in props validation

Check warning on line 21 in src/applications/edu-benefits/10215/components/AboutPage.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/AboutPage.jsx:21:57:'router.location.pathname' is missing in props validation
</div>
<h1>About VA Form 22-10215</h1>
<p>
Expand Down Expand Up @@ -67,6 +67,9 @@ const AboutPage = ({ props }) => {
};
AboutPage.propTypes = {
props: PropTypes.shape({
location: PropTypes.shape({
pathname: PropTypes.string.isRequired,
}).isRequired,
router: PropTypes.shape({
push: PropTypes.func.isRequired,
}).isRequired,
Expand Down
17 changes: 6 additions & 11 deletions src/applications/edu-benefits/10215/components/Breadcrumbs.jsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react';

Check warning on line 1 in src/applications/edu-benefits/10215/components/Breadcrumbs.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import PropTypes from 'prop-types';
import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
import { BrowserRouter as Router, useLocation } from 'react-router-dom';

const BreadcrumbsComponent = () => {
const location = useLocation();
const { pathname } = location;
const Breadcrumbs = ({ pathname }) => {
const crumbs = [
{
href: '/',
label: 'Home',
},
...(pathname.endsWith('/10215/')
...(pathname === '/'
? [
{
href: '/find-forms/',
Expand Down Expand Up @@ -48,11 +46,8 @@ const BreadcrumbsComponent = () => {
</div>
);
};

const Breadcrumbs = () => (
<Router>
<BreadcrumbsComponent />
</Router>
);
Breadcrumbs.propTypes = {
pathname: PropTypes.string.isRequired,
};

export default Breadcrumbs;
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React from 'react';

Check warning on line 1 in src/applications/edu-benefits/10215/components/CalculationInstructions.jsx

View workflow job for this annotation

GitHub Actions / App Isolation Annotations

Staged Continuous Deployment App Isolation Conflict

*WARNING* This PR contains changes related to an application that is currently not isolated. As of Feb 3, 2025 deployment may no longer be possible for apps that are not isolated. Please isolate this app from other directories in 'src/applications' to prevent future deployment issues. More information on your app's status can be seen here: https://department-of-veterans-affairs.github.io/veteran-facing-services-tools/frontend-support-dashboard/cross-app-import-report Please reach out to Frontend Platform Support with any questions.
import PropTypes from 'prop-types';
import NeedHelp from './NeedHelp';
import BreadcrumbInstructionPage from './Breadcrumbs';
import Breadcrumbs from './Breadcrumbs';

export const CalculationInstructions = () => {
export const CalculationInstructions = ({ props }) => {
return (
<div className="vads-l-grid-container vads-u-margin-top--4">
<div className="desktop-lg:vads-u-padding-left--0">
<BreadcrumbInstructionPage />
<Breadcrumbs pathname={props?.router?.location?.pathname} />

Check warning on line 10 in src/applications/edu-benefits/10215/components/CalculationInstructions.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/CalculationInstructions.jsx:10:39:'router' is missing in props validation

Check warning on line 10 in src/applications/edu-benefits/10215/components/CalculationInstructions.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/CalculationInstructions.jsx:10:47:'router.location' is missing in props validation

Check warning on line 10 in src/applications/edu-benefits/10215/components/CalculationInstructions.jsx

View workflow job for this annotation

GitHub Actions / Linting (Files Changed)

src/applications/edu-benefits/10215/components/CalculationInstructions.jsx:10:57:'router.location.pathname' is missing in props validation
</div>
<h1 className="vads-u-margin-top--2">
Calculation instructions for VA Form 22-10215: Statement of Assurance of
Expand Down Expand Up @@ -245,3 +246,13 @@ export const CalculationInstructions = () => {
</div>
);
};

CalculationInstructions.propTypes = {
props: PropTypes.shape({
router: PropTypes.shape({
location: PropTypes.shape({
pathname: PropTypes.string,
}),
}),
}),
};
2 changes: 1 addition & 1 deletion src/applications/edu-benefits/10215/containers/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function App({ location, children }) {
return (
<div className="form-22-10215-container">
<div className="vads-u-padding-left--0">
<Breadcrumbs />
<Breadcrumbs pathname={location.pathname} />
</div>
<RoutedSavableApp formConfig={formConfig} currentLocation={location}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion src/applications/edu-benefits/10215/routes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import AboutPage from './components/AboutPage';
const route = [
{
path: '/calculation-instructions',
component: CalculationInstructions,
component: props => <CalculationInstructions props={props} />,
},
{
path: '/',
Expand Down

0 comments on commit ed525ce

Please sign in to comment.