-
Notifications
You must be signed in to change notification settings - Fork 36
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 edit icon and form for approved SIT requests #2004
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2004 +/- ##
==========================================
+ Coverage 60.38% 60.56% +0.17%
==========================================
Files 193 193
Lines 12525 12496 -29
==========================================
+ Hits 7563 7567 +4
+ Misses 4073 4045 -28
+ Partials 889 884 -5 |
}); | ||
|
||
it('renders without crashing', () => { | ||
expect(wrapper.exists('.storage-in-transit-panel-modal')).toBe(true); |
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.
Could you start using data-cy
rather than class names to identify elements in integration tests as we transition to using css modules?
}); | ||
|
||
it('buttons are enabled', () => { | ||
expect(wrapper.find('button.usa-button-primary').prop('disabled')).toBe(false); |
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.
same as above- use data-cy attribute rather than class name
</div> | ||
<div className="usa-width-one-half align-right"> | ||
<button | ||
className="button usa-button-primary storage-in-transit-request-form-send-request-button" |
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.
Do you use this class name storage-in-transit-request-form-send-request-button
anywhere?
@@ -97,10 +93,18 @@ | |||
font-weight: normal; | |||
} | |||
|
|||
.storage-in-transit-office-edit-form { | |||
font-weight: normal; |
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 the storage in transit forms have this font-weight: normal
applied to them. Might be nice if we create a new class to use for all the forms rather than apply the style to each unique class.
.storage-in-transit-office-approval-form textarea { | ||
height: 9rem; | ||
} | ||
|
||
.storage-in-transit-office-edit-form textarea { | ||
height: 9rem; |
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.
Same as above comment regarding creating a new class (for height: 9rem)
The story for this is an edit form for approved SIT requests, though your demo shows denied SIT requests. Does this cover both approved and denied edit form stories? |
height: 9rem; | ||
} | ||
|
||
.storage-in-transit-office-deny-form { | ||
.place-in-sit-form { |
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.
nitpick: this could also use the .storage-in-transit-form
since it has the same styling. Same with .storage-in-transit-office-deny-form
below.
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 didn't for place-in-sit-form
bc that class gets called in the test for PlaceInSitForm
.
storage-in-transit-office-deny-form
has some additional css for the textarea (line 104), so that's why I kept that class. Otherwise I would have to add storage-in-transit-form
and storage-in-transit-office-deny-form
in that component. I thought this way was better, because the component reads cleaner.
let me know if you agree/disagree. I can make the update if you think it would be better.
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 think trying to refactor the CSS more will be a rabbit-hole- it's fine to leave it as is. As I'm working on the PlaceInSit, I will replace the references to classes in the tests and see if it makes sense to combine.
I ran it, and the form shows up fine, although I get an error: |
I'd still like to see use of data-cy in your integration step instead of class names. The syntax is |
just pushed up a fix for this. |
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 working for me now!
Description
Adds edit icon and form for approving sit requests. Also adds the logic to handle the various transitions between the icons and forms in the sit panel.
Reviewer Notes
Might make sense to break up the logic a bit so it's not all in one file. Conversely, we could end up with a bunch of files that are a pain to navigate.
Setup
Add any steps or code to run in this section to help others prepare to run your code:
In the Office app, select an HHG record with an
APPROVED
SIT. In the SIT panel you will see an 'Edit' link. Clicking on this will open up a form that shoes the various SIT information, with an editable authorized notes field. All other fields are informational and not editable.References
Screenshots