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

Add edit icon and form for approved SIT requests #2004

Merged
merged 8 commits into from
May 1, 2019

Conversation

LeDeep
Copy link
Contributor

@LeDeep LeDeep commented Apr 11, 2019

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:

make db_dev_e2e_populate
make server_run
make client_run

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

Apr-11-2019 14-19-56

@codecov
Copy link

codecov bot commented Apr 11, 2019

Codecov Report

Merging #2004 into master will increase coverage by 0.17%.
The diff coverage is n/a.

@@            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

@LeDeep LeDeep added the A-Team label Apr 12, 2019
});

it('renders without crashing', () => {
expect(wrapper.exists('.storage-in-transit-panel-modal')).toBe(true);
Copy link
Contributor

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);
Copy link
Contributor

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"
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

@kimallen kimallen Apr 30, 2019

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)

@kimallen
Copy link
Contributor

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 {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@kimallen
Copy link
Contributor

kimallen commented May 1, 2019

I ran it, and the form shows up fine, although I get an error:
index.js:1446 Warning: Failed prop type: Invalid prop `value` of type `object` supplied to `PanelField`, expected `string`. in PanelField (at StorageInTransitOfficeEditForm.jsx:42) in StorageInTransitOfficeEditForm (created by Form(StorageInTransitOfficeEditForm)) in Form(StorageInTransitOfficeEditForm) (created by

@kimallen
Copy link
Contributor

kimallen commented May 1, 2019

I'd still like to see use of data-cy in your integration step instead of class names. The syntax is '[data-cy="invoice-detail"]'. Let me know if you have questions how to implement it.

@LeDeep
Copy link
Contributor Author

LeDeep commented May 1, 2019

I ran it, and the form shows up fine, although I get an error:
index.js:1446 Warning: Failed prop type: Invalid prop `value` of type `object` supplied to `PanelField`, expected `string`. in PanelField (at StorageInTransitOfficeEditForm.jsx:42) in StorageInTransitOfficeEditForm (created by Form(StorageInTransitOfficeEditForm)) in Form(StorageInTransitOfficeEditForm) (created by

just pushed up a fix for this.

Copy link
Contributor

@kimallen kimallen left a 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!

@LeDeep LeDeep merged commit 4f13eca into master May 1, 2019
@LeDeep LeDeep deleted the sm-164251823-office-sit-edit-form branch May 1, 2019 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants