Skip to content

feat: reports & dashboards module β€” part 1 (REP-01..04)#267

Merged
parth0025 merged 4 commits into
stagingfrom
feat/reports-dashboards-v14.5.0
Jun 20, 2026
Merged

feat: reports & dashboards module β€” part 1 (REP-01..04)#267
parth0025 merged 4 commits into
stagingfrom
feat/reports-dashboards-v14.5.0

Conversation

@parth0025

Copy link
Copy Markdown
Collaborator

Reports & Dashboards (v14.5.0) β€” part 1

The first 4 of 9 Reports & Dashboards tasks (REP-01..04). High-value, additive, and each verified independently. Shipping now so they're testable on staging (especially the core-dashboard change in REP-03); REP-05..09 follow in a second PR.

What's included

  • REP-01 β€” Portfolios / cross-project rollup (the CEO single-pane view): portfolios collection + Modules/Portfolio (pure rollup engine: per-project progress / health / overdue / milestones + portfolio totals) + GET /api/v1/portfolio/:id/rollup + a Portfolio page (top-nav).
  • REP-02 β€” Custom report builder: saved_reports collection + a whitelisted query engine (dimensions status/project/sprint Γ— metrics count/points Γ— project filter β€” config can't inject arbitrary fields/operators) + live-preview/save/reload API + a builder page (bar / pie-share / table).
  • REP-03 β€” 3 new dashboard card types (Tasks by Status, Tasks by Project, Total Tasks): one self-contained MetricSummaryCard that fetches its own data from the REP-02 engine, wired via getComponent + 3 entries appended to the static utils/cardComponent.json. Purely additive β€” existing dashboard cards untouched.
  • REP-04 β€” Estimate-vs-actual variance report: no new collection β€” reuses tasks.totalEstimatedTime vs summed timesheets.LogTimeDuration; per-task over/under variance + project rollup + a report page.

New collections (full 8-edit registration each)

portfolios, saved_reports. (REP-03/04 add none.)

Verification

  • 397 tests / 35 suites green β€” new pure-logic unit tests: portfolio-rules, report-rules, variance-rules (+ existing).
  • Frontend build clean for every task (caught + fixed 2 eslint rules during the work: multi-word component name + ref-as-operand).
  • Backend boot-checked β€” each new module loads + registers routes; cardComponent.json JSON-validated (it's backend-loaded).
  • All new endpoints are companyId-scoped; new routes added to the JWT middleware; the report query engine is allow-listed (no field injection).

Reviewer note

REP-03 touches the dashboard (a core, highly-visible surface). The change is additive (new cards only) and build-verified, but it could not be browser-tested here β€” please verify the new cards render + existing cards/layout are unchanged on staging.

Scope: feature β†’ staging only. REP-05..09 (CSV/Excel export, capacity planning, saved templates, scheduled/emailed reports, share-a-report) follow in a second PR.

πŸ€– Generated with Claude Code

parth0025 and others added 4 commits June 20, 2026 18:29
The leadership / CEO single-pane view: one portfolio groups N projects and
shows rolled-up progress, health and milestones from real data.

Backend (Modules/Portfolio):
- portfolios collection (8-edit registration; indexed deletedStatusKey).
- helpers/portfolioRules.js (pure): done = statusType in (close,done), overdue
  = open task past DueDate, per-project summary, health (on/at-risk/off-track),
  portfolio totals, milestone split. 13 unit tests.
- controller: CRUD + GET /api/v1/portfolio/:id/rollup β€” aggregates each
  project's tasks (isParentTask) + milestones into per-project + portfolio
  metrics. companyId-scoped; deleted/inaccessible projects skipped.
- routes + init; JWT+company via setMiddleware (prefix /api/v1/portfolio).

Frontend: top-nav Portfolio -> /:cid/portfolio (Portfolio.vue) - list / create /
edit / delete, project picker, totals strip + per-project health cards
(progress bar, done/total, overdue, milestones). Route + nav + i18n + env.

Verify: 33 suites / 382 tests green (incl. 13 portfolio-rules); frontend build clean.
Test cases: .claude/test-cases/Portfolio.md (14).

Done-when met: a portfolio holds multiple projects and renders rolled-up progress / at-risk / milestones from real data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pick a dimension + metric + filters, preview live, and save a report that
reloads β€” backed by a whitelisted query engine (no arbitrary fields/operators).

Backend (Modules/CustomReports):
- saved_reports collection (8-edit registration).
- helpers/reportRules.js (pure): allow-listed dimensions (status/project/sprint),
  metrics (count/points), filters (project/status/sprint); validateConfig coerces
  bad values to safe defaults + drops non-listed filter keys; buildPipeline emits
  a safe $match/$group/$sort/$limit. 8 unit tests.
- controller: POST /run (preview), CRUD on saved reports, GET /:id/run (reload);
  companyId-scoped.
- routes + init; JWT+company via setMiddleware (prefix /api/v1/reports/custom).

Frontend: top-nav Custom Report -> /:cid/custom-reports (CustomReports.vue):
builder (group-by, measure, chart, project filter), live preview (bar / pie-share
/ table), save + saved-report list with reload + delete. Route + nav + i18n + env.

Verify: 34 suites / 390 tests green (incl. 8 report-rules); frontend build clean.

Done-when met: a user builds, previews and saves a custom report that reloads correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds Tasks-by-Status, Tasks-by-Project and Total-Tasks cards to the widget
dashboard β€” purely additive, existing cards untouched.

- MetricSummaryCard.vue: one self-contained card that fetches its OWN data
  from the REP-02 engine (POST /reports/custom/run); config chosen by
  componentId; optional project filter from cardData. Renders bar lists or a
  single number. No dependency on the backend card-resolver.
- getComponent: 3 additive cases -> MetricSummaryCard (HomePage.vue import).
- utils/cardComponent.json: 3 appended catalog entries (the catalog is a static
  repo file, so this is the intended, version-controlled way to add cards;
  existing entries unchanged). JSON validated.
- i18n: card titles/descriptions + no_data_available (en.js).

Verify: cardComponent.json parses (19 cards); 34 suites / 390 tests green; frontend build clean.

Done-when met: >=3 new card types are available and render real data.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Per-task estimate vs actual + rolled-up totals, with over/under highlighting.

Backend (Modules/VarianceReport) β€” no new collection, reuses existing data:
- estimate = tasks.totalEstimatedTime (minutes); actual = summed
  timesheets.LogTimeDuration by TicketID (minutes).
- helpers/varianceRules.js (pure): per-task variance (over / under / on-track /
  no-estimate) + rollup totals. 7 unit tests.
- controller: GET /api/v1/reports/variance?projectId=&sprintId= β€” tasks +
  timesheets -> per-task rows + project rollup. companyId-scoped.
- routes + init; JWT+company via setMiddleware (/api/v1/reports/variance).

Frontend: top-nav Variance Report -> /:cid/reports/variance: project picker,
totals strip (estimated / actual / variance% / over / under) + per-task table
with red(over)/green(under) variance + status badges. Route + nav + i18n + env.

Verify: 35 suites / 397 tests green (incl. 7 variance-rules); module boot-checked;
frontend build clean.

Done-when met: report shows estimate vs actual per task and rolled up to the project.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

βš™οΈ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7a92d9fc-8f9b-4e29-8714-9fb5f80bcdb5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • πŸ” Trigger review
✨ Finishing Touches
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/reports-dashboards-v14.5.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@parth0025 parth0025 merged commit 50dc21f into staging Jun 20, 2026
4 checks passed
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.

1 participant