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

Issue 442/basic information form #533

Merged
merged 56 commits into from
Apr 24, 2024

Conversation

andycwilliams
Copy link
Member

This PR:

Resolves #442

Just a draft for now to make sure I'm on the right track.

1. Adds (basic) styling to BasicInfo.jsx
2. Adds logic from #515

Screenshots (if applicable):

Capture2 Capture

Future Steps/PRs Needed to Finish This Work (optional):

1. Ensure this component is properly implementing the useCivicProfile hook
2. Ensure the labeling (such as all the ids and names) is consistent and adheres to any standards (if necessary)

Issues needing discussion/feedback (optional):

1. What styling is needed for each form as well as overall Civic Profile section

@andycwilliams andycwilliams self-assigned this Nov 20, 2023
@andycwilliams andycwilliams added the enhancement Enhancement of existing features label Nov 20, 2023
Copy link
Contributor

@timbot1789 timbot1789 left a comment

Choose a reason for hiding this comment

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

This all looks like it's on the right track.

  • For the placeholder text, I'd say legal first name and legal last name. We want to emphasize that the data put here should be usable in a legal context.
  • I think there's a typo in the test that's causing it to fail. You're trying to select a textbox role, but the first name is actually an input role.

@xscottxbrownx
Copy link
Contributor

xscottxbrownx commented Nov 27, 2023

I haven't looked at this deeply yet...

But, personally don't like the date format - not a big deal though. Still logical.

When does submit button become active? Seems like it's disabled because isSuccess is false, but can't switch isSuccess to true without the button it seems.
Screenshot 2023-11-26 at 8 42 02 PM

And to hit on what Tim was saying more about the test...

I was able to get it passing by matching the label of each <TextField>:
const firstNameField = getByRole('textbox', { name: 'Legal first name' }); worked.

@xscottxbrownx
Copy link
Contributor

I'm not really sure why but two things:

  1. the margin between the first input and second is like double the others on mobile
  2. the clear function doesn't seem to clear the date field

@andycwilliams andycwilliams marked this pull request as ready for review April 17, 2024 02:13
@andycwilliams
Copy link
Member Author

andycwilliams commented Apr 17, 2024

Opening up this PR now. That final test still isn't passing, so my hope right now is to comment that one out and create a separate issue to address it.

Also please ignore my above mis-click.

@leekahung
Copy link
Contributor

Opening up this PR now. That final test still isn't passing, so my hope right now is to comment that one out and create a separate issue to address it.

Think we could make an exception for this one. We could comment on the unit test for the basic information form for now, but like what you've mentioned we'll have to open an issue/bug report to fix it.

Can approve this after the merge conflict resolution.


expect(legalFirstName.value).toBe('');
expect(legalLastName.value).toBe('');
expect(legalDOB.value).toBe(null);
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this test is failing because the input field for the date picker is not your typical text field. You can't use the same approach to test the data picker. The same would be said for legalGender which is a select field.

If you'd like, we can open up another issue to write unit tests for these inputs.

Copy link
Contributor

@leekahung leekahung left a comment

Choose a reason for hiding this comment

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

Hey Andy, I've finished reviewing the PR. Just one minor feedback on potential changes (see feedback), but it seems to be working overall, so I'm approving.

firstName: '',
lastName: '',
dateOfBirth: null,
gender: ''
Copy link
Contributor

@leekahung leekahung Apr 24, 2024

Choose a reason for hiding this comment

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

Not too big of an issue since the feature appears to be working as intended, however, MUI is complaining about the input fields if it's not using one of the values from the option elements.

Screenshot 2024-04-23 at 7 45 27 PM Screenshot 2024-04-23 at 7 45 41 PM

Think we could simply set the defaultValue, state, and clear value for gender as the number 9 to work around the problem. So Line 36, Line 75, and Line 133.

@andycwilliams andycwilliams merged commit 4fa1dc6 into Development Apr 24, 2024
3 checks passed
@andycwilliams andycwilliams deleted the issue-442/basic-information-form branch April 24, 2024 03:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HMIS Profile Page: Basic Information Form
4 participants