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

Ability to add attributes to select option #977

Merged

Conversation

malcolmhire
Copy link

@malcolmhire malcolmhire commented Sep 4, 2018

Within our service, we need the ability to add data attributes to a select option, I've used a very similar approach to how radio and checkboxes attributes were added by @colinrotherham to keep it simple.

Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

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

This looks great, thanks! There's a couple of very minor comments that it'd be good to fix if possible, then we'll need a review from another member of the team and we can get this merged 👍

@@ -17,6 +17,12 @@ examples:
value: 3
text: GOV.UK frontend option 3
disabled: true
-
Copy link
Contributor

Choose a reason for hiding this comment

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

Generally we're trying to only add to these examples when there's a visual difference that we need to be able to eyeball in the review app – we can omit this because we've got tests that cover this functionality.

It'd be good if we could remove this addition, and revert the corresponding changes to the README.

(sorry that this isn't documented anywhere – we must make this clearer)

Copy link
Author

Choose a reason for hiding this comment

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

This should now be reverted, thanks for the quick review 😀

@@ -151,6 +151,40 @@ describe('Select', () => {
})
})

describe('when they include option attributes', () => {
it('it renders the option attributes', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor – duplicated 'it', don't need to include it as part of the test name.

Copy link
Author

Choose a reason for hiding this comment

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

Removed the duplicate, thanks.

@36degrees
Copy link
Contributor

@malcolmhire sorry, one more thing – would you be able to add a entry for this to the changelog?

Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

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

I think this requires a changelog entry since we're adding a new feature (woo 🙌).

We can do this on your behalf, let us know.

Edit: Oops, didn't refresh to see Ollie's comment sorry!

@36degrees
Copy link
Contributor

Thanks Malcolm – unfortunately there's a conflict because the CHANGELOG has changed on master. Would you be able to rebase against master?

(I am very happy to do this on your behalf if you'd prefer)

@malcolmhire
Copy link
Author

@36degrees Yeah if you go ahead and rebase for me, I don't often use rebase.

@36degrees 36degrees force-pushed the feature/select-option-attributes branch from fa26abf to 17096ca Compare September 7, 2018 08:41
@36degrees 36degrees force-pushed the feature/select-option-attributes branch from 17096ca to 7e04169 Compare September 7, 2018 08:42
Copy link
Contributor

@36degrees 36degrees left a comment

Choose a reason for hiding this comment

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

I've rebased this against master to resolve the conflict. I've also taken the liberty of squashing some of your commits together – I hope that's OK!

Happy this can now be merged once it's been reviewed by another member of the team – thanks again for all your work on this.

@36degrees
Copy link
Contributor

@NickColley would you mind re-reviewing?

@malcolmhire
Copy link
Author

malcolmhire commented Sep 7, 2018

@36degrees yeah fine to squash my commits 🙂. No problem with helping out, it helps me out in my project once this is released. Also working a very similar feature for the date component, so should have that done sometime soon. 🙂

Copy link
Contributor

@NickColley NickColley left a comment

Choose a reason for hiding this comment

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

Excellent work thank you 👍

@36degrees 36degrees merged commit ecbd5c0 into alphagov:master Sep 7, 2018
@NickColley NickColley mentioned this pull request Sep 10, 2018
@kr8n3r kr8n3r added this to the v2.0.0 milestone Sep 10, 2018
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.

4 participants