feat(reports): add custom Report Builder UI (PMS-180) #99

Merged
longjacksonle merged 1 commit from feat/mapps-custom-report-builder into main 2026-06-09 23:02:29 +02:00

What

Replace the Report Builder placeholder with an interactive, safe custom report builder (PMS-180). The user never writes SQL or raw field names.

How it works

  • Fetches the whitelisted catalog from GET /api/v1/reports/custom/schema (sources, each with its allowed dimensions / measures / filters and whether it supports a date range).
  • The user picks a data source, checks dimensions to group by and measures to aggregate, and optionally sets a date range.
  • Run POSTs the spec to POST /api/v1/reports/custom; the response is the generic columns / rows / totals envelope, rendered as a table with a totals summary.

Changes

  • ReportDetailPage early-returns the new CustomReportBuilder component for the report-builder type (report_type is a fixed route param, so hook order stays stable).
  • New SourceSchema / FieldSchema / CustomSpec / CustomResult types.
  • Selections reset when the source changes; the Run button is disabled until at least one measure is chosen and while a request is in flight; catalog-load and request failures render inline notices.

Safety

This is the safe alternative PMS-93 called for instead of an ad-hoc SQL console: all identifiers come from the server-side catalog, values are bound, and the query is tenant-scoped (enforced and tested on the backend).

Verification

cargo check --target wasm32-unknown-unknown clean, cargo fmt --check clean. (The one host clippy hit is clippy::manual_checked_ops on pre-existing projects.rs:685, a lint that only exists in host rust 1.95; CI runs rust 1.94 where it does not fire.)

Depends on

mokosh-server PMS-180 (GET /reports/custom/schema + POST /reports/custom).

🤖 Generated with Claude Code

## What Replace the **Report Builder** placeholder with an interactive, *safe* custom report builder (PMS-180). The user never writes SQL or raw field names. ## How it works - Fetches the whitelisted catalog from `GET /api/v1/reports/custom/schema` (sources, each with its allowed dimensions / measures / filters and whether it supports a date range). - The user picks a **data source**, checks **dimensions** to group by and **measures** to aggregate, and optionally sets a **date range**. - **Run** POSTs the spec to `POST /api/v1/reports/custom`; the response is the generic **columns / rows / totals** envelope, rendered as a table with a totals summary. ## Changes - `ReportDetailPage` early-returns the new `CustomReportBuilder` component for the `report-builder` type (`report_type` is a fixed route param, so hook order stays stable). - New `SourceSchema` / `FieldSchema` / `CustomSpec` / `CustomResult` types. - Selections reset when the source changes; the Run button is disabled until at least one measure is chosen and while a request is in flight; catalog-load and request failures render inline notices. ## Safety This is the safe alternative PMS-93 called for instead of an ad-hoc SQL console: all identifiers come from the server-side catalog, values are bound, and the query is tenant-scoped (enforced and tested on the backend). ## Verification `cargo check --target wasm32-unknown-unknown` clean, `cargo fmt --check` clean. (The one host clippy hit is `clippy::manual_checked_ops` on pre-existing `projects.rs:685`, a lint that only exists in host rust 1.95; CI runs rust 1.94 where it does not fire.) ## Depends on mokosh-server PMS-180 (`GET /reports/custom/schema` + `POST /reports/custom`). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(reports): add custom Report Builder UI (MAPPS, PMS-180)
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m33s
Create release / Create release from merged PR (pull_request) Has been skipped
2c56c20523
Replace the Report Builder placeholder with an interactive, safe custom report builder backed by the new whitelisted backend (PMS-180). The user never writes SQL or raw field names: the page fetches the catalog from GET /reports/custom/schema, lets them pick a data source, check dimensions to group by and measures to aggregate, optionally set a date range, then POSTs the spec to /reports/custom and renders the returned generic columns / rows / totals table with a totals summary.

ReportDetailPage early-returns the CustomReportBuilder component for the report-builder type (report_type is a fixed route param, so hook order stays stable). Adds SourceSchema / FieldSchema / CustomSpec / CustomResult types. Selections reset when the source changes; the Run button is disabled until at least one measure is chosen and while a request is in flight; load and request failures render inline notices.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
longjacksonle deleted branch feat/mapps-custom-report-builder 2026-06-09 23:02:29 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!99
No description provided.