diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 7f4ad8c5..f91227ad 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -15,6 +15,7 @@ import { EnergyEquipmentIdbService } from './indexed-db/energy-equipment-idb.ser import { ProcessEquipmentIdbService } from './indexed-db/process-equipment-idb.service'; import { KeyPerformanceMetricImpactsIdbService } from './indexed-db/key-performance-metric-impacts-idb.service'; import { ToastNotificationsService } from './core-components/toast-notifications/toast-notifications.service'; +import { UpdateDbEntriesService } from './indexed-db/update-db-entries.service'; @Component({ selector: 'app-root', @@ -36,7 +37,8 @@ export class AppComponent { private energyEquipmentIdbService: EnergyEquipmentIdbService, private processEquipmentIdbService: ProcessEquipmentIdbService, private keyPerformanceMetricImpactIdbService: KeyPerformanceMetricImpactsIdbService, - private toastNotificationService: ToastNotificationsService) { + private toastNotificationService: ToastNotificationsService, + private updateDbEntriesService: UpdateDbEntriesService) { } async ngOnInit() { @@ -51,6 +53,9 @@ export class AppComponent { console.log('init') await this.userIdbService.initializeData(); console.log('users init..'); + //update db entries + let user: IdbUser = this.userIdbService.user.getValue(); + await this.updateDbEntriesService.updateDbEntries(user); //companies await this.companyIdbService.setCompanies(); console.log('companies init..'); diff --git a/src/app/core-components/import-backup-modal/import-backup-modal.component.spec.ts b/src/app/core-components/import-backup-modal/import-backup-modal.component.spec.ts index 2aeb059a..9e1002af 100644 --- a/src/app/core-components/import-backup-modal/import-backup-modal.component.spec.ts +++ b/src/app/core-components/import-backup-modal/import-backup-modal.component.spec.ts @@ -1,27 +1,16 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ImportBackupModalComponent } from './import-backup-modal.component'; -import { UserIdbService } from 'src/app/indexed-db/user-idb.service'; -import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; -import { BackupDataService } from 'src/app/shared/shared-services/backup-data.service'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; describe('ImportBackupModalComponent', () => { let component: ImportBackupModalComponent; let fixture: ComponentFixture; beforeEach(async () => { - let userDbService: Partial = {}; - let dbChangesService: Partial = {}; - let backupDataService: Partial = {}; - await TestBed.configureTestingModule({ declarations: [ImportBackupModalComponent], - providers: [ - { provide: UserIdbService, useValue: userDbService }, - { provide: BackupDataService, useValue: backupDataService}, - { provide: DbChangesService, useValue: dbChangesService} - - ] + providers: stubServiceProviders }) .compileComponents(); diff --git a/src/app/core-components/import-backup-modal/import-backup-modal.component.ts b/src/app/core-components/import-backup-modal/import-backup-modal.component.ts index 93ed6cfc..7576833a 100644 --- a/src/app/core-components/import-backup-modal/import-backup-modal.component.ts +++ b/src/app/core-components/import-backup-modal/import-backup-modal.component.ts @@ -8,6 +8,7 @@ import { IdbUser } from 'src/app/models/user'; import { Subscription } from 'rxjs'; import { ImportBackupModalService } from './import-backup-modal.service'; import { environment } from 'src/environments/environment'; +import { UpdateDbEntriesService } from 'src/app/indexed-db/update-db-entries.service'; @Component({ selector: 'app-import-backup-modal', @@ -32,7 +33,8 @@ export class ImportBackupModalComponent implements OnInit, OnDestroy { private backupDataService: BackupDataService, private dbChangesService: DbChangesService, private router: Router, - private importBackupModalService: ImportBackupModalService + private importBackupModalService: ImportBackupModalService, + private updateDbEntriesService: UpdateDbEntriesService ) { } @@ -124,6 +126,8 @@ export class ImportBackupModalComponent implements OnInit, OnDestroy { async addToCurrentUser(importFile: BackupFile) { // Add backup data to current user await this.backupDataService.importUserBackupFile(importFile, this.currentUser.guid); + this.currentUser.kpiFacilityMigrationDone = false; + await this.updateDbEntriesService.updateDbEntries(this.currentUser); await this.dbChangesService.selectUser(this.currentUser, false); } diff --git a/src/app/core-components/navbar/navbar.component.spec.ts b/src/app/core-components/navbar/navbar.component.spec.ts index 099b8358..30a3e71f 100644 --- a/src/app/core-components/navbar/navbar.component.spec.ts +++ b/src/app/core-components/navbar/navbar.component.spec.ts @@ -1,33 +1,21 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NavbarComponent } from './navbar.component'; -import { UserIdbService } from 'src/app/indexed-db/user-idb.service'; import { RouterTestingModule } from '@angular/router/testing'; -import { LoadingService } from '../loading/loading.service'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; -import { BackupDataService } from 'src/app/shared/shared-services/backup-data.service'; import { ImportBackupModalComponent } from '../import-backup-modal/import-backup-modal.component'; -import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; import { FeedbackPageComponent } from '../feedback-page/feedback-page.component'; +import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; describe('NavbarComponent', () => { let component: NavbarComponent; let fixture: ComponentFixture; beforeEach(() => { - let userDbService: Partial = {}; - let loadingService: Partial = {}; - let backupDataService: Partial = {}; - let dbChangesService: Partial = {}; TestBed.configureTestingModule({ imports: [RouterTestingModule, FontAwesomeModule], declarations: [NavbarComponent, ImportBackupModalComponent, FeedbackPageComponent], - providers: [ - { provide: UserIdbService, useValue: userDbService }, - { provide: LoadingService, useValue: loadingService }, - { provide: BackupDataService, useValue: backupDataService}, - { provide: DbChangesService, useValue: dbChangesService} - ] + providers: stubServiceProviders }); fixture = TestBed.createComponent(NavbarComponent); component = fixture.componentInstance; diff --git a/src/app/core-components/welcome/welcome.component.ts b/src/app/core-components/welcome/welcome.component.ts index 65a602f0..9daf883b 100644 --- a/src/app/core-components/welcome/welcome.component.ts +++ b/src/app/core-components/welcome/welcome.component.ts @@ -16,6 +16,7 @@ import { BackupDataService, BackupFile } from 'src/app/shared/shared-services/ba import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; import { Router } from '@angular/router'; import { ToastNotificationsService } from '../toast-notifications/toast-notifications.service'; +import { UpdateDbEntriesService } from 'src/app/indexed-db/update-db-entries.service'; @Component({ selector: 'app-welcome', @@ -60,7 +61,8 @@ export class WelcomeComponent { private backupDataService: BackupDataService, private dbChangesService: DbChangesService, private toastNotificationService: ToastNotificationsService, - private router: Router + private router: Router, + private updateDbEntriesService: UpdateDbEntriesService ) { } @@ -129,6 +131,8 @@ export class WelcomeComponent { let fileData: string = reader.result as string; let tmpBackupFile: BackupFile = JSON.parse(fileData); let updatedBackupFile: BackupFile = await this.backupDataService.importUserBackupFile(tmpBackupFile, this.user.guid); + this.user.kpiFacilityMigrationDone = false; + await this.updateDbEntriesService.updateDbEntries(this.user); await this.dbChangesService.selectUser(this.user, false); this.loadingService.setLoadingStatus(false); let exampleVisit: IdbOnSiteVisit = updatedBackupFile.onSiteVisits[0]; diff --git a/src/app/indexed-db/key-performance-indicators-idb.service.ts b/src/app/indexed-db/key-performance-indicators-idb.service.ts index be908f83..0271bdee 100644 --- a/src/app/indexed-db/key-performance-indicators-idb.service.ts +++ b/src/app/indexed-db/key-performance-indicators-idb.service.ts @@ -81,14 +81,14 @@ export class KeyPerformanceIndicatorsIdbService { }); } - getKpiFromKpm(companyGuid: string, performanceMetricValue: KeyPerformanceIndicatorValue): IdbKeyPerformanceIndicator { + getKpiFromKpm(facilityId: string, performanceMetricValue: KeyPerformanceIndicatorValue): IdbKeyPerformanceIndicator { let keyPerformanceIndicators: Array = this.keyPerformanceIndicators.getValue(); return keyPerformanceIndicators.find(kpi => { - return kpi.companyId == companyGuid && kpi.optionValue == performanceMetricValue; + return kpi.facilityId == facilityId && kpi.optionValue == performanceMetricValue; }); } - async addKpmToKpi(companyId: string, performanceMetricToAdd: KeyPerformanceMetric | KeyPerformanceMetricOption, userId: string): Promise { + async addKpmToKpi(companyId: string, performanceMetricToAdd: KeyPerformanceMetric | KeyPerformanceMetricOption, userId: string, facilityId: string): Promise { let addedMetric: KeyPerformanceMetric; let keyPerformanceIndicator: IdbKeyPerformanceIndicator = this.getKpiFromKpm(companyId, performanceMetricToAdd.kpiValue); if (keyPerformanceIndicator) { @@ -112,7 +112,7 @@ export class KeyPerformanceIndicatorsIdbService { let kpiOption: KeyPerformanceIndicatorOption = KeyPerformanceIndicatorOptions.find(option => { return option.optionValue == performanceMetricToAdd.kpiValue }); - keyPerformanceIndicator = getNewKeyPerformanceIndicator(userId, companyId, kpiOption, false); + keyPerformanceIndicator = getNewKeyPerformanceIndicator(userId, companyId, kpiOption, false, facilityId); addedMetric = keyPerformanceIndicator.performanceMetrics.find(_metric => { return (_metric.value == performanceMetricToAdd.value); }); diff --git a/src/app/indexed-db/update-db-entries.service.spec.ts b/src/app/indexed-db/update-db-entries.service.spec.ts new file mode 100644 index 00000000..da319d47 --- /dev/null +++ b/src/app/indexed-db/update-db-entries.service.spec.ts @@ -0,0 +1,19 @@ +import { TestBed } from '@angular/core/testing'; + +import { UpdateDbEntriesService } from './update-db-entries.service'; +import { stubServiceProviders } from '../spec-helpers/spec-test-service-stub'; + +describe('UpdateDbEntriesService', () => { + let service: UpdateDbEntriesService; + + beforeEach(() => { + TestBed.configureTestingModule({ + providers: stubServiceProviders + }); + service = TestBed.inject(UpdateDbEntriesService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/indexed-db/update-db-entries.service.ts b/src/app/indexed-db/update-db-entries.service.ts new file mode 100644 index 00000000..bb701ddf --- /dev/null +++ b/src/app/indexed-db/update-db-entries.service.ts @@ -0,0 +1,96 @@ +import { Injectable } from '@angular/core'; +import { KeyPerformanceIndicatorsIdbService } from './key-performance-indicators-idb.service'; +import { KeyPerformanceMetricImpactsIdbService } from './key-performance-metric-impacts-idb.service'; +import { CompanyIdbService } from './company-idb.service'; +import { FacilityIdbService } from './facility-idb.service'; +import { IdbCompany } from '../models/company'; +import { firstValueFrom } from 'rxjs'; +import { IdbFacility } from '../models/facility'; +import { IdbKeyPerformanceIndicator } from '../models/keyPerformanceIndicator'; +import { IdbUser } from '../models/user'; +import { UserIdbService } from './user-idb.service'; +import { IdbKeyPerformanceMetricImpact } from '../models/keyPerformanceMetricImpact'; +import { getGUID } from '../shared/helpFunctions'; + +@Injectable({ + providedIn: 'root' +}) +export class UpdateDbEntriesService { + + constructor( + private keyPerformanceIndicatorsIdbService: KeyPerformanceIndicatorsIdbService, + private keyPerformanceMetricImpactsIdbService: KeyPerformanceMetricImpactsIdbService, + private facilityIdbService: FacilityIdbService, + private userIdbService: UserIdbService + ) { } + + async updateDbEntries(user: IdbUser): Promise { + let userNeedsUpdate: boolean = false; + if (!user.kpiFacilityMigrationDone) { + await this.updateToFacilityKPI(); + user.kpiFacilityMigrationDone = true; + userNeedsUpdate = true; + } + + if (userNeedsUpdate) { + user = await firstValueFrom(this.userIdbService.updateWithObservable(user)); + this.userIdbService.user.next(user); + } + return user; + } + + //migration of KPIs to facility level + async updateToFacilityKPI() { + let keyPerformanceIndicators: Array = await firstValueFrom(this.keyPerformanceIndicatorsIdbService.getAll()); + //get kpis without facility ids + let noFacilityKeyPerformanceIndicators: Array = keyPerformanceIndicators.filter(indicator => { + return indicator.facilityId == undefined; + }); + if (noFacilityKeyPerformanceIndicators.length > 0) { + let facilities: Array = await firstValueFrom(this.facilityIdbService.getAll()); + let keyPerformanceMetricImpacts: Array = await firstValueFrom(this.keyPerformanceMetricImpactsIdbService.getAll()); + + for (let i = 0; i < noFacilityKeyPerformanceIndicators.length; i++) { + let kpi: IdbKeyPerformanceIndicator = noFacilityKeyPerformanceIndicators[i]; + // move kpi to all facilities in company + let kpiFacilities: Array = facilities.filter(facility => { return facility.companyId == kpi.companyId }); + //if multiple facilities in a company + //need to create copies of kpis with uniq guids + + for (let f = 0; f < kpiFacilities.length; f++) { + let facility: IdbFacility = kpiFacilities[f]; + let facilityMetricImpacts: Array = keyPerformanceMetricImpacts.filter(impact => { return impact.facilityId == facility.guid }); + kpi.facilityId = facility.guid; + if (f == 0) { + await firstValueFrom(this.keyPerformanceIndicatorsIdbService.updateWithObservable(kpi)); + } else { + //create new kpis when multiple facilities; + let originalKpiGuid: string = kpi.guid; + let originalKpmGuids: Array<{ originalGuid: string, newGuid: string }> = kpi.performanceMetrics.map(metric => { return { originalGuid: metric.guid, newGuid: undefined } }); + + let newKpiGuid: string = getGUID(); + kpi.guid = newKpiGuid; + let associatedImpacts: Array = facilityMetricImpacts.filter(impact => { return impact.kpiGuid == originalKpiGuid }); + //add new kpi with updated guids + for (let m = 0; m < kpi.performanceMetrics.length; m++) { + let newGuid: string = getGUID(); + let kpmGuidIndex: number = originalKpmGuids.findIndex(kpmGuid => { return kpmGuid.originalGuid == kpi.performanceMetrics[m].guid }); + originalKpmGuids[kpmGuidIndex].newGuid = newGuid; + kpi.performanceMetrics[m].guid = newGuid; + }; + delete kpi.id; + await firstValueFrom(this.keyPerformanceIndicatorsIdbService.addWithObservable(kpi)); + //updates guid for associated impacts + for (let a = 0; a < associatedImpacts.length; a++) { + let impact: IdbKeyPerformanceMetricImpact = associatedImpacts[a]; + impact.kpiGuid = newKpiGuid; + let newKpmGuid: string = originalKpmGuids.find(ogGuid => { return ogGuid.originalGuid == impact.kpmGuid }).newGuid; + impact.kpmGuid = newKpmGuid; + await firstValueFrom(this.keyPerformanceMetricImpactsIdbService.updateWithObservable(impact)); + } + } + } + } + } + } +} diff --git a/src/app/models/keyPerformanceIndicator.ts b/src/app/models/keyPerformanceIndicator.ts index b6e56c51..b04b2920 100644 --- a/src/app/models/keyPerformanceIndicator.ts +++ b/src/app/models/keyPerformanceIndicator.ts @@ -5,18 +5,20 @@ import { IdbEntry, getNewIdbEntry } from "./idbEntry"; export interface IdbKeyPerformanceIndicator extends IdbEntry, KeyPerformanceIndicatorOption { userId: string, companyId: string, + facilityId: string, isCustom: boolean, description: string, performanceMetrics: Array } -export function getNewKeyPerformanceIndicator(userId: string, companyId: string, keyPerformanceIndicatorOption: KeyPerformanceIndicatorOption, isCustom: boolean): IdbKeyPerformanceIndicator { +export function getNewKeyPerformanceIndicator(userId: string, companyId: string, keyPerformanceIndicatorOption: KeyPerformanceIndicatorOption, isCustom: boolean, facilityId: string): IdbKeyPerformanceIndicator { let idbEntry: IdbEntry = getNewIdbEntry(); return { ...idbEntry, userId: userId, companyId: companyId, + facilityId: facilityId, ...keyPerformanceIndicatorOption, isCustom: isCustom, description: undefined, diff --git a/src/app/models/user.ts b/src/app/models/user.ts index 8214a98e..df4ef812 100644 --- a/src/app/models/user.ts +++ b/src/app/models/user.ts @@ -1,13 +1,15 @@ import { IdbEntry, getNewIdbEntry } from "./idbEntry"; export interface IdbUser extends IdbEntry { - skipSplashScreen: boolean + skipSplashScreen: boolean, + kpiFacilityMigrationDone: boolean } export function getNewIdbUser(): IdbUser { let idbEntry: IdbEntry = getNewIdbEntry(); return { ...idbEntry, + kpiFacilityMigrationDone: true, skipSplashScreen: false } } \ No newline at end of file diff --git a/src/app/routing/portfolio.routes.ts b/src/app/routing/portfolio.routes.ts index e1eaf005..49a5eedf 100644 --- a/src/app/routing/portfolio.routes.ts +++ b/src/app/routing/portfolio.routes.ts @@ -5,7 +5,6 @@ import { CompanyDashboardComponent } from "../user-portfolio/company-dashboard/c import { CompanyDashboardHomeComponent } from "../user-portfolio/company-dashboard/company-dashboard-home/company-dashboard-home.component"; import { FacilityDashboardComponent } from "../user-portfolio/facility-dashboard/facility-dashboard.component"; import { AssessmentDashboardComponent } from "../user-portfolio/assessment-dashboard/assessment-dashboard.component"; -import { CompanyPerformanceIndicatorsComponent } from "../user-portfolio/company-dashboard/company-performance-indicators/company-performance-indicators.component"; import { CompanyStakeholdersComponent } from "../user-portfolio/company-dashboard/company-stakeholders/company-stakeholders.component"; import { CompanyReportsComponent } from "../user-portfolio/company-dashboard/company-reports/company-reports.component"; import { CompanySettingsComponent } from "../user-portfolio/company-dashboard/company-settings/company-settings.component"; @@ -19,8 +18,8 @@ import { AssessmentReportsComponent } from "../user-portfolio/assessment-dashboa import { AssessmentDetailsComponent } from "../user-portfolio/assessment-dashboard/assessment-details/assessment-details.component"; import { AssessmentEnergyOpportunitiesComponent } from "../user-portfolio/assessment-dashboard/assessment-energy-opportunities/assessment-energy-opportunities.component"; import { CanDeactivateGuard } from "../guards/can-deactivate.guard"; -import { CompanyKpiSearchFormComponent } from "../shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component"; -import { CompanyKpiDetailsFormComponent } from "../shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component"; +import { KpiSearchFormComponent } from "../shared/shared-facility-forms/kpi-search-form/kpi-search-form.component"; +import { KpiDetailsFormComponent } from "../shared/shared-facility-forms/kpi-details-form/kpi-details-form.component"; import { AssessmentEnergyOpportunitiesHomeComponent } from "../user-portfolio/assessment-dashboard/assessment-energy-opportunities/assessment-energy-opportunities-home/assessment-energy-opportunities-home.component"; import { EnergyOpportunitySetupFormComponent } from "../shared/shared-assessment-forms/energy-opportunity-setup-form/energy-opportunity-setup-form.component"; import { AssessmentNebsComponent } from "../user-portfolio/assessment-dashboard/assessment-nebs/assessment-nebs.component"; @@ -32,6 +31,7 @@ import { EndUseInventoryHomeComponent } from "../user-portfolio/facility-dashboa import { ProcessEquipmentFormComponent } from "../shared/shared-facility-forms/process-equipment-form/process-equipment-form.component"; import { CompanyStakeholdersHomeComponent } from "../user-portfolio/company-dashboard/company-stakeholders/company-stakeholders-home/company-stakeholders-home.component"; import { CompanyContactsFormComponent } from "../shared/shared-company-forms/company-contacts-form/company-contacts-form.component"; +import { FacilityPerformanceIndicatorsComponent } from "../user-portfolio/facility-dashboard/facility-performance-indicators/facility-performance-indicators.component"; export const PortfolioRoutes: Route = { @@ -50,20 +50,6 @@ export const PortfolioRoutes: Route = { path: '', component: CompanyDashboardHomeComponent }, - { - path: 'performance-indicators', - component: CompanyPerformanceIndicatorsComponent, - children: [ - { - path: '', - component: CompanyKpiSearchFormComponent - }, - { - path: 'details/:id', - component: CompanyKpiDetailsFormComponent - } - ] - }, { path: 'stakeholders', component: CompanyStakeholdersComponent, @@ -98,6 +84,20 @@ export const PortfolioRoutes: Route = { path: '', component: FacilityDashboardHomeComponent }, + { + path: 'performance-indicators', + component: FacilityPerformanceIndicatorsComponent, + children: [ + { + path: '', + component: KpiSearchFormComponent + }, + { + path: 'details/:id', + component: KpiDetailsFormComponent + } + ] + }, { path: 'system-inventory', component: IndustrialSystemInventoryComponent, diff --git a/src/app/routing/setup-wizard.routes.ts b/src/app/routing/setup-wizard.routes.ts index 1534855e..9bf7166a 100644 --- a/src/app/routing/setup-wizard.routes.ts +++ b/src/app/routing/setup-wizard.routes.ts @@ -3,8 +3,6 @@ import { SetupWizardComponent } from "../setup-wizard/setup-wizard.component"; import { PreVisitComponent } from "../setup-wizard/pre-visit/pre-visit.component"; import { CompanySetupComponent } from "../setup-wizard/pre-visit/company-setup/company-setup.component"; import { CanDeactivateGuard } from "../guards/can-deactivate.guard"; -import { CompanyKpiSelectComponent } from "../setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component"; -import { CompanyKpiDetailsComponent } from "../setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component"; import { CompanyContactsSetupComponent } from "../setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component"; import { FacilitySetupComponent } from "../setup-wizard/pre-visit/facility-setup/facility-setup.component"; import { FacilityEnergyEquipmentSetupComponent } from "../setup-wizard/pre-visit/facility-energy-equipment-setup/facility-energy-equipment-setup.component"; @@ -23,6 +21,8 @@ import { AssessmentEvaluationComponent } from "../setup-wizard/data-evaluation/a import { VisitReportComponent } from "../setup-wizard/data-evaluation/visit-report/visit-report.component"; import { AssessmentDetailsFormComponent } from "../shared/shared-assessment-forms/assessment-details-form/assessment-details-form.component"; import { AssessmentEnergyOpportunitiesFormComponent } from "../setup-wizard/data-collection/on-site-assessment/assessment-energy-opportunities-form/assessment-energy-opportunities-form.component"; +import { FacilityKpiSelectComponent } from "../setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component"; +import { FacilityKpiDetailsComponent } from "../setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component"; export const SetupWizardRoutes: Route = { @@ -44,12 +44,12 @@ export const SetupWizardRoutes: Route = { canDeactivate: [CanDeactivateGuard] }, { - path: 'company-kpi-select', - component: CompanyKpiSelectComponent + path: 'kpi-select', + component: FacilityKpiSelectComponent }, { - path: 'company-kpi-detail/:id', - component: CompanyKpiDetailsComponent + path: 'kpi-detail/:id', + component: FacilityKpiDetailsComponent }, { path: 'company-contacts', diff --git a/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.html b/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.html index 41ac24a1..38b91c55 100644 --- a/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.html +++ b/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.html @@ -14,7 +14,7 @@ Go Back diff --git a/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.ts b/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.ts index 89b6c4b9..3e69963e 100644 --- a/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.ts +++ b/src/app/setup-wizard/pre-visit/company-contacts-setup/company-contacts-setup.component.ts @@ -75,7 +75,7 @@ export class CompanyContactsSetupComponent implements OnInit, OnDestroy { goToKPIs() { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-select'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/facility-setup'); } setHasInvalidContacts() { diff --git a/src/app/setup-wizard/pre-visit/facility-energy-equipment-setup/facility-energy-equipment-setup.component.ts b/src/app/setup-wizard/pre-visit/facility-energy-equipment-setup/facility-energy-equipment-setup.component.ts index be84e907..09c50ded 100644 --- a/src/app/setup-wizard/pre-visit/facility-energy-equipment-setup/facility-energy-equipment-setup.component.ts +++ b/src/app/setup-wizard/pre-visit/facility-energy-equipment-setup/facility-energy-equipment-setup.component.ts @@ -78,7 +78,7 @@ export class FacilityEnergyEquipmentSetupComponent { goBack() { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/facility-setup'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-select'); } goToNext() { diff --git a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.css b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.css similarity index 100% rename from src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.css rename to src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.css diff --git a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.html b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.html similarity index 92% rename from src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.html rename to src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.html index 8d528b20..7beed2c4 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.html +++ b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.html @@ -2,7 +2,7 @@
- +
diff --git a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.spec.ts b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.spec.ts similarity index 89% rename from src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.spec.ts rename to src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.spec.ts index afdd7ed9..07d6ce92 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CompanyKpiDetailsComponent } from './company-kpi-details.component'; +import { FacilityKpiDetailsComponent } from './facility-kpi-details.component'; import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; import { BehaviorSubject } from 'rxjs'; import { IdbOnSiteVisit, getNewIdbOnSiteVisit } from 'src/app/models/onSiteVisit'; @@ -17,9 +17,9 @@ import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.mod import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-performance-metric-impacts-idb.service'; import { IdbKeyPerformanceMetricImpact } from 'src/app/models/keyPerformanceMetricImpact'; -describe('CompanyKpiDetailsComponent', () => { - let component: CompanyKpiDetailsComponent; - let fixture: ComponentFixture; +describe('FacilityKpiDetailsComponent', () => { + let component: FacilityKpiDetailsComponent; + let fixture: ComponentFixture; let onSiteVisitIdbService: Partial = { onSiteVisits: new BehaviorSubject>([]), @@ -40,7 +40,7 @@ describe('CompanyKpiDetailsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FontAwesomeModule, FormsModule, RouterTestingModule, HelperPipesModule], - declarations: [CompanyKpiDetailsComponent], + declarations: [FacilityKpiDetailsComponent], providers: [ { provide: CompanyIdbService, useValue: companyIdbService }, { provide: OnSiteVisitIdbService, useValue: onSiteVisitIdbService }, @@ -51,7 +51,7 @@ describe('CompanyKpiDetailsComponent', () => { }) .compileComponents(); - fixture = TestBed.createComponent(CompanyKpiDetailsComponent); + fixture = TestBed.createComponent(FacilityKpiDetailsComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.ts b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.ts similarity index 92% rename from src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.ts rename to src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.ts index 6c7bcec9..dd7ac8b8 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-details/company-kpi-details.component.ts +++ b/src/app/setup-wizard/pre-visit/facility-kpi-details/facility-kpi-details.component.ts @@ -11,11 +11,11 @@ import { Subscription } from 'rxjs'; import { IdbCompany } from 'src/app/models/company'; @Component({ - selector: 'app-company-kpi-details', - templateUrl: './company-kpi-details.component.html', - styleUrl: './company-kpi-details.component.css' + selector: 'app-facility-kpi-details', + templateUrl: './facility-kpi-details.component.html', + styleUrl: './facility-kpi-details.component.css' }) -export class CompanyKpiDetailsComponent { +export class FacilityKpiDetailsComponent { faChevronRight: IconDefinition = faChevronRight; faChevronLeft: IconDefinition = faChevronLeft; @@ -56,7 +56,7 @@ export class CompanyKpiDetailsComponent { goBack() { if (this.indicatorIndex == 0) { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-select'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-select'); } else { let companyKpis: Array = this.getCompanyKPIs(); this.goToKPI(companyKpis[this.indicatorIndex - 1].guid); @@ -74,7 +74,7 @@ export class CompanyKpiDetailsComponent { goToKPI(kpiGUID: string) { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-detail/' + kpiGUID); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-detail/' + kpiGUID); } goToFacility() { diff --git a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.css b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.css similarity index 100% rename from src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.css rename to src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.css diff --git a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.html b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.html similarity index 79% rename from src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.html rename to src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.html index 3187e4fe..6d85a147 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.html +++ b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.html @@ -3,10 +3,10 @@
- Company Key Performance Indicators (KPIs) + Facility Key Performance Indicators (KPIs)

- +
@@ -18,11 +18,11 @@
Go Back diff --git a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.spec.ts b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.spec.ts similarity index 80% rename from src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.spec.ts rename to src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.spec.ts index 48cba502..b6be8316 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.spec.ts +++ b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CompanyKpiSelectComponent } from './company-kpi-select.component'; +import { FacilityKpiSelectComponent } from './facility-kpi-select.component'; import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; import { BehaviorSubject } from 'rxjs'; import { IdbOnSiteVisit, getNewIdbOnSiteVisit } from 'src/app/models/onSiteVisit'; @@ -14,23 +14,23 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { FormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; -import { AddKpiSearchComponent } from '../../../shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component'; -import { CompanyKpiListComponent } from '../../../shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component'; import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; import { IdbFacility, getNewIdbFacility } from 'src/app/models/facility'; import { EnergyOpportunityIdbService } from 'src/app/indexed-db/energy-opportunity-idb.service'; import { AssessmentIdbService } from 'src/app/indexed-db/assessment-idb.service'; import { NonEnergyBenefitsIdbService } from 'src/app/indexed-db/non-energy-benefits-idb.service'; -import { SelectedKpiOptionPipe } from '../../../shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe'; import { PrimaryKpiBadgeModule } from 'src/app/shared/primary-kpi-badge/primary-kpi-badge.module'; import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-performance-metric-impacts-idb.service'; import { IdbKeyPerformanceMetricImpact } from 'src/app/models/keyPerformanceMetricImpact'; -import { SharedCompanyFormsModule } from 'src/app/shared/shared-company-forms/shared-company-forms.module'; +import { AddKpiSearchComponent } from 'src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component'; +import { KpiListComponent } from 'src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component'; +import { SelectedKpiOptionPipe } from 'src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe'; +import { SharedFacilityFormsModule } from 'src/app/shared/shared-facility-forms/shared-facility-forms.module'; -describe('CompanyKpiSelectComponent', () => { - let component: CompanyKpiSelectComponent; - let fixture: ComponentFixture; +describe('FacilityKpiSelectComponent', () => { + let component: FacilityKpiSelectComponent; + let fixture: ComponentFixture; let onSiteVisitIdbService: Partial = { onSiteVisits: new BehaviorSubject>([]), selectedVisit: new BehaviorSubject(getNewIdbOnSiteVisit('', '', '')), @@ -58,8 +58,8 @@ describe('CompanyKpiSelectComponent', () => { }; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FontAwesomeModule, FormsModule, RouterTestingModule, HelperPipesModule, PrimaryKpiBadgeModule, SharedCompanyFormsModule], - declarations: [CompanyKpiSelectComponent, AddKpiSearchComponent, CompanyKpiListComponent, SelectedKpiOptionPipe], + imports: [FontAwesomeModule, FormsModule, RouterTestingModule, HelperPipesModule, PrimaryKpiBadgeModule, SharedFacilityFormsModule], + declarations: [FacilityKpiSelectComponent, AddKpiSearchComponent, KpiListComponent, SelectedKpiOptionPipe], providers: [ { provide: CompanyIdbService, useValue: companyIdbService }, { provide: OnSiteVisitIdbService, useValue: onSiteVisitIdbService }, @@ -75,7 +75,7 @@ describe('CompanyKpiSelectComponent', () => { }) .compileComponents(); - fixture = TestBed.createComponent(CompanyKpiSelectComponent); + fixture = TestBed.createComponent(FacilityKpiSelectComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.ts b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.ts similarity index 61% rename from src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.ts rename to src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.ts index df5fbe7e..f8528e2b 100644 --- a/src/app/setup-wizard/pre-visit/company-kpi-select/company-kpi-select.component.ts +++ b/src/app/setup-wizard/pre-visit/facility-kpi-select/facility-kpi-select.component.ts @@ -8,17 +8,17 @@ import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicat import { Subscription } from 'rxjs'; @Component({ - selector: 'app-company-kpi-select', - templateUrl: './company-kpi-select.component.html', - styleUrl: './company-kpi-select.component.css' + selector: 'app-facility-kpi-select', + templateUrl: './facility-kpi-select.component.html', + styleUrl: './facility-kpi-select.component.css' }) -export class CompanyKpiSelectComponent { +export class FacilityKpiSelectComponent { faChartBar: IconDefinition = faChartBar; faChevronRight: IconDefinition = faChevronRight; faChevronLeft: IconDefinition = faChevronLeft; - companyKpiSub: Subscription; - companyKpis: Array; + facilityKpiSub: Subscription; + facilityKpis: Array; onSiteVisit: IdbOnSiteVisit; constructor(private router: Router, private onSiteVisitIdbService: OnSiteVisitIdbService, @@ -27,28 +27,27 @@ export class CompanyKpiSelectComponent { ngOnInit() { this.onSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.companyKpiSub = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.subscribe(kpis => { - let keyPerformanceIndicators: Array = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.getValue(); - this.companyKpis = keyPerformanceIndicators.filter(kpi => { - return kpi.companyId == this.onSiteVisit.companyId + this.facilityKpiSub = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.subscribe(kpis => { + this.facilityKpis = kpis.filter(kpi => { + return kpi.facilityId == this.onSiteVisit.facilityId }); }); } - ngOnDestroy(){ - this.companyKpiSub.unsubscribe(); + ngOnDestroy() { + this.facilityKpiSub.unsubscribe(); } goBack() { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-contacts'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/facility-setup'); } goToKpiDetails() { - if (this.companyKpis.length > 0) { - this.router.navigateByUrl('setup-wizard/pre-visit/' + this.onSiteVisit.guid + '/company-kpi-detail/' + this.companyKpis[0].guid); + if (this.facilityKpis.length > 0) { + this.router.navigateByUrl('setup-wizard/pre-visit/' + this.onSiteVisit.guid + '/kpi-detail/' + this.facilityKpis[0].guid); } else { - this.router.navigateByUrl('setup-wizard/pre-visit/' + this.onSiteVisit.guid + '/facility-setup'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + this.onSiteVisit.guid + '/energy-equipment'); } } } diff --git a/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.html b/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.html index f27b0832..bb680e64 100644 --- a/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.html +++ b/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.html @@ -19,7 +19,7 @@
Go Back diff --git a/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.ts b/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.ts index 69d49cfe..7b1c91d8 100644 --- a/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.ts +++ b/src/app/setup-wizard/pre-visit/facility-setup/facility-setup.component.ts @@ -56,12 +56,12 @@ export class FacilitySetupComponent implements OnInit { goBack() { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('/setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-select'); + this.router.navigateByUrl('/setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-contacts'); } goToEnergyEquipment() { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/energy-equipment'); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-select'); } canDeactivate(): Observable { diff --git a/src/app/setup-wizard/setup-wizard-help-panel/HelpContext.ts b/src/app/setup-wizard/setup-wizard-help-panel/HelpContext.ts index ffaebc76..f21e37d9 100644 --- a/src/app/setup-wizard/setup-wizard-help-panel/HelpContext.ts +++ b/src/app/setup-wizard/setup-wizard-help-panel/HelpContext.ts @@ -1,7 +1,7 @@ export type HelpContext = 'company-setup' | 'company-contacts' | - 'company-kpi-select' | - 'company-kpi-detail' | + 'kpi-select' | + 'kpi-detail' | 'facility-setup' | 'energy-equipment' | 'end-uses' | diff --git a/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.html b/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.html index 5a2548eb..87c2f698 100644 --- a/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.html +++ b/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.html @@ -16,9 +16,9 @@
- + - + diff --git a/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.ts b/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.ts index 25c3b873..7a8fef65 100644 --- a/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.ts +++ b/src/app/setup-wizard/setup-wizard-help-panel/setup-wizard-help-panel.component.ts @@ -60,11 +60,11 @@ export class SetupWizardHelpPanelComponent { } else if (url.includes('company-contacts')) { this.helpContext = 'company-contacts'; this.helpLabel = 'Stakeholder Help'; - } else if (url.includes('company-kpi-select')) { - this.helpContext = 'company-kpi-select'; + } else if (url.includes('kpi-select')) { + this.helpContext = 'kpi-select'; this.helpLabel = 'KPI Select Help'; - } else if (url.includes('company-kpi-detail')) { - this.helpContext = 'company-kpi-detail'; + } else if (url.includes('kpi-detail')) { + this.helpContext = 'kpi-detail'; this.helpLabel = 'KPI Details Help'; } else if (url.includes('facility-setup')) { this.helpContext = 'facility-setup'; diff --git a/src/app/setup-wizard/setup-wizard-sidebar/setup-wizard-sidebar.component.html b/src/app/setup-wizard/setup-wizard-sidebar/setup-wizard-sidebar.component.html index 5349c1aa..ce268f15 100644 --- a/src/app/setup-wizard/setup-wizard-sidebar/setup-wizard-sidebar.component.html +++ b/src/app/setup-wizard/setup-wizard-sidebar/setup-wizard-sidebar.component.html @@ -32,29 +32,29 @@ Stakeholder Contacts
+ + - diff --git a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metric-impact-form/performance-metric-impact-form.component.ts b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metric-impact-form/performance-metric-impact-form.component.ts index 9860da30..7cc5b2a8 100644 --- a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metric-impact-form/performance-metric-impact-form.component.ts +++ b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metric-impact-form/performance-metric-impact-form.component.ts @@ -105,7 +105,7 @@ export class PerformanceMetricImpactFormComponent { goToMetric() { this.showDropdownMenu = false; let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-detail/' + this.keyPerformanceMetricImpact.kpiGuid) + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-detail/' + this.keyPerformanceMetricImpact.kpiGuid) } async savePerformanceMetric() { diff --git a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.html b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.html index b6cc70c8..b5fa7afe 100644 --- a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.html +++ b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.html @@ -89,7 +89,7 @@ + [facilityId]="nonEnergyBenefit.facilityId"> diff --git a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.ts b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.ts index 2285223a..526597e0 100644 --- a/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.ts +++ b/src/app/shared/shared-assessment-forms/neb-forms-accordion/neb-setup-form/performance-metrics-modal/performance-metrics-modal.component.ts @@ -3,11 +3,10 @@ import { faAsterisk, faChevronDown, faChevronUp, faMagnifyingGlass, faPlus, faSe import { firstValueFrom } from 'rxjs'; import { KeyPerformanceIndicatorsIdbService } from 'src/app/indexed-db/key-performance-indicators-idb.service'; import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-performance-metric-impacts-idb.service'; -import { getNewKeyPerformanceIndicator, IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; +import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; import { getNewIdbKeyPerformanceMetricImpact, IdbKeyPerformanceMetricImpact } from 'src/app/models/keyPerformanceMetricImpact'; import { IdbNonEnergyBenefit } from 'src/app/models/nonEnergyBenefit'; -import { KeyPerformanceIndicatorOption, KeyPerformanceIndicatorOptions } from 'src/app/shared/constants/keyPerformanceIndicatorOptions'; -import { convertOptionTypeToMetricType, getPerformanceMetrics, KeyPerformanceMetric, KeyPerformanceMetricOption, KeyPerformanceMetricOptions } from 'src/app/shared/constants/keyPerformanceMetrics'; +import { convertOptionTypeToMetricType, KeyPerformanceMetric, KeyPerformanceMetricOptions } from 'src/app/shared/constants/keyPerformanceMetrics'; import { NebOption, NebOptions } from 'src/app/shared/constants/nonEnergyBenefitOptions'; @Component({ @@ -56,8 +55,8 @@ export class PerformanceMetricsModalComponent { async confirmAddMetric() { //make sure metric is tracked in KPI - let addedMetric: KeyPerformanceMetric = await this.keyPerformanceIndicatorIdbService.addKpmToKpi(this.nonEnergyBenefit.companyId, this.performanceMetricToAdd, this.nonEnergyBenefit.userId); - let keyPerformanceIndicator: IdbKeyPerformanceIndicator = this.keyPerformanceIndicatorIdbService.getKpiFromKpm(this.nonEnergyBenefit.companyId, this.performanceMetricToAdd.kpiValue); + let addedMetric: KeyPerformanceMetric = await this.keyPerformanceIndicatorIdbService.addKpmToKpi(this.nonEnergyBenefit.companyId, this.performanceMetricToAdd, this.nonEnergyBenefit.userId, this.nonEnergyBenefit.facilityId); + let keyPerformanceIndicator: IdbKeyPerformanceIndicator = this.keyPerformanceIndicatorIdbService.getKpiFromKpm(this.nonEnergyBenefit.facilityId, this.performanceMetricToAdd.kpiValue); let newKeyPerformanceMetricImpact: IdbKeyPerformanceMetricImpact = getNewIdbKeyPerformanceMetricImpact(this.nonEnergyBenefit.userId, this.nonEnergyBenefit.companyId, this.nonEnergyBenefit.facilityId, this.nonEnergyBenefit.energyOpportunityId, this.nonEnergyBenefit.guid, addedMetric.value, this.nonEnergyBenefit.assessmentId, keyPerformanceIndicator.guid, addedMetric.guid); await firstValueFrom(this.keyPerformanceMetricImpactIdbService.addWithObservable(newKeyPerformanceMetricImpact)); await this.keyPerformanceMetricImpactIdbService.setKeyPerformanceMetricImpacts(); diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.ts b/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.ts deleted file mode 100644 index e839e1ab..00000000 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { Component } from '@angular/core'; - -@Component({ - selector: 'app-company-kpi-search-form', - templateUrl: './company-kpi-search-form.component.html', - styleUrl: './company-kpi-search-form.component.css' -}) -export class CompanyKpiSearchFormComponent { - -} diff --git a/src/app/shared/shared-company-forms/shared-company-forms.module.ts b/src/app/shared/shared-company-forms/shared-company-forms.module.ts index 5554bc5c..285d7d00 100644 --- a/src/app/shared/shared-company-forms/shared-company-forms.module.ts +++ b/src/app/shared/shared-company-forms/shared-company-forms.module.ts @@ -5,18 +5,8 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { LabelWithTooltipModule } from '../label-with-tooltip/label-with-tooltip.module'; import { SharedSettingsFormsModule } from '../shared-settings-forms/shared-settings-forms.module'; import { CompanySetupFormComponent } from './company-setup-form/company-setup-form.component'; -import { CompanyKpiDetailsFormComponent } from './company-kpi-details-form/company-kpi-details-form.component'; -import { PrimaryKpiBadgeModule } from '../primary-kpi-badge/primary-kpi-badge.module'; import { HelperPipesModule } from '../helper-pipes/_helper-pipes.module'; -import { KpiDescriptionPipe } from './company-kpi-details-form/kpi-description.pipe'; -import { KpmDetailsFormModule } from '../kpm-details-form/kpm-details-form.module'; -import { KpmDatabaseModalComponent } from './company-kpi-details-form/kpm-database-modal/kpm-database-modal.component'; -import { KpmImpactsTableComponent } from './company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component'; import { ContactModalModule } from '../contact-modal/contact-modal.module'; -import { CompanyKpiSearchFormComponent } from './company-kpi-search-form/company-kpi-search-form.component'; -import { AddKpiSearchComponent } from './company-kpi-search-form/add-kpi-search/add-kpi-search.component'; -import { CompanyKpiListComponent } from './company-kpi-search-form/company-kpi-list/company-kpi-list.component'; -import { SelectedKpiOptionPipe } from './company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe'; import { CompanyContactsFormComponent } from './company-contacts-form/company-contacts-form.component'; @@ -24,14 +14,6 @@ import { CompanyContactsFormComponent } from './company-contacts-form/company-co @NgModule({ declarations: [ CompanySetupFormComponent, - CompanyKpiDetailsFormComponent, - KpiDescriptionPipe, - KpmDatabaseModalComponent, - KpmImpactsTableComponent, - CompanyKpiSearchFormComponent, - AddKpiSearchComponent, - CompanyKpiListComponent, - SelectedKpiOptionPipe, CompanyContactsFormComponent ], imports: [ @@ -41,15 +23,11 @@ import { CompanyContactsFormComponent } from './company-contacts-form/company-co LabelWithTooltipModule, SharedSettingsFormsModule, FormsModule, - PrimaryKpiBadgeModule, HelperPipesModule, - KpmDetailsFormModule, ContactModalModule ], exports: [ CompanySetupFormComponent, - CompanyKpiDetailsFormComponent, - CompanyKpiSearchFormComponent, CompanyContactsFormComponent ] }) diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpi-description.pipe.spec.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-description.pipe.spec.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpi-description.pipe.spec.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-description.pipe.spec.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpi-description.pipe.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-description.pipe.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpi-description.pipe.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-description.pipe.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.css b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.css rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.html b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.html similarity index 99% rename from src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.html rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.html index e717a7d4..0e4058aa 100644 --- a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.html +++ b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.html @@ -125,7 +125,7 @@

The below associated key performance metrics () - will be used later on during an assessment to tie Non-Energy Benefits found back to company Key + will be used later on during an assessment to tie Non-Energy Benefits found back to facility Key Performance Indicators. This information can be added to and modified at a later time if not all of the details are currently known.

diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.spec.ts similarity index 71% rename from src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.spec.ts index b9df83c9..bbb7083f 100644 --- a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.spec.ts +++ b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CompanyKpiDetailsFormComponent } from './company-kpi-details-form.component'; +import { KpiDetailsFormComponent } from './kpi-details-form.component'; import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; import { KpmDatabaseModalComponent } from './kpm-database-modal/kpm-database-modal.component'; import { KpmImpactsTableComponent } from './kpm-impacts-table/kpm-impacts-table.component'; @@ -10,19 +10,19 @@ import { PrimaryKpiBadgeModule } from '../../primary-kpi-badge/primary-kpi-badge import { KpiDescriptionPipe } from './kpi-description.pipe'; import { KpmDetailsFormModule } from '../../kpm-details-form/kpm-details-form.module'; -describe('CompanyKpiDetailsFormComponent', () => { - let component: CompanyKpiDetailsFormComponent; - let fixture: ComponentFixture; +describe('KpiDetailsFormComponent', () => { + let component: KpiDetailsFormComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FontAwesomeModule, HelperPipesModule, PrimaryKpiBadgeModule, KpmDetailsFormModule], - declarations: [CompanyKpiDetailsFormComponent, KpmDatabaseModalComponent, KpmImpactsTableComponent, KpiDescriptionPipe], + declarations: [KpiDetailsFormComponent, KpmDatabaseModalComponent, KpmImpactsTableComponent, KpiDescriptionPipe], providers: stubServiceProviders }) .compileComponents(); - fixture = TestBed.createComponent(CompanyKpiDetailsFormComponent); + fixture = TestBed.createComponent(KpiDetailsFormComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.ts similarity index 93% rename from src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.ts index d1883356..fae79206 100644 --- a/src/app/shared/shared-company-forms/company-kpi-details-form/company-kpi-details-form.component.ts +++ b/src/app/shared/shared-facility-forms/kpi-details-form/kpi-details-form.component.ts @@ -1,5 +1,5 @@ -import { Component, Input, SimpleChanges } from '@angular/core'; -import { faBullseye, faChartBar, faChevronRight, faCircleQuestion, faClose, faContactBook, faPlus, faScaleUnbalancedFlip, faSearchPlus, faTrash, faUser, IconDefinition } from '@fortawesome/free-solid-svg-icons'; +import { Component } from '@angular/core'; +import { faBullseye, faCircleQuestion, faContactBook, faPlus, faScaleUnbalancedFlip, faSearchPlus, faTrash, faUser, IconDefinition } from '@fortawesome/free-solid-svg-icons'; import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; import { PrimaryKPI, PrimaryKPIs } from '../../constants/keyPerformanceIndicatorOptions'; import { firstValueFrom, Subscription } from 'rxjs'; @@ -15,11 +15,11 @@ import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-pe import { SharedDataService } from '../../shared-services/shared-data.service'; @Component({ - selector: 'app-company-kpi-details-form', - templateUrl: './company-kpi-details-form.component.html', - styleUrl: './company-kpi-details-form.component.css' + selector: 'app-kpi-details-form', + templateUrl: './kpi-details-form.component.html', + styleUrl: './kpi-details-form.component.css' }) -export class CompanyKpiDetailsFormComponent { +export class KpiDetailsFormComponent { // @Input({ required: true }) diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.css b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.css rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.html b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.html similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.html rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.html diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts similarity index 96% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts index 5dff4684..14075813 100644 --- a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts +++ b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.spec.ts @@ -24,7 +24,7 @@ describe('KpmDatabaseModalComponent', () => { htmlLabel: '', optionValue: 'chemicalEmissions' } - component.keyPerformanceIndicator = getNewKeyPerformanceIndicator('', '', tmpIndicatorOption, false) + component.keyPerformanceIndicator = getNewKeyPerformanceIndicator('', '', tmpIndicatorOption, false, '') fixture.detectChanges(); }); diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-database-modal/kpm-database-modal.component.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-database-modal/kpm-database-modal.component.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.css b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.css rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.html b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.html similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.html rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.html diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.spec.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.spec.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.ts b/src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.ts rename to src/app/shared/shared-facility-forms/kpi-details-form/kpm-impacts-table/kpm-impacts-table.component.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.css b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.css rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.html b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.html similarity index 97% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.html rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.html index bd64aa84..47c37a6a 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.html +++ b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.html @@ -29,7 +29,7 @@
+ [ngClass]="{'hidden': option.optionValue | selectedKpiOption: keyPerformanceIndicators: facility.guid }">
diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts similarity index 84% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts index 71716581..67ea6f50 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.spec.ts @@ -3,21 +3,21 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { AddKpiSearchComponent } from './add-kpi-search.component'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { FormsModule } from '@angular/forms'; -import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; import { BehaviorSubject } from 'rxjs'; -import { IdbCompany, getNewIdbCompany } from 'src/app/models/company'; import { SelectedKpiOptionPipe } from './selected-kpi-option.pipe'; import { KeyPerformanceIndicatorsIdbService } from 'src/app/indexed-db/key-performance-indicators-idb.service'; import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; import { HelperPipesModule } from 'src/app/shared/helper-pipes/_helper-pipes.module'; import { NonEnergyBenefitsIdbService } from 'src/app/indexed-db/non-energy-benefits-idb.service'; import { PrimaryKpiBadgeModule } from 'src/app/shared/primary-kpi-badge/primary-kpi-badge.module'; +import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; +import { getNewIdbFacility, IdbFacility } from 'src/app/models/facility'; describe('AddKpiSearchComponent', () => { let component: AddKpiSearchComponent; let fixture: ComponentFixture; - let companyIdbService: Partial = { - selectedCompany: new BehaviorSubject(getNewIdbCompany('',)) + let facilityIdbService: Partial = { + selectedFacility: new BehaviorSubject(getNewIdbFacility('', '')) }; let keyPerformanceIndicatorIdbService: Partial = { keyPerformanceIndicators: new BehaviorSubject>([]) @@ -29,7 +29,7 @@ describe('AddKpiSearchComponent', () => { imports: [FontAwesomeModule, FormsModule, HelperPipesModule, PrimaryKpiBadgeModule], declarations: [AddKpiSearchComponent, SelectedKpiOptionPipe], providers: [ - { provide: CompanyIdbService, useValue: companyIdbService }, + { provide: FacilityIdbService, useValue: facilityIdbService }, { provide: KeyPerformanceIndicatorsIdbService, useValue: keyPerformanceIndicatorIdbService }, { provide: NonEnergyBenefitsIdbService, useValue: nonEnergyBenefitsIdbService } ] diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.ts b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.ts similarity index 77% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.ts index 7f611d9e..29052986 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/add-kpi-search.component.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/add-kpi-search.component.ts @@ -1,9 +1,9 @@ import { Component } from '@angular/core'; import { IconDefinition, faCircleQuestion, faMagnifyingGlass, faMagnifyingGlassPlus, faPlus } from '@fortawesome/free-solid-svg-icons'; import { Subscription, firstValueFrom } from 'rxjs'; -import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; +import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; import { KeyPerformanceIndicatorsIdbService } from 'src/app/indexed-db/key-performance-indicators-idb.service'; -import { IdbCompany } from 'src/app/models/company'; +import { IdbFacility } from 'src/app/models/facility'; import { IdbKeyPerformanceIndicator, getNewKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; import { KeyPerformanceIndicatorOption, KeyPerformanceIndicatorOptions, PrimaryKPI, PrimaryKPIs } from 'src/app/shared/constants/keyPerformanceIndicatorOptions'; @@ -19,8 +19,8 @@ export class AddKpiSearchComponent { faPlus: IconDefinition = faPlus; faCircleQuestion: IconDefinition = faCircleQuestion; - company: IdbCompany; - companySub: Subscription; + facility: IdbFacility; + facilitySub: Subscription; primaryKPIs: Array = PrimaryKPIs; @@ -30,13 +30,13 @@ export class AddKpiSearchComponent { keyPerformanceIndicatorOptions: Array = KeyPerformanceIndicatorOptions; keyPerformanceIndicators: Array; keyPerformanceIndicatorSub: Subscription; - constructor(private companyIdbService: CompanyIdbService, private keyPerformanceIndicatorIdbService: KeyPerformanceIndicatorsIdbService + constructor(private facilityIdbService: FacilityIdbService, private keyPerformanceIndicatorIdbService: KeyPerformanceIndicatorsIdbService ) { } ngOnInit() { - this.companySub = this.companyIdbService.selectedCompany.subscribe(_company => { - this.company = _company; + this.facilitySub = this.facilityIdbService.selectedFacility.subscribe(_facility => { + this.facility = _facility;; }); this.keyPerformanceIndicatorSub = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.subscribe(_keyPerformanceIndicators => { this.keyPerformanceIndicators = _keyPerformanceIndicators; @@ -44,12 +44,12 @@ export class AddKpiSearchComponent { } ngOnDestroy() { - this.companySub.unsubscribe(); + this.facilitySub.unsubscribe(); this.keyPerformanceIndicatorSub.unsubscribe(); } async addKPI(option: KeyPerformanceIndicatorOption) { - let newKPI: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator(this.company.userId, this.company.guid, option, false); + let newKPI: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator(this.facility.userId, this.facility.companyId, option, false, this.facility.guid); await firstValueFrom(this.keyPerformanceIndicatorIdbService.addWithObservable(newKPI)); await this.keyPerformanceIndicatorIdbService.setKeyPerformanceIndicators(); } diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe.spec.ts b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe.spec.ts similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe.spec.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe.spec.ts diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts similarity index 73% rename from src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts index 28367055..8c61036e 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/add-kpi-search/selected-kpi-option.pipe.ts @@ -6,9 +6,9 @@ import { IdbKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicat }) export class SelectedKpiOptionPipe implements PipeTransform { - transform(optionValue: string, keyPerformanceIndicators: Array, companyGuid: string): boolean { + transform(optionValue: string, keyPerformanceIndicators: Array, facilityId: string): boolean { return keyPerformanceIndicators.find(kpi => { - return kpi.optionValue == optionValue && kpi.companyId == companyGuid + return kpi.optionValue == optionValue && kpi.facilityId == facilityId }) != undefined; } diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.css b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.css rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.html b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.html similarity index 94% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.html rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.html index 10f8b74a..dcebb9e4 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.html +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.html @@ -2,7 +2,7 @@
- Selected {{company.generalInformation.name}} KPIs + Selected {{facility.generalInformation.name}} KPIs
@@ -13,11 +13,12 @@
- +@let facilityKpis = (facility.guid | facilityKpiList:keyPerformanceIndicators); +

-
+
@@ -45,7 +46,7 @@
- No KPI's selected for this company. Add KPI's from the list provided. + No KPI's selected for this facility. Add KPI's from the list provided.
diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.spec.ts similarity index 92% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.spec.ts index 84e400b1..f10520b6 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.spec.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.spec.ts @@ -1,6 +1,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CompanyKpiListComponent } from './company-kpi-list.component'; +import { KpiListComponent } from './kpi-list.component'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; import { IdbCompany, getNewIdbCompany } from 'src/app/models/company'; @@ -22,9 +22,9 @@ import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-performance-metric-impacts-idb.service'; import { IdbKeyPerformanceMetricImpact } from 'src/app/models/keyPerformanceMetricImpact'; -describe('CompanyKpiListComponent', () => { - let component: CompanyKpiListComponent; - let fixture: ComponentFixture; +describe('KpiListComponent', () => { + let component: KpiListComponent; + let fixture: ComponentFixture; let companyIdbService: Partial = { selectedCompany: new BehaviorSubject(getNewIdbCompany('',)) }; @@ -53,7 +53,7 @@ describe('CompanyKpiListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FontAwesomeModule, FormsModule, HelperPipesModule], - declarations: [CompanyKpiListComponent], + declarations: [KpiListComponent], providers: [ { provide: CompanyIdbService, useValue: companyIdbService }, { provide: ContactIdbService, useValue: contactIdbService }, @@ -69,7 +69,7 @@ describe('CompanyKpiListComponent', () => { }) .compileComponents(); - fixture = TestBed.createComponent(CompanyKpiListComponent); + fixture = TestBed.createComponent(KpiListComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.ts b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.ts similarity index 85% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.ts index c8266f73..efe08577 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-list/company-kpi-list.component.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-list/kpi-list.component.ts @@ -4,21 +4,23 @@ import { IconDefinition, faBullseye, faCircleQuestion, faPlus, faTrash, faUser } import { Subscription, firstValueFrom } from 'rxjs'; import { CompanyIdbService } from 'src/app/indexed-db/company-idb.service'; import { DbChangesService } from 'src/app/indexed-db/db-changes.service'; +import { FacilityIdbService } from 'src/app/indexed-db/facility-idb.service'; import { KeyPerformanceIndicatorsIdbService } from 'src/app/indexed-db/key-performance-indicators-idb.service'; import { KeyPerformanceMetricImpactsIdbService } from 'src/app/indexed-db/key-performance-metric-impacts-idb.service'; import { OnSiteVisitIdbService } from 'src/app/indexed-db/on-site-visit-idb.service'; import { IdbCompany } from 'src/app/models/company'; +import { IdbFacility } from 'src/app/models/facility'; import { IdbKeyPerformanceIndicator, getNewKeyPerformanceIndicator } from 'src/app/models/keyPerformanceIndicator'; import { IdbKeyPerformanceMetricImpact } from 'src/app/models/keyPerformanceMetricImpact'; import { IdbOnSiteVisit } from 'src/app/models/onSiteVisit'; import { KeyPerformanceIndicatorOption, PrimaryKPI, PrimaryKPIs } from 'src/app/shared/constants/keyPerformanceIndicatorOptions'; @Component({ - selector: 'app-company-kpi-list', - templateUrl: './company-kpi-list.component.html', - styleUrl: './company-kpi-list.component.css' + selector: 'app-kpi-list', + templateUrl: './kpi-list.component.html', + styleUrl: './kpi-list.component.css' }) -export class CompanyKpiListComponent { +export class KpiListComponent { faTrash: IconDefinition = faTrash; faBullseye: IconDefinition = faBullseye; @@ -26,8 +28,8 @@ export class CompanyKpiListComponent { faPlus: IconDefinition = faPlus; faCircleQuestion: IconDefinition = faCircleQuestion; - company: IdbCompany; - companySub: Subscription; + facility: IdbFacility; + facilitySub: Subscription; kpiToDelete: IdbKeyPerformanceIndicator; @@ -49,13 +51,14 @@ export class CompanyKpiListComponent { private dbChangesService: DbChangesService, private router: Router, private onSiteVisitIdbService: OnSiteVisitIdbService, - private keyPerformanceMetricImpactsIdbService: KeyPerformanceMetricImpactsIdbService + private keyPerformanceMetricImpactsIdbService: KeyPerformanceMetricImpactsIdbService, + private facilityIdbService: FacilityIdbService ) { } ngOnInit() { - this.companySub = this.companyIdbService.selectedCompany.subscribe(_company => { - this.company = _company; + this.facilitySub = this.facilityIdbService.selectedFacility.subscribe(_facility => { + this.facility = _facility; }); this.keyPerformanceIndicatorSub = this.keyPerformanceIndicatorIdbService.keyPerformanceIndicators.subscribe(_keyPerformanceIndicators => { this.keyPerformanceIndicators = _keyPerformanceIndicators; @@ -66,7 +69,7 @@ export class CompanyKpiListComponent { } ngOnDestroy() { - this.companySub.unsubscribe(); + this.facilitySub.unsubscribe(); this.keyPerformanceIndicatorSub.unsubscribe(); this.keyPerformanceMetricImpactsSub.unsubscribe(); } @@ -100,8 +103,8 @@ export class CompanyKpiListComponent { label: this.customKPIName, htmlLabel: this.customKPIName, optionValue: 'other', - } - let newKPI: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator(this.company.userId, this.company.guid, option, true); + }; + let newKPI: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator(this.facility.userId, this.facility.companyId, option, true, this.facility.guid); await firstValueFrom(this.keyPerformanceIndicatorIdbService.addWithObservable(newKPI)); await this.keyPerformanceIndicatorIdbService.setKeyPerformanceIndicators(); this.closeCustomKPIModal(); @@ -112,7 +115,7 @@ export class CompanyKpiListComponent { this.router.navigateByUrl('portfolio/company/' + kpi.companyId + '/performance-indicators/details/' + kpi.guid); } else { let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue(); - this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/company-kpi-detail/' + kpi.guid); + this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/kpi-detail/' + kpi.guid); } } diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.css b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.css similarity index 100% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.css rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.css diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.html b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.html similarity index 74% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.html rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.html index 37dffce1..2bd4ed90 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.html +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.html @@ -3,6 +3,6 @@
- +
\ No newline at end of file diff --git a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.spec.ts b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.spec.ts similarity index 65% rename from src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.spec.ts rename to src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.spec.ts index 6632b4e2..2843be0f 100644 --- a/src/app/shared/shared-company-forms/company-kpi-search-form/company-kpi-search-form.component.spec.ts +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.spec.ts @@ -1,7 +1,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CompanyKpiSearchFormComponent } from './company-kpi-search-form.component'; -import { CompanyKpiListComponent } from './company-kpi-list/company-kpi-list.component'; +import { KpiSearchFormComponent } from './kpi-search-form.component'; +import { KpiListComponent } from './kpi-list/kpi-list.component'; import { AddKpiSearchComponent } from './add-kpi-search/add-kpi-search.component'; import { stubServiceProviders } from 'src/app/spec-helpers/spec-test-service-stub'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; @@ -10,19 +10,19 @@ import { HelperPipesModule } from '../../helper-pipes/_helper-pipes.module'; import { SelectedKpiOptionPipe } from './add-kpi-search/selected-kpi-option.pipe'; import { PrimaryKpiBadgeModule } from '../../primary-kpi-badge/primary-kpi-badge.module'; -describe('CompanyKpiSearchFormComponent', () => { - let component: CompanyKpiSearchFormComponent; - let fixture: ComponentFixture; +describe('KpiSearchFormComponent', () => { + let component: KpiSearchFormComponent; + let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FontAwesomeModule, FormsModule, HelperPipesModule, PrimaryKpiBadgeModule], - declarations: [CompanyKpiSearchFormComponent, CompanyKpiListComponent, AddKpiSearchComponent, SelectedKpiOptionPipe], + declarations: [KpiSearchFormComponent, KpiListComponent, AddKpiSearchComponent, SelectedKpiOptionPipe], providers: stubServiceProviders }) .compileComponents(); - fixture = TestBed.createComponent(CompanyKpiSearchFormComponent); + fixture = TestBed.createComponent(KpiSearchFormComponent); component = fixture.componentInstance; fixture.detectChanges(); }); diff --git a/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.ts b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.ts new file mode 100644 index 00000000..9fbeb1f1 --- /dev/null +++ b/src/app/shared/shared-facility-forms/kpi-search-form/kpi-search-form.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app-kpi-search-form', + templateUrl: './kpi-search-form.component.html', + styleUrl: './kpi-search-form.component.css' +}) +export class KpiSearchFormComponent { + +} diff --git a/src/app/shared/shared-facility-forms/shared-facility-forms.module.ts b/src/app/shared/shared-facility-forms/shared-facility-forms.module.ts index 1ad8d9b7..02f3146e 100644 --- a/src/app/shared/shared-facility-forms/shared-facility-forms.module.ts +++ b/src/app/shared/shared-facility-forms/shared-facility-forms.module.ts @@ -7,6 +7,16 @@ import { EnergyEquipmentFormComponent } from './energy-equipment-form/energy-equ import { HelperPipesModule } from '../helper-pipes/_helper-pipes.module'; import { FontAwesomeModule } from '@fortawesome/angular-fontawesome'; import { ProcessEquipmentFormComponent } from './process-equipment-form/process-equipment-form.component'; +import { AddKpiSearchComponent } from './kpi-search-form/add-kpi-search/add-kpi-search.component'; +import { SelectedKpiOptionPipe } from './kpi-search-form/add-kpi-search/selected-kpi-option.pipe'; +import { KpiListComponent } from './kpi-search-form/kpi-list/kpi-list.component'; +import { KpiSearchFormComponent } from './kpi-search-form/kpi-search-form.component'; +import { KpmDetailsFormModule } from '../kpm-details-form/kpm-details-form.module'; +import { PrimaryKpiBadgeModule } from '../primary-kpi-badge/primary-kpi-badge.module'; +import { KpmDatabaseModalComponent } from './kpi-details-form/kpm-database-modal/kpm-database-modal.component'; +import { KpmImpactsTableComponent } from './kpi-details-form/kpm-impacts-table/kpm-impacts-table.component'; +import { KpiDescriptionPipe } from './kpi-details-form/kpi-description.pipe'; +import { KpiDetailsFormComponent } from './kpi-details-form/kpi-details-form.component'; @@ -14,7 +24,15 @@ import { ProcessEquipmentFormComponent } from './process-equipment-form/process- declarations: [ FacilitySetupFormComponent, EnergyEquipmentFormComponent, - ProcessEquipmentFormComponent + ProcessEquipmentFormComponent, + AddKpiSearchComponent, + SelectedKpiOptionPipe, + KpiListComponent, + KpiSearchFormComponent, + KpmDatabaseModalComponent, + KpmImpactsTableComponent, + KpiDescriptionPipe, + KpiDetailsFormComponent ], imports: [ CommonModule, @@ -22,12 +40,16 @@ import { ProcessEquipmentFormComponent } from './process-equipment-form/process- FormsModule, ReactiveFormsModule, HelperPipesModule, - FontAwesomeModule + FontAwesomeModule, + KpmDetailsFormModule, + PrimaryKpiBadgeModule ], exports: [ FacilitySetupFormComponent, EnergyEquipmentFormComponent, - ProcessEquipmentFormComponent + ProcessEquipmentFormComponent, + KpiDetailsFormComponent, + KpiSearchFormComponent ] }) export class SharedFacilityFormsModule { } diff --git a/src/app/spec-helpers/spec-test-service-stub.ts b/src/app/spec-helpers/spec-test-service-stub.ts index 083a0962..e138a7e1 100644 --- a/src/app/spec-helpers/spec-test-service-stub.ts +++ b/src/app/spec-helpers/spec-test-service-stub.ts @@ -32,6 +32,7 @@ import { SharedDataService } from "../shared/shared-services/shared-data.service import { CompanyContactsFormService } from "../shared/shared-company-forms/company-contacts-form/company-contacts-form.service"; import { FormControl, FormGroup } from "@angular/forms"; import { LocalStorageService } from "ngx-webstorage"; +import { UpdateDbEntriesService } from "../indexed-db/update-db-entries.service"; let stubCompany: IdbCompany = getNewIdbCompany('123'); stubCompany.guid = '123'; @@ -109,7 +110,7 @@ let option: KeyPerformanceIndicatorOption = htmlLabel: 'Expense Cost', optionValue: 'reduceExpenseCost' } -let stubKpi: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator('123', '123', option, false); +let stubKpi: IdbKeyPerformanceIndicator = getNewKeyPerformanceIndicator('123', '123', option, false, '123'); stubKpi.guid = '123'; let keyPerformanceIndicatorService: Partial = { keyPerformanceIndicators: new BehaviorSubject>([stubKpi]), @@ -162,6 +163,8 @@ let companyContactsFormService: Partial = { } } +let updateDbEntriesService: Partial = {}; + let localStorageService: Partial = { retrieve: () => { return undefined }, store: () => { return undefined }, @@ -184,6 +187,7 @@ export const stubServiceProviders: Array<{ provide: any, useValue: any }> = [ { provide: LocalStorageDataService, useValue: localStorageService }, { provide: SharedDataService, useValue: sharedDataService }, { provide: CompanyContactsFormService, useValue: companyContactsFormService }, + { provide: UpdateDbEntriesService, useValue: updateDbEntriesService }, { provide: ActivatedRoute, useValue: { diff --git a/src/app/user-portfolio/company-dashboard/company-dashboard-nav/company-dashboard-nav.component.html b/src/app/user-portfolio/company-dashboard/company-dashboard-nav/company-dashboard-nav.component.html index 84f70005..c90da70a 100644 --- a/src/app/user-portfolio/company-dashboard/company-dashboard-nav/company-dashboard-nav.component.html +++ b/src/app/user-portfolio/company-dashboard/company-dashboard-nav/company-dashboard-nav.component.html @@ -17,13 +17,13 @@ Stakeholders -
+