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 form legend required symbol #5214

Merged
merged 10 commits into from
Aug 15, 2024
Merged

Conversation

britneywwc
Copy link
Contributor

@britneywwc britneywwc commented Jul 11, 2024

Done

  • Add is-required class to fieldset legend

Fixes [list issues/bugs if needed]

QA

Check if PR is ready for release

If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:

  • PR should have one of the following labels to automatically categorise it in release notes:
    • Feature 🎁, Breaking Change 💣, Bug 🐛, Documentation 📝, Maintenance 🔨.
  • Vanilla version in package.json should be updated relative to the most recent release, following semver convention:
    • if CSS class names are not changed it can be bugfix relesase (x.x.X)
    • if CSS class names are changed/added/removed it should be minor version (x.X.0)
    • see the wiki for more details
  • Any changes to component class names (new patterns, variants, removed or added features) should be listed on the what's new page.

Screenshots

[if relevant, include a screenshot or screen capture]

@webteam-app
Copy link

@bartaz
Copy link
Member

bartaz commented Jul 11, 2024

Thanks @britneywwc, could you share some context to it, where do we show required on fieldset level instead of input level?

@britneywwc
Copy link
Contributor Author

Hi @bartaz. Yeah sure, when checkbox/radio inputs are grouped under a fieldset and we wish to set the legend for that fieldset group to show that it's required. We set required on the input level as well but the intention behind this is to show the required label (*) on the corresponding legend.

Example use case here: https://github.com/canonical/ubuntu.com/blob/56e02eb43914c928fc20e553f75eb70ae56e4d74/templates/kernel/real-time/contact-us.html#L312

Please let me know it makes sense to add it to the legend field, it's ongoing work so I figured this could be upstreamed if useful.

@bartaz
Copy link
Member

bartaz commented Jul 11, 2024

In such case I'd suggest making an example that reflects this use case (have a group of checkboxes inside the fieldset, rather than text input).

scss/_base_reset.scss Outdated Show resolved Hide resolved
@bartaz
Copy link
Member

bartaz commented Jul 22, 2024

There seem to be some linting/prettier issues that fail the tests. You can run dotrun test locally to see them as well.

For the linter failing that we don't allow element selectors, just disable linting for that (we are doing that for all base styles, because we expect them to be on elements).

@pastelcyborg pastelcyborg self-requested a review August 12, 2024 16:56
scss/_base_forms.scss Outdated Show resolved Hide resolved
scss/_base_forms.scss Outdated Show resolved Hide resolved
templates/docs/base/forms.md Outdated Show resolved Hide resolved
scss/_base_forms.scss Outdated Show resolved Hide resolved
Copy link
Member

@jmuzina jmuzina left a comment

Choose a reason for hiding this comment

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

Added a note about adding this to combined forms example to ensure this gets tested by Percy.

Also, I think this should set package.json package version to 4.15.1 as 4.15.0 has already been released and no PR has updated main to 4.15.1 yet.

edit: updated to 4.16.0 as we have since pushed a minor version update to staging :)

@britneywwc
Copy link
Contributor Author

Thanks for all the suggestions, I've addressed them in the recent pushes. Please have another look!

@jmuzina
Copy link
Member

jmuzina commented Aug 14, 2024

Thanks @britneywwc ! Another thing - can we get an entry in releases.yml announcing the new class variant?

Copy link
Contributor

@pastelcyborg pastelcyborg left a comment

Choose a reason for hiding this comment

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

LGTM; please just roll back that content/margin-right change in the unresolved conversation and it's good to go!

@jmuzina jmuzina merged commit 154e858 into canonical:main Aug 15, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants