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

chaining actions #197

Open
kapouer opened this issue Jun 3, 2024 · 0 comments
Open

chaining actions #197

kapouer opened this issue Jun 3, 2024 · 0 comments

Comments

@kapouer
Copy link
Member

kapouer commented Jun 3, 2024

Redirection is meant initially to change the page state.
If a redirection to an /@api/xxx url is done, then the server could make the redirection directly - in dev, the client would do it.

Actions (form_api or fetch) request/response fields can be used to plug previous response to next request.
The $pathname, $query, $request, $response fields must be available to the expressions in "request" parameter.

Currently, actions have specific code in their custom-elements to merge the fetch's $response with their redirection attribute.

This allows actions, as clients, to redirect to another page state, and pass parameters through $query to another action which is triggered by the presence of that parameter in the $query.

If an action was redirecting to another action on the same page, it could pass the $response to that action, which then would be fused as an expression in the request parameter of that action, without passing the parameters through a new page state.

If an action is redirection to another action that is not on the same page, the client won't be able to chain those actions. Only the server can.
In practice, chained actions should be maintained on separate "administrative" pages, and client mode would be there as a way to debug them to see how response is merged into next request.

Important note: this mecanism of changing page state is still useful when the user must see different forms because of the result of API calls - e.g, the login form.

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

No branches or pull requests

1 participant