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

[Workplace Search] Migrates Org Settings tree #88092

Merged

Conversation

scottybollinger
Copy link
Contributor

@scottybollinger scottybollinger commented Jan 12, 2021

Summary

This PR migrates the Org Settings tree from ent-search.

ui (1)

tests

Checklist

Only does linting changes and lodash import
Use useLocation and no longer pass around history, using the KibanaLogic navigateToUrl method instead
Also change name of component to OauthApplication as the default import was named that before
This is no longer needed with the Kibana syntax. Flash messages are set globally and only render when present.
In Kibana, we use the Eui components directly
We no longer control telemetry in Workplace Search. It is handled by Kibana itself
The global org name is not used anywhere outside of this section so we no longer need to update the global organization object as it is re-fetched when this section is entered.

Previously, we displayed the org name in the sidebar but that has been removed in Kibana
We recently split out the logic from SourceLogic to the new AddSourceLogic and in settings, we were calling the saveSourceConfig method from the SourceLogic (now in AddSourceLogic) file and passing a callback that set the flash messages from that component’s state.

Now, we set the flash messages globally and no longer need to have a saveUpdatedConfig method in the logic file, but can call it directly in the component and the flash messages will be set globally.
We use this method across both Enterprise Search products in Kibana
This would be the only place in the sidebar with a nav item breaking to a second line.
This happens automatically now in the global flash messages logic; route changes trigger clearing of messages
@scottybollinger scottybollinger added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Jan 12, 2021
@scottybollinger scottybollinger marked this pull request as ready for review January 12, 2021 21:19
@scottybollinger scottybollinger requested a review from a team January 12, 2021 21:19
@scottybollinger
Copy link
Contributor Author

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

LGTM! Only 1 minor typo:

);

export const CREDENTIALS_TITLE = i18n.translate(
'xpack.enterpriseSearch.workplaceSearch.credentials.desctitleription',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
'xpack.enterpriseSearch.workplaceSearch.credentials.desctitleription',
'xpack.enterpriseSearch.workplaceSearch.credentials.title',

@yakhinvadim
Copy link
Contributor

@elasticmachine merge upstream

@scottybollinger
Copy link
Contributor Author

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
enterpriseSearch 1085 1095 +10

Async chunks

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

id before after diff
enterpriseSearch 1.8MB 1.9MB +35.4KB

History

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

@scottybollinger scottybollinger merged commit 5f0e9f4 into elastic:master Jan 18, 2021
@scottybollinger scottybollinger deleted the scottybollinger/migrate-settings branch January 18, 2021 20:14
JasonStoltz pushed a commit to JasonStoltz/kibana that referenced this pull request Jan 19, 2021
* Initial copy/paste of component tree

Only does linting changes and lodash import

* Replace withRouter HOC with hooks

Use useLocation and no longer pass around history, using the KibanaLogic navigateToUrl method instead

* Migrate LicenseCallout component

* Update paths

Also change name of component to OauthApplication as the default import was named that before

* Remove conditional and passed in flash messages

This is no longer needed with the Kibana syntax. Flash messages are set globally and only render when present.

* Replace removed ConfirmModal

In Kibana, we use the Eui components directly

* Use internal tools for determining license

* Fix a bunch of type issues

* Remove telemetry settings section

We no longer control telemetry in Workplace Search. It is handled by Kibana itself

* Add SettingsSubNav component

* Add route and update nav

* Remove legacy AppView and sidenav

* Clear flash messages globally

* Remove global name change method call

The global org name is not used anywhere outside of this section so we no longer need to update the global organization object as it is re-fetched when this section is entered.

Previously, we displayed the org name in the sidebar but that has been removed in Kibana

* Refactor saveUpdatedConfig

We recently split out the logic from SourceLogic to the new AddSourceLogic and in settings, we were calling the saveSourceConfig method from the SourceLogic (now in AddSourceLogic) file and passing a callback that set the flash messages from that component’s state.

Now, we set the flash messages globally and no longer need to have a saveUpdatedConfig method in the logic file, but can call it directly in the component and the flash messages will be set globally.

* Update logic file to use global flash messages

* Update server routes

* Replace Rails http with kibana http

* Fix subnav

* Update routes to use consistent syntax

We use this method across both Enterprise Search products in Kibana

* Shorten nav item copy

This would be the only place in the sidebar with a nav item breaking to a second line.

* Fix some random typos

* Replace React Router Link with helper

* Add i18n

* Remove redundant clearing of flash messages

This happens automatically now in the global flash messages logic; route changes trigger clearing of messages

* Add unit tests for components

* Add tests for router

* Store oauthApplication in mock for reuse

* Add tests for SettingsLogic

* Fix typo

* Remove unncessary imports

Copied from this PR:
elastic#88525

* Refactor to use new helpers when mocking

See elastic#88494

* Update logic test to use error helper

See elastic#88422

* Fix type issue

* Fix whitespace lint issue

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Plugins release_note:skip Skip the PR/issue when compiling release notes v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants