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

[Enterprise Search] Added reusable HiddenText component to Credentials #80033

Merged
merged 11 commits into from
Oct 19, 2020

Conversation

JasonStoltz
Copy link
Member

@JasonStoltz JasonStoltz commented Oct 8, 2020

Summary

This PR introduces a new component, HiddenText, which allows you to toggle between real text values and an obfuscated version (with the * character) of that same text.

It uses a similar Render Props pattern to the EuiCopy component: https://elastic.github.io/eui/#/utilities/copy

Example:

<HiddenText text={token.key}>
  {({ hiddenText, isHidden, toggle }) => (
    <div>
      <span>{hiddenText}</span>
      <button onClick={toggle}>{isHidden ? 'Show' : 'Hide'}</button>
    </div>
  )}
</HiddenText>

This PR replaces the plain text credential key with this new HiddenText component.

It also factors out the key display into it's own component, Key, for easier testing and separation.

https://user-images.githubusercontent.com/1427475/95224145-5c666480-07c8-11eb-96a2-d3d0da30032e.png

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@JasonStoltz JasonStoltz added release_note:skip Skip the PR/issue when compiling release notes v7.11.0 labels Oct 8, 2020
@JasonStoltz JasonStoltz requested review from a team and removed request for a team October 8, 2020 17:30
@JasonStoltz JasonStoltz force-pushed the JasonStoltz/hidden-text branch from a5064f3 to 1ad1078 Compare October 8, 2020 18:09
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Test comments

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

some remaining super small nit comments, and that's it from me!

@JasonStoltz
Copy link
Member Author

@constancecchen This is ready for a second look, ty.

@JasonStoltz JasonStoltz requested a review from cee-chen October 19, 2020 18:08
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

🎉 Thanks for the speedy changes Jason!

Some super small comments, not at all blockers. Feel free to commit suggestions from github and merge after if that's easier

@JasonStoltz
Copy link
Member Author

@constancecchen Thanks, updates made, let me know what you think.

@JasonStoltz JasonStoltz requested a review from cee-chen October 19, 2020 19:22
Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Sweeet! FWIW approvals don't dismiss after code changes like ent-search does, so feel free to merge w/o waiting for me if you prefer 🎉

@JasonStoltz
Copy link
Member Author

Oh rad I hadn't noticed.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id before after diff
enterpriseSearch 414 417 +3

async chunks size

id before after diff
enterpriseSearch 639.5KB 642.5KB +3.0KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@JasonStoltz JasonStoltz merged commit e74613a into elastic:master Oct 19, 2020
@JasonStoltz JasonStoltz deleted the JasonStoltz/hidden-text branch October 19, 2020 21:06
JasonStoltz added a commit to JasonStoltz/kibana that referenced this pull request Oct 19, 2020
jloleysens added a commit to jloleysens/kibana that referenced this pull request Oct 20, 2020
…lout-for-warm-and-cold-tier

* 'master' of github.com:elastic/kibana: (126 commits)
  Add cumulative sum expression function (elastic#80129)
  [APM] Fix link to trace (elastic#80993)
  Provide url rewritten in onPreRouting interceptor (elastic#80810)
  limit renovate to npm packages
  Fix bug in logs UI link (elastic#80943)
  [Monitoring] Fix bug with setup mode appearing on pages it shouldn't (elastic#80343)
  [Security Solution][Detection Engine] Fixes false positives caused by empty records in threat list
  docs test (elastic#81080)
  Fixed alerts ui test timeout issue, related to the multiple server calls for delete all alerts, by reducing the number of alerts to the two and increasing retry timeout. (elastic#81067)
  [APM] Fix service map highlighted edge on node select (elastic#80791)
  Fix typo in toast, slight copy adjustment. (elastic#80843)
  [Security Solution] reduce optimizer limits (elastic#80997)
  [maps] 7.10 documentation updates (elastic#79917)
  [Workplace Search] Fix Group Prioritization route and clean up design (elastic#80903)
  [Enterprise Search] Added reusable HiddenText component to Credentials (elastic#80033)
  Upgrade EUI to v29.5.0 (elastic#80753)
  [Maps] Fix layer-flash when changing style (elastic#80948)
  [Security Solution] [Detections] Disable edit button when user does not have actions privileges w/ rule + actions (elastic#80220)
  [Enterprise Search] Handle loading state on Credentials page (elastic#80035)
  [Monitoring] Fix cluster listing page in how it handles global state (elastic#78979)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes v7.11.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants