Skip to content

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

Open
remko48 wants to merge 3 commits into
stack/g2-grid-widget-typesfrom
stack/g3-views-api-v2
Open

remko48 wants to merge 3 commits into
stack/g2-grid-widget-typesfrom
stack/g3-views-api-v2

Conversation

@remko48

@remko48 remko48 commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

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
remko48 added this pull request to stack #15 October 12, 2026 08:27
Comment thread lib/Controller/ApiViewsController.php Outdated
Comment thread lib/Controller/ApiViewsController.php Outdated
Comment thread lib/Controller/ApiViewsController.php Outdated
Comment thread lib/ResponseDefinitions.php Outdated
Comment thread appinfo/routes.php Outdated
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>
@remko48
remko48 force-pushed the stack/g3-views-api-v2 branch from 051a586 to 8feffe3 Compare October 12, 2026 09:32
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants