-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Allow classes to define client side actions #22579
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
base: main
Are you sure you want to change the base?
Allow classes to define client side actions #22579
Conversation
|
My initial reaction to this is that it does not seem ideal. |
I am going for a progressive improvement approach here, with the goal to improve the KB step by step without breaking everything. The target for the first iteration is simply to start removing tabs one by one (by moving the content into the main tab and the "actions" dropdown). We don't need a custom layout for that, we'll work on it in another iteration.
Doesn't seem a big issue to me, there are 10 lines added in the backend code and 5 on the client. |
|
(My bad it should target main tho). |
2580e28 to
1439b66
Compare
How does this affect the use of massive actions in the legacy API? The new KB looks like an interactive client-side feature, but this code doesn't seem to align with that. Granted, this is indeed only a very small part of the work so I don't have the full view of where this is going. |
|
My opinion that is probably not surprising to anyone, is to implement the main view (including an actions toolbar) of the KB in Vue to start and then slowly replace the tabs with features in that view. Otherwise, you are looking at potentially building this feature as SSR just to rewrite it again later. |
I don't want to start adding Vue code until it's been agreed by most of the team (there are still a lot of people strongly against it). While this feature require some client interactions, the vast majority of it are very simple tasks like toggling some item visibility (side panel, modals, alerts, ...) and enabling/disabling the rich text editor. I think a standard JS module will be plenty enough for this (maybe time will prove me wrong, but that's how I see it when trying the mock I was given). |
This is only for single items. API should already be excluded but I'll add another check to be safe. |
Checklist before requesting a review
Description
Classes can now implement a
HasClientSideActionsInterfaceinterface like this:In this example, this will add the "My action" entry to the single action dropdown:
Which will display this:
This action does nothing by default.
You can then listen to the event (using the value defined as the
key) to execute client side code as needed:This will be needed for the upcoming KB rework as we need to execute some client side logic using the action dropdown.