-
Notifications
You must be signed in to change notification settings - Fork 7
[FEATURE] Selection provider and Item actions #40
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
Conversation
249c863 to
9c52f39
Compare
9c52f39 to
dbf69c7
Compare
AntoineThebaud
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review of the CUE part
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think item actions are super interesting for embedded usage, maybe a little less for Perses App.
Idea for the future, add a provider for adding supported custom events, it will be useful for autocomplete (who can know all custom events :p) and remove the "custom event" option if there is no custom event supported (like currently in Perses App).
About the webhook, I did not test it, but can we have some CORS issues due to this? Maybe we want to allow to pass by the proxy too (like datasources) at some point?
| } | ||
| return matches; | ||
| } | ||
| // Re-export all variable interpolation utilities from @perses-dev/components for backwards compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason(s) to move everything to @perses-dev/components? Circular deps?
Look like more runtime stuff than components to me 👀
And ItemActionsOptionsEditor + SelectionOptionsEditor, I would see them in @perses-dev/components instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I moved to components or they will create a circular dependency. Re exported as all the plugins currently consume this from the plugin-system so I wanted to avoid big breaking changes for a single release.
I left the new ItemSelectionActionsOptionsEditor in plugin-system as other plugin related editors are there. We can move/refactor these components to the components in a different PR.
...ystem/src/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.tsx
Show resolved
Hide resolved
| ): SelectionState<T, Id> & { hasContext: boolean } { | ||
| const ctx = useContext(SelectionContext); | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not fan of this useEffect, but I guess no others choices. This provider is complex to understand, some comments would be welcomed 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some comments. The useEffect avoids registering the getId function on every render.
| {isCollapsed ? <ChevronRight /> : <ChevronDown />} | ||
| </IconButton> | ||
|
|
||
| <Typography variant="subtitle2">{eventAction.name ?? 'Event Action'}</Typography> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…mers Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
dbf69c7 to
9f2f167
Compare
Yes we can have some CORS issues, I thought about the proxy configuration. But wanted t keep the initial change "small" 😅 |
529c9b3 to
f54133f
Compare
…erpolation Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
Signed-off-by: Gabriel Bernal <gbernal@redhat.com>
f54133f to
18ce97d
Compare
|
Hmmm, I keep getting the following error, when I try to go on Selections or Item Actions of table panel: Did you already had this issue? 👀 |
|
These are the steps I follow in my local setup. Having
# from shared using https://github.com/perses/shared/pull/32
npm i
npm run build
./scripts/link-with-perses/link-with-perses.sh --perses
./scripts/link-with-perses/link-with-perses.sh --plugins
# from perses
./scripts/api_backend_dev.sh --e2e
cd ui
npm i
cd app
npm run start:shared
# from plugins
../perses/bin/percli login
../perses/bin/percli plugin start table |
Gladorme
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I retried and it's working fine (strange). lgtm



Description
This PR adds a new Actions and selection features. perses/perses#3788. This allows to define actions based on selected data, for example calling an HTTP request with the interpolated data from multiple rows selection.
Two new Providers were added to the main Panel component, yes we have more providers but users don't have to configure these two, plugin developers can just use the hooks without any issue as they are resilient to undefined context:
I split into 3 commits so is easier to review:
Screenshots
Screen.Recording.2026-01-23.at.20.41.34.mov
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: