-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ObsUX] Use bottom bar action buttons in Infra settings #169210
Comments
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
@mykolaharmash I added a |
@cauemarcondes Is it ok to new dev work on this issue? if ok can you please help me to assign this issue. Thanks. |
Hey @abfahimb, one example of how to implement this would be following what has done on The settings page on APM imports the We don't want to copy and paste this component in the Infra plugin but rather export it to a common place where more plugins could use it. So here are the steps:
@mykolaharmash could you point out where the files are in the Infra plugin? |
Hey @cauemarcondes @abfahimb. Here is the component that handles the bottom bar in Infra. Just a heads up, bringing this unified bottom bar to Infra might be a bit trickier as it does not already use a similar component to APM or Advanced Settings, we might need to refactor the whole Infra settings form state management a bit. |
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
@jennypavlova just fyi, there is an open PR that also touches some parts of the settings editing logic, there might be some conflicts. |
@mykolaharmash Thank you, I will keep it in mind, I am working on other PR/review so I was only looking at the current implementation for now and I haven't pushed any changes yet and I should probably use part of the changes in the PR you mentioned so if the PR is merged soon I will pull the changes 👍 |
The PR is not merged yet so I started with some changes here: I was looking at the infra settings and as @mykolaharmash mentioned they are different than the form in APM - the on/off feature switches are pretty similar but the indices and name field are different - there are no default values concept and there is extra validation on the metrics indices and the name should not be empty. I checked in APM and there is no messages/validation there if I set an invalid value the save button is visible but when I click it the value is reset (Which I think is not perfect so we should keep the infra validation even if the bar is hidden when the form is invalid): Screen.Recording.2024-01-17.at.14.11.29.movSo in infra when the form is invalid, the action bar will disappear and also if there is a change in one of the fields and then the change is removed and the old value is shown in the form it will still track it as change. So I tried it and apart from that the infra functionality is the same as it was with the old buttons (except that the bar is hidden and the buttons are disabled). infra_settings_new_action_bar_720.movI found the defaultSourceConfiguration but in some cases, it can be merged with other values so currently we don't have reset to default option (as this will override other configuration the user set there) So, in that case, I don't think we need the @mykolaharmash I saw you mentioned something about the state management in infra - do you mean the default values and validation (I will look into those) or I am missing something there - I am adding a draft PR so you can see what I mean in this comment |
@jennypavlova tbh I don't quite remember, but I think I was just meant the fact that component props and callbacks from the custom bottom bar in Infra are quite different from the one in APM in Advanced Settings, and we might need more changes in Infra to adapt to the unified bottom bar API. |
Closes #169210 ## Summary This PR adds bottom bar action buttons to the infra settings page to make it consistent with the APM settings page. The bottom bar appears after a change is made (and won't appear if the value is the same as it was before - same as APM). | APM | Infra Now | | ---- | ---------- | | ![image](https://github.com/elastic/kibana/assets/14139027/8400cc75-c3d3-40c6-adf7-040779598c7d) | ![image](https://github.com/elastic/kibana/assets/14139027/60f49a78-f733-43f4-a1c8-9b9c337b49f6) | The infra page validation is a bit different so I used the same logic as in advance settings - if the field is invalid disable the button and show a tooltip: <img width="1920" alt="image" src="https://github.com/elastic/kibana/assets/14139027/9e73e77f-f572-4dbe-a8cc-9aa7bf5ec370"> ## Testing - Open the infra settings page - Check if the bottom bar is displayed and the save/discard functionality works as expected - Check infra valdation - Verify that the APM settings page works as expected https://github.com/elastic/kibana/assets/14139027/6804e24b-2b33-456d-be8f-cb17cc044759
…c#175024) Closes elastic#169210 ## Summary This PR adds bottom bar action buttons to the infra settings page to make it consistent with the APM settings page. The bottom bar appears after a change is made (and won't appear if the value is the same as it was before - same as APM). | APM | Infra Now | | ---- | ---------- | | ![image](https://github.com/elastic/kibana/assets/14139027/8400cc75-c3d3-40c6-adf7-040779598c7d) | ![image](https://github.com/elastic/kibana/assets/14139027/60f49a78-f733-43f4-a1c8-9b9c337b49f6) | The infra page validation is a bit different so I used the same logic as in advance settings - if the field is invalid disable the button and show a tooltip: <img width="1920" alt="image" src="https://github.com/elastic/kibana/assets/14139027/9e73e77f-f572-4dbe-a8cc-9aa7bf5ec370"> ## Testing - Open the infra settings page - Check if the bottom bar is displayed and the save/discard functionality works as expected - Check infra valdation - Verify that the APM settings page works as expected https://github.com/elastic/kibana/assets/14139027/6804e24b-2b33-456d-be8f-cb17cc044759
At the moment Advanced Settings, APM and Profiling plugins use the same bottom bar with "Save"/"Cancel" buttons on their settings screens which is different from what Infra Settings is using. We need to unify the UI and, ideally create a shared component for that bottom bar as currently all three plugins use custom components that look the same.
The text was updated successfully, but these errors were encountered: