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

[Docs] Selection controls #5607

Merged
merged 48 commits into from
Feb 15, 2022
Merged

Conversation

elizabetdev
Copy link
Contributor

@elizabetdev elizabetdev commented Feb 7, 2022

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

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

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

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

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

Copy link
Contributor

@florent-leborgne florent-leborgne left a comment

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!

src-docs/src/views/selection_controls/guidelines.js Outdated Show resolved Hide resolved
src-docs/src/views/selection_controls/guidelines.js Outdated Show resolved Hide resolved
description={
<p>
The label should be static, action-oriented, and describe the
feature or present a question.
Copy link
Contributor

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
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
Contributor

Choose a reason for hiding this comment

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

🤷‍♀️ 🤣

elizabetdev and others added 2 commits February 8, 2022 17:34
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
Co-authored-by: florent-leborgne <florent.leborgne@elastic.co>
elizabetdev and others added 14 commits February 11, 2022 17:38
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@kibanamachine
Copy link

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

@elizabetdev
Copy link
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
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
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
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.

LGTM! Just found some last text fixes.

src-docs/src/views/guidelines/writing_guidelines.js Outdated Show resolved Hide resolved
text="In a list of already created items, use the past tense."
minHeight={234}
>
<EuiBasicTable columns={columns} items={items} tableLayout="auto" />
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

elizabetdev and others added 4 commits February 15, 2022 18:41
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
…le.js

Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
@kibanamachine
Copy link

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

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants