Hello all,
Livetable has a notion of async action, allowing to perform declaratively the following steps:
- the user click on the action
- a request to the action’s url is called in the background (with a loading message)
- the success/failure status of the actions is presented to the user
- in case of success the table is reloaded
I propose to introduce the same notion for Live Data.
Note: the intent for now is to only cover the simple case where no special error handling is required, and where a single http request is enough (i.e., moving a page, where several steps are required, is not covered by this proposal)
Developer
The goal is to make it easy for developers to declare a action are asynchronous, by declaring four properties:
- async: true
- loadingMessage/successMessage/failureMessage: localized messages for the different steps of the async process. Optionally we could provide generic messages, but I’d don’t think that’s really great for users.
{
"meta": {
"actions": [
{
"id": "delete",
// ...Other usual action descriptor properties here
"async": true,
"loadingMessage": "Deletion in progress.",
"successMessage": "Page successfully deleted.",
"failureMessage": "A problem occurred while deleting the page."
}
]
}
}
Implementation
You can see an implementation draft in this PR: XWIKI-21944: Allow live data action to be async by manuelleduc · Pull Request #2937 · xwiki/xwiki-platform · GitHub
Conclusion
WDYT?