Skip to content

Implement default reports#62

Merged
kflemin merged 7 commits into
mainfrom
default-reports
May 5, 2026
Merged

Implement default reports#62
kflemin merged 7 commits into
mainfrom
default-reports

Conversation

@kflemin
Copy link
Copy Markdown
Contributor

@kflemin kflemin commented May 5, 2026

Implements the Default Reports page under Insights, porting the functionality from the
AngularJS inventory_reports_controller.js to Angular v21. This provides interactive
scatter and bar chart visualizations of property data across cycles and access levels.

Core Components:

  • DefaultReportsComponent — Full page with dual Chart.js charts (scatter + aggregated
    bar), reactive form controls for axis selection, cycle/filter configuration, and a
    statistics accordion
  • ReportConfigModalComponent — Dialog for creating, renaming, and deleting saved report
    configurations
  • ExportReportModalComponent — Dialog for naming and downloading XLSX data exports

Services:

  • InventoryReportService — Wraps /api/v3/.../report/, /report_aggregated/, and
    /report_export/ endpoints
  • ReportConfigurationService — CRUD service for saved report configurations with
    auto-refresh on org change

Infrastructure:

  • Added CSRF token handling in auth.interceptor.ts — reads csrftoken cookie and sets
    X-CSRFToken header on mutating requests (required for Django views using
    SessionAuthentication)
  • Added withXsrfConfiguration() to auth provider
  • Updated proxy.conf.mjs to rewrite Origin/Referer headers for proxied API requests
  • Added csrftoken to .spelling.dic

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements the Angular v21 “Default Reports” Insights page, porting the prior AngularJS inventory reports workflow into a standalone Angular component with Chart.js visualizations, report configuration management, and data export.

Changes:

  • Added Default Reports page with scatter + aggregated bar charts, reactive controls, statistics display, and export/chart download actions.
  • Added modals for report configuration CRUD and XLSX export naming/download.
  • Added new API services/types for inventory reports + report configurations, and updated auth/proxy infrastructure for CSRF/session-based endpoints.

Reviewed changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/app/modules/insights/default-reports/default-reports.component.ts Main page logic: dependency wiring, chart setup, data loading, report config handling, export/download actions
src/app/modules/insights/default-reports/default-reports.component.html Page UI: form controls, chart canvases, tables, export buttons, statistics accordion
src/app/modules/insights/default-reports/modal/report-config-modal.component.ts Modal logic for create/rename/delete report configurations
src/app/modules/insights/default-reports/modal/report-config-modal.component.html Modal UI for configuration actions
src/app/modules/insights/default-reports/modal/export-report-modal.component.ts Modal logic for exporting report data to XLSX
src/app/modules/insights/default-reports/modal/export-report-modal.component.html Export modal UI
src/app/modules/insights/default-reports/modal/index.ts Barrel exports for modals
src/@seed/api/inventory-report/inventory-report.service.ts Client wrapper for report, aggregated report, and report export endpoints
src/@seed/api/inventory-report/inventory-report.types.ts Types for report chart points, aggregated points, stats payloads, etc.
src/@seed/api/inventory-report/index.ts Barrel exports for inventory-report API
src/@seed/api/report-configuration/report-configuration.service.ts CRUD + org-change auto-refresh for saved report configurations
src/@seed/api/report-configuration/report-configuration.types.ts Types for report configurations and responses
src/@seed/api/report-configuration/index.ts Barrel exports for report-configuration API
src/@seed/api/index.ts Re-export new API modules
src/app/core/auth/auth.provider.ts Configured Angular XSRF cookie/header names
src/app/core/auth/auth.interceptor.ts Added CSRF cookie parsing/header injection for mutating API requests
proxy.conf.mjs Rewrites Origin/Referer on proxied API requests
.spelling.dic Added csrftoken to dictionary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/modules/insights/default-reports/default-reports.component.ts Outdated
Comment thread src/app/modules/insights/default-reports/default-reports.component.ts Outdated
Comment thread src/app/modules/insights/default-reports/default-reports.component.ts Outdated
Comment thread src/app/modules/insights/default-reports/modal/report-config-modal.component.ts Outdated
Comment thread src/app/modules/insights/default-reports/default-reports.component.html Outdated
Comment thread src/app/core/auth/auth.interceptor.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kflemin and others added 3 commits May 5, 2026 13:53
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… error, remove redundant CSRF handling

Agent-Logs-Url: https://github.com/SEED-platform/seed-angular/sessions/e265961d-9aad-44c3-be72-f06517de29ff

Co-authored-by: kflemin <2205659+kflemin@users.noreply.github.com>
Copilot finished work on behalf of kflemin May 5, 2026 19:59
@kflemin kflemin merged commit 3b50924 into main May 5, 2026
2 checks passed
@kflemin kflemin deleted the default-reports branch May 5, 2026 22:05
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.

3 participants