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

[Lens] provide the ability to update/modify the User Messages #184985

Closed

Conversation

markov00
Copy link
Member

@markov00 markov00 commented Jun 7, 2024

Summary

This PR provides an example of how an external Lens consumer can intercept and modify the UserMessages Lens shows when something in the visualization/data/configuration is wrong.

The Code also brings in a simple example of intercept and change how the field_not_found message will appear in the O11y solution infra/host page.

Before
Screenshot 2024-06-07 at 10 38 34

After
Screenshot 2024-06-07 at 10 37 05

fix #151526

@markov00 markov00 added enhancement New value added to drive a business result release_note:skip Skip the PR/issue when compiling release notes labels Jun 7, 2024
@roshan-elastic
Copy link

Thanks @markov00!

@crespocarlos - are you able to check this over and confirm which requirements it will allow you to meet in the following issue?

e.g. would it allow you to meet the designs Karolina shared?

@crespocarlos
Copy link
Contributor

@roshan-elastic

are you able to check this over and confirm which requirements it will allow you to meet in the following issue?
Yes. This lets us customize the message

e.g. would it allow you to meet the designs Karolina shared?

The changes allow us to get close to this version

image

But it won't fully match.

image
  1. I don't think we can customize the icon shown on the panel, we can pass in the severity (info, warning, error). Lens renders the icon based on that.
  2. The popover will always show the severity icon on its left side. The right side can be a custom component.

@markov00 correct me if I'm wrong.

@markov00
Copy link
Member Author

markov00 commented Jun 7, 2024

@crespocarlos

I don't think we can customize the icon shown on the panel, we can pass in the severity (info, warning, error). Lens renders the icon based on that.

We can probably find a generic icon that works in your case to put here as info. Right now is the popover configuration shows only error or warning icons, but we can probably add a bit of flexibility there.

The popover will always show the severity icon on its left side. The right side can be a custom component.

correct. This is how every messages are displayed. We can probably force it a bit to make render it completely from your modified message, but I'm wondering if we are gaining benefit from that. If we can provide a way to change the icon, I believe that we can deviate a bit from the proposed style without UX issues, wdyt?

@markov00
Copy link
Member Author

markov00 commented Jun 7, 2024

@crespocarlos do you also need to know the name for each failing field or just catching this error is enough?

@crespocarlos
Copy link
Contributor

@crespocarlos do you also need to know the name for each failing field or just catching this error is enough?

@markov00 , catching this error is enough from now. @roshan-elastic do you think showing the missing fields adds any value for users?

@roshan-elastic
Copy link

Thanks @crespocarlos for jumping on this! (and @markov00)

But it won't fully match.

I'm not to worried about the perfect design and try and make UI handling very specific to us - I see the advantages of having the UX managed centrally as long as we have enough configurability.

Do you know what level of flexibility it gives us?

@crespocarlos do you also need to know the name for each failing field or just catching this error is enough?

@markov00 , catching this error is enough from now. @roshan-elastic do you think showing the missing fields adds any value for users?

If we wanted to show the missing fields in the box, could we do this in the error message?

Also, would we have control to refer to a field in different fonts so we could show field.name and maybe a link to somewhere if we wanted?

@markov00
Copy link
Member Author

I see the advantages of having the UX managed centrally as long as we have enough configurability. Do you know what level of flexibility it gives us?

@roshan-elastic We can provide a way to configure your own icon, but other then that you have complete freedom on how to render that popover panel.

Also, would we have control to refer to a field in different fonts so we could show field.name and maybe a link to somewhere if we wanted?

Totally doable because you have complete freedom there

@roshan-elastic
Copy link

Cool @markov00.

I think it would make sense for us to leverage the icons you set based on the level (e.g. info, warn etc) but if we had the flexibility to use our own icon if we have to - that'd be great.

Would that be part of this PR or would you need to update?

@markov00
Copy link
Member Author

markov00 commented Sep 11, 2024

Closing this PR in favor of this #189099

@markov00 markov00 closed this Sep 11, 2024
@markov00 markov00 deleted the 2024_06_07-expose_handling_messages branch September 11, 2024 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result release_note:skip Skip the PR/issue when compiling release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Lens] hide missing fields errors until the data view has some fields
3 participants