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

Added labelProps prop to [EuiSwitch, EuiRadio, EuiCheckbox] #4516

Merged
merged 7 commits into from
Feb 18, 2021

Conversation

akashgp09
Copy link
Contributor

Summary

This PR Fixes #3660
Added labelProps prop to EuiSwitch, EuiRadio and EuiCheckbox.

  • data test subject can be added now.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Edge, and Firefox
  • x ] Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for the any docs examples
    - [ ] Added or updated jest tests
    - [ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

src/components/form/radio/radio.tsx Outdated Show resolved Hide resolved
src/components/form/radio/radio.tsx Outdated Show resolved Hide resolved
@akashgp09 akashgp09 requested a review from cchaos February 13, 2021 10:37
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Thanks! These are now applied to the right components. We'll also need to add tests per component. I find it easy to test the types of {...props} by just doing something like:;

<EuiSwitch labelProps={requiredProps} />

@@ -56,6 +57,10 @@ export type EuiSwitchProps = CommonProps &
disabled?: boolean;
compressed?: boolean;
type?: 'submit' | 'reset' | 'button';
/**
* Object of props passed to the <span/>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* Object of props passed to the <span/>
* Object of props passed to the label's <span/>

src/components/form/switch/switch.tsx Show resolved Hide resolved
@akashgp09 akashgp09 marked this pull request as draft February 17, 2021 05:13
@akashgp09 akashgp09 marked this pull request as ready for review February 17, 2021 05:48
@akashgp09 akashgp09 requested a review from cchaos February 17, 2021 05:49
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Almost there. Some more changes to the tests so to ensure they output something expected.

CHANGELOG.md Outdated Show resolved Hide resolved
src/components/form/checkbox/checkbox.test.tsx Outdated Show resolved Hide resolved
src/components/form/radio/radio.tsx Outdated Show resolved Hide resolved
src/components/form/radio/radio.test.tsx Outdated Show resolved Hide resolved
src/components/form/switch/switch.test.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Code LGTM!
Jenkins, test this

@cchaos
Copy link
Contributor

cchaos commented Feb 18, 2021

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4516/

@cchaos
Copy link
Contributor

cchaos commented Feb 18, 2021

Failed to set up Chromium

Jenkins, test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4516/

@cchaos cchaos merged commit db3ddc1 into elastic:master Feb 18, 2021
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.

[EuiSwitch] Can't add data test subject
3 participants