-
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
Add convert central to virtual and virtual to central hearings workflow #14704
Conversation
…fairs/caseflow into shalliburton/14421-convert-to-virtual
…fairs/caseflow into shalliburton/14421-convert-to-virtual
…fairs/caseflow into shalliburton/14421-convert-to-virtual
Generated by 🚫 Danger |
@@ -75,9 +76,7 @@ export default class HearingsApp extends React.PureComponent { | |||
|
|||
routeForHearingDetails = ({ match: { params }, history }) => ( | |||
<HearingsUserContext.Provider value={this.userPermissionProps()}> | |||
<HearingsFormContextProvider> |
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.
Moved the forms context into the DetailsContainer component to inherit state that we already have
|
||
return { | ||
hearingDetailsForm: { |
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.
All of this state was moved into the HearingsFormContext
Code Climate has analyzed commit 2b756c6 and detected 0 issues on this pull request. View more on Code Climate. |
...(virtualHearingForm || {}) | ||
} | ||
const submit = async (editedEmails) => { | ||
try { |
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.
convert to try-catch block with async/await to remove all of the callbacks
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.
some comments for backend
@@ -34,7 +34,7 @@ def index | |||
def show | |||
render json: { | |||
hearing_day: hearing_day.to_hash.merge( | |||
hearings: hearing_day.hearings_for_user(current_user).map { |hearing| hearing.quick_to_hash(current_user.id) } | |||
hearings: hearing_day.hearings_for_user(current_user).map { |hearing| hearing.to_hash(current_user.id) } |
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.
I have some concerns that this may affect the performance of DailyDocket
as the quick_to_hash
does not serialize things that DailyDocket
does not need yet like appellant_email_address
which make calls VACOLS
cc: @ferristseng
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.
there will be a performance tradeoff whether we use the quick_to_hash here or make an additional call on the details page, this preloads data that will be needed to reduce the number of roundtrips
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.
I ended up reverting this and removing the frontend caching for now as it was creating too much of a bottleneck on the daily docket page @rubaiyat22 and @ferristseng, we should create a separate ticket though to revisit frontend caching so that we can improve client-side performance
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.
Looks great! I think there are some small things that I noted in the feedback to fix (some of the out-of-date stuff might be mislabelled in that it is still relevant). Thank you for all the new tests and stories!
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
export const FormLabel = ({ label, name, required, optional }) => ( |
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.
Nice! Good refactors 🛠️
client/app/hearings/components/details/VirtualHearingForm.stories.js
Outdated
Show resolved
Hide resolved
0 | ||
); | ||
|
||
expect(details).toMatchSnapshot(); |
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.
Great tests!!
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.
Some differences I noticed between design and my dev. let me know if you wanna talk about any of these.
-
if have some unsaved on details page and I choose to convert a central to Virtual, it does not indicate that there some unsaved changes (Maybe be out of scope for this PR as we did not decide to go with a new page. If out of scope, me may want to write that somwhere/create a ticket)
-
POA email is being validated when converting to virtual .
Also the convert button changes to disabled loading button and does not allow me to make any edits without reloading the page
4. Updating the timezone for Veteran the modal looks like this
but in figma it looks like this
this also applies to the success message which in figma looks like this
|
||
/** | ||
* Hearing Details Component | ||
* @param {Object} props -- React props inherited from client/app/hearings/containers/DetailsContainer.jsx |
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.
Nice and clear comment!
}); | ||
|
||
// Focus to the error | ||
return document.getElementById('email-section').scrollIntoView(); |
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.
Cool idea!
// Set the Virtual Hearing errors | ||
setVirtualHearingErrors({ | ||
[!hearing.virtualHearing.appellantEmail && 'appellantEmail']: 'Appellant email is required', | ||
[!hearing.virtualHearing.representativeEmail && 'representativeEmail']: 'Representative email is required', |
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.
[note] I think there's a ticket out to remove this required constraint for representative email
@@ -3,253 +3,182 @@ import { connect } from 'react-redux'; | |||
import { css } from 'glamor'; | |||
import AppSegment from '@department-of-veterans-affairs/caseflow-frontend-toolkit/components/AppSegment'; | |||
import PropTypes from 'prop-types'; | |||
import React, { useState, useEffect, useContext } from 'react'; | |||
import _ from 'lodash'; |
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.
great idea to import specifics
import { JudgeDropdown } from '../../components/DataDropdowns/index'; | ||
import { marginTop, noMaxWidth } from './details/style'; | ||
import COPY from '../../../COPY'; | ||
import { AddressLine } from './details/Address'; |
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.
Noticed that there is an Address
component in /queue/components
. This might be place where we could take it out to the shared components and reuse it but that's out of scope for this PR
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.
Great job putting all these together. It looks great!!
It looks like we're sending confirmation emails to both appellant and poa when either of the timezone changes so i think we have to change our backend to send confirmation emails to only the recipient whose timezone was updated. I added some comments about some differences i found in figma and your PR hence requested changes but let me know if anything is too out of scope and you want to create a follow up ticket instead.
Also would you mind adding some screens shots of the changes in the PR.
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.
Going to go ahead and approve as @sahalliburton and I resolved some of comments async and we created some follow up tickets
Resolves #14421
Description
This PR adds the convert-to-virtual workflow for Central Office hearings. This work is currently behind the feature flag
schedule_virtual_hearings_for_central
and offers users with this permission to change currently scheduled Central Office hearings to virtual hearings.Acceptance Criteria
Testing Plan
Central Office Hearing
Video Hearing
User Facing Changes
Code Documentation Updates
Storybook Story
For Frontend (Presentationa) Components
MyComponent.stories.js
alongsideMyComponent.jsx
)