-
Notifications
You must be signed in to change notification settings - Fork 900
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(core/presentation): Support inline radio buttons #7078
feat(core/presentation): Support inline radio buttons #7078
Conversation
- Remove inline checkbox and radio button CSS tweaks (revert margin/padding to Bootstrap 3 defaults) - Add margin hack for inline radio/checkboxes to support wrapping to the next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't feel like I have enough/any context on the motivation for splitting out stringOptions
/options
, so no real opinion there.
const RadioButton = ({ option }: { option: Option }) => ( | ||
<label key={option.label} className={inline ? 'radio-inline clickable' : 'inline clickable'}> | ||
<input type="radio" {...otherProps} value={option.value as any} checked={option.value === selectedValue} /> | ||
<Markdown message={option.label} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realize this was already here before the diff, purely curiosity: is this intended for html sanitization/support, actual markdown support, or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When its merged I'll remove the provider specific implementation in favour of this one. |
I can't wait to use this, looks great! 🔥 |
8398d77 refactor(*): make accountExtractor return an array of strings (spinnaker#7068) e6d1586 feat(core/presentation): support JSX for validationMessage in FormFields (spinnaker#7083) 78a9f72 fix(core): Disable rewriteLinks to allow proper event handling (spinnaker#7064) 3f21c1f feat(executions): Adding redirect for execution without application (spinnaker#7076) f89d97d feat(core/presentation): Add "success" type to ValidationMessage (spinnaker#7082) 4e89a39 refactor(core/presentation): Consolidate Checklist and ChecklistInput components (spinnaker#7077) 9bbc002 feat(core/presentation): Support inline radio buttons (spinnaker#7078) b142789 fix(triggers): Poll on execution id instead of event id (spinnaker#7067) 6af93e3 refactor(pipeline): Pipeline stage execution details to react (spinnaker#7063)
8398d77 refactor(*): make accountExtractor return an array of strings (#7068) e6d1586 feat(core/presentation): support JSX for validationMessage in FormFields (#7083) 78a9f72 fix(core): Disable rewriteLinks to allow proper event handling (#7064) 3f21c1f feat(executions): Adding redirect for execution without application (#7076) f89d97d feat(core/presentation): Add "success" type to ValidationMessage (#7082) 4e89a39 refactor(core/presentation): Consolidate Checklist and ChecklistInput components (#7077) 9bbc002 feat(core/presentation): Support inline radio buttons (#7078) b142789 fix(triggers): Poll on execution id instead of event id (#7067) 6af93e3 refactor(pipeline): Pipeline stage execution details to react (#7063)
This PR changes the following things in
RadioButtonInput
:inline
radio buttons.stringOptions
prop instead of overloadingoptions
which previously took either an array ofOption
objects or an array ofstring
s (I'm open to feedback on this API change)Set
of options to an array, so ordering can be applied.I'd primarily like feedback from @anotherchrisberry but he's OOO so I'm tagging Erik and Alan.
This PR also reverts tweaks to global bootstrap CSS that adjust margins and padding.
before:
![Screen Shot 2019-06-03 at 6 22 18 PM](https://user-images.githubusercontent.com/2053478/58844560-8b952080-862c-11e9-91ad-480c947f28d1.png)
after:
![Screen Shot 2019-06-03 at 5 47 04 PM](https://user-images.githubusercontent.com/2053478/58844563-92bc2e80-862c-11e9-8b77-c4d0cc5319e1.png)
Finally, this adds support for wrapping of inline checkboxes and radio buttons using a margin hack. This puts the margin between successive elements on the right of the element instead of the left. This is to support wrapping of inline checkboxes and radios.
before:
![Screen Shot 2019-06-03 at 5 53 00 PM](https://user-images.githubusercontent.com/2053478/58844589-c39c6380-862c-11e9-8471-5449ab8f9054.png)
after:
![Screen Shot 2019-06-03 at 5 53 39 PM](https://user-images.githubusercontent.com/2053478/58844594-cc8d3500-862c-11e9-9c1f-5c7d2ccc2fe3.png)
cc: @Jammy-Louie I believe this component should allow you to drop this duplicate component:
deck/app/scripts/modules/cloudfoundry/src/presentation/forms/inputs/CloudFoundryRadioButtonInput.tsx
Lines 23 to 57 in de57adf