diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component.html index 72d4d598..67c8d284 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component.html @@ -2,15 +2,20 @@
{{company.generalInformation.name}}
- +
diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.html index d495a060..95b25313 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.html @@ -1,29 +1,81 @@
Key Performance Indicators
-
-
-
-
- - -
-
-
Address - - — + @let address = company.generalInformation | addressDisplay; + + {{address}} + + + — +
- - - - - - -
- KPI Category - - -
+ + + + + + + + + + + + + + + + + + - - - - \ No newline at end of file + + + + + + + + + + + +
+ + + Units + + Cost
Per Unit +
+ Baseline
Amount +
+ Baseline Cost
($/yr) +
+ +
+ + + + + + + — + + + + + + + — + + + + + + + — + + + + + Qualitative Metric +
\ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.ts index e6c30279..0cdba268 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component.ts @@ -28,7 +28,9 @@ export class CompanyKpisSummaryComponent { ngOnInit(){ this.company = this.companyIdbService.selectedCompany.getValue(); - this.keyPerformanceIndicators = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.getValue(); + this.keyPerformanceIndicators = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.getValue().filter(kpi => { + return kpi.companyId == this.company.guid; + }); this.contacts = this.contactsIdbService.contacts.getValue(); } } diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component.html index 339f1727..7c781325 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component.html @@ -2,15 +2,20 @@
{{facility.generalInformation.name}}
- +
diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.html index 6d041e88..9381aa4b 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.html @@ -1,71 +1,76 @@
Pre-Assessments for {{onSiteVisit.visitDate| date}}
-
-
-
-
- - {{assessment.name}} -
-
-
Address - - — + @let address = facility.generalInformation | addressDisplay; + + {{address}} + + + — +
- - - - - - - - - - - - - - - -
- Annual Energy Use - - -
- Annual Costs - - -
- Contacts - - -
-
- - - {{contact | contactNameDisplay}} - -
-
-
- - — - -
- - +@let preAssessments = (onSiteVisit.assessmentIds | assessmentListOnSite: assessments); + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + Utility Types + + Baseline
+ Energy Use
+ ({{companyEnergyUnit}}/yr) +
+ Baseline
+ Energy Cost
+ + ($/yr) + +
+ Stakeholders +
+ {{assessment.name}} + + + + + + {{utilityType.utilityType}}
+
+
+
+ + + + + @let associatedContacts = assessment.guid | associatedContacts:'assessment': contacts; + + + {{contact | contactNameDisplay}}
+
+
+ + — + +
+
+ +
+ No pre-assessments added for this visit.
- \ No newline at end of file +
\ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.spec.ts index a76bcec6..b8390882 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.spec.ts @@ -4,45 +4,17 @@ import { PreAssessmentSummaryComponent } from './pre-assessment-summary.componen import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; import { TableEntriesModule } from 'src/app/shared/table-entries/table-entries.module'; -import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; -import { IdbFacility, getNewIdbFacility } from 'src/app/models/facility'; -import { BehaviorSubject } from 'rxjs'; -import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; -import { IdbAssessment } from 'src/app/models/assessment'; -import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; -import { IdbOnSiteVisit, getNewIdbOnSiteVisit } from 'src/app/models/onSiteVisit'; -import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; -import { IdbContact } from 'src/app/models/contact'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; describe('PreAssessmentSummaryComponent', () => { let component: PreAssessmentSummaryComponent; let fixture: ComponentFixture; - - let facilityIdbService: Partial = { - facilities: new BehaviorSubject>([]), - selectedFacility: new BehaviorSubject(getNewIdbFacility('', '')) - }; - let assessmentIdbService: Partial = { - assessments: new BehaviorSubject>([]) - }; - let onSiteVisitIdbService: Partial = { - selectedVisit: new BehaviorSubject(getNewIdbOnSiteVisit('', '', '')) - }; - let contactIdbService: Partial = { - contacts: new BehaviorSubject>([]) - }; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ FontAwesomeModule, HelperPipesModule, TableEntriesModule], declarations: [PreAssessmentSummaryComponent], - providers: [ - { provide: FacilityIdbService, useValue: facilityIdbService }, - { provide: AssessmentIdbService, useValue: assessmentIdbService }, - { provide: OnSiteVisitIdbService, useValue: onSiteVisitIdbService }, - { provide: ContactIdbService, useValue: contactIdbService } - - ] + providers: stubServiceProviders }) .compileComponents(); diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.ts index 58583276..5d83554c 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/pre-assessment-summary/pre-assessment-summary.component.ts @@ -1,13 +1,13 @@ import { Component } from '@angular/core'; import { IconDefinition, faScrewdriverWrench, faToolbox, faUser } from '@fortawesome/free-solid-svg-icons'; import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; +import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; -import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; import { IdbAssessment } from 'src/app/models/assessment'; +import { IdbCompany } from 'src/app/models/company'; import { IdbContact } from 'src/app/models/contact'; import { IdbOnSiteVisit } from 'src/app/models/onSiteVisit'; -// import { ProcessEquipment } from 'src/app/shared/constants/processEquipment'; @Component({ selector: 'app-pre-assessment-summary', @@ -20,19 +20,20 @@ export class PreAssessmentSummaryComponent { assessments: Array; faToolbox: IconDefinition = faToolbox; faScrewdriverWrench: IconDefinition = faScrewdriverWrench; - // processEquipment: Array; contacts: Array; faUser: IconDefinition = faUser; onSiteVisit: IdbOnSiteVisit; - constructor(private facilityIdbService: FacilityIdbService, private contactIdbService: ContactIdbService, + companyEnergyUnit: string; + constructor(private companyIdbService: CompanyIdbService, private contactIdbService: ContactIdbService, private assessmentIdbService: AssessmentIdbService, private onSiteVisitIdbService: OnSiteVisitIdbService ) { } ngOnInit() { + let company: IdbCompany = this.companyIdbService.selectedCompany.getValue(); + this.companyEnergyUnit = company.companyEnergyUnit; this.onSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); this.assessments = this.assessmentIdbService.assessments.getValue(); - // this.processEquipment = this.facilityIdbService.selectedFacility.getValue().processEquipment; this.contacts = this.contactIdbService.contacts.getValue(); } } diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.html index e6e28aac..21d0b4fd 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.html @@ -1,89 +1,45 @@ -
Process Equipment
-
-
-
-
- - {{equipment.equipmentName}} -
-
- - - - - - - - - - - - -
- Notes - - -
- Contacts - - -
-
- - - {{contact | contactNameDisplay}} - -
-
-
- - — - -
-
-
+
End Use Inventory
+ + + + + + + + + + + + + + + + +
+ Name + + Notes + + Stakeholders +
+ {{processEquipment.equipmentName}} + + + + @let associatedContacts = processEquipment.guid | associatedContacts:'processEquipment': contacts; + + + {{contact | contactNameDisplay}}
+
+
+ + — + +
+
+ + +
+ No end use inventory items added to this facility.
-
\ No newline at end of file + \ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.spec.ts index f09916c6..95732340 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.spec.ts @@ -3,31 +3,17 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ProcessEquipmentSummaryComponent } from './process-equipment-summary.component'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; -import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; -import { BehaviorSubject } from 'rxjs'; -import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; -import { IdbContact } from 'src/app/models/contact'; -import { ProcessEquipmentIdbService } from 'src/app/indexed-db/process-equipment-idb.service'; -import { IdbProcessEquipment } from 'src/app/models/processEquipment'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; +import { TableEntriesModule } from 'src/app/shared/table-entries/table-entries.module'; describe('ProcessEquipmentSummaryComponent', () => { let component: ProcessEquipmentSummaryComponent; let fixture: ComponentFixture; - - let contactIdbService: Partial = { - contacts: new BehaviorSubject>([]) - }; - let processEquipmentIdbService: Partial = { - processEquipments: new BehaviorSubject>([]) - } beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FontAwesomeModule, HelperPipesModule], + imports: [FontAwesomeModule, HelperPipesModule, TableEntriesModule], declarations: [ProcessEquipmentSummaryComponent], - providers: [ - { provide: ContactIdbService, useValue: contactIdbService }, - { provide: ProcessEquipmentIdbService, useValue: processEquipmentIdbService } - ] + providers: stubServiceProviders }) .compileComponents(); diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.ts index 9ca7c2ac..ca002566 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component.ts @@ -1,8 +1,10 @@ import { Component } from '@angular/core'; import { IconDefinition, faDiagramProject, faUser } from '@fortawesome/free-solid-svg-icons'; import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; +import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; import { ProcessEquipmentIdbService } from 'src/app/indexed-db/process-equipment-idb.service'; import { IdbContact } from 'src/app/models/contact'; +import { IdbFacility } from 'src/app/models/facility'; import { IdbProcessEquipment } from 'src/app/models/processEquipment'; @Component({ @@ -13,15 +15,18 @@ import { IdbProcessEquipment } from 'src/app/models/processEquipment'; export class ProcessEquipmentSummaryComponent { faDiagramProject: IconDefinition = faDiagramProject; - processEquipment: Array; + processEquipments: Array; contacts: Array; faUser: IconDefinition = faUser; - constructor(private processEquipmentIdbService: ProcessEquipmentIdbService, private contactIdbService: ContactIdbService){ + constructor(private processEquipmentIdbService: ProcessEquipmentIdbService, private contactIdbService: ContactIdbService, + private facilityIdbService: FacilityIdbService + ) { } - ngOnInit(){ - this.processEquipment = this.processEquipmentIdbService.processEquipments.getValue(); + ngOnInit() { + let facility: IdbFacility = this.facilityIdbService.selectedFacility.getValue(); + this.processEquipments = this.processEquipmentIdbService.getFacilityProcessEquipment(facility.guid); this.contacts = this.contactIdbService.contacts.getValue(); } } diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.html index 0f8757d9..6ae25909 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.html @@ -15,6 +15,8 @@


+ +

diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.spec.ts index 7fcf35d6..9bb0df44 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/review-pre-visit-setup.component.spec.ts @@ -2,15 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReviewPreVisitSetupComponent } from './review-pre-visit-setup.component'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { BehaviorSubject } from 'rxjs'; -import { IdbCompany, getNewIdbCompany } from 'src/app/models/company'; -import { IdbFacility, getNewIdbFacility } from 'src/app/models/facility'; -import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; -import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; -import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; -import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; -import { SetupWizardService } from 'src/app/setup-wizard/setup-wizard.service'; import { TeamDetailsSummaryComponent } from './team-details-summary/team-details-summary.component'; import { ProcessEquipmentSummaryComponent } from './process-equipment-summary/process-equipment-summary.component'; import { PreAssessmentSummaryComponent } from './pre-assessment-summary/pre-assessment-summary.component'; @@ -18,60 +10,18 @@ import { FacilityDetailsSummaryComponent } from './facility-details-summary/faci import { CompanyKpisSummaryComponent } from './company-kpis-summary/company-kpis-summary.component'; import { CompanyDetailsSummaryComponent } from './company-details-summary/company-details-summary.component'; import { TableEntriesModule } from 'src/app/shared/table-entries/table-entries.module'; -import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; -import { IdbOnSiteVisit, getNewIdbOnSiteVisit } from 'src/app/models/onSiteVisit'; -import { IdbContact } from 'src/app/models/contact'; -import { IdbAssessment } from 'src/app/models/assessment'; -import { KeyPerformanceIndicatorsIdbService } from 'src/app/indexed-db/key-performance-indicators-idb.service'; -import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; -import { ProcessEquipmentIdbService } from 'src/app/indexed-db/process-equipment-idb.service'; -import { IdbProcessEquipment } from 'src/app/models/processEquipment'; +import { SystemInventorySummaryComponent } from './system-inventory-summary/system-inventory-summary.component'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; describe('ReviewPreVisitSetupComponent', () => { let component: ReviewPreVisitSetupComponent; let fixture: ComponentFixture; - let setupWizardService: Partial = { - sidebarOpen: new BehaviorSubject(false), - }; - let companyIdbService: Partial = { - companies: new BehaviorSubject>([]), - selectedCompany: new BehaviorSubject(getNewIdbCompany('')) - }; - let facilityIdbService: Partial = { - facilities: new BehaviorSubject>([]), - selectedFacility: new BehaviorSubject(getNewIdbFacility('', '')) - }; - let onSiteVisitIdbService: Partial = { - selectedVisit: new BehaviorSubject(getNewIdbOnSiteVisit('', '', '')) - }; - - let contactIdbService: Partial = { - contacts: new BehaviorSubject>([]) - }; - let assessmentIdbService: Partial = { - assessments: new BehaviorSubject>([]) - }; - let keyPerformanceIndicatorIdbService: Partial = { - keyPerformanceIndicators: new BehaviorSubject>([]) - }; - let processEquipmentIdbService: Partial = { - processEquipments: new BehaviorSubject>([]) - } beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FontAwesomeModule, HelperPipesModule, TableEntriesModule], - declarations: [ReviewPreVisitSetupComponent, TeamDetailsSummaryComponent, ProcessEquipmentSummaryComponent, PreAssessmentSummaryComponent, FacilityDetailsSummaryComponent, CompanyKpisSummaryComponent, CompanyDetailsSummaryComponent], - providers: [ - { provide: SetupWizardService, useValue: setupWizardService }, - { provide: CompanyIdbService, useValue: companyIdbService }, - { provide: FacilityIdbService, useValue: facilityIdbService }, - { provide: ContactIdbService, useValue: contactIdbService }, - { provide: AssessmentIdbService, useValue: assessmentIdbService }, - { provide: OnSiteVisitIdbService, useValue: onSiteVisitIdbService }, - { provide: KeyPerformanceIndicatorsIdbService, useValue: keyPerformanceIndicatorIdbService }, - { provide: ProcessEquipmentIdbService, useValue: processEquipmentIdbService } - ] + declarations: [ReviewPreVisitSetupComponent, TeamDetailsSummaryComponent, ProcessEquipmentSummaryComponent, PreAssessmentSummaryComponent, FacilityDetailsSummaryComponent, CompanyKpisSummaryComponent, CompanyDetailsSummaryComponent, SystemInventorySummaryComponent], + providers: stubServiceProviders }) .compileComponents(); diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.css b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.css new file mode 100644 index 00000000..e69de29b diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.html new file mode 100644 index 00000000..55a1e0f9 --- /dev/null +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.html @@ -0,0 +1,61 @@ +
Industrial System Inventory
+ + + + + + + + + + + + + + + + + + + + +
+ Name + + Industrial
System +
+ Utility
Type +
+ Energy Use
+ + (/yr) + +
+ Stakeholders +
+ {{energyEquipment.equipmentName}} + + + + + + + + @let associatedContacts = energyEquipment.guid | associatedContacts:'energyEquipment': contacts; + + + {{contact | contactNameDisplay}}
+
+
+ + — + +
+
+ + +
+ No system inventory equipment added to this facility. +
+
\ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.spec.ts new file mode 100644 index 00000000..33188c1f --- /dev/null +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.spec.ts @@ -0,0 +1,29 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SystemInventorySummaryComponent } from './system-inventory-summary.component'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; +import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; +import { TableEntriesModule } from 'src/app/shared/table-entries/table-entries.module'; +import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; + +describe('SystemInventorySummaryComponent', () => { + let component: SystemInventorySummaryComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + imports: [FontAwesomeModule, HelperPipesModule, TableEntriesModule], + declarations: [SystemInventorySummaryComponent], + providers: stubServiceProviders + }) + .compileComponents(); + + fixture = TestBed.createComponent(SystemInventorySummaryComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.ts new file mode 100644 index 00000000..f1988034 --- /dev/null +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component.ts @@ -0,0 +1,40 @@ +import { Component } from '@angular/core'; +import { faList, IconDefinition } from '@fortawesome/free-solid-svg-icons'; +import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; +import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; +import { EnergyEquipmentIdbService } from 'src/app/indexed-db/energy-equipment-idb.service'; +import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; +import { IdbCompany } from 'src/app/models/company'; +import { IdbContact } from 'src/app/models/contact'; +import { IdbEnergyEquipment } from 'src/app/models/energyEquipment'; +import { IdbFacility } from 'src/app/models/facility'; + +@Component({ + selector: 'app-system-inventory-summary', + templateUrl: './system-inventory-summary.component.html', + styleUrl: './system-inventory-summary.component.css' +}) +export class SystemInventorySummaryComponent { + + faList: IconDefinition = faList; + + facility: IdbFacility; + energyEquipments: Array; + + companyEnergyUnit: string; + + contacts: Array; + constructor(private facilityIdbService: FacilityIdbService, + private energyEquipmentIdbService: EnergyEquipmentIdbService, + private companyIdbService: CompanyIdbService, + private contactIdbService: ContactIdbService + ) { } + + ngOnInit() { + let company: IdbCompany = this.companyIdbService.selectedCompany.getValue(); + this.companyEnergyUnit = company.companyEnergyUnit; + this.facility = this.facilityIdbService.selectedFacility.getValue(); + this.energyEquipments = this.energyEquipmentIdbService.getByOtherGuid(this.facility.guid, 'facility'); + this.contacts = this.contactIdbService.contacts.getValue(); + } +} diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.css b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.css deleted file mode 100644 index d4b8e8c6..00000000 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.css +++ /dev/null @@ -1,3 +0,0 @@ -.card-header{ - background-color: white; -} \ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.html deleted file mode 100644 index 421747d8..00000000 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.html +++ /dev/null @@ -1,107 +0,0 @@ -
-
- {{contact | contactNameDisplay}} -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Phone - - -
- Email - - -
- Title - - -
- Team - - -
- Notes - - -
- KPIs - - -
-
- -
-
-
- - — - -
- End Use - - -
-
- {{processEquipmentId - | processEquipmentDisplay: processEquipment}} -
-
-
- - — - -
- Assessments - - -
-
- {{assessmentId | - assessmentNameDisplay: assessments}} -
-
-
- - — - -
-
-
\ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.spec.ts deleted file mode 100644 index f8a45108..00000000 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.spec.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { ContactSummaryCardComponent } from './contact-summary-card.component'; -import { getNewIdbContact } from 'src/app/models/contact'; -import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; -import { TableEntriesModule } from 'src/app/shared/table-entries/table-entries.module'; -import { BehaviorSubject } from 'rxjs'; -import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; -import { IdbFacility, getNewIdbFacility } from 'src/app/models/facility'; -import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; -import { IdbAssessment } from 'src/app/models/assessment'; -import { ProcessEquipmentIdbService } from 'src/app/indexed-db/process-equipment-idb.service'; -import { IdbProcessEquipment } from 'src/app/models/processEquipment'; - -describe('ContactSummaryCardComponent', () => { - let component: ContactSummaryCardComponent; - let fixture: ComponentFixture; - - let facilityIdbService: Partial = { - facilities: new BehaviorSubject>([]), - selectedFacility: new BehaviorSubject(getNewIdbFacility('', '')) - }; - let assessmentIdbService: Partial = { - assessments: new BehaviorSubject>([]) - }; - let processEquipmentIdbService: Partial = { - processEquipments: new BehaviorSubject>([]) - }; - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [FontAwesomeModule, HelperPipesModule, TableEntriesModule], - declarations: [ContactSummaryCardComponent], - providers: [ - { provide: AssessmentIdbService, useValue: assessmentIdbService }, - { provide: FacilityIdbService, useValue: facilityIdbService }, - { provide: ProcessEquipmentIdbService, useValue: processEquipmentIdbService } - ] - }) - .compileComponents(); - - fixture = TestBed.createComponent(ContactSummaryCardComponent); - component = fixture.componentInstance; - component.contact = getNewIdbContact('', ''); - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.ts deleted file mode 100644 index 71858f7e..00000000 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { Component, Input } from '@angular/core'; -import { IconDefinition, faUser } from '@fortawesome/free-solid-svg-icons'; -import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; -import { ProcessEquipmentIdbService } from 'src/app/indexed-db/process-equipment-idb.service'; -import { IdbAssessment } from 'src/app/models/assessment'; -import { IdbContact } from 'src/app/models/contact'; -import { IdbProcessEquipment } from 'src/app/models/processEquipment'; - -@Component({ - selector: 'app-contact-summary-card', - templateUrl: './contact-summary-card.component.html', - styleUrl: './contact-summary-card.component.css' -}) -export class ContactSummaryCardComponent { - @Input() - contact: IdbContact; - - assessments: Array; - processEquipment: Array; - faUser: IconDefinition = faUser; - constructor(private assessmentIdbService: AssessmentIdbService, - private processEquipmentIdbService: ProcessEquipmentIdbService - ) { - } - - ngOnInit() { - this.assessments = this.assessmentIdbService.assessments.getValue(); - this.processEquipment = this.processEquipmentIdbService.processEquipments.getValue(); - } -} diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.html b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.html index 61742a64..0de9a0ac 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.html +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.html @@ -1,7 +1,43 @@ -
Stakeholders Details
-
-
- + + + + + + + + + + + + + + + + + + +
+ Name + + Title + + Team + + Notes +
+ {{contact | contactNameDisplay}} + + + + + + +
+
+ + +
+ No stakeholders added to this company.
-
\ No newline at end of file + \ No newline at end of file diff --git a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.spec.ts b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.spec.ts index f98ce771..c738d883 100644 --- a/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component.spec.ts @@ -1,7 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TeamDetailsSummaryComponent } from './team-details-summary.component'; -import { ContactSummaryCardComponent } from './contact-summary-card/contact-summary-card.component'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service'; @@ -24,7 +23,7 @@ describe('TeamDetailsSummaryComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ FontAwesomeModule, HelperPipesModule], - declarations: [TeamDetailsSummaryComponent, ContactSummaryCardComponent], + declarations: [TeamDetailsSummaryComponent], providers: [ { provide: ContactIdbService, useValue: contactIdbService }, { provide: OnSiteVisitIdbService, useValue: onSiteVisitIdbService } diff --git a/src/app/setup-wizard/setup-wizard.module.ts b/src/app/setup-wizard/setup-wizard.module.ts index 94fe9e08..f7aade1b 100644 --- a/src/app/setup-wizard/setup-wizard.module.ts +++ b/src/app/setup-wizard/setup-wizard.module.ts @@ -17,7 +17,6 @@ import { ContactModalModule } from '../shared/contact-modal/contact-modal.module import { ReviewOnSiteComponent } from './data-collection/review-on-site/review-on-site.component'; import { CompanyDetailsSummaryComponent } from './pre-visit/review-pre-visit-setup/company-details-summary/company-details-summary.component'; import { TeamDetailsSummaryComponent } from './pre-visit/review-pre-visit-setup/team-details-summary/team-details-summary.component'; -import { ContactSummaryCardComponent } from './pre-visit/review-pre-visit-setup/team-details-summary/contact-summary-card/contact-summary-card.component'; import { CompanyKpisSummaryComponent } from './pre-visit/review-pre-visit-setup/company-kpis-summary/company-kpis-summary.component'; import { FacilityDetailsSummaryComponent } from './pre-visit/review-pre-visit-setup/facility-details-summary/facility-details-summary.component'; import { ProcessEquipmentSummaryComponent } from './pre-visit/review-pre-visit-setup/process-equipment-summary/process-equipment-summary.component'; @@ -46,6 +45,7 @@ import { SharedCompanyFormsModule } from "../shared/shared-company-forms/shared- import { SharedFacilityFormsModule } from '../shared/shared-facility-forms/shared-facility-forms.module'; import { AssessmentEnergyOpportunitiesFormComponent } from './data-collection/on-site-assessment/assessment-energy-opportunities-form/assessment-energy-opportunities-form.component'; import { CompanyContactsSetupFormComponent } from './pre-visit/company-contacts-setup/company-contacts-setup-form/company-contacts-setup-form.component'; +import { SystemInventorySummaryComponent } from './pre-visit/review-pre-visit-setup/system-inventory-summary/system-inventory-summary.component'; @NgModule({ declarations: [ @@ -60,7 +60,6 @@ import { CompanyContactsSetupFormComponent } from './pre-visit/company-contacts- ReviewOnSiteComponent, CompanyDetailsSummaryComponent, TeamDetailsSummaryComponent, - ContactSummaryCardComponent, CompanyKpisSummaryComponent, FacilityDetailsSummaryComponent, ProcessEquipmentSummaryComponent, @@ -79,7 +78,8 @@ import { CompanyContactsSetupFormComponent } from './pre-visit/company-contacts- OnSiteAssessmentResultsComponent, FacilityEnergyEquipmentSetupComponent, AssessmentEnergyOpportunitiesFormComponent, - CompanyContactsSetupFormComponent + CompanyContactsSetupFormComponent, + SystemInventorySummaryComponent ], imports: [ CommonModule, diff --git a/src/app/spec-helpers/spec-test-service-stub.ts b/src/app/spec-helpers/spec-test-service-stub.ts index c8299bc6..083a0962 100644 --- a/src/app/spec-helpers/spec-test-service-stub.ts +++ b/src/app/spec-helpers/spec-test-service-stub.ts @@ -130,7 +130,8 @@ let stubProcessEquipment: IdbProcessEquipment = getNewIdbProcessEquipment('123', stubProcessEquipment.guid = '123'; let processEquipmentIdbService: Partial = { processEquipments: new BehaviorSubject>([stubProcessEquipment]), - getByGuid: () => { return stubProcessEquipment } + getByGuid: () => { return stubProcessEquipment }, + getFacilityProcessEquipment: () => { return [stubProcessEquipment] } } let stubKpiImpact: IdbKeyPerformanceMetricImpact = getNewIdbKeyPerformanceMetricImpact('123', '123', '123', '123', '123', 'TRIR', '123', '123', '123');