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 StudioTextarea and StudioTextfield components #12323

Merged
merged 8 commits into from
Feb 22, 2024

Conversation

TomasEng
Copy link
Contributor

@TomasEng TomasEng commented Feb 16, 2024

Description

Added a textarea component to the component library. The component adds the possibility to provide an error mssage that will not be visible until the user blurs the field. It will then remain visible until the user empties the field. The implementation of the validation that makes the error message occur must be done independent from this.

Update: Added StudioTextfield (moved the code from AltinnTextField) and created a shared hook for the two components.

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

@github-actions github-actions bot added the solution/studio/designer Issues related to the Altinn Studio Designer solution. label Feb 16, 2024
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (45977c3) 86.70% compared to head (78779b2) 86.73%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12323      +/-   ##
==========================================
+ Coverage   86.70%   86.73%   +0.03%     
==========================================
  Files        1200     1205       +5     
  Lines       18070    18109      +39     
  Branches     2290     2292       +2     
==========================================
+ Hits        15667    15707      +40     
+ Misses       2122     2121       -1     
  Partials      281      281              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TomasEng TomasEng marked this pull request as ready for review February 16, 2024 07:41
@TomasEng TomasEng force-pushed the add-studio-textarea-component branch from e4581a8 to 5e9851f Compare February 16, 2024 07:47
@github-actions github-actions bot added the area/data-modeling Area: Related to data models - e.g. create, edit, use data models. label Feb 16, 2024
@TomasEng TomasEng force-pushed the add-studio-textarea-component branch from 9509839 to 963eac2 Compare February 16, 2024 12:17
@TomasEng TomasEng changed the title Add StudioTextarea component Add StudioTextarea and StudioTextfield components Feb 16, 2024
@standeren standeren self-assigned this Feb 20, 2024
Copy link
Contributor

@standeren standeren left a comment

Choose a reason for hiding this comment

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

Looks very good! Nice tests 💯

However, I believe that both textfield and textarea should be replaced by textField and textArea all places 😬

TomasEng and others added 2 commits February 21, 2024 12:14
…StudioTextarea.test.tsx

Co-authored-by: andreastanderen <71079896+standeren@users.noreply.github.com>
…/StudioTextfield.test.tsx

Co-authored-by: andreastanderen <71079896+standeren@users.noreply.github.com>
@TomasEng
Copy link
Contributor Author

Thank you for your review, @standeren. I appreciate your feedback.

However, I believe that both textfield and textarea should be replaced by textField and textArea all places

When it comes to casing, my opinion is that we should follow the casing used in the design system to keep consistency. The design system components are again referring to primitive HTML components, which are case insensitive, but generally referred by lowercase letters only. (Also, I'm not a fan of exaggerated camel/pascal-casing.)

@TomasEng TomasEng requested a review from standeren February 22, 2024 06:59
Copy link
Contributor

@standeren standeren left a comment

Choose a reason for hiding this comment

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

Nice 🌟

…omponent

# Conflicts:
#	frontend/libs/studio-components/src/components/StudioDecimalInput/StudioDecimalInput.tsx
@TomasEng TomasEng merged commit fa6c9e6 into main Feb 22, 2024
11 checks passed
@TomasEng TomasEng deleted the add-studio-textarea-component branch February 22, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/data-modeling Area: Related to data models - e.g. create, edit, use data models. solution/studio/designer Issues related to the Altinn Studio Designer solution.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants