Skip to content

uui-box: add a property to control the headline variant #521

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

Merged

Conversation

Digipex
Copy link
Contributor

@Digipex Digipex commented Jun 28, 2023

Description

fixes #447

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (minor updates related to the tooling or maintenance of the repository, does not impact compiled assets)

Motivation and context

How to test?

Story at /docs/layout-box--docs been updated to include new property headerVariant

Change dropdown to a different H tag and inspect element to see component now renders with the H tag selected rather than then always h5

Screenshots (if appropriate)

Checklist

  • If my change requires a change to the documentation, I have updated the documentation in this pull request.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@github-actions
Copy link

github-actions bot commented Jun 28, 2023

Hi there @Digipex, thank you for this contribution! 👍

While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@nielslyngsoe
Copy link
Member

Hi @Digipex thanks for your contribution, well done.

And I'm happy to see that this does not enable the developer to visually pick different headline sizes, but just enabling to correct the tag for Accessibility concerns.

I've added a comment to emphasize this, so no one in the future thinks that's a mistake.

I also did a few minor corrections to the code, to make it work properly with ESLint.

I'm unsure when those commits will be picked up by GitHub. But when they are in place I will approve and merge :-)

@nielslyngsoe nielslyngsoe self-requested a review July 4, 2023 13:57
@Digipex
Copy link
Contributor Author

Digipex commented Jul 4, 2023

Hi @nielslyngsoe

Thanks for the feedback.

Yeah was struggling to figure out the ESLint issue so be good to see what you did.

Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

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

Very good now, and I sneaked a little update to .gitignorer, so I can have cSpell words for the workspace in vs-code...

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) July 4, 2023 19:05
Copy link
Contributor

@iOvergaard iOvergaard left a comment

Choose a reason for hiding this comment

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

I have changed the following:

  • Rename headerVariant to headlineVariant to better reflect what it controls/changes (headline)
  • Moved call to unsafeStatic() out of render() method and used the literal-literal following recommendation from Lit
  • Added a test case to ensure the new property works as intended
  • Fixed prettier formatting
  • Fixed typings.d.ts to allow story files that references markdown files to pass the tsc-files check

LGTM.

@iOvergaard iOvergaard changed the title #447 uui-box: add a property to control header variant uui-box: add a property to control the headline variant Jul 17, 2023
@iOvergaard iOvergaard added the feature Something we are looking to build label Jul 17, 2023
@iOvergaard iOvergaard disabled auto-merge July 17, 2023 12:05
@iOvergaard iOvergaard merged commit 6fd4d85 into umbraco:v1/contrib Jul 17, 2023
iOvergaard added a commit that referenced this pull request Sep 21, 2023
* uui-box: add a property to control header variant

* allow to commit /.vscode/settings.json

* allow for vscode to store workspace cSpell.words

* comment, rendering optimization + disable eslint

* fix: tell typescript raw files can be loaded

* feat: rename to headlineVariant to better reflect what the property changes

* feat: move unsafeStatic call out of render() method and only assign it when the property changes, also use the literal-literal for static strings

* chore: prettier formatting

* docs: update README for headline-variant

* test: update to reflect changed property name

* test: add test to ensure headlineVariant works as intended

---------

Co-authored-by: Niels Lyngsø <[email protected]>
Co-authored-by: Jacob Overgaard <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community/pr feature Something we are looking to build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uui-box: add a property to control header variant
3 participants