@aggdirect/coolmap 2.6.6 → 2.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karma.conf.js +44 -0
- package/ng-package.json +7 -0
- package/package.json +5 -30
- package/src/assets/mixin.scss +28 -0
- package/src/assets/palette.scss +24 -0
- package/src/assets/variable.scss +15 -0
- package/src/lib/component/add-route/add-route.component.html +136 -0
- package/src/lib/component/add-route/add-route.component.scss +236 -0
- package/src/lib/component/add-route/add-route.component.spec.ts +23 -0
- package/src/lib/component/add-route/add-route.component.ts +295 -0
- package/src/lib/component/job-code/job-code.component.html +79 -0
- package/src/lib/component/job-code/job-code.component.scss +396 -0
- package/src/lib/component/job-code/job-code.component.ts +157 -0
- package/src/lib/component/map/map.component.css +0 -0
- package/src/lib/component/map/map.component.html +4 -0
- package/src/lib/component/map/map.component.spec.ts +23 -0
- package/src/lib/component/map/map.component.ts +34 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +46 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +18 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +23 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +131 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +48 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +24 -0
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +154 -0
- package/src/lib/component/nav/nav.component.html +19 -0
- package/src/lib/component/nav/nav.component.scss +67 -0
- package/src/lib/component/nav/nav.component.ts +38 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +56 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +168 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +43 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +66 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +232 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +234 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +7 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +10 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +15 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +28 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +172 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +23 -0
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +20 -0
- package/src/lib/component/shared/dialog/dialog.component.html +7 -0
- package/src/lib/component/shared/dialog/dialog.component.scss +30 -0
- package/src/lib/component/shared/dialog/dialog.component.ts +18 -0
- package/src/lib/component/shared/estimation-display/estimation-display.component.html +7 -0
- package/src/lib/component/shared/estimation-display/estimation-display.component.scss +7 -0
- package/src/lib/component/shared/estimation-display/estimation-display.component.ts +13 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.html +30 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.scss +15 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +23 -0
- package/src/lib/component/shared/job-route-list/job-route-list.component.ts +54 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +11 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +13 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +23 -0
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +19 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +5 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +40 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +23 -0
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +11 -0
- package/src/lib/component/shared/route-info-card/route-info-card.component.html +11 -0
- package/src/lib/component/shared/route-info-card/route-info-card.component.scss +50 -0
- package/src/lib/component/shared/route-info-card/route-info-card.component.spec.ts +23 -0
- package/src/lib/component/shared/route-info-card/route-info-card.component.ts +69 -0
- package/src/lib/coolmap.module.ts +117 -0
- package/{public-api.d.ts → src/public-api.ts} +8 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +15 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/esm2022/aggdirect-coolmap.mjs +0 -5
- package/esm2022/lib/component/add-route/add-route.component.mjs +0 -348
- package/esm2022/lib/component/job-code/job-code.component.mjs +0 -192
- package/esm2022/lib/component/map/map.component.mjs +0 -39
- package/esm2022/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +0 -152
- package/esm2022/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +0 -119
- package/esm2022/lib/component/nav/nav.component.mjs +0 -54
- package/esm2022/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +0 -77
- package/esm2022/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +0 -321
- package/esm2022/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +0 -19
- package/esm2022/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +0 -37
- package/esm2022/lib/component/shared/dialog/dialog.component.mjs +0 -31
- package/esm2022/lib/component/shared/estimation-display/estimation-display.component.mjs +0 -18
- package/esm2022/lib/component/shared/job-route-list/job-route-list.component.mjs +0 -79
- package/esm2022/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +0 -24
- package/esm2022/lib/component/shared/jobcode-status/jobcode-status.component.mjs +0 -15
- package/esm2022/lib/component/shared/route-info-card/route-info-card.component.mjs +0 -57
- package/esm2022/lib/coolmap.module.mjs +0 -186
- package/esm2022/public-api.mjs +0 -19
- package/fesm2022/aggdirect-coolmap.mjs +0 -1644
- package/fesm2022/aggdirect-coolmap.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/component/add-route/add-route.component.d.ts +0 -61
- package/lib/component/job-code/job-code.component.d.ts +0 -42
- package/lib/component/map/map.component.d.ts +0 -15
- package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +0 -49
- package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +0 -42
- package/lib/component/nav/nav.component.d.ts +0 -31
- package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +0 -20
- package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +0 -42
- package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +0 -9
- package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +0 -12
- package/lib/component/shared/dialog/dialog.component.d.ts +0 -13
- package/lib/component/shared/estimation-display/estimation-display.component.d.ts +0 -8
- package/lib/component/shared/job-route-list/job-route-list.component.d.ts +0 -26
- package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +0 -10
- package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +0 -7
- package/lib/component/shared/route-info-card/route-info-card.component.d.ts +0 -29
- package/lib/coolmap.module.d.ts +0 -44
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { JobRouteListComponent } from './job-route-list.component';
|
|
4
|
+
|
|
5
|
+
describe('JobRouteListComponent', () => {
|
|
6
|
+
let component: JobRouteListComponent;
|
|
7
|
+
let fixture: ComponentFixture<JobRouteListComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ JobRouteListComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(JobRouteListComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { CoolmapService, Route, UtilsService } from '@aggdirect/coolmap-services';
|
|
4
|
+
import { map, Observable, startWith } from 'rxjs';
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: 'app-job-route-list',
|
|
8
|
+
templateUrl: './job-route-list.component.html',
|
|
9
|
+
styleUrls: ['./job-route-list.component.scss']
|
|
10
|
+
})
|
|
11
|
+
export class JobRouteListComponent {
|
|
12
|
+
@Output() public changeNav = new EventEmitter<string | any>();
|
|
13
|
+
filteredOptions!: Observable<any[]> | undefined;
|
|
14
|
+
preventListUpdate: boolean;
|
|
15
|
+
filterForm = new FormGroup({ search: new FormControl() });
|
|
16
|
+
filters: any[];
|
|
17
|
+
@Input() public routes: Route[];
|
|
18
|
+
@Input() public selectedRoute;
|
|
19
|
+
@Output() public changeRoutes = new EventEmitter<string | any>();
|
|
20
|
+
@Output() public changeSelectedRoute = new EventEmitter<string | any>();
|
|
21
|
+
@Input() public masterRoutes: Route[];
|
|
22
|
+
|
|
23
|
+
constructor(public utils: UtilsService, public coolMap: CoolmapService) {
|
|
24
|
+
this.filters = [];
|
|
25
|
+
this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''),
|
|
26
|
+
map(value => this.utils.filter(value, this.filters)));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
filterSearch(e: any): void {
|
|
30
|
+
this.changeNav.emit({ type: 'Addroute' });
|
|
31
|
+
this.preventListUpdate = true;
|
|
32
|
+
this.filterForm.controls.search.setValue(null);
|
|
33
|
+
this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }];
|
|
34
|
+
const filteredRoutes = this.utils.getSearchResults(this.masterRoutes, [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]);
|
|
35
|
+
this.changeRoutes.emit(filteredRoutes);
|
|
36
|
+
this.selectedRoute.selected.forEach((item: any) => {
|
|
37
|
+
const routeData = filteredRoutes.find(x => x.route_id === item.route_id);
|
|
38
|
+
if (!routeData) {
|
|
39
|
+
this.selectedRoute.toggle(item);
|
|
40
|
+
this.changeSelectedRoute.emit(this.selectedRoute);
|
|
41
|
+
this.coolMap.removeRouteAndMarker(item['route_id']).then((res: any) => {
|
|
42
|
+
this.coolMap.extendReBound();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
removeFromFilter(filter: any): void {
|
|
49
|
+
this.changeNav.emit({ type: 'Addroute' });
|
|
50
|
+
const index = this.filters.indexOf(filter);
|
|
51
|
+
if (index >= 0) { this.filters = []; this.changeRoutes.emit(this.masterRoutes); }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div class="detail_view m-20">
|
|
2
|
+
<div class="destination">
|
|
3
|
+
<div class="duration">
|
|
4
|
+
<p class="pickprt"><b>{{makeValueObject('pickup_location')['label']}}:</b> {{makeValueObject('pickup_location')['value']}}</p>
|
|
5
|
+
<p class="dropprt"><b>{{makeValueObject('delivery_location')['label']}}:</b> {{makeValueObject('delivery_location')['value']}}</p>
|
|
6
|
+
</div>
|
|
7
|
+
<ng-container *ngFor="let item of label">
|
|
8
|
+
<span *ngIf="item !== 'pickup_location' && item !== 'delivery_location'" (mousedown)="$event.stopPropagation()"><b>{{makeValueObject(item)['label']}}:</b> {{makeValueObject(item)['value']}}</span>
|
|
9
|
+
</ng-container>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { JobcodeOverviewComponent } from './jobcode-overview.component';
|
|
4
|
+
|
|
5
|
+
describe('JobcodeOverviewComponent', () => {
|
|
6
|
+
let component: JobcodeOverviewComponent;
|
|
7
|
+
let fixture: ComponentFixture<JobcodeOverviewComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ JobcodeOverviewComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(JobcodeOverviewComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { JobCodeOverviewData, JobCodeOverviewEnum } from '@aggdirect/coolmap-services';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-jobcode-overview',
|
|
6
|
+
templateUrl: './jobcode-overview.component.html',
|
|
7
|
+
styleUrls: ['./jobcode-overview.component.scss']
|
|
8
|
+
})
|
|
9
|
+
export class JobcodeOverviewComponent {
|
|
10
|
+
@Input() public jobValue: any;
|
|
11
|
+
label = JobCodeOverviewData;
|
|
12
|
+
overViewEnum: any = JobCodeOverviewEnum;
|
|
13
|
+
constructor() {}
|
|
14
|
+
makeValueObject(item: string) {
|
|
15
|
+
let obj;
|
|
16
|
+
obj = { label: this.overViewEnum[item], value: this.jobValue[item] }
|
|
17
|
+
return obj;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="statusprt" *ngIf="jobValue['values']">
|
|
2
|
+
<span class="done"> Done - {{jobValue['values']['Done']}} </span>
|
|
3
|
+
<span class="ongoing"> Ongoing - {{jobValue['values']['Ongoing']}} </span>
|
|
4
|
+
<span class="open"> Open - {{jobValue['values']['Open']}} </span>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
@import "../../../../assets/variable.scss";
|
|
2
|
+
|
|
3
|
+
.statusprt {
|
|
4
|
+
span {
|
|
5
|
+
padding: 5px 10px;
|
|
6
|
+
font-size: 0.9rem;
|
|
7
|
+
margin-left: 0;
|
|
8
|
+
margin-right: 5px;
|
|
9
|
+
|
|
10
|
+
&.done {
|
|
11
|
+
border: 2px solid #0b843c;
|
|
12
|
+
color: #0b843c;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
background: #0b843c;
|
|
16
|
+
color: $white;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&.ongoing {
|
|
21
|
+
border: 2px solid #eecb27;
|
|
22
|
+
color: #eecb27;
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
background: #eecb27;
|
|
26
|
+
color: $white;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.open {
|
|
31
|
+
border: 2px solid #12afcb;
|
|
32
|
+
color: #12afcb;
|
|
33
|
+
|
|
34
|
+
&:hover {
|
|
35
|
+
background: #12afcb;
|
|
36
|
+
color: $white;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { JobcodeStatusComponent } from './jobcode-status.component';
|
|
4
|
+
|
|
5
|
+
describe('JobcodeStatusComponent', () => {
|
|
6
|
+
let component: JobcodeStatusComponent;
|
|
7
|
+
let fixture: ComponentFixture<JobcodeStatusComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ JobcodeStatusComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(JobcodeStatusComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
import { Route } from '@aggdirect/coolmap-services';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-jobcode-status',
|
|
6
|
+
templateUrl: './jobcode-status.component.html',
|
|
7
|
+
styleUrls: ['./jobcode-status.component.scss']
|
|
8
|
+
})
|
|
9
|
+
export class JobcodeStatusComponent {
|
|
10
|
+
@Input() public jobValue!: Route;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<div [class]="propData['className']">
|
|
2
|
+
<div class="destination">
|
|
3
|
+
<div class="duration">
|
|
4
|
+
<p class="pickprt"><b>Pickup:</b>{{createLabel('pickup_location')['value']}}</p>
|
|
5
|
+
<p class="dropprt"><b>Delivery:</b>{{createLabel('delivery_location')['value']}}</p>
|
|
6
|
+
</div>
|
|
7
|
+
<ng-container *ngFor="let item of cardKeysElement">
|
|
8
|
+
<span *ngIf="item !== 'pickup_location' && item !== 'delivery_location'" [class.notes]="item === 'note'"><b>{{createLabel(item)['label']}}:</b> {{createLabel(item)['value']}}</span>
|
|
9
|
+
</ng-container>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.routeCard span {
|
|
2
|
+
padding: 5px 0;
|
|
3
|
+
&.notes{
|
|
4
|
+
max-height: 200px;
|
|
5
|
+
overflow: auto;
|
|
6
|
+
white-space: pre-wrap;
|
|
7
|
+
word-break: break-all;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.routeCard .duration {
|
|
12
|
+
padding: 10px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
.listRoutecard{
|
|
17
|
+
.duration{
|
|
18
|
+
background: #444343;
|
|
19
|
+
border: 1px solid #918e8e;
|
|
20
|
+
padding: 10px;
|
|
21
|
+
color:#fff;
|
|
22
|
+
b{
|
|
23
|
+
color: #fff;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.pickprt, .dropprt {
|
|
27
|
+
&:before {
|
|
28
|
+
background: #fff;
|
|
29
|
+
}
|
|
30
|
+
b{
|
|
31
|
+
&:before {
|
|
32
|
+
background: #fff;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
span{
|
|
37
|
+
line-height: 20px;
|
|
38
|
+
color: #fff;
|
|
39
|
+
padding: 3px 0;
|
|
40
|
+
b{
|
|
41
|
+
color: #fff;
|
|
42
|
+
}
|
|
43
|
+
&.notes{
|
|
44
|
+
max-height: 200px;
|
|
45
|
+
overflow: auto;
|
|
46
|
+
white-space: pre-wrap;
|
|
47
|
+
word-break: break-all;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { RouteInfoCardComponent } from './route-info-card.component';
|
|
4
|
+
|
|
5
|
+
describe('RouteInfoCardComponent', () => {
|
|
6
|
+
let component: RouteInfoCardComponent;
|
|
7
|
+
let fixture: ComponentFixture<RouteInfoCardComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ RouteInfoCardComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
|
|
15
|
+
fixture = TestBed.createComponent(RouteInfoCardComponent);
|
|
16
|
+
component = fixture.componentInstance;
|
|
17
|
+
fixture.detectChanges();
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should create', () => {
|
|
21
|
+
expect(component).toBeTruthy();
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Component, Input } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
interface CardEntity {
|
|
4
|
+
pickup_location: string,
|
|
5
|
+
delivery_location: string,
|
|
6
|
+
route_name: string,
|
|
7
|
+
customer_name: string,
|
|
8
|
+
material: string,
|
|
9
|
+
materialName: string;
|
|
10
|
+
unit: string,
|
|
11
|
+
estimated_distance: string,
|
|
12
|
+
estimated_time: string,
|
|
13
|
+
trucker_pay_estimate: string,
|
|
14
|
+
customer_price_estimate: string,
|
|
15
|
+
note: string,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface CardPropEntity {
|
|
19
|
+
className: string,
|
|
20
|
+
repository: string
|
|
21
|
+
}
|
|
22
|
+
const CardKeysValue = ['route_name', 'customer_name', 'material', 'unit',
|
|
23
|
+
'estimated_distance', 'estimated_time', 'trucker_pay_estimate', 'customer_price_estimate', 'note', 'pickup_location', 'delivery_location'];
|
|
24
|
+
|
|
25
|
+
enum CardElements {
|
|
26
|
+
route_name = 'Name',
|
|
27
|
+
customer_name = 'Customer',
|
|
28
|
+
material = 'Material',
|
|
29
|
+
unit = 'Type',
|
|
30
|
+
estimated_distance = 'Distance',
|
|
31
|
+
estimated_time = 'Travel Time',
|
|
32
|
+
trucker_pay_estimate = 'Trucker Pay Estimate',
|
|
33
|
+
customer_price_estimate = 'Customer Price Estimate',
|
|
34
|
+
note = 'Notes',
|
|
35
|
+
pickup_location = 'Pickup',
|
|
36
|
+
delivery_location = 'Delivery'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@Component({
|
|
41
|
+
selector: 'lib-route-info-card',
|
|
42
|
+
templateUrl: './route-info-card.component.html',
|
|
43
|
+
styleUrls: ['./route-info-card.component.scss']
|
|
44
|
+
})
|
|
45
|
+
export class RouteInfoCardComponent {
|
|
46
|
+
@Input() popupData: CardEntity;
|
|
47
|
+
@Input() propData: CardPropEntity;
|
|
48
|
+
cardKeysElement = CardKeysValue;
|
|
49
|
+
ngAfterViewInit(): void {
|
|
50
|
+
if (this.propData['repository'] === 'customer') this.cardKeysElement = this.cardKeysElement.filter(ele => ele !== 'trucker_pay_estimate');
|
|
51
|
+
}
|
|
52
|
+
createLabel(itemName) {
|
|
53
|
+
let obj;
|
|
54
|
+
if (this.propData['repository'] === 'coolmap') {
|
|
55
|
+
obj = { label: CardElements[itemName], value: this.popupData[itemName] }
|
|
56
|
+
}
|
|
57
|
+
if (this.propData['repository'] === 'customer') {
|
|
58
|
+
if (itemName === 'material') {
|
|
59
|
+
obj = { label: CardElements[itemName], value: this.popupData['materialLabel'] }
|
|
60
|
+
} else {
|
|
61
|
+
obj = { label: CardElements[itemName], value: this.popupData[itemName] }
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (itemName === 'trucker_pay_estimate' || itemName === 'customer_price_estimate') {
|
|
65
|
+
obj['value'] = obj['value'] ? '$' + obj['value'] : '';
|
|
66
|
+
}
|
|
67
|
+
return obj;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ModuleWithProviders, NgModule } from '@angular/core';
|
|
2
|
+
import { MapComponent } from './component/map/map.component';
|
|
3
|
+
import { NavComponent } from './component/nav/nav.component';
|
|
4
|
+
|
|
5
|
+
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
6
|
+
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
7
|
+
import { DragDropModule } from '@angular/cdk/drag-drop';
|
|
8
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { MatInputModule } from '@angular/material/input';
|
|
10
|
+
import { MatSelectModule } from '@angular/material/select';
|
|
11
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
12
|
+
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
13
|
+
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
14
|
+
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
15
|
+
import { MatChipsModule } from '@angular/material/chips';
|
|
16
|
+
import { MatDialogModule } from '@angular/material/dialog';
|
|
17
|
+
import { CommonModule } from '@angular/common';
|
|
18
|
+
import {MatTooltipModule} from '@angular/material/tooltip';
|
|
19
|
+
import { AddRouteNavComponent } from './component/nav/layout/add-route-nav/add-route-nav.component';
|
|
20
|
+
import { JobCodeNavComponent } from './component/nav/layout/job-code-nav/job-code-nav.component';
|
|
21
|
+
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
22
|
+
import { MatNativeDateModule, MatPseudoCheckboxModule } from '@angular/material/core';
|
|
23
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
24
|
+
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
|
25
|
+
import { RouteJobCodeListComponent } from './component/route-jobcode-list/route-jobcode-list.component';
|
|
26
|
+
import { ViewRouteListCardComponent } from './component/route-jobcode-list/view-route-list-card/view-route-list-card.component';
|
|
27
|
+
import { SmsCardDetailsOverviewComponent } from './component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component';
|
|
28
|
+
import { JobCodeListCardComponent } from './component/route-jobcode-list/job-code-list-card/job-code-list-card.component';
|
|
29
|
+
import { JobCodeComponent } from './component/job-code/job-code.component';
|
|
30
|
+
import { JobcodeStatusComponent } from './component/shared/jobcode-status/jobcode-status.component';
|
|
31
|
+
import { JobRouteListComponent } from './component/shared/job-route-list/job-route-list.component';
|
|
32
|
+
import { JobcodeOverviewComponent } from './component/shared/jobcode-overview/jobcode-overview.component';
|
|
33
|
+
import { DialogComponent } from './component/shared/dialog/dialog.component';
|
|
34
|
+
import { AddRouteComponent } from './component/add-route/add-route.component';
|
|
35
|
+
import { EstimationDisplayComponent } from './component/shared/estimation-display/estimation-display.component';
|
|
36
|
+
import { RouteInfoCardComponent } from './component/shared/route-info-card/route-info-card.component';
|
|
37
|
+
import { CoolmapConfigModel } from '@aggdirect/coolmap-services';
|
|
38
|
+
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@NgModule({
|
|
43
|
+
declarations: [
|
|
44
|
+
MapComponent,
|
|
45
|
+
NavComponent,
|
|
46
|
+
AddRouteNavComponent,
|
|
47
|
+
JobCodeNavComponent,
|
|
48
|
+
RouteJobCodeListComponent,
|
|
49
|
+
ViewRouteListCardComponent,
|
|
50
|
+
SmsCardDetailsOverviewComponent,
|
|
51
|
+
JobCodeListCardComponent,
|
|
52
|
+
JobCodeComponent,
|
|
53
|
+
JobRouteListComponent,
|
|
54
|
+
JobcodeStatusComponent,
|
|
55
|
+
JobcodeOverviewComponent,
|
|
56
|
+
DialogComponent,
|
|
57
|
+
AddRouteComponent,
|
|
58
|
+
EstimationDisplayComponent,
|
|
59
|
+
RouteInfoCardComponent
|
|
60
|
+
],
|
|
61
|
+
imports: [
|
|
62
|
+
CommonModule,
|
|
63
|
+
MatSnackBarModule,
|
|
64
|
+
MatSidenavModule,
|
|
65
|
+
DragDropModule,
|
|
66
|
+
FormsModule,
|
|
67
|
+
MatInputModule,
|
|
68
|
+
MatSelectModule,
|
|
69
|
+
MatIconModule,
|
|
70
|
+
ReactiveFormsModule,
|
|
71
|
+
MatAutocompleteModule,
|
|
72
|
+
MatFormFieldModule,
|
|
73
|
+
MatProgressSpinnerModule,
|
|
74
|
+
MatChipsModule,
|
|
75
|
+
MatDialogModule,
|
|
76
|
+
MatTooltipModule,
|
|
77
|
+
MatDatepickerModule,
|
|
78
|
+
MatNativeDateModule,
|
|
79
|
+
MatPseudoCheckboxModule,
|
|
80
|
+
MatButtonModule,
|
|
81
|
+
MatProgressBarModule,
|
|
82
|
+
ScrollingModule
|
|
83
|
+
],
|
|
84
|
+
exports: [
|
|
85
|
+
MapComponent,
|
|
86
|
+
NavComponent,
|
|
87
|
+
AddRouteNavComponent,
|
|
88
|
+
JobCodeNavComponent,
|
|
89
|
+
RouteJobCodeListComponent,
|
|
90
|
+
ViewRouteListCardComponent,
|
|
91
|
+
SmsCardDetailsOverviewComponent,
|
|
92
|
+
JobCodeListCardComponent,
|
|
93
|
+
JobCodeComponent,
|
|
94
|
+
JobRouteListComponent,
|
|
95
|
+
JobcodeStatusComponent,
|
|
96
|
+
JobcodeOverviewComponent,
|
|
97
|
+
DialogComponent,
|
|
98
|
+
AddRouteComponent
|
|
99
|
+
],
|
|
100
|
+
// TODO: entryComponents is no longer supported. Find out if this breaks something
|
|
101
|
+
// entryComponents: [
|
|
102
|
+
// DialogComponent,
|
|
103
|
+
// JobCodeComponent,
|
|
104
|
+
// AddRouteComponent
|
|
105
|
+
// ],
|
|
106
|
+
providers: [
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
export class CoolmapModule {
|
|
111
|
+
public static forRoot(memberData: CoolmapConfigModel): ModuleWithProviders<CoolmapModule> {
|
|
112
|
+
return {
|
|
113
|
+
ngModule: CoolmapModule,
|
|
114
|
+
providers: [{provide: 'memberData', useValue: memberData}]
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of coolmap
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
export * from './lib/coolmap.module';
|
|
2
6
|
export * from './lib/component/map/map.component';
|
|
3
7
|
export * from './lib/component/nav/nav.component';
|
|
4
8
|
export * from './lib/component/nav/layout/add-route-nav/add-route-nav.component';
|
|
5
9
|
export * from './lib/component/nav/layout/job-code-nav/job-code-nav.component';
|
|
10
|
+
|
|
6
11
|
export * from './lib/component/route-jobcode-list/route-jobcode-list.component';
|
|
7
12
|
export * from './lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component';
|
|
8
13
|
export * from './lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component';
|
|
@@ -13,3 +18,6 @@ export * from './lib/component/shared/jobcode-status/jobcode-status.component';
|
|
|
13
18
|
export * from './lib/component/shared/job-route-list/job-route-list.component';
|
|
14
19
|
export * from './lib/component/shared/jobcode-overview/jobcode-overview.component';
|
|
15
20
|
export * from './lib/component/shared/dialog/dialog.component';
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
package/src/test.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
|
|
2
|
+
|
|
3
|
+
import 'zone.js';
|
|
4
|
+
import 'zone.js/testing';
|
|
5
|
+
import { getTestBed } from '@angular/core/testing';
|
|
6
|
+
import {
|
|
7
|
+
BrowserDynamicTestingModule,
|
|
8
|
+
platformBrowserDynamicTesting
|
|
9
|
+
} from '@angular/platform-browser-dynamic/testing';
|
|
10
|
+
|
|
11
|
+
declare const require: {
|
|
12
|
+
context(path: string, deep?: boolean, filter?: RegExp): {
|
|
13
|
+
<T>(id: string): T;
|
|
14
|
+
keys(): string[];
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// First, initialize the Angular testing environment.
|
|
19
|
+
getTestBed().initTestEnvironment(
|
|
20
|
+
BrowserDynamicTestingModule,
|
|
21
|
+
platformBrowserDynamicTesting(),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
// Then we find all the tests.
|
|
25
|
+
const context = require.context('./', true, /\.spec\.ts$/);
|
|
26
|
+
// And load the modules.
|
|
27
|
+
context.keys().forEach(context);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": []
|
|
10
|
+
},
|
|
11
|
+
"exclude": [
|
|
12
|
+
"src/test.ts",
|
|
13
|
+
"**/*.spec.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../out-tsc/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWdnZGlyZWN0LWNvb2xtYXAuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9jb29sbWFwL3NyYy9hZ2dkaXJlY3QtY29vbG1hcC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
|