Skip to content

Commit 662a264

Browse files
authored
Merge pull request #2274 from ORNL-AMO/issue-2263-other-impacts
fixup: updated help text and template
2 parents d196265 + 9bb0383 commit 662a264

File tree

12 files changed

+323
-324
lines changed

12 files changed

+323
-324
lines changed

src/app/data-evaluation/facility/facility-reports/facility-report-setup/facility-overview-report-setup/facility-overview-report-setup.component.html

Lines changed: 145 additions & 141 deletions
Large diffs are not rendered by default.

src/app/data-evaluation/facility/facility-reports/facility-report-setup/facility-overview-report-setup/facility-overview-report-setup.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export class FacilityOverviewReportSetupComponent {
2828
months: Array<Month> = Months;
2929
errorMessage: string;
3030
errorMessageSub: Subscription;
31-
31+
account: IdbAccount;
32+
accountSub: Subscription;
3233
constructor(private facilityReportsDbService: FacilityReportsDbService,
3334
private accountDbService: AccountdbService,
3435
private facilityDbService: FacilitydbService,
@@ -40,6 +41,9 @@ export class FacilityOverviewReportSetupComponent {
4041
}
4142

4243
ngOnInit() {
44+
this.accountSub = this.accountDbService.selectedAccount.subscribe(account => {
45+
this.account = account;
46+
});
4347
this.facilityReportSub = this.facilityReportsDbService.selectedReport.subscribe(report => {
4448
if (this.isFormChange == false) {
4549
this.facilityReport = report;
@@ -58,16 +62,16 @@ export class FacilityOverviewReportSetupComponent {
5862
ngOnDestroy() {
5963
this.facilityReportSub.unsubscribe();
6064
this.errorMessageSub.unsubscribe();
65+
this.accountSub.unsubscribe();
6166
}
6267

6368
async save() {
6469
this.isFormChange = true;
6570
let facilityReport: IdbFacilityReport = this.facilityReportsDbService.selectedReport.getValue();
6671
this.facilityReport.dataOverviewReportSettings = this.reportSettings;
6772
this.facilityReport = await firstValueFrom(this.facilityReportsDbService.updateWithObservable(facilityReport));
68-
let selectedAccount: IdbAccount = this.accountDbService.selectedAccount.getValue();
6973
let selectedFacility: IdbFacility = this.facilityDbService.selectedFacility.getValue();
70-
await this.dbChangesService.setAccountFacilityReports(selectedAccount, selectedFacility);
74+
await this.dbChangesService.setAccountFacilityReports(this.account, selectedFacility);
7175
this.facilityReportsDbService.selectedReport.next(facilityReport);
7276
}
7377

src/app/data-evaluation/help-panel/account-help/account-overview-help/account-overview-help.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h4>Account Overview</h4>
1313
<hr>
1414
<p>
1515
The first section of the overview provides a map of the facilities is provided based on their zip code. The size on
16-
the graph is based on their relative consumption, cost, or emissions.
16+
the graph is based on their relative consumption or cost.
1717
</p>
1818
<p>
1919
Next is a breakdown of the data by facility. The graph colors are representative of the facility color set in the

src/app/indexedDB/update-db-entry.service.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import { IdbUtilityMeterGroup } from '../models/idbModels/utilityMeterGroup';
99
import { IdbAccountReport } from '../models/idbModels/accountReport';
1010
import { IdbAnalysisItem } from '../models/idbModels/analysisItem';
1111
import { IdbAccountAnalysisItem } from '../models/idbModels/accountAnalysisItem';
12-
import { IdbFacilityReport } from '../models/idbModels/facilityReport';
1312
import { IdbUtilityMeterData } from '../models/idbModels/utilityMeterData';
1413
import { getGUID } from '../shared/sharedHelperFunctions';
15-
import { ChargeCostUnit, MeterChargeType } from '../shared/shared-meter-content/edit-meter-form/meter-charges-form/meterChargesOptions';
14+
import { MeterChargeType } from '../shared/shared-meter-content/edit-meter-form/meter-charges-form/meterChargesOptions';
1615
import { IdbCustomGWP } from '../models/idbModels/customGWP';
1716

1817
@Injectable({
@@ -47,8 +46,12 @@ export class UpdateDbEntryService {
4746
//default to displaying emissions if not defined.
4847
// This was added in 2026 and we want legacy accounts to display emissions by default
4948
// unless they had it explicitly set to false.
50-
if(account.displayEmissions == undefined){
51-
account.displayEmissions = true;
49+
if (account.displayEmissions == undefined) {
50+
if (account.name != 'Cocoa Co. Example') {
51+
account.displayEmissions = true;
52+
}else{
53+
account.displayEmissions = false;
54+
}
5255
isChanged = true;
5356
}
5457

@@ -142,19 +145,19 @@ export class UpdateDbEntryService {
142145
group.maxModelVariables = 4;
143146
isChanged = true;
144147
}
145-
if(group.analysisType == 'regression' && !group.userDefinedModel && group.regressionModelStartMonth == undefined){
148+
if (group.analysisType == 'regression' && !group.userDefinedModel && group.regressionModelStartMonth == undefined) {
146149
group.regressionModelStartMonth = 0;
147150
isChanged = true;
148151
}
149-
if(group.analysisType == 'regression' && !group.userDefinedModel && group.regressionStartYear == undefined){
152+
if (group.analysisType == 'regression' && !group.userDefinedModel && group.regressionStartYear == undefined) {
150153
group.regressionStartYear = analysisItem.baselineYear;
151154
isChanged = true;
152155
}
153-
if(group.analysisType == 'regression' && !group.userDefinedModel && group.regressionModelEndMonth == undefined){
156+
if (group.analysisType == 'regression' && !group.userDefinedModel && group.regressionModelEndMonth == undefined) {
154157
group.regressionModelEndMonth = 11;
155158
isChanged = true;
156159
}
157-
if(group.analysisType == 'regression' && !group.userDefinedModel && group.regressionEndYear == undefined){
160+
if (group.analysisType == 'regression' && !group.userDefinedModel && group.regressionEndYear == undefined) {
158161
group.regressionEndYear = analysisItem.baselineYear;
159162
isChanged = true;
160163
}
@@ -396,7 +399,7 @@ export class UpdateDbEntryService {
396399

397400
updateCustomGWP(customGWP: IdbCustomGWP): { customGWP: IdbCustomGWP, isChanged: boolean } {
398401
let isChanged: boolean = false;
399-
if(customGWP.gwp_ar4 == undefined && customGWP['gwp'] != undefined){
402+
if (customGWP.gwp_ar4 == undefined && customGWP['gwp'] != undefined) {
400403
customGWP.gwp_ar4 = customGWP['gwp'];
401404
customGWP.gwp_ar5 = customGWP['gwp'];
402405
customGWP.gwp_ar6 = customGWP['gwp'];

src/app/models/idbModels/facilityReport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function getDataOverviewReportSettings(groups: Array<IdbUtilityMeterGroup
113113
emissionsDisplay: 'market',
114114
includeEnergySection: true,
115115
includeCostsSection: true,
116-
includeEmissionsSection: true,
116+
includeEmissionsSection: false,
117117
includeWaterSection: true,
118118
includeAllMeterData: true,
119119
startYear: undefined,

0 commit comments

Comments
 (0)