-
Notifications
You must be signed in to change notification settings - Fork 55
Feature/split energy source #1519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/split energy source #1519
Conversation
There was a problem hiding this 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 splits energy source attribution into more granular fields for energy performance data. The change separates source tracking for aggregate estimate EPC and DEC data, allowing for better documentation of data provenance.
- Adds new database columns for source type and link tracking for both aggregate estimate EPC and DEC data
- Updates the frontend configuration to support the new source fields
- Modifies the energy performance UI to display separate source inputs for each energy metric
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| migrations/056.split_energy_source_part_1.up.sql | Adds four new columns to buildings table for source tracking |
| migrations/056.split_energy_source_part_1.down.sql | Provides rollback for the new columns |
| app/src/frontend/config/data-fields-config.ts | Configures frontend field definitions for new source fields and fixes category for existing fields |
| app/src/frontend/building/data-containers/energy-performance.tsx | Adds UI components for the new source input fields |
| app/src/api/config/dataFields.ts | Enables edit and verify permissions for new fields |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
app/src/frontend/building/data-containers/energy-performance.tsx
Outdated
Show resolved
Hide resolved
aaed126 to
36cfe35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| {(props.building.sust_aggregate_estimate_epc_source_type == dataFields.sust_aggregate_estimate_epc_source_type.items[0] || | ||
| props.building.sust_aggregate_estimate_epc_source_type == dataFields.sust_aggregate_estimate_epc_source_type.items[1] || | ||
| props.building.sust_aggregate_estimate_epc_source_type == null) ? <></> : |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded array indices [0] and [1] make the code fragile and unclear. Consider extracting these specific source types into named constants or checking for the actual string values to improve readability and maintainability.
| {(props.building.sust_dec_source_type == dataFields.sust_dec_source_type.items[0] || | ||
| props.building.sust_dec_source_type == dataFields.sust_dec_source_type.items[1] || | ||
| props.building.sust_dec_source_type == null) ? <></> : |
Copilot
AI
Sep 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to the EPC source type check above, this condition uses hardcoded array indices [0] and [1]. This duplicates the same fragile pattern and should use named constants or actual string values for better maintainability.
No description provided.