Skip to content

[Docs] Selection controls - #5607

Merged
elizabetdev merged 48 commits into
elastic:mainfrom
elizabetdev:selection-controls
Feb 15, 2022
Merged

elizabetdev merged 48 commits into
elastic:mainfrom
elizabetdev:selection-controls

Conversation

@elizabetdev

@elizabetdev elizabetdev commented Feb 7, 2022 •

Copy link
Copy Markdown
Contributor

Summary

This PR adds a new section called selection controls. It's basically a follow-up on #5558 where we were adding switch guidelines. But we started having some issues, just the EuiSwitch had text in the examples section. The same was happening in the guidelines tab.

So I decided to go ahead and add texts for all the components in the examples tab. Also, more generic guidelines to cover other components.

Selection controls - Elastic UI Framework 1

Decisions to make

Right now in the selection controls section lives:

  • Checkboxes
  • Radio buttons
  • Switches

Should the EuiSelect move out from form controls section and move to this new section?

If we decided to move the EuiSelect to this section let's do it in another PR. Just to not overcomplicate.

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • [ ] Checked in mobile
  • Checked in Chrome, Safari, Edge, and Firefox
  • [ ] Props have proper autodocs and playground toggles
  • Added documentation~
  • [ ] Checked Code Sandbox works for any docs examples
  • [ ] Added or updated jest and cypress 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

@elizabetdev elizabetdev added the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Feb 7, 2022
@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev added the documentation Issues or PRs that only affect documentation - will not need changelog entries label Feb 8, 2022
@kibanamachine

Copy link
Copy Markdown
Contributor

@elizabetdev
elizabetdev marked this pull request as ready for review February 8, 2022 15:18
@kibanamachine

Copy link
Copy Markdown
Contributor

@florent-leborgne florent-leborgne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I left a few small comments. Thanks for putting this together!

description={
<p>
The label should be static, action-oriented, and describe the
feature or present a question.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do you have an example where the label is (or should be) a question?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's a good point. I couldn't find in our products any example where we presented a question so for now I deleted this text.
@cchaos this text was already in our docs, do you have any example of when we should present a question?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤷‍♀️ 🤣

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@kibanamachine

Copy link
Copy Markdown
Contributor

@elizabetdev

Copy link
Copy Markdown
Contributor Author

Thanks, @cchaos for all the help and suggestions. I address all of them.

But... I had some difficulties addressing the playground console log warnings. I was able to address the EuiCheckbox and EuiRadio onChange is marked as required warnings. But for the EuiSwitch, the checked prop is required. If I set it to false:

Screenshot 2022-02-14 at 19 47 36

It gets a warning:

Warning: Failed prop type: The prop `checked` is marked as required in `EuiSwitch`, but its value is `undefined`.


propsToUse.onChange = {
...propsToUse.onChange,
value: 'onChange',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This value renders onChange={()=> {}}:

Screenshot 2022-02-14 at 19 56 03

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I actually don't think you need this configuration at all because the the value you're passing is actually a string not function. I think the dummy function is coming from line 85:

     customProps: {
        onChange: dummyFunction,
      },

@elizabetdev
elizabetdev requested a review from cchaos February 14, 2022 19:57

@cchaos cchaos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM! Just found some last text fixes.

text="In a list of already created items, use the past tense."
minHeight={234}
>
<EuiBasicTable columns={columns} items={items} tableLayout="auto" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

😍

@kibanamachine

Copy link
Copy Markdown
Contributor

@elizabetdev
elizabetdev merged commit ab4f37f into elastic:main Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues or PRs that only affect documentation - will not need changelog entries skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants