Skip to content

feat(api): list widget types and create views without a table on api/2 - #3077

Open
remko48 wants to merge 5 commits into
feat/noid/grid-widget-typesfrom
feat/noid/views-api-v2-grid
Open

remko48 wants to merge 5 commits into
feat/noid/grid-widget-typesfrom
feat/noid/views-api-v2-grid

Conversation

@remko48

@remko48 remko48 commented Oct 12, 2026

Copy link
Copy Markdown

Two api/2 endpoints so a client can build grid views: one to fetch the widget types with their schemas (the frontend renders its forms from them), and one to create a grid view, a view without a table.

What changes

  • GET /api/2/views/widget-types: returns every widget type with its title, default size and two schemas: configuration (how the widget sits on the page) and properties (what the widget shows, stored as its content).
  • POST /api/2/views: creates a grid view without a table. The type is always grid. It takes a title and optionally an emoji and a description; an invalid title or emoji returns a 400. It takes no technical name, since a view without a table is named by its id. The view belongs to whoever creates it and is returned in the usual view shape.
  • Create is rate limited (20 per minute per user). No RequirePermission is needed: there is no existing resource to check, and ownership is the creator's.
  • Only on api/2; api/1 is unchanged. OpenAPI and TS types regenerated.

🖼️ Screenshots

Backend only, no UI changes.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

remko48 and others added 3 commits October 12, 2026 11:32
Two api/2 endpoints for grid views: one returns the widget types with the
schemas of their configuration and content, the other creates a view
without a table, owned by the user who creates it. Creating is rate
limited like the other mutation endpoints.

Co-authored-by: Ruben van der Linde <ruben@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
- the title and emoji of a new grid view are validated like on update, so
  an empty or too long title or an invalid emoji is a 400 instead of a 200
  or a database error
- the endpoint drops the technicalName and type parameters: a view without
  a table is named by its id and is always a grid view
- widget property and widget types are typed as their known values
- both routes are declared with #[ApiRoute] on the controller; the spec
  moves them, which reorders openapi.json

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
@remko48
remko48 requested review from blizzz and enjeck as code owners October 12, 2026 14:50
@remko48
remko48 added this pull request to stack #3080 October 12, 2026 14:56
Signed-off-by: Remko <remko@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants