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 a way to intercept and rewrite user messages #183514

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

markov00
Copy link
Member

@markov00 markov00 commented May 15, 2024

Summary

This is a simple POC that provides a way to intercept, review and modify user messages coming from a Lens embeddable.

The property handleUserMessages?: (userMessages: UserMessage[]) => UserMessage[]; can be used from the lens embeddable to remap/rewrite/filter the UserMessages that the embeddable is throwing to the user.
This includes both info, warning and error messages.

The UserMessage type needs to be extended a few more property to be able to correctly manipulate the user messages:

  • a messageType property should be added to identify the message type. An enum/string can be used to represent each specific message type and have a specific semantic meaning (for example LENS_FORMULA_MISSING_FIELD_ERROR.
  • for each messageType there could be some context variables that provide more information about the error itself (in the case of formula missing field we can provide for example the associated field names.

At the dashboard level, we can probably implement all the necessary logic to filter/review/modify the messages for managed dashboard at the Lens embeddable bootstrap.

Screenshot 2024-05-15 at 15 33 47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant