-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set Up Container Component for MTV Checkout Workflows #13334
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
038c73d
commented out existing MTV-related routes etc from QueueApp;
ea90b63
updated AddressMotionToVacateView to be functional component w/ hooks
dec3769
initial implementation of MotioonToVacateFlowContainer w/ stubs;
6af15da
fixed route to ReviewMotionToVacateView
a49010a
Merge branch 'master' into jc/13318-mtv-container
ed7c12c
added route to MotionToVacateFlowContainer
0009638
Cleaned up the commented-out stuff in QueueApp
e46596c
Merge branch 'master' into jc/13318-mtv-container
1e7b7e0
updated the routes under MotionToVacateFlowContainer;
0bda9ea
removed ".json" from import in AddressMotionToVacateView
d6bf35e
Merge branch 'master' into jc/13318-mtv-container
beced6a
Merge branch 'master' into jc/13318-mtv-container
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,11 +73,9 @@ import TASK_STATUSES from '../../constants/TASK_STATUSES'; | |
import USER_ROLE_TYPES from '../../constants/USER_ROLE_TYPES'; | ||
import DECISION_TYPES from '../../constants/APPEAL_DECISION_TYPES'; | ||
import { FlashAlerts } from '../nonComp/components/Alerts'; | ||
import AddressMotionToVacateView from './mtv/AddressMotionToVacateView'; | ||
import ReviewMotionToVacateView from './mtv/ReviewMotionToVacateView'; | ||
|
||
import { PulacCerulloReminderModal } from './pulacCerullo/PulacCerulloReminderModal'; | ||
import { ReturnToLitSupportModal } from './mtv/ReturnToLitSupportModal'; | ||
import { returnToLitSupport } from './mtv/mtvActions'; | ||
import { motionToVacateRoutes } from './mtv/motionToVacateRoutes'; | ||
|
||
class QueueApp extends React.PureComponent { | ||
componentDidMount = () => { | ||
|
@@ -214,10 +212,6 @@ class QueueApp extends React.PureComponent { | |
|
||
routedAssignToUser = (props) => <AssignToView {...props.match.params} />; | ||
|
||
routedSendMotionToVacateToJudge = () => <ReviewMotionToVacateView />; | ||
|
||
routedAddressMotionToVacate = (props) => <AddressMotionToVacateView {...props.match.params} />; | ||
|
||
routedPulacCerulloReminder = (props) => { | ||
const { appealId, taskId } = props.match.params; | ||
const pulacRoute = `/queue/appeals/${appealId}/tasks/${taskId}/${TASK_ACTIONS.LIT_SUPPORT_PULAC_CERULLO.value}`; | ||
|
@@ -234,21 +228,6 @@ class QueueApp extends React.PureComponent { | |
|
||
routedAssignToPulacCerullo = (props) => <AssignToView isTeamAssign assigneeAlreadySelected {...props.match.params} />; | ||
|
||
routedReturnToLitSupport = (props) => { | ||
const { taskId } = props.match.params; | ||
|
||
return ( | ||
<ReturnToLitSupportModal | ||
{...props.match.params} | ||
onCancel={() => props.history.goBack()} | ||
onSubmit={({ instructions }) => { | ||
this.props.returnToLitSupport({ instructions, | ||
task_id: taskId }, props); | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
routedReassignToUser = (props) => <AssignToView isReassignAction {...props.match.params} />; | ||
|
||
routedCompleteTaskModal = (props) => <CompleteTaskModal modalType="mark_task_complete" {...props.match.params} />; | ||
|
@@ -445,12 +424,6 @@ class QueueApp extends React.PureComponent { | |
render={this.routedAddColocatedTask} | ||
/> | ||
|
||
<PageRoute | ||
path={`/queue/appeals/:appealId/tasks/:taskId/${TASK_ACTIONS.ADDRESS_MOTION_TO_VACATE.value}`} | ||
title="Address Motion to Vacate | Caseflow" | ||
render={this.routedAddressMotionToVacate} | ||
/> | ||
|
||
<PageRoute | ||
path="/team_management" | ||
title="Team Management | Caseflow" | ||
|
@@ -461,6 +434,8 @@ class QueueApp extends React.PureComponent { | |
title="User Management | Caseflow" | ||
render={this.routedUserManagement} | ||
/> | ||
|
||
{motionToVacateRoutes.page} | ||
</Switch> | ||
|
||
{/* Modal routes are in their own Switch so they will display above the base routes */} | ||
|
@@ -551,10 +526,6 @@ class QueueApp extends React.PureComponent { | |
path={`/queue/appeals/:appealId/tasks/:taskId/${TASK_ACTIONS.SPECIAL_CASE_MOVEMENT.value}`} | ||
render={this.routedAssignToUser} | ||
/> | ||
<Route | ||
path={`/queue/appeals/:appealId/tasks/:taskId/${TASK_ACTIONS.SEND_MOTION_TO_VACATE_TO_JUDGE.value}`} | ||
render={this.routedSendMotionToVacateToJudge} | ||
/> | ||
|
||
<PageRoute | ||
exact | ||
|
@@ -574,16 +545,6 @@ class QueueApp extends React.PureComponent { | |
title="Assign to Pulac-Cerullo | Caseflow" | ||
render={this.routedAssignToPulacCerullo} | ||
/> | ||
<PageRoute | ||
exact | ||
path={[ | ||
'/queue/appeals/:appealId/tasks/:taskId', | ||
TASK_ACTIONS.ADDRESS_MOTION_TO_VACATE.value, | ||
TASK_ACTIONS.JUDGE_RETURN_TO_LIT_SUPPORT.value | ||
].join('/')} | ||
title="Return to Litigation Support | Caseflow" | ||
render={this.routedReturnToLitSupport} | ||
/> | ||
<PageRoute | ||
exact | ||
path={`/queue/appeals/:appealId/tasks/:taskId/${ | ||
|
@@ -657,6 +618,8 @@ class QueueApp extends React.PureComponent { | |
<Route path="/team_management/add_vso" render={this.routedAddVsoModal} /> | ||
<Route path="/team_management/add_private_bar" render={this.routedAddPrivateBarModal} /> | ||
<Route path="/team_management/lookup_participant_id" render={this.routedLookupParticipantIdModal} /> | ||
|
||
{motionToVacateRoutes.modal} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✨ |
||
</Switch> | ||
</div> | ||
</AppFrame> | ||
|
@@ -688,8 +651,7 @@ QueueApp.propTypes = { | |
applicationUrls: PropTypes.array, | ||
flash: PropTypes.array, | ||
reviewActionType: PropTypes.string, | ||
userCanViewHearingSchedule: PropTypes.bool, | ||
returnToLitSupport: PropTypes.func | ||
userCanViewHearingSchedule: PropTypes.bool | ||
}; | ||
|
||
const mapStateToProps = (state) => ({ | ||
|
@@ -704,8 +666,7 @@ const mapDispatchToProps = (dispatch) => | |
setUserCssId, | ||
setUserIsVsoEmployee, | ||
setFeedbackUrl, | ||
setOrganizations, | ||
returnToLitSupport | ||
setOrganizations | ||
}, | ||
dispatch | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React, { useState } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const defaultState = {}; | ||
|
||
// This pattern allows us to access a shared object state using familiar functions | ||
// Components that consume this context can simply use this syntax: | ||
// const [state, setState] = useContext(MotionToVacateContext); | ||
// setState({...state, foo: 'bar'}); | ||
export const MotionToVacateContext = React.createContext([{}, () => null]); | ||
|
||
export const MotionToVacateContextProvider = ({ initialState = { ...defaultState }, children }) => { | ||
const [state, setState] = useState(initialState); | ||
|
||
return <MotionToVacateContext.Provider value={[state, setState]}>{children}</MotionToVacateContext.Provider>; | ||
}; | ||
MotionToVacateContextProvider.propTypes = { | ||
initialState: PropTypes.object, | ||
children: PropTypes.element | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import { useParams, useRouteMatch, Switch, Route } from 'react-router'; | ||
import { taskById, appealWithDetailSelector } from '../selectors'; | ||
import { MotionToVacateContextProvider } from './MotionToVacateContext'; | ||
|
||
export const MotionToVacateFlowContainer = () => { | ||
const { path } = useRouteMatch(); | ||
const { taskId, appealId } = useParams(); | ||
const task = useSelector((state) => taskById(state, { taskId })); | ||
const appeal = useSelector((state) => appealWithDetailSelector(state, { appealId })); | ||
|
||
// For linter while things are stubbed — remove once used | ||
(() => ({ task, | ||
appeal }))(); | ||
|
||
return ( | ||
<React.Fragment> | ||
<MotionToVacateContextProvider> | ||
jcq marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{/* MTV Progress Bar (#13319) Here */} | ||
|
||
<Switch> | ||
<Route path={`${path}/review_vacatures`}> | ||
{/* Insert component from #13007 here */} | ||
{/* <ReviewVacatedDecisionIssuesView appeal={appeal} /> */} | ||
<></> | ||
</Route> | ||
<Route path={`${path}/add_decisions`}> | ||
{/* Insert component from #13071 here */} | ||
{/* <AddDecisionsView appeal={appeal} /> */} | ||
<></> | ||
</Route> | ||
</Switch> | ||
</MotionToVacateContextProvider> | ||
</React.Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react'; | ||
import { Route, useParams, useHistory } from 'react-router'; | ||
import PageRoute from '../../components/PageRoute'; | ||
|
||
import TASK_ACTIONS from '../../../constants/TASK_ACTIONS.json'; | ||
import ReviewMotionToVacateView from './ReviewMotionToVacateView'; | ||
import { AddressMotionToVacateView } from './AddressMotionToVacateView'; | ||
import { ReturnToLitSupportModal } from './ReturnToLitSupportModal'; | ||
import { useDispatch } from 'react-redux'; | ||
import { returnToLitSupport } from './mtvActions'; | ||
import { MotionToVacateFlowContainer } from './MotionToVacateFlowContainer'; | ||
|
||
const RoutedReturnToLitSupport = (props) => { | ||
const { taskId } = useParams(); | ||
const { goBack } = useHistory(); | ||
const dispatch = useDispatch(); | ||
|
||
return ( | ||
<ReturnToLitSupportModal | ||
onCancel={() => goBack()} | ||
onSubmit={({ instructions }) => dispatch(returnToLitSupport({ instructions, | ||
task_id: taskId }, props))} | ||
/> | ||
); | ||
}; | ||
|
||
const PageRoutes = [ | ||
<PageRoute | ||
path={`/queue/appeals/:appealId/tasks/:taskId/${TASK_ACTIONS.ADDRESS_MOTION_TO_VACATE.value}`} | ||
title="Address Motion to Vacate | Caseflow" | ||
component={AddressMotionToVacateView} | ||
/>, | ||
|
||
// This route handles the remaining checkout flow | ||
<Route | ||
path="/queue/appeals/:appealId/tasks/:taskId/motion_to_vacate_checkout" | ||
leikkisa marked this conversation as resolved.
Show resolved
Hide resolved
|
||
component={MotionToVacateFlowContainer} | ||
/> | ||
]; | ||
|
||
const ModalRoutes = [ | ||
<PageRoute | ||
exact | ||
path={[ | ||
'/queue/appeals/:appealId/tasks/:taskId', | ||
TASK_ACTIONS.ADDRESS_MOTION_TO_VACATE.value, | ||
TASK_ACTIONS.JUDGE_RETURN_TO_LIT_SUPPORT.value | ||
].join('/')} | ||
title="Return to Litigation Support | Caseflow" | ||
component={RoutedReturnToLitSupport} | ||
/>, | ||
|
||
<Route | ||
path={`/queue/appeals/:appealId/tasks/:taskId/${TASK_ACTIONS.SEND_MOTION_TO_VACATE_TO_JUDGE.value}`} | ||
component={ReviewMotionToVacateView} | ||
/> | ||
]; | ||
|
||
export const motionToVacateRoutes = { | ||
page: PageRoutes, | ||
modal: ModalRoutes | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very pretty and nicely done!