Skip to content
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

5511: update /case-messages routes to /messages #6073

Merged
merged 2 commits into from
Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-api/storage/fixtures/seed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = [
...require('./105-20.json'),
...require('./117-20.json'),
...require('./120-20.json'),
...require('./case-messages.json'),
...require('./messages.json'),
...require('./trial-sessions.json'),
...require('./trial-sessions-past.json'),
...require('./misc.json'),
Expand Down
8 changes: 4 additions & 4 deletions web-client/integration-tests/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ describe('helpers', () => {
expect(cbSpy).toHaveBeenCalledWith('abc-123-Z', '123-ABC-T');
});

it('should invoke the expected case-messages route definition', async () => {
it('should invoke the expected messages route definition', async () => {
const cbSpy = jest.fn().mockResolvedValue('awesome');
const routes = [
{
cb: cbSpy,
route: '/case-messages..',
route: '/messages..',
},
];
const results = await gotoRoute(routes, '/case-messages/section/inbox');
const results = await gotoRoute(routes, '/messages/section/inbox');
expect(results).toEqual('awesome');
expect(cbSpy).toHaveBeenCalledWith('/section/inbox');
});
Expand All @@ -40,7 +40,7 @@ describe('helpers', () => {
},
{
cb: () => null,
route: '/case-messages..',
route: '/messages..',
},
];
const results = await gotoRoute(routes, '/');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const adcsSignsProposedStipulatedDecisionFromMessage = test => {
docketNumber: test.docketNumber,
documentId: test.proposedStipDecisionDocumentId,
parentMessageId: foundMessage.parentMessageId,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${foundMessage.parentMessageId}?documentId=${test.proposedStipDecisionDocumentId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${foundMessage.parentMessageId}?documentId=${test.proposedStipDecisionDocumentId}`,
});
expect(test.getState('currentPage')).toEqual('SignOrder');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const docketClerkAddsDocketEntryFromMessage = test => {
await test.runSequence('gotoAddCourtIssuedDocketEntrySequence', {
docketNumber: test.docketNumber,
documentId: orderDocument.documentId,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
});

await test.runSequence('updateCourtIssuedDocketEntryFormValueSequence', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const docketClerkAppliesSignatureFromMessage = test => {
docketNumber: test.docketNumber,
documentId: orderDocument.documentId,
parentMessageId: test.parentMessageId,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
});

expect(test.getState('currentPage')).toEqual('SignOrder');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const docketClerkEditsOrderFromMessage = test => {
docketNumber: test.docketNumber,
documentIdToEdit: orderDocument.documentId,
parentMessageId: test.parentMessageId,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I should update the URL in my PR based on this! Also, yay for no more case-messages :)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JK just realized the file I worked on is a part of this change set haha, I'll just merge in develop after you merge this branch

});

await test.runSequence('navigateToEditOrderSequence');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const petitionsClerk1CreatesNoticeFromMessageDetail = test => {
documentTitle: test.getState('modal.documentTitle'),
documentType: test.getState('modal.documentType'),
eventCode: test.getState('modal.eventCode'),
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
});

expect(test.getState('currentPage')).toBe('CreateOrder');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ export const petitionsClerk1ServesDocumentFromCaseMessageDetail = test => {
return it('petitions clerk 1 serves document from case message detail', async () => {
await test.runSequence('openConfirmServePaperFiledDocumentSequence', {
documentId: test.documentId,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
});

expect(test.getState('redirectUrl')).toBe(
`/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
`/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
);
expect(test.getState('documentId')).toBe(test.documentId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const petitionsClerk1ServesPetitionFromMessageDetail = test => {

await test.runSequence('gotoPetitionQcSequence', {
docketNumber: test.docketNumber,
redirectUrl: `/case-messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
redirectUrl: `/messages/${test.docketNumber}/message-detail/${test.parentMessageId}`,
});

expect(test.getState('currentPage')).toEqual('PetitionQc');
Expand Down
16 changes: 8 additions & 8 deletions web-client/pa11y/pa11y-petitionsclerk.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,11 +479,11 @@ module.exports = [
},
'http://localhost:1234/mock-login?token=petitionsclerk&path=/practitioner-detail/PT1234',
/* case messages */
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/my/inbox&info=case-messages-inbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/my/outbox&info=case-messages-outbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/inbox&info=case-messages-section-inbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/section/outbox&info=case-messages-section-outbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=case-message-detail',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/my/inbox&info=case-messages-inbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/my/outbox&info=case-messages-outbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/section/inbox&info=case-messages-section-inbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/section/outbox&info=case-messages-section-outbox',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=case-message-detail',
{
actions: [
'wait for #button-forward to be visible',
Expand All @@ -492,7 +492,7 @@ module.exports = [
],
notes: 'checks the forward modal',
url:
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-forward',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-forward',
},
{
actions: [
Expand All @@ -502,7 +502,7 @@ module.exports = [
],
notes: 'checks the reply modal',
url:
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-reply',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-reply',
},
{
actions: [
Expand All @@ -512,6 +512,6 @@ module.exports = [
],
notes: 'checks the complete modal',
url:
'http://localhost:1234/mock-login?token=petitionsclerk&path=/case-messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-complete',
'http://localhost:1234/mock-login?token=petitionsclerk&path=/messages/105-20/message-detail/eb0a139a-8951-4de1-8b83-f02a27504105&info=message-detail-complete',
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const completeDocumentSigningAction = async ({
let redirectUrl;

if (parentMessageId) {
redirectUrl = `/case-messages/${docketNumber}/message-detail/${parentMessageId}`;
redirectUrl = `/messages/${docketNumber}/message-detail/${parentMessageId}`;
} else {
redirectUrl = `/case-detail/${docketNumber}/draft-documents?documentId=${documentId}`;
}
Expand Down
4 changes: 2 additions & 2 deletions web-client/src/presenter/actions/navigateToMessagesAction.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* changes the route to messages, which is "/case-messages/my/inbox"
* changes the route to messages, which is "/messages/my/inbox"
*
* @param {object} providers the providers object
* @param {object} providers.router the riot.router object that is used for changing the route
* @returns {Promise} async action
*/
export const navigateToMessagesAction = async ({ router }) => {
await router.route('/case-messages/my/inbox');
await router.route('/messages/my/inbox');
};
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ describe('navigateToMessagesAction', () => {
},
});

expect(routeStub).toHaveBeenCalledWith('/case-messages/my/inbox');
expect(routeStub).toHaveBeenCalledWith('/messages/my/inbox');
});
});
20 changes: 10 additions & 10 deletions web-client/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ const router = {
setPageTitle(`${getPageTitleDocketPrefix(docketNumber)} Petition QC`);
return app.getSequence('gotoPetitionQcSequence')({
docketNumber,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}, ROLE_PERMISSIONS.UPDATE_CASE),
);
Expand Down Expand Up @@ -441,7 +441,7 @@ const router = {
documentType: decodeURIComponent(documentType),
eventCode,
parentMessageId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}),
);
Expand Down Expand Up @@ -479,7 +479,7 @@ const router = {
return app.getSequence('gotoEditUploadCourtIssuedDocumentSequence')({
docketNumber,
documentId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}),
);
Expand Down Expand Up @@ -547,7 +547,7 @@ const router = {
return app.getSequence('gotoEditCorrespondenceDocumentSequence')({
docketNumber,
documentId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}),
);
Expand All @@ -574,7 +574,7 @@ const router = {
docketNumber,
documentId,
parentMessageId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}?documentId=${documentId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}?documentId=${documentId}`,
});
}),
);
Expand All @@ -600,7 +600,7 @@ const router = {
docketNumber,
documentIdToEdit,
parentMessageId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}),
);
Expand Down Expand Up @@ -640,7 +640,7 @@ const router = {
return sequence({
docketNumber,
documentId,
redirectUrl: `/case-messages/${docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${docketNumber}/message-detail/${parentMessageId}`,
});
}),
);
Expand Down Expand Up @@ -989,7 +989,7 @@ const router = {
});

registerRoute(
'/case-messages/*/*',
'/messages/*/*',
ifHasAccess((queue, box) => {
setPageTitle('Messages');
return app.getSequence('gotoCaseMessagesSequence')({
Expand All @@ -1000,7 +1000,7 @@ const router = {
);

registerRoute(
'/case-messages/*/message-detail/*',
'/messages/*/message-detail/*',
ifHasAccess((docketNumber, parentMessageId) => {
setPageTitle('Message detail');
return app.getSequence('gotoMessageDetailSequence')({
Expand All @@ -1011,7 +1011,7 @@ const router = {
);

registerRoute(
'/case-messages/*/message-detail/*?..',
'/messages/*/message-detail/*?..',
ifHasAccess((docketNumber, parentMessageId) => {
const { documentId } = route.query();
setPageTitle('Message detail');
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/CaseDetail/CaseMessagesCompleted.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const CaseMessagesCompleted = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/CaseDetail/CaseMessagesInProgress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const CaseMessagesInProgress = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const NavigationItems = (
'usa-nav__link',
headerHelper.pageIsCaseMessages && 'usa-current',
)}
href="/case-messages/my/inbox"
href="/messages/my/inbox"
onClick={() => toggleMobileMenuSequence()}
>
Messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const CaseMessagesIndividualCompleted = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const CaseMessagesIndividualInbox = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const CaseMessagesIndividualOutbox = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const CaseMessagesSectionCompleted = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion web-client/src/views/Messages/CaseMessagesSectionInbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const CaseMessagesSectionInbox = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const CaseMessagesSectionOutbox = connect(
<Button
link
className="padding-0"
href={`/case-messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
href={`/messages/${message.docketNumber}/message-detail/${message.parentMessageId}`}
>
{message.subject}
</Button>
Expand Down
6 changes: 3 additions & 3 deletions web-client/src/views/Messages/MessageDocument.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const MessageDocument = connect(
docketNumber: caseDetail.docketNumber,
documentIdToEdit: viewerDocumentToDisplay.documentId,
parentMessageId,
redirectUrl: `/case-messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
})
}
>
Expand Down Expand Up @@ -140,7 +140,7 @@ export const MessageDocument = connect(
onClick={() => {
openConfirmServeCourtIssuedDocumentSequence({
documentId: viewerDocumentToDisplay.documentId,
redirectUrl: `/case-messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
});
}}
>
Expand All @@ -156,7 +156,7 @@ export const MessageDocument = connect(
onClick={() => {
openConfirmServePaperFiledDocumentSequence({
documentId: viewerDocumentToDisplay.documentId,
redirectUrl: `/case-messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
redirectUrl: `/messages/${caseDetail.docketNumber}/message-detail/${parentMessageId}`,
});
}}
>
Expand Down
Loading