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

[MR-3576] Add required and optional labels to fields #1923

Merged
merged 25 commits into from
Sep 19, 2023

Conversation

pearl-truss
Copy link
Contributor

@pearl-truss pearl-truss commented Sep 14, 2023

Summary

This PR adds required or optional labels to fields based on the designs referenced in the ticket

  • showRequiredOptionalLabel was created to conditionally show the required/optional label given that inputs on the non contract and rate details pages shouldn't have this label displayed
  • FieldTextarea, FIeldYesNo, and FileUpload uses aria-required

Related issues

https://qmacbis.atlassian.net/browse/MR-3576

Screenshots

Screenshot 2023-09-13 at 8 30 54 AM Screenshot 2023-09-13 at 8 31 12 AM Screenshot 2023-09-13 at 8 34 33 AM

Test cases covered

QA guidance

@pearl-truss pearl-truss changed the title Mr 3576 add required and optional labels to fields [MR-3576] Add required and optional labels to fields Sep 14, 2023
@haworku
Copy link
Contributor

haworku commented Sep 14, 2023

@pearl-truss Is it possible to just use the input's required attribute to determine the label? I'm wondering if the showRequiredOptionalLabel could be redundant - what are the use cases where we don't want to show the label?. I thought we were just moving towards labeling each field input in general across the forms in the application.

@pearl-truss
Copy link
Contributor Author

pearl-truss commented Sep 14, 2023

@pearl-truss Is it possible to just use the input's required attribute to determine the label? I'm wondering if the showRequiredOptionalLabel could be redundant - what are the use cases where we don't want to show the label?. I thought we were just moving towards labeling each field input in general across the forms in the application.

Maybe I'm mistaken (I'll clarify with design) but what I saw on figma showed the labels just on the contract and rate pages.

And I agree that if it is for every label than showRequiredOptionalLabel would be redundant

@haworku
Copy link
Contributor

haworku commented Sep 15, 2023

🛑 I found one set of fields on rate details that doesn't have this handling yet - its the components in PackagesWithSharedRates theres a radio and then a thing called PackageSelect rendered
Screenshot 2023-09-15 at 2 29 12 PM

Otherwise looks v good!

nal label to the shared package rates fields
@pearl-truss
Copy link
Contributor Author

🛑 I found one set of fields on rate details that doesn't have this handling yet - its the components in PackagesWithSharedRates theres a radio and then a thing called PackageSelect rendered Screenshot 2023-09-15 at 2 29 12 PM

Otherwise looks v good!

great catch! I just pushed an update

@pearl-truss pearl-truss merged commit b419922 into main Sep 19, 2023
27 checks passed
@pearl-truss pearl-truss deleted the mr-3576-add-required-and-optional-labels-to-fields branch September 19, 2023 13:22
haworku pushed a commit that referenced this pull request Oct 16, 2023
* add and use theme color for hints

* start adding required labels

* add inline required labels where possible

* add styling to inline required label

* Add required lable to actuary fields

* Add required label to file uploads

* Add required label to FieldYesNo component

* conditionally display required or optional label depending on whats passed in

* pass required prop to contacts

* include required/optional label for textarea

* add new styles for textarea

* add optional label to supporting documents upload field

* update so that required/optional labels are on the contacts and rate details page

* update styling

* add correct file types for supporting rate docs

* clean up single rate cert file

* ensure file upload only shows required/optional contract and rate pages

* remove the showRequiredOptionalLabel prop

* add required labels to the submission type page

* add required/optional labels to the Contacts page

* cypress re-run

* Add required/optio
nal label to the shared package rates fields

* fix unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants