Skip to content

Commit

Permalink
Add CSV help dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccollum-woolpert committed Feb 1, 2024
1 parent 3d2ad69 commit c7d45de
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<h3 class="strong">What data can I upload via CSV?</h3>
<p>
If you have data for vehicles, shipments, or vehicle operators in individual .csv files, you can
use this option to upload your data. You can also use this option get sample files to see how your
data should be structured.
</p>
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CsvHelpDialogComponent } from './csv-help-dialog.component';

describe('CsvHelpDialogComponent', () => {
let component: CsvHelpDialogComponent;
let fixture: ComponentFixture<CsvHelpDialogComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [CsvHelpDialogComponent],
}).compileComponents();

fixture = TestBed.createComponent(CsvHelpDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
selector: 'app-csv-help-dialog',
templateUrl: './csv-help-dialog.component.html',
styleUrls: ['./csv-help-dialog.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CsvHelpDialogComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ <h4 class="strong d-flex mb-2">
</div>
<h4 class="strong d-flex mt-4 mb-2">
Load shipment, vehicle, and operator data individually
<a
(click)="openScenarioSolutionHelp()"
class="ml-1 scenario-solution-help-icon blue-svg-icon">
<a (click)="openCsvHelp()" class="ml-1 scenario-solution-help-icon blue-svg-icon">
<mat-icon svgIcon="help-filled"></mat-icon>
</a>
</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { DispatcherService, FileService, PlacesService, UploadService } from '..
import { toDispatcherLatLng } from 'src/app/util';
import { ScenarioSolutionHelpDialogComponent } from 'src/app/core/containers/scenario-solution-help-dialog/scenario-solution-help-dialog.component';
import { UploadActions } from '../../actions';
import { CsvHelpDialogComponent } from '../csv-help-dialog/csv-help-dialog.component';

@Component({
selector: 'app-upload-dialog',
Expand Down Expand Up @@ -84,6 +85,12 @@ export class UploadDialogComponent {
});
}

openCsvHelp(): void {
this.dialog.open(CsvHelpDialogComponent, {
maxWidth: '600px',
});
}

loadFromCsv(): void {
this.dialogRef.close();
this.store.dispatch(UploadActions.openCsvDialog());
Expand Down
2 changes: 2 additions & 0 deletions application/frontend/src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ import { ConfirmBulkEditDialogComponent } from './components/confirm-bulk-edit-d
import { VehicleOperatorsControlBarComponent } from './containers/vehicle-operators-control-bar/vehicle-operators-control-bar.component';
import { BaseEditVehicleOperatorDialogComponent } from './components/base-edit-vehicle-operator-dialog/base-edit-vehicle-operator-dialog.component';
import { PreSolveEditVehicleOperatorDialogComponent } from './containers/pre-solve-edit-vehicle-operator-dialog/pre-solve-edit-vehicle-operator-dialog.component';
import { CsvHelpDialogComponent } from './containers/csv-help-dialog/csv-help-dialog.component';

export const COMPONENTS = [
BaseDocumentationDialogComponent,
Expand Down Expand Up @@ -180,6 +181,7 @@ export const CONTAINERS = [
VehicleOperatorsControlBarComponent,
PreSolveEditVehicleOperatorDialogComponent,
BaseEditVehicleOperatorDialogComponent,
CsvHelpDialogComponent,
],
exports: [COMPONENTS, CONTAINERS, CsvUploadDialogComponent],
})
Expand Down

0 comments on commit c7d45de

Please sign in to comment.