Made a taskwrapperview to be able to properly sort in the taskwrapper…#2034
Made a taskwrapperview to be able to properly sort in the taskwrapper…#2034
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dedicated TaskWrapperDisplay database view + API model to provide a UI-friendly representation of task wrappers (including a computed displayName) so clients can sort/display wrappers consistently.
Changes:
- Introduces
TaskWrapperDisplaySQL views for both Postgres and MySQL. - Adds new DBA model/factory and API v2 endpoint (
/api/v2/ui/taskwrapperdisplays) for read-only access. - Wires the new model into the API factory mapping and API v2 registration.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/migrations/postgres/20260413140000_task-view.sql | Creates the Postgres TaskWrapperDisplay view with wrapper/task fields + displayName. |
| src/migrations/mysql/20260413140000_task-view.sql | Creates the MySQL TaskWrapperDisplay view mirroring the Postgres definition. |
| src/inc/apiv2/model/TaskWrapperDisplayAPI.php | New read-only API resource with ACL filtering based on hashlist access groups. |
| src/inc/apiv2/common/AbstractBaseAPI.php | Maps TaskWrapperDisplay model class to its DBA factory for API operations. |
| src/dba/models/TaskWrapperDisplayFactory.php | New factory to hydrate TaskWrapperDisplay objects from DB rows. |
| src/dba/models/TaskWrapperDisplay.php | New DBA model describing the view’s fields and metadata. |
| src/dba/models/generator.php | Registers TaskWrapperDisplay in the model generator configuration. |
| src/dba/Factory.php | Adds TaskWrapperDisplayFactory singleton getter. |
| src/api/v2/index.php | Registers TaskWrapperDisplayAPI routes with the v2 API app. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
We additionally need the following data in the frontend to be able to display all things we currently do. The taskwrapper endpoint did contain these, the new taskwrapperdisplay endpoint does not:
The display endpoint contains hashlistId and accessgroupId, but hashtype is completely missing. |
Thanks for checking, I will add them |
|
*Edit: We need also the task.status of all tasks of the taskWrapper for the status calculation which currently is done in the frontend. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
src/inc/apiv2/model/TaskWrapperAPI.php:119
- With the removal of
parseFilters()(which previously forced a LEFT JOIN and constrained the Task join totaskType = NORMAL), any sorting/filtering ontask.*via thetaskrelationship in this endpoint will now use a default INNER join onTask.taskWrapperId. That can duplicate TaskWrapper rows when multiple tasks share a wrapper and also makes the singulartaskrelationship ambiguous for SUPERTASK wrappers. If this endpoint is still expected to supportsort=task.taskName/ filters ontask.*, the join needs an equivalent constraint; otherwise consider removing the to-onetaskrelationship and using onlytasks/the new TaskWrapperDisplay endpoint.
/**
* @throws HttpError
*/
protected function createObject(array $data): int {
throw new HttpError("TaskWrappers cannot be created via API");
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… overview