feat(table,runs,sessions): add server-side sorting and pagination

- add sortable column support to Table with asc/desc/unsorted icons
- active sort icon uses --color-primary; no header background change
- Table supports server-side mode via total/page/onPageChange props
- wire server-side sort+pagination in ScenariosPage, AllRunsPage, RunsPage, SessionsPage
- remove steps count column from run tables
- fix server: RunsQueryDto now extends PaginationQueryDto with orderBy/orderDir
- fix findAllRuns to use QueryBuilder; sort by scenario.name via JOIN
- add per-resource typed query DTOs with @IsIn allowlist on orderBy
- prevents SQL injection and returns 400 for unknown orderBy values
This commit is contained in:
ars9 committed 2026-04-15 12:18:47 +03:00
1 parent f268d0e3eb
commit ad155e269c
20 files changed
+456 -125

No files matched your search

@@ -0,0 +1,13 @@
import { ApiPropertyOptional } from "@nestjs/swagger";
import { IsIn, IsOptional } from "class-validator";
import { PaginationQueryDto } from "../../common/dto/pagination.dto";
import { SnippetOrderBy } from "../snippet.service";
const SNIPPET_ORDER_BY: SnippetOrderBy[] = ["id", "alias", "title"];
export class SnippetQueryDto extends PaginationQueryDto<SnippetOrderBy> {
@ApiPropertyOptional({ enum: SNIPPET_ORDER_BY })
@IsOptional()
@IsIn(SNIPPET_ORDER_BY)
declare orderBy?: SnippetOrderBy;
}