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

[Infra UI] Add Features section to Infra settings #168712

Merged

Conversation

mykolaharmash
Copy link
Contributor

@mykolaharmash mykolaharmash commented Oct 12, 2023

Closes #167062

Summary

  • Adds "Features" section to Infra settings screen
  • Hooks changes to uiSettings into existing form in order to use the current "Discard" and "Apply" buttons logic
  • Replaces usage of uiSettings with settings.client as uiSettings seems to be [deprecated]([KibanaReact] Use settings service in useUiSetting hook #154710. Observables exposed by uiSettings do not seem to work anymore.
  • Deletes the Hosts landing screen
  • Revives the logic for showing/hiding Hosts nav item depending on the settings toggle
CleanShot.2023-10-17.at.16.48.24.mp4

How to test

  • Checkout locally and run in stateful mode
  • Go to Infra Setttings screen and make sure Features section is present
  • Make sure that the "Infrastructure Hosts view" toggle shows/hides the Hosts nav item
  • Make sure that "Infrastructure Hosts view" in "Anvanced Settings" is synced with the the one in Infra settings

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@mykolaharmash mykolaharmash force-pushed the 167062-features-infra-settings branch from a3473ef to 166e7af Compare October 12, 2023 14:33
@mykolaharmash mykolaharmash added Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting v8.12.0 labels Oct 12, 2023
@mykolaharmash mykolaharmash marked this pull request as ready for review October 12, 2023 14:39
@mykolaharmash mykolaharmash requested review from a team as code owners October 12, 2023 14:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

Copy link
Contributor

@alisonelizabeth alisonelizabeth left a comment

Choose a reason for hiding this comment

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

Management changes LGTM (packages/serverless/settings/observability_project/index.ts). Please see comment for awareness. Did not test locally.

@@ -27,4 +27,5 @@ export const OBSERVABILITY_PROJECT_SETTINGS = [
settings.OBSERVABILITY_APM_TRACE_EXPLORER_TAB_ID,
settings.OBSERVABILITY_ENABLE_AWS_LAMBDA_METRICS_ID,
settings.OBSERVABILITY_APM_ENABLE_CRITICAL_PATH_ID,
settings.OBSERVABILITY_ENABLE_INFRASTRUCTURE_HOSTS_VIEW_ID,
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI - this setting will also appear on the Advanced Settings page in serverless. Just pointing out as it wasn't mentioned in the PR description.

Copy link
Contributor

@neptunian neptunian Oct 12, 2023

Choose a reason for hiding this comment

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

Hi @alisonelizabeth I reached out to understand further but I was under the impression that there wasn't going to be an observability advanced settings area or at least one where Infra could have a setting. If there is and we can keep our setting there, we don't necessarily need to add it to our own UI. Since it won't work in our UI without enabling it here, I assume we then have to show it in the Project Advanced Settings and I misinterpreted the docs.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mykolaharmash I think we need to leave this out for now and add it when we "flip the switch" to enable our plugin. Otherwise this setting will show up with no Infra UI if we haven't enabled the plugin for serverless yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @alisonelizabeth I reached out to understand further but I was under the impression that there wasn't going to be an observability advanced settings area or at least one where Infra could have a setting. If there is and we can keep our setting there, we don't necessarily need to add it to our own UI. Since it won't work in our UI without enabling it here, I assume we then have to show it in the Project Advanced Settings and I misinterpreted the docs.

You can go to /app/management/kibana/settings to view Advanced Settings in serverless for each project type.

It is possible to have project-specific settings. The settings are defined here. You'll see that there is a set of common settings that are used across project types, as well as project-specific settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI - this setting will also appear on the Advanced Settings page in serverless. Just pointing out as it wasn't mentioned in the PR description.

Thank you @alisonelizabeth for pointing this out! Somehow I thought that the allowlist only enables the changes through the API and does not affect the UI 🙈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mykolaharmash I think we need to leave this out for now and add it when we "flip the switch" to enable our plugin. Otherwise this setting will show up with no Infra UI if we haven't enabled the plugin for serverless yet.

Agree 💯

@neptunian
Copy link
Contributor

neptunian commented Oct 12, 2023

@mykolaharmash In #142477 at the time Hosts was unavailable or hidden in the navigation and turned on if the setting was enabled. We used an observable so it would react to the change without a refresh. I think the same should happen now where when I go to the advanced settings enable/disable it and then click on Hosts the change should be reflected. Would this be difficult to change? I also think our UI setting should update when the one in the Advanced Setting does. I understand it might not work vice versa where the Advanced Setting changes when the one in our UI settings changes and I think that's fine for now.

@mykolaharmash
Copy link
Contributor Author

mykolaharmash commented Oct 13, 2023

@mykolaharmash In #142477 at the time Hosts was unavailable or hidden in the navigation and turned on if the setting was enabled. We used an observable so it would react to the change without a refresh. I think the same should happen now where when I go to the advanced settings enable/disable it and then click on Hosts the change should be reflected. Would this be difficult to change? I also think our UI setting should update when the one in the Advanced Setting does. I understand it might not work vice versa where the Advanced Setting changes when the one in our UI settings changes and I think that's fine for now.

Thank you for catching this @neptunian 🙌 I double-checked and it seems like toggling the flag in advanced settings does not have an immediate effect in the current version as well. Have not checked the code but my guess is that it worked before with nav item because the nav component was subscribed to the observable and once we switched to the new Hosts landing screen, that lives within our plugin, the subscription is not initialized while user is on the advanced settings screen, so it requires a page reload.

With the Features section in our own settings toggling the flag works as expected and the landing screen updates without a refresh.

In case we decide to keep the Feature section, what we could do is force page reload when making changes from Advanced Settings and rely on the observable when changing from Infra settings. Or alternatively, we could always reload the page, in case we want to keep the toggles in sync on the Infra and Advanced Settings screens (afaik there is no other way to reset the uiSettings cache other than page reload).

Wdyt?

@mykolaharmash
Copy link
Contributor Author

Moving back to draft as requirements in #167062 have been updated.

@mykolaharmash mykolaharmash marked this pull request as draft October 13, 2023 12:33
@mykolaharmash mykolaharmash force-pushed the 167062-features-infra-settings branch from 4012e50 to f4a521b Compare October 17, 2023 14:36
@mykolaharmash mykolaharmash marked this pull request as ready for review October 17, 2023 14:52
@mykolaharmash mykolaharmash requested a review from a team as a code owner October 17, 2023 14:52
@neptunian
Copy link
Contributor

Looks great!

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
infra 1414 1411 -3

Async chunks

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

id before after diff
infra 1.9MB 1.9MB -2.5KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
infra 105.8KB 106.3KB +548.0B
observabilityShared 47.1KB 47.1KB +23.0B
total +571.0B
Unknown metric groups

miscellaneous assets size

id before after diff
infra 1.2MB 961.0KB -238.2KB

History

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

Copy link
Contributor

@cauemarcondes cauemarcondes left a comment

Choose a reason for hiding this comment

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

@mykolaharmash maybe to keep it consistent with what we have on Profiling and APM you should use the bottom button bar when something has changed.
Screenshot 2023-10-18 at 09 45 11

@mykolaharmash
Copy link
Contributor Author

@mykolaharmash maybe to keep it consistent with what we have on Profiling and APM you should use the bottom button bar when something has changed. Screenshot 2023-10-18 at 09 45 11

Right, was thinking the same as we use the bottom bar on the Advanced Settings screen and APM settings. The current infra settings already had those custom form buttons and I did not want to bloat this PR with bottom bar refactoring. If you don't mind, I'll create a separate issue to migrate the whole form to use the bottom bar, wdyt?

@mykolaharmash
Copy link
Contributor Author

mykolaharmash commented Oct 18, 2023

Created a ticket to unify the buttons #169210 cc @cauemarcondes

@cauemarcondes
Copy link
Contributor

Created a ticket to unify the buttons #169210 cc @cauemarcondes

Thanks for that... 🙏🏻

@mykolaharmash mykolaharmash removed request for a team October 19, 2023 07:31
@mykolaharmash mykolaharmash merged commit 8478047 into elastic:main Oct 19, 2023
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 release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Infra UI] duplicate advanced setting to Infra settings
8 participants