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] Migrate shared role mapping components #91723

Conversation

scottybollinger
Copy link
Contributor

@scottybollinger scottybollinger commented Feb 17, 2021

Summary

Migrate shared role mapping components from ent-search. These will be used by both App Search and Workplace Search in their respective Role Mapping sections.

Checklist

EUI has not updated their types to include this util and no one else in Kibana uses it so falling back to the lodash equivalent
Also cleaned up shared type import
Also added new lines to match other places in Kibana
@scottybollinger scottybollinger added Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.13.0 auto-backport Deprecated: Automatically backport this PR after it's merged labels Feb 17, 2021
- AddRoleMappingButton
- DeleteMappingCallout
- RoleSelector
When trying to achieve coverage it was impossible to create a state that these fallbacks were ever triggered. It’s my assumption that these were added in ent-search to get around TypeScript  errors. Added typings instead.
@scottybollinger scottybollinger marked this pull request as ready for review February 18, 2021 17:43
@scottybollinger scottybollinger requested review from a team as code owners February 18, 2021 17:43
@scottybollinger
Copy link
Contributor Author

@JasonStoltz would you mind taking a look at this commit. It appears the change was made here in ent-search and I want to be sure my assumption and corresponding change are correct.

When actually implementing these I found that these types were wrong
@scottybollinger
Copy link
Contributor Author

It won't let me reply to your comment so doing it here:

Where does tooltip.content come from and does it need to be i18ned?

It is sent from the API

@scottybollinger
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Member

@JasonStoltz JasonStoltz left a comment

Choose a reason for hiding this comment

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

I made a bunch of comments about small stuff, nothing major, but I thought it'd be good to clean this up now rather than needing to circle back to it later.

@JasonStoltz
Copy link
Member

@elasticmachine merge upstream

Copy link
Member

@JasonStoltz JasonStoltz left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks for making those changes.

Side note, I had a really hard time going back through my comments and figuring out which you addressed and which you didn't. It's OK if you don't address everything, but it helps me on re-review if you let me know what you decide. Thanks!

selectedAuthProviders={['kbn_saml']}
/>
);
const select = findAuthProvidersSelect(wrapper) as any;
Copy link
Member

Choose a reason for hiding this comment

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

I see you resolved this but didn't make the change. It's fine if you're choosing not to make this change, but could you just update the comments in the future so I know?

@scottybollinger
Copy link
Contributor Author

@JasonStoltz for some reason GitHub still will not let me reply to your comments inline. In regards to the overlooked, resolved comment, that was an oversight on my part. Sorry for that. When I attempt to make the change locally, it causes type errors in other places.

image

There's actually another one on line 85 that I am not easily able to resolve without the any.

image

IMO it's ok to have any's in test files so I am going to go ahead and merge this on green. If you feel it warrants the effort to remove, we can address it in a separate PR.

@scottybollinger scottybollinger enabled auto-merge (squash) February 22, 2021 14:40
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@scottybollinger scottybollinger merged commit 9477df1 into elastic:master Feb 22, 2021
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Feb 22, 2021
…1723)

* Initial copy/paste of components

* Add types

* Add constants

* Replace EUI toSentenceCase with lodash startCase

EUI has not updated their types to include this util and no one else in Kibana uses it so falling back to the lodash equivalent

* Update paths

* Fix test

* Fix TypeScript issues

* Remove ability check for non-federated users

* Use Kibana React Router helpers

Also cleaned up shared type import

* Update comments

* Fix failing test

Also added new lines to match other places in Kibana

* Add i18n

* Add tests for smaller components

- AddRoleMappingButton
- DeleteMappingCallout
- RoleSelector

* Fix fallbacks

When trying to achieve coverage it was impossible to create a state that these fallbacks were ever triggered. It’s my assumption that these were added in ent-search to get around TypeScript  errors. Added typings instead.

* Add tests for AttributeSelector

* Add mocks and testSubj attrs

* Add tests for RoleMappingsTable

* Fix types

When actually implementing these I found that these types were wrong

* Refactor for better typing

* Remove return type

This was causing a TypeScript error and is not needed

* Rename interface

* Rename more interfaces

* PR feedback

* Add test for radio checked state

* Add false radio assertion to

* Update className

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine
Copy link
Contributor

💚 Backport successful

7.x / #92214

Successful backport PRs will be merged automatically after passing CI.

@scottybollinger scottybollinger deleted the scottybollinger/shared-role-mapping branch February 22, 2021 15:52
gmmorris added a commit to gmmorris/kibana that referenced this pull request Feb 22, 2021
* master:
  Ability to filter alerts by string parameters (elastic#92036)
  [APM] Fix for flaky correlations API test (elastic#91673) (elastic#92094)
  [Enterprise Search] Migrate shared role mapping components (elastic#91723)
  [file_upload] move ml Importer classes to file_upload plugin (elastic#91559)
  [Discover] Always show the "hide missing fields" toggle (elastic#91889)
  v2 migrations should exit process on corrupt saved object document (elastic#91465)
  [ML] Data Frame Analytics exploration page: filters improvements (elastic#91748)
  [ML] Data Frame Analytics: Improved error handling for scatterplot matrix. (elastic#91993)
  [coverage] speed up merging results of functional tests (elastic#92111)
  Adds a Reason indicator to the onClose handler in AddAlert and EditAlert (elastic#92149)
@cee-chen
Copy link
Member

just popping in here to add my 2c, if there's a super quick fix/ alternative to any in tests I'll usually suggest it, but if it takes longer than that / the typing is super annoying, I'm totally good with any in tests 👍

kibanamachine added a commit that referenced this pull request Feb 22, 2021
…92214)

* Initial copy/paste of components

* Add types

* Add constants

* Replace EUI toSentenceCase with lodash startCase

EUI has not updated their types to include this util and no one else in Kibana uses it so falling back to the lodash equivalent

* Update paths

* Fix test

* Fix TypeScript issues

* Remove ability check for non-federated users

* Use Kibana React Router helpers

Also cleaned up shared type import

* Update comments

* Fix failing test

Also added new lines to match other places in Kibana

* Add i18n

* Add tests for smaller components

- AddRoleMappingButton
- DeleteMappingCallout
- RoleSelector

* Fix fallbacks

When trying to achieve coverage it was impossible to create a state that these fallbacks were ever triggered. It’s my assumption that these were added in ent-search to get around TypeScript  errors. Added typings instead.

* Add tests for AttributeSelector

* Add mocks and testSubj attrs

* Add tests for RoleMappingsTable

* Fix types

When actually implementing these I found that these types were wrong

* Refactor for better typing

* Remove return type

This was causing a TypeScript error and is not needed

* Rename interface

* Rename more interfaces

* PR feedback

* Add test for radio checked state

* Add false radio assertion to

* Update className

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated: Automatically backport this PR after it's merged Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants