Skip to content

Issue 1921 - company level analysis report#1957

Merged
rmroot merged 5 commits intodevelopfrom
issue-1921
Jul 9, 2025
Merged

Issue 1921 - company level analysis report#1957
rmroot merged 5 commits intodevelopfrom
issue-1921

Conversation

@jamlokim
Copy link
Copy Markdown
Contributor

connects #1921 #1552 #1306

@jamlokim jamlokim requested a review from rmroot June 30, 2025 18:58
@rmroot rmroot requested a review from Copilot July 7, 2025 16:21
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

This PR adds support for a new “Analysis” report type, including routing, data models, form services, and a suite of Angular components for dashboard, setup, and report rendering.

  • Introduces AnalysisReportSetup in the shared models and integrates it into IdbAccountReport
  • Adds new routes for analysis under account reports and extends the ReportType union
  • Implements a full set of Angular components (dashboard, setup, report, facility report, problems info, data validation) and updates services/modules accordingly

Reviewed Changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/app/routing/account.routes.ts Added imports and routes for analysis report and dashboard
src/app/models/overview-report.ts Defined new AnalysisReportSetup interface
src/app/models/idbModels/accountReport.ts Integrated analysisReportSetup into IdbAccountReport and default initializer
src/app/models/constantsAndTypes.ts Extended ReportType to include 'analysis'
src/app/account/account-reports/account-reports.service.ts Updated form builders and validation logic for analysis reports
Comments suppressed due to low confidence (2)

src/app/account/account-reports/account-reports.service.ts:47

  • The else if branches for specialized report types (betterPlants/analysis/etc.) appear after the return statement, making them unreachable. Please refactor so that form selection logic occurs before any return.
  getSetupFormFromReport(report: IdbAccountReport): FormGroup {

src/app/account/account-reports/report-pipes/account-report-type.pipe.ts:10

  • There is no default/fallback return path if reportType doesn't match any case, so the function may return undefined. Add a final else or default case that returns a valid string or throws.
  transform(reportType: ReportType): 'Better Plants' | 'Data Overview' | 'Performance' | 'Better Climate Report' | 'Analysis' {

this.initializeGroups();
}

initializeGroups() {
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

The method pushes into executiveSummaryItems without clearing it first, causing duplicates on repeated calls. Consider resetting this.executiveSummaryItems = [] at the start of this method.

Suggested change
initializeGroups() {
initializeGroups() {
this.executiveSummaryItems = [];

Copilot uses AI. Check for mistakes.
</div>
</div>

<app-print-report-button *ngIf="facilityDetails"></app-print-report-button> No newline at end of file
Copy link

Copilot AI Jul 7, 2025

Choose a reason for hiding this comment

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

Using *ngIf="facilityDetails" will always be truthy once defined, even if the array is empty. Consider using *ngIf="facilityDetails.length > 0" to hide the button when there is no data.

Suggested change
<app-print-report-button *ngIf="facilityDetails"></app-print-report-button>
<app-print-report-button *ngIf="facilityDetails.length > 0"></app-print-report-button>

Copilot uses AI. Check for mistakes.
@rmroot
Copy link
Copy Markdown
Member

rmroot commented Jul 7, 2025

I think overall I'm happy with how this has turned out. I do have two notes on UI related stuff, not code related:

  1. The tables with a bunch of columns are tough to read on smaller screens, this is a bit of a problem in other areas of the app as well. We may want to create an issue to address this.
  2. I've realized that calling this report and "Analysis Report" may get confusing with the "Analysis Report" we have within the facilities. That report gives results and this really gives a detailed look at the models used. Can we think of a better name for the account level report that matches better to the content? Kristina or Chris may have good input for this.

@jamlokim jamlokim requested a review from rmroot July 9, 2025 16:57
@jamlokim jamlokim requested a review from rmroot July 9, 2025 17:22
@rmroot rmroot merged commit aa27340 into develop Jul 9, 2025
3 checks passed
@jamlokim jamlokim deleted the issue-1921 branch July 16, 2025 19:12
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