Skip to content

Commit f623db3

Browse files
committed
updates review pre-visit page with new content
1 parent 8bc89eb commit f623db3

19 files changed

+381
-389
lines changed

src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ <h5 class="bold w-100 text-center">
22
<fa-icon [icon]="faBuilding" class="me-2"></fa-icon> {{company.generalInformation.name}}
33
</h5>
44

5-
<table class="table table-bordered table-hover">
5+
<table class="table table-bordered table-hover table-sm">
66
<tbody>
77
<tr>
88
<td class="w-25">
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,81 @@
11
<h5 class="bold w-100 text-center">
22
<fa-icon [icon]="faChartBar" class="me-2"></fa-icon> Key Performance Indicators
33
</h5>
4-
<div class="row">
5-
<div class="col-lg-6 col-md-12 pb-2" *ngFor="let kpi of (company.guid | companyKpiList:keyPerformanceIndicators)">
6-
<div class="card">
7-
<div class="card-header">
8-
<fa-icon [icon]="faBullseye" class="pe-1"></fa-icon>
9-
<span [innerHTML]="kpi.htmlLabel"></span>
10-
</div>
11-
<div class="card-body">
124

13-
<table class="table table-sm">
14-
<tbody>
15-
<tr>
16-
<td class="w-50">
17-
KPI Category
18-
</td>
19-
<td>
20-
<app-primary-kpi-badge [kpiOption]="kpi"></app-primary-kpi-badge>
21-
</td>
22-
</tr>
23-
</tbody>
24-
</table>
5+
<table class="table table-bordered savings-table table-hover table-sm">
6+
<thead>
7+
<tr>
8+
<th>
9+
<!-- KPM -->
10+
</th>
11+
<th>
12+
Units
13+
</th>
14+
<th>
15+
Cost<br> Per Unit
16+
</th>
17+
<th>
18+
Baseline<br> Amount
19+
</th>
20+
<th>
21+
Baseline Cost<br> (&dollar;/yr)
22+
</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
<ng-container *ngFor="let kpi of keyPerformanceIndicators">
27+
<tr>
28+
<th colspan="5">
29+
<span [innerHTML]="kpi.htmlLabel"></span>
30+
</th>
31+
</tr>
32+
<tr *ngFor="let keyPerformanceMetric of kpi.performanceMetrics">
33+
<td class="ps-3">
34+
<span [innerHTML]="keyPerformanceMetric.htmlLabel"></span>
35+
</td>
36+
<ng-template [ngIf]="keyPerformanceMetric.isQuantitative" [ngIfElse]="qualitativeBlock">
2537

26-
</div>
27-
</div>
28-
</div>
29-
</div>
38+
<td>
39+
<ng-template [ngIf]="keyPerformanceMetric.calculationMethod == 'costPerUnit'"
40+
[ngIfElse]="unitMdash">
41+
<app-single-cell-item [strValue]="keyPerformanceMetric.totalUnit"
42+
[isCurrency]="false"></app-single-cell-item>
43+
</ng-template>
44+
<ng-template #unitMdash>
45+
&mdash;
46+
</ng-template>
47+
</td>
48+
<td>
49+
<ng-template [ngIf]="keyPerformanceMetric.calculationMethod == 'costPerUnit'"
50+
[ngIfElse]="costPerMdash">
51+
<app-single-cell-item [numValue]="keyPerformanceMetric.costPerValue"
52+
[isCurrency]="true"></app-single-cell-item>
53+
</ng-template>
54+
<ng-template #costPerMdash>
55+
&mdash;
56+
</ng-template>
57+
</td>
58+
<td>
59+
<ng-template [ngIf]="keyPerformanceMetric.calculationMethod == 'costPerUnit'"
60+
[ngIfElse]="baselineValueMdash">
61+
<app-single-cell-item [numValue]="keyPerformanceMetric.baselineValue"
62+
[isCurrency]="false"></app-single-cell-item>
63+
</ng-template>
64+
<ng-template #baselineValueMdash>
65+
&mdash;
66+
</ng-template>
67+
</td>
68+
<td>
69+
<app-single-cell-item [numValue]="keyPerformanceMetric.baselineCost"
70+
[isCurrency]="true"></app-single-cell-item>
71+
</td>
72+
</ng-template>
73+
<ng-template #qualitativeBlock>
74+
<td colspan="4">
75+
Qualitative Metric
76+
</td>
77+
</ng-template>
78+
</tr>
79+
</ng-container>
80+
</tbody>
81+
</table>

src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export class CompanyKpisSummaryComponent {
2828

2929
ngOnInit(){
3030
this.company = this.companyIdbService.selectedCompany.getValue();
31-
this.keyPerformanceIndicators = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.getValue();
31+
this.keyPerformanceIndicators = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.getValue().filter(kpi => {
32+
return kpi.companyId == this.company.guid;
33+
});
3234
this.contacts = this.contactsIdbService.contacts.getValue();
3335
}
3436
}

src/app/setup-wizard/pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ <h5 class="bold w-100 text-center">
22
<fa-icon [icon]="faIndustry" class="me-2"></fa-icon> {{facility.generalInformation.name}}
33
</h5>
44

5-
<table class="table table-bordered table-hover">
5+
<table class="table table-bordered table-hover table-sm">
66
<tbody>
77
<tr>
88
<td class="w-25">
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,76 @@
11
<h5 class="bold w-100 text-center">
22
<fa-icon [icon]="faToolbox" class="me-2"></fa-icon> Pre-Assessments for {{onSiteVisit.visitDate| date}}
33
</h5>
4-
<div class="row">
5-
<div class="col-lg-6 col-md-12 pb-2" *ngFor="let assessment of (onSiteVisit.assessmentIds | assessmentListOnSite: assessments)">
6-
<div class="card">
7-
<div class="card-header">
8-
<fa-icon [icon]="faScrewdriverWrench" class="pe-1"></fa-icon>
9-
{{assessment.name}}
10-
</div>
11-
<div class="card-body">
124

13-
<table class="table table-sm">
14-
<tbody>
15-
<!-- <tr>
16-
<td>
17-
Process Equipment
18-
</td>
19-
<td>
20-
<ng-template [ngIf]="assessment.equipmentId" [ngIfElse]="equipmentMdash">
21-
{{assessment.equipmentId | processEquipmentDisplay: processEquipment}}
22-
</ng-template>
23-
<ng-template #equipmentMdash>
24-
&mdash;
25-
</ng-template>
26-
</td>
27-
</tr> -->
28-
<tr>
29-
<td>
30-
Annual Energy Use
31-
</td>
32-
<td>
33-
<app-single-cell-item [numValue]="assessment.energyUse"></app-single-cell-item>
34-
</td>
35-
</tr>
36-
<tr>
37-
<td>
38-
Annual Costs
39-
</td>
40-
<td>
41-
<app-single-cell-item [numValue]="assessment.cost" [isCurrency]="true"></app-single-cell-item>
42-
</td>
43-
</tr>
44-
<tr>
45-
<td>
46-
Contacts
47-
</td>
48-
<td>
49-
<ng-template [ngIf]="(assessment.guid| associatedContacts:'assessment': contacts).length != 0"
50-
[ngIfElse]="contactMdash">
51-
<div class="d-flex">
52-
<div class="pe-1"
53-
*ngFor="let contact of assessment.guid| associatedContacts:'assessment': contacts;">
54-
<span class="badge bg-primary">
55-
<fa-icon [icon]="faUser"></fa-icon>
56-
{{contact | contactNameDisplay}}
57-
</span>
58-
</div>
59-
</div>
60-
</ng-template>
61-
<ng-template #contactMdash>
62-
&mdash;
63-
</ng-template>
64-
</td>
65-
</tr>
66-
</tbody>
67-
</table>
68-
</div>
69-
</div>
5+
@let preAssessments = (onSiteVisit.assessmentIds | assessmentListOnSite: assessments);
6+
<ng-template [ngIf]="preAssessments.length > 0" [ngIfElse]="noPreAssessmentsBlock">
7+
<table class="table table-bordered table-hover table-sm">
8+
<thead>
9+
<tr>
10+
<th>
11+
Name
12+
</th>
13+
<th>
14+
Type
15+
</th>
16+
<th>
17+
Utility Types
18+
</th>
19+
<th>
20+
Baseline<br>
21+
Energy Use<br>
22+
<span class="fw-light">({{companyEnergyUnit}}/yr)</span>
23+
</th>
24+
<th>
25+
Baseline<br>
26+
Energy Cost<br>
27+
<span class="fw-light">
28+
(&dollar;/yr)
29+
</span>
30+
</th>
31+
<th>
32+
Stakeholders
33+
</th>
34+
</tr>
35+
</thead>
36+
<tbody>
37+
<tr *ngFor="let assessment of preAssessments">
38+
<td>
39+
{{assessment.name}}
40+
</td>
41+
<td>
42+
<app-single-cell-item [strValue]="assessment.assessmentType"></app-single-cell-item>
43+
</td>
44+
<td>
45+
<ng-container *ngFor="let utilityType of assessment.utilityEnergyUses">
46+
<ng-container *ngIf="utilityType.include">
47+
{{utilityType.utilityType}}<br>
48+
</ng-container>
49+
</ng-container>
50+
</td>
51+
<td>
52+
<app-single-cell-item [numValue]="assessment.energyUse"></app-single-cell-item>
53+
</td>
54+
<td>
55+
<app-single-cell-item [numValue]="assessment.cost" [isCurrency]="true"></app-single-cell-item>
56+
</td>
57+
<td>
58+
@let associatedContacts = assessment.guid | associatedContacts:'assessment': contacts;
59+
<ng-template [ngIf]="associatedContacts.length > 0" [ngIfElse]="noContactsBlock">
60+
<span *ngFor="let contact of associatedContacts">
61+
{{contact | contactNameDisplay}} <br>
62+
</span>
63+
</ng-template>
64+
<ng-template #noContactsBlock>
65+
&mdash;
66+
</ng-template>
67+
</td>
68+
</tr>
69+
</tbody>
70+
</table>
71+
</ng-template>
72+
<ng-template #noPreAssessmentsBlock>
73+
<div class="alert alert-info small p-2">
74+
No pre-assessments added for this visit.
7075
</div>
71-
</div>
76+
</ng-template>
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { Component } from '@angular/core';
22
import { IconDefinition, faScrewdriverWrench, faToolbox, faUser } from '@fortawesome/free-solid-svg-icons';
33
import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service';
4+
import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service';
45
import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service';
5-
import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service';
66
import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service';
77
import { IdbAssessment } from 'src/app/models/assessment';
8+
import { IdbCompany } from 'src/app/models/company';
89
import { IdbContact } from 'src/app/models/contact';
910
import { IdbOnSiteVisit } from 'src/app/models/onSiteVisit';
10-
// import { ProcessEquipment } from 'src/app/shared/constants/processEquipment';
1111

1212
@Component({
1313
selector: 'app-pre-assessment-summary',
@@ -20,19 +20,20 @@ export class PreAssessmentSummaryComponent {
2020
assessments: Array<IdbAssessment>;
2121
faToolbox: IconDefinition = faToolbox;
2222
faScrewdriverWrench: IconDefinition = faScrewdriverWrench;
23-
// processEquipment: Array<ProcessEquipment>;
2423
contacts: Array<IdbContact>;
2524
faUser: IconDefinition = faUser;
2625
onSiteVisit: IdbOnSiteVisit;
27-
constructor(private facilityIdbService: FacilityIdbService, private contactIdbService: ContactIdbService,
26+
companyEnergyUnit: string;
27+
constructor(private companyIdbService: CompanyIdbService, private contactIdbService: ContactIdbService,
2828
private assessmentIdbService: AssessmentIdbService, private onSiteVisitIdbService: OnSiteVisitIdbService
2929
) {
3030
}
3131

3232
ngOnInit() {
33+
let company: IdbCompany = this.companyIdbService.selectedCompany.getValue();
34+
this.companyEnergyUnit = company.companyEnergyUnit;
3335
this.onSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue();
3436
this.assessments = this.assessmentIdbService.assessments.getValue();
35-
// this.processEquipment = this.facilityIdbService.selectedFacility.getValue().processEquipment;
3637
this.contacts = this.contactIdbService.contacts.getValue();
3738
}
3839
}

0 commit comments

Comments
 (0)