-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Pre solve metrics panel updates (#167)
- Loading branch information
1 parent
f9742e1
commit 77bb215
Showing
11 changed files
with
319 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...ontend/src/app/shared/components/load-demands-metrics/load-demands-metrics.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="title" mat-dialog-title> | ||
<div class="m-0 mr-6">Total Scenario Load Demands</div> | ||
<button mat-icon-button type="button" title="Cancel" class="close-button" matDialogClose=""> | ||
<mat-icon svgIcon="clear"></mat-icon> | ||
</button> | ||
</div> | ||
<div mat-dialog-container> | ||
<table cdk-table [dataSource]="kpiData"> | ||
<ng-container cdkColumnDef="type"> | ||
<th cdk-header-cell *cdkHeaderCellDef class="kpi-title">Load Type</th> | ||
<td cdk-cell *cdkCellDef="let kpi" class="metric-box-value">{{ kpi.type }}</td> | ||
</ng-container> | ||
<ng-container cdkColumnDef="demand"> | ||
<th cdk-header-cell *cdkHeaderCellDef class="kpi-title">Total Shipment Demand</th> | ||
<td cdk-cell *cdkCellDef="let kpi" class="metric-box-value">{{ kpi.demand | number }}</td> | ||
</ng-container> | ||
<ng-container cdkColumnDef="capacity"> | ||
<th cdk-header-cell *cdkHeaderCellDef class="kpi-title">Total Vehicle Capacity</th> | ||
<td cdk-cell *cdkCellDef="let kpi" class="metric-box-value">{{ kpi.capacity | number }}</td> | ||
</ng-container> | ||
|
||
<tr cdk-header-row *cdkHeaderRowDef="displayedColumns"></tr> | ||
<tr cdk-row *cdkRowDef="let row; columns: displayedColumns"></tr> | ||
</table> | ||
</div> |
40 changes: 40 additions & 0 deletions
40
...ontend/src/app/shared/components/load-demands-metrics/load-demands-metrics.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@import '../../../../styles/variables.scss'; | ||
|
||
:host { | ||
text-align: left; | ||
} | ||
|
||
table { | ||
border-spacing: 20px 0; | ||
margin-left: -20px; | ||
margin-right: -20px; | ||
} | ||
|
||
.close-button { | ||
margin-top: -1rem; | ||
margin-right: -1rem; | ||
} | ||
|
||
.title { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
font-size: 16px; | ||
line-height: 24px; | ||
font-weight: 400; | ||
letter-spacing: 0.15px; | ||
margin-bottom: 26px; | ||
} | ||
|
||
.kpi-title { | ||
font-weight: 400; | ||
font-size: 12px; | ||
line-height: 24px; | ||
|
||
padding-right: 35px; | ||
margin-right: 20px; | ||
|
||
&:last-child { | ||
padding-right: 0; | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
...end/src/app/shared/components/load-demands-metrics/load-demands-metrics.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoadDemandsMetricsComponent } from './load-demands-metrics.component'; | ||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; | ||
|
||
describe('LoadDemandsMetricsComponent', () => { | ||
let component: LoadDemandsMetricsComponent; | ||
let fixture: ComponentFixture<LoadDemandsMetricsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [LoadDemandsMetricsComponent], | ||
providers: [ | ||
{ provide: MatDialogRef, useValue: {} }, | ||
{ | ||
provide: MAT_DIALOG_DATA, | ||
useValue: { | ||
kpis: { | ||
shipmentKpis: { | ||
total: 1, | ||
selected: 1, | ||
demands: [ | ||
{ | ||
selected: 10, | ||
total: 20, | ||
type: 'weight', | ||
}, | ||
{ | ||
selected: 5, | ||
total: 5, | ||
type: 'volume', | ||
}, | ||
], | ||
pickups: 1, | ||
deliveries: 1, | ||
dwellTime: 1, | ||
}, | ||
vehicleKpis: { | ||
total: 1, | ||
selected: 1, | ||
capacities: [ | ||
{ | ||
selected: 20, | ||
total: 20, | ||
type: 'weight', | ||
}, | ||
{ | ||
selected: 10, | ||
total: 15, | ||
type: 'volume', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LoadDemandsMetricsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
|
||
it('should parse KPIs object into an array', () => { | ||
expect(component.kpiData).toEqual([ | ||
{ | ||
demand: 10, | ||
capacity: 20, | ||
type: 'weight', | ||
}, | ||
{ | ||
demand: 5, | ||
capacity: 10, | ||
type: 'volume', | ||
}, | ||
]); | ||
}); | ||
}); |
Oops, something went wrong.