[DASHBOARDS] Allow dashboards to be restored (#17042)

This PR introduces a few changes:
- Add three actions: see deleted dashboards, destroy dashboard and
restore dashboard
- Remove the soft delete and restore on all the page layout entities
- Cascade the destruction of a dashboard to a page layout

Video QA:


https://github.com/user-attachments/assets/ab993b11-dd9c-4e88-880c-92691a521cc2
This commit is contained in:
Raphaël Bosi
2026-01-12 13:59:17 +01:00
committed by GitHub
parent 3ada8e5168
commit 655f1eef5f
60 changed files with 1178 additions and 2067 deletions
@@ -54,10 +54,10 @@ export class PageLayoutWidgetController {
);
}
return this.pageLayoutWidgetService.findByPageLayoutTabId(
workspace.id,
return this.pageLayoutWidgetService.findByPageLayoutTabId({
workspaceId: workspace.id,
pageLayoutTabId,
);
});
}
@Get(':id')
@@ -66,7 +66,10 @@ export class PageLayoutWidgetController {
@Param('id') id: string,
@AuthWorkspace() workspace: WorkspaceEntity,
): Promise<PageLayoutWidgetDTO | null> {
return this.pageLayoutWidgetService.findByIdOrThrow(id, workspace.id);
return this.pageLayoutWidgetService.findByIdOrThrow({
id,
workspaceId: workspace.id,
});
}
@Post()
@@ -75,7 +78,10 @@ export class PageLayoutWidgetController {
@Body() input: CreatePageLayoutWidgetInput,
@AuthWorkspace() workspace: WorkspaceEntity,
): Promise<PageLayoutWidgetDTO> {
return this.pageLayoutWidgetService.create(input, workspace.id);
return this.pageLayoutWidgetService.create({
input,
workspaceId: workspace.id,
});
}
@Patch(':id')
@@ -85,7 +91,11 @@ export class PageLayoutWidgetController {
@Body() input: UpdatePageLayoutWidgetInput,
@AuthWorkspace() workspace: WorkspaceEntity,
): Promise<PageLayoutWidgetDTO> {
return this.pageLayoutWidgetService.update(id, workspace.id, input);
return this.pageLayoutWidgetService.update({
id,
workspaceId: workspace.id,
updateData: input,
});
}
@Delete(':id')
@@ -93,7 +103,10 @@ export class PageLayoutWidgetController {
async delete(
@Param('id') id: string,
@AuthWorkspace() workspace: WorkspaceEntity,
): Promise<PageLayoutWidgetDTO> {
return this.pageLayoutWidgetService.delete(id, workspace.id);
): Promise<boolean> {
return this.pageLayoutWidgetService.destroy({
id,
workspaceId: workspace.id,
});
}
}