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

Refactor heading logic in radio component #2051

Merged
merged 2 commits into from
May 7, 2021

Conversation

danacotoran
Copy link
Contributor

@danacotoran danacotoran commented May 6, 2021

What

This is step 1 towards removing the is_page_heading parameter from the radio component.

Why

Due to a need for more flexibility, the ability to pass a custom heading level was introduced to the radio component some time back #1951
The is_page_heading parameter is a specialised flag that dictates that the heading should be a h1 of size xl.
This used to solve a problem when the component did not use to support heading_level, however now that we can use heading_level and heading_size to achieve the same result, the is_page_heading parameter becomes redundant.

The reason we have to do this in steps is that the component is referenced with the is_page_heading parameter in several applications.
Due to the way the logic in this component is structured, it would be a breaking change if we simply went ahead with replacing is_page_heading: true with heading_level: 1 and heading_size: 'xl'

Related issue: #1953

Visual Changes

None

@bevanloon bevanloon temporarily deployed to govuk-publis-retire-is--qy0i9n May 6, 2021 16:41 Inactive
@danacotoran danacotoran marked this pull request as ready for review May 6, 2021 16:43
@danacotoran danacotoran changed the title Retire is_page_heading parameter (part 1) Retire is_page_heading parameter (step 1) May 7, 2021
@danacotoran danacotoran force-pushed the retire_is_page_heading_param_1 branch from 34c0963 to 5c2d7a9 Compare May 7, 2021 11:02
@bevanloon bevanloon temporarily deployed to govuk-publis-retire-is--qy0i9n May 7, 2021 11:02 Inactive
@danacotoran danacotoran force-pushed the retire_is_page_heading_param_1 branch from 5c2d7a9 to a72ab5e Compare May 7, 2021 14:39
@bevanloon bevanloon temporarily deployed to govuk-publis-retire-is--qy0i9n May 7, 2021 14:39 Inactive
@danacotoran danacotoran marked this pull request as draft May 7, 2021 16:10
@bevanloon bevanloon temporarily deployed to govuk-publis-retire-is--qy0i9n May 7, 2021 16:26 Inactive
@danacotoran danacotoran marked this pull request as ready for review May 7, 2021 16:31
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

Looks good! One suggestion for the changelog and I'm not sure we earn much by removing the vowels in heading_lvl, but since this is not exposed in the component API, I'll let you decide on a final name.

This is step 1 towards removing the is_page_heading parameter from the
radio component. The reason behind this is that the ability to pass a
custom heading level was introduced to the radio component some time
back #1951
The is_page_heading parameter is a specialised parameter that dictates
that the heading should be a h1 of size xl.
This used to solve a problem when the component did not use to support
heading_level, however now that we can use heading_level and
heading_size to achieve the same result, the is_page_heading parameter
becomes redundant.

The reason we have to do this in steps is that the component is
referenced with the is_page_heading parameter in several applications.
Due to the way the logic in this component is structured, it would be
a breaking change if we simply went ahead with replacing
is_page_heading: true with heading_level: 1 and heading_size: 'xl'
@danacotoran danacotoran force-pushed the retire_is_page_heading_param_1 branch from e00ca31 to 71167d5 Compare May 7, 2021 16:46
@danacotoran danacotoran changed the title Retire is_page_heading parameter (step 1) Refactor heading logic in radio component May 7, 2021
@bevanloon bevanloon temporarily deployed to govuk-publis-retire-is--qy0i9n May 7, 2021 16:47 Inactive
@danacotoran danacotoran merged commit 7d41d0a into master May 7, 2021
@danacotoran danacotoran deleted the retire_is_page_heading_param_1 branch May 7, 2021 16:50
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