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] Refactor Role mappings to use single endpoint #102096

Conversation

scottybollinger
Copy link
Contributor

@scottybollinger scottybollinger commented Jun 14, 2021

Summary

This PR accomplishes 3 things:

  1. Fixes two minor bugs from [Enterprise Search] Refactor RoleMappingsTable to use EuiInMemoryTable #101918 (ae32dfe, f37d2ea)
  2. Refactors the API calls for role mappings. After this PR, we now receive all data that is needed for rendering role mappings in the initial server request. Previously calls were made when either creating or updating an endpoint to fetch the necessary data for the UI. Since this is now a single-page feature, we no longer need the extra calls.
  3. Fix some logic in Workplace Search to match App Search. This simplifies the logic and matches App Search (cc97d98)

Please review ent-search companion PR as a part of this review.

Checklist

This was missed when refactoring the table to an EUI component. Built-in mappings have tooltips and don’t have IDs and need to show tooltips instead of actions.
Also missed in the refactor. Made a mistake when copying/pasting
As a part of this feature, we are now passing all props needed for the UI in the list endpoint. Previously, whether creating a new mapping, or updating an existing mapping, an endpoint had to be called to fetch the data needed for display. Now all this data comes from the initial fetching of mappings and the other endpoints are no longer needed.
There was an issue where 100% test coverage was not achieved in Workplace Search. This had already been fixed in App Search by refactoring. This changes the code and test in Workplace Search to match
@scottybollinger scottybollinger added auto-backport Deprecated - use backport:version if exact versions are needed Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.14.0 labels Jun 14, 2021
@scottybollinger scottybollinger marked this pull request as ready for review June 14, 2021 16:48
@scottybollinger scottybollinger requested review from a team June 14, 2021 16:48
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
enterpriseSearch 2.1MB 2.1MB -824.0B

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

Copy link
Contributor

@yakhinvadim yakhinvadim left a comment

Choose a reason for hiding this comment

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

WS changes LGTM

Copy link
Member

@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.

Rubberstamping for speed - generally if something is approved on Kibana I think it's GTG on ent-search without waiting for CODEOWNERS approval

@scottybollinger scottybollinger merged commit 42aa7f5 into elastic:master Jun 15, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 15, 2021
…astic#102096)

* Add tooltip back to table row

This was missed when refactoring the table to an EUI component. Built-in mappings have tooltips and don’t have IDs and need to show tooltips instead of actions.

* Fix roleType display

Also missed in the refactor. Made a mistake when copying/pasting

* Refactor logic files to use single endpoint for UI props

As a part of this feature, we are now passing all props needed for the UI in the list endpoint. Previously, whether creating a new mapping, or updating an existing mapping, an endpoint had to be called to fetch the data needed for display. Now all this data comes from the initial fetching of mappings and the other endpoints are no longer needed.

* Refactor WS test to match AS

There was an issue where 100% test coverage was not achieved in Workplace Search. This had already been fixed in App Search by refactoring. This changes the code and test in Workplace Search to match

* Remove server routes
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Jun 15, 2021
…02096) (#102229)

* Add tooltip back to table row

This was missed when refactoring the table to an EUI component. Built-in mappings have tooltips and don’t have IDs and need to show tooltips instead of actions.

* Fix roleType display

Also missed in the refactor. Made a mistake when copying/pasting

* Refactor logic files to use single endpoint for UI props

As a part of this feature, we are now passing all props needed for the UI in the list endpoint. Previously, whether creating a new mapping, or updating an existing mapping, an endpoint had to be called to fetch the data needed for display. Now all this data comes from the initial fetching of mappings and the other endpoints are no longer needed.

* Refactor WS test to match AS

There was an issue where 100% test coverage was not achieved in Workplace Search. This had already been fixed in App Search by refactoring. This changes the code and test in Workplace Search to match

* Remove server routes

Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
cuff-links pushed a commit to cuff-links/kibana that referenced this pull request Jun 15, 2021
…astic#102096)

* Add tooltip back to table row

This was missed when refactoring the table to an EUI component. Built-in mappings have tooltips and don’t have IDs and need to show tooltips instead of actions.

* Fix roleType display

Also missed in the refactor. Made a mistake when copying/pasting

* Refactor logic files to use single endpoint for UI props

As a part of this feature, we are now passing all props needed for the UI in the list endpoint. Previously, whether creating a new mapping, or updating an existing mapping, an endpoint had to be called to fetch the data needed for display. Now all this data comes from the initial fetching of mappings and the other endpoints are no longer needed.

* Refactor WS test to match AS

There was an issue where 100% test coverage was not achieved in Workplace Search. This had already been fixed in App Search by refactoring. This changes the code and test in Workplace Search to match

* Remove server routes
@scottybollinger scottybollinger deleted the scottybollinger/rm-route-refactor branch June 24, 2021 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v7.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants