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

feat(tailwind-components): add form legend component #4616

Merged
merged 19 commits into from
Jan 23, 2025

Conversation

connoratrug
Copy link
Contributor

@connoratrug connoratrug commented Jan 20, 2025

What are the main changes you did

  • Added a legend component
  • Added legend to form demo page
  • Added temp code to show the number of errors per chapter ( for now via the demo page, eventually this can be wrapped in a 'Form' component
  • Added temp code to set the active chapter

How to test

  • explain here what to do to test this (or point to unit tests)

Checklist

  • updated docs in case of new feature
  • added/updated tests
  • added/updated testplan to include a test for this fix, including ref to bug using # notation

@mswertz
Copy link
Member

mswertz commented Jan 21, 2025

looks good, only links are breaking

@connoratrug
Copy link
Contributor Author

looks good, only links are breaking

there are no links ( yet)

@connoratrug connoratrug marked this pull request as ready for review January 22, 2025 12:04
Copy link
Contributor

@chinook25 chinook25 left a comment

Choose a reason for hiding this comment

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

Code: Just some nitpicks, looks good.
Functional:

  • error bubbles in the legend don't look right (firefox, chrome looks ok)
  • in the form the error counts don't show (firefox/chrome)
  • The current chapter is not being highlighted (firefox/chrome) initially, does after switching to the complex form.

apps/tailwind-components/components/form/Legend.vue Outdated Show resolved Hide resolved
apps/tailwind-components/pages/Form.story.vue Show resolved Hide resolved
apps/tailwind-components/pages/Form.story.vue Outdated Show resolved Hide resolved
apps/tailwind-components/pages/Legend.story.vue Outdated Show resolved Hide resolved
@connoratrug
Copy link
Contributor Author

Code: Just some nitpicks, looks good. Functional:

  • error bubbles in the legend don't look right (firefox, chrome looks ok)

fixed by switching to styled div instead of svg ( svg v-align has issue in firefox)

  • in the form the error counts don't show (firefox/chrome)

can not reproduce , can you add steps

  • The current chapter is not being highlighted (firefox/chrome) initially, does after switching to the complex form.

can not reproduce , can you add steps ( note the 'simple' form does not start with a chapter ( not sure if this should be allows , or if we should use a 'default' chapter name if the field list does not start with a chpater)

@connoratrug connoratrug requested a review from chinook25 January 23, 2025 10:46
@chinook25
Copy link
Contributor

chinook25 commented Jan 23, 2025

  • in the form the error counts don't show (firefox/chrome)
    can not reproduce , can you add steps
  • Go to the simple form
  • Type in a name
  • Delete the name
  • I expect the required error to give an error count in the legend

Ok while writing this I understand why it doesn't show. There is no heading for the unheaded first chapter. I think we should add something for this. Maybe a "Top of form" or something in case there the top field is not a header. I believe in the old forms we had something like this.

yes, maybe but suggest not to put it in this pr, the final form has more options to show the error state , and i would like to discuss maken a chapter ( if any) madatory

  • The current chapter is not being highlighted (firefox/chrome) initially, does after switching to the complex form.

can not reproduce , can you add steps ( note the 'simple' form does not start with a chapter ( not sure if this should be allows , or if we should use a 'default' chapter name if the field list does not start with a chapter)

  • Go to the simple form
  • Scroll down or click on a chapter
  • I expect the chapter to be highlighted but it doesn't
  • Switch to extended form
  • It works now
  • Switch back to simple
  • It keeps working, sort of. I think there is still room for (future) improvement on the behaviour if there are 2 headings on the screen.

yes , i would depend on things like the viewport size en size of the elements between 2 headers , imo the current setup is a good start, not this is not part of the components but the story , a final version may need to be tweaked depending its context ( modal , page ) i would like to do that once we have most form elements working.

@connoratrug connoratrug merged commit 11ec853 into master Jan 23, 2025
7 checks passed
@connoratrug connoratrug deleted the feat/tw-forms-add-legend branch January 23, 2025 18:44
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.

3 participants