Skip to content

Commit

Permalink
Merge pull request #361 from NREL/issue-354
Browse files Browse the repository at this point in the history
Issue 354: updated list ordering for KPIs based off feedback
  • Loading branch information
RLiNREL authored Jan 21, 2025
2 parents 2eef2df + e5fd9aa commit 055eff0
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 43 deletions.
84 changes: 44 additions & 40 deletions src/app/shared/constants/keyPerformanceIndicatorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ export interface KeyPerformanceIndicatorOption {
};

export const KeyPerformanceIndicatorOptions: Array<KeyPerformanceIndicatorOption> = [
{
primaryKPI: 'Strategic Relationship Impact',
label: 'Strategic Relationship Impact',
htmlLabel: 'Strategic Relationship Impact',
optionValue: 'strategicRelationshipImpact'
},
//operations
{
primaryKPI: 'Operations',
label: 'Productivity',
Expand All @@ -46,16 +41,22 @@ export const KeyPerformanceIndicatorOptions: Array<KeyPerformanceIndicatorOption
},
{
primaryKPI: 'Operations',
label: 'Machine Utilization',
htmlLabel: 'Machine Utilization',
optionValue: 'machineUtilization'
label: 'Expense Cost',
htmlLabel: 'Expense Cost',
optionValue: 'reduceExpenseCost'
},
{
primaryKPI: 'Operations',
label: 'Quality',
htmlLabel: 'Quality',
optionValue: 'quality'
},
{
primaryKPI: 'Operations',
label: 'Machine Utilization',
htmlLabel: 'Machine Utilization',
optionValue: 'machineUtilization'
},
{
primaryKPI: 'Operations',
label: 'Material Utilization',
Expand All @@ -70,9 +71,35 @@ export const KeyPerformanceIndicatorOptions: Array<KeyPerformanceIndicatorOption
},
{
primaryKPI: 'Operations',
label: 'Expense Cost',
htmlLabel: 'Expense Cost',
optionValue: 'reduceExpenseCost'
label: 'Maintenance Expense',
htmlLabel: 'Maintenance Expense',
optionValue: 'maintenanceExpense'
},
//Employee and workplace environment
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Safety',
htmlLabel: 'Safety',
optionValue: 'safety'
},
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Employee Engagement - Workforce Development',
htmlLabel: 'Employee Engagement - Workforce Development',
optionValue: 'employeeEngagementWorkforceDevelopment'
},
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Employee Engagement - Working Environment',
htmlLabel: 'Employee Engagement - Working Environment',
optionValue: 'employeeEngagementWorkingEnvironment'
},
//Sustainability (Environmental Impact)
{
primaryKPI: 'Sustainability (Environmental Impact)',
label: 'GHG Emissions',
htmlLabel: 'GHG Emissions',
optionValue: 'chemicalEmissions'
},
{
primaryKPI: 'Sustainability (Environmental Impact)',
Expand Down Expand Up @@ -110,12 +137,6 @@ export const KeyPerformanceIndicatorOptions: Array<KeyPerformanceIndicatorOption
htmlLabel: 'Dust Emissions',
optionValue: 'dustEmissions'
},
{
primaryKPI: 'Sustainability (Environmental Impact)',
label: 'GHG Emissions',
htmlLabel: 'GHG Emissions',
optionValue: 'chemicalEmissions'
},
{
primaryKPI: 'Sustainability (Environmental Impact)',
label: 'Air Pollutant Emissions',
Expand All @@ -134,28 +155,11 @@ export const KeyPerformanceIndicatorOptions: Array<KeyPerformanceIndicatorOption
htmlLabel: 'Reduce Refrigerant Gas Emissions',
optionValue: 'reduceRefrigerantGasEmissions'
},
//Strategic relationship impact
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Safety',
htmlLabel: 'Safety',
optionValue: 'safety'
},
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Employee Engagement - Working Environment',
htmlLabel: 'Employee Engagement - Working Environment',
optionValue: 'employeeEngagementWorkingEnvironment'
},
{
primaryKPI: 'Employee and Workplace Environment',
label: 'Employee Engagement - Workforce Development',
htmlLabel: 'Employee Engagement - Workforce Development',
optionValue: 'employeeEngagementWorkforceDevelopment'
},
{
primaryKPI: 'Operations',
label: 'Maintenance Expense',
htmlLabel: 'Maintenance Expense',
optionValue: 'maintenanceExpense'
primaryKPI: 'Strategic Relationship Impact',
label: 'Strategic Relationship Impact',
htmlLabel: 'Strategic Relationship Impact',
optionValue: 'strategicRelationshipImpact'
},
]
21 changes: 19 additions & 2 deletions src/app/shared/helper-pipes/kpi-list-filter.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,26 @@ export class KpiListFilterPipe implements PipeTransform {
return option.label.toLowerCase().includes(searchStr.toLowerCase());
});
}


return _.orderBy(filteredOptions, (option: KeyPerformanceIndicatorOption) => {
return option.label;
return this.getPrimaryOrder(option);
}, 'asc');
}

}

getPrimaryOrder(option: KeyPerformanceIndicatorOption): number {
switch (option.primaryKPI) {
case 'Operations':
return 1;
case 'Employee and Workplace Environment':
return 2;
case 'Sustainability (Environmental Impact)':
return 3;
case 'Strategic Relationship Impact':
return 4;
case 'Other':
return 5;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class KpiListComponent {

goToKpiDetails(kpi: IdbKeyPerformanceIndicator) {
if (this.router.url.includes('portfolio')) {
this.router.navigateByUrl('portfolio/company/' + kpi.companyId + '/performance-indicators/details/' + kpi.guid);
this.router.navigateByUrl('portfolio/facility/' + kpi.facilityId + '/performance-indicators/details/' + kpi.guid);
} else {
let onSiteVisit: IdbOnSiteVisit = this.onSiteVisitIdbService.selectedVisit.getValue();
this.router.navigateByUrl('setup-wizard/pre-visit/' + onSiteVisit.guid + '/facility-kpi-detail/' + kpi.guid);
Expand Down

0 comments on commit 055eff0

Please sign in to comment.