@aggdirect/coolmap 0.1.3 → 1.0.1
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/README.md +33 -0
- package/esm2020/aggdirect-coolmap.mjs +5 -0
- package/esm2020/lib/component/add-route/add-route.component.mjs +310 -0
- package/esm2020/lib/component/job-code/job-code.component.mjs +114 -0
- package/esm2020/lib/component/map/map.component.mjs +39 -0
- package/esm2020/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +87 -0
- package/esm2020/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +89 -0
- package/esm2020/lib/component/nav/nav.component.mjs +52 -0
- package/esm2020/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +68 -0
- package/esm2020/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +314 -0
- package/esm2020/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +19 -0
- package/esm2020/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +29 -0
- package/esm2020/lib/component/shared/dialog/dialog.component.mjs +29 -0
- package/esm2020/lib/component/shared/job-route-list/job-route-list.component.mjs +71 -0
- package/esm2020/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +19 -0
- package/esm2020/lib/component/shared/jobcode-status/jobcode-status.component.mjs +14 -0
- package/esm2020/lib/coolmap.component.mjs +22 -0
- package/esm2020/lib/coolmap.module.mjs +156 -0
- package/esm2020/lib/event.service.mjs +26 -0
- package/esm2020/public-api.mjs +16 -0
- package/fesm2015/aggdirect-coolmap.mjs +1367 -0
- package/fesm2015/aggdirect-coolmap.mjs.map +1 -0
- package/fesm2020/aggdirect-coolmap.mjs +1340 -0
- package/fesm2020/aggdirect-coolmap.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/component/add-route/add-route.component.d.ts +62 -0
- package/lib/component/job-code/job-code.component.d.ts +31 -0
- package/lib/component/map/map.component.d.ts +16 -0
- package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +40 -0
- package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +38 -0
- package/lib/component/nav/nav.component.d.ts +30 -0
- package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +19 -0
- package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +42 -0
- package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +9 -0
- package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +11 -0
- package/lib/component/shared/dialog/dialog.component.d.ts +13 -0
- package/lib/component/shared/job-route-list/job-route-list.component.d.ts +26 -0
- package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +9 -0
- package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +8 -0
- package/lib/coolmap.component.d.ts +8 -0
- package/lib/coolmap.module.d.ts +40 -0
- package/lib/event.service.d.ts +19 -0
- package/package.json +31 -5
- package/public-api.d.ts +12 -0
- package/karma.conf.js +0 -44
- package/ng-package.json +0 -7
- package/src/assets/mixin.scss +0 -28
- package/src/assets/palette.scss +0 -24
- package/src/assets/variable.scss +0 -15
- package/src/lib/component/add-route/add-route.component.html +0 -140
- package/src/lib/component/add-route/add-route.component.scss +0 -235
- package/src/lib/component/add-route/add-route.component.spec.ts +0 -23
- package/src/lib/component/add-route/add-route.component.ts +0 -270
- package/src/lib/component/job-code/job-code.component.html +0 -93
- package/src/lib/component/job-code/job-code.component.scss +0 -427
- package/src/lib/component/job-code/job-code.component.ts +0 -94
- package/src/lib/component/map/map.component.css +0 -0
- package/src/lib/component/map/map.component.html +0 -5
- package/src/lib/component/map/map.component.spec.ts +0 -23
- package/src/lib/component/map/map.component.ts +0 -33
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +0 -44
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +0 -0
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +0 -23
- package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +0 -70
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +0 -43
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +0 -5
- package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +0 -64
- package/src/lib/component/nav/nav.component.html +0 -19
- package/src/lib/component/nav/nav.component.scss +0 -65
- package/src/lib/component/nav/nav.component.ts +0 -38
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +0 -56
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +0 -167
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +0 -23
- package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +0 -42
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +0 -66
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +0 -226
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +0 -234
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +0 -7
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +0 -10
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +0 -23
- package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +0 -15
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +0 -30
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +0 -172
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +0 -23
- package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +0 -19
- package/src/lib/component/shared/dialog/dialog.component.html +0 -7
- package/src/lib/component/shared/dialog/dialog.component.scss +0 -30
- package/src/lib/component/shared/dialog/dialog.component.ts +0 -18
- package/src/lib/component/shared/job-route-list/job-route-list.component.html +0 -27
- package/src/lib/component/shared/job-route-list/job-route-list.component.scss +0 -3
- package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +0 -23
- package/src/lib/component/shared/job-route-list/job-route-list.component.ts +0 -54
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +0 -8
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +0 -12
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +0 -23
- package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +0 -15
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +0 -5
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +0 -32
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +0 -23
- package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +0 -12
- package/src/lib/coolmap.component.ts +0 -20
- package/src/lib/coolmap.module.ts +0 -92
- package/src/public-api.ts +0 -10
- package/src/test.ts +0 -27
- package/tsconfig.lib.json +0 -15
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -17
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Output, Input, SimpleChanges, OnDestroy } from '@angular/core';
|
|
2
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
-
import { Route, UtilsService } from 'coolmap-services';
|
|
4
|
-
import { map, Observable, startWith } from 'rxjs';
|
|
5
|
-
interface Filter {
|
|
6
|
-
name?: string;
|
|
7
|
-
type: string;
|
|
8
|
-
value: any;
|
|
9
|
-
label?: string;
|
|
10
|
-
}
|
|
11
|
-
import { Subject, takeUntil } from 'rxjs';
|
|
12
|
-
|
|
13
|
-
@Component({
|
|
14
|
-
selector: 'app-add-route-nav',
|
|
15
|
-
templateUrl: './add-route-nav.component.html',
|
|
16
|
-
styleUrls: ['./add-route-nav.component.scss']
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
export class AddRouteNavComponent implements OnDestroy {
|
|
20
|
-
filterForm = new FormGroup({ search: new FormControl() });
|
|
21
|
-
filteredOptions!: Observable<any[]> | undefined;
|
|
22
|
-
filters: Filter[] = [];
|
|
23
|
-
loaderVal = false;
|
|
24
|
-
routes: Route[] = [];
|
|
25
|
-
@Output() changeNav = new EventEmitter<string | any>();
|
|
26
|
-
@Input() navValue: string = '';
|
|
27
|
-
@Output() addemit = new EventEmitter();
|
|
28
|
-
@Input() updateRouteList: boolean = false;
|
|
29
|
-
private destroyer$ = new Subject<boolean>();
|
|
30
|
-
preventListUpdate: boolean = false;
|
|
31
|
-
constructor(public utils: UtilsService) {
|
|
32
|
-
this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''),
|
|
33
|
-
map(value => this.utils.filter(value, this.filters)));
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
showAddForm() { this.changeNav.emit('addForm'); this.addemit.emit('') }
|
|
37
|
-
filterSearch(e: any): void {
|
|
38
|
-
this.changeNav.emit({type: 'Addroute'});
|
|
39
|
-
this.preventListUpdate = true;
|
|
40
|
-
this.filterForm.controls.search.setValue(null);
|
|
41
|
-
this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]
|
|
42
|
-
}
|
|
43
|
-
removeFromFilter(filter: any): void {
|
|
44
|
-
this.changeNav.emit({type: 'Addroute'});
|
|
45
|
-
const index = this.filters.indexOf(filter);
|
|
46
|
-
if (index >= 0) { this.filters = [] }
|
|
47
|
-
}
|
|
48
|
-
ngAfterViewInit(): void { this.getRouteList() }
|
|
49
|
-
ngOnChanges(changes: SimpleChanges) {
|
|
50
|
-
if (changes['updateRouteList'] && changes['updateRouteList']['currentValue']) this.getRouteList();
|
|
51
|
-
if(changes['navValue'] && (changes['navValue']['previousValue'] === 'addForm') && !this.preventListUpdate) this.getRouteList();
|
|
52
|
-
}
|
|
53
|
-
getRoute(event: Route) { if (event['type'] === 'editroute') { this.addemit.emit(event) } }
|
|
54
|
-
getRouteList() {
|
|
55
|
-
this.utils.getData('coolmap/routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
56
|
-
if (res) {
|
|
57
|
-
this.filters = [];
|
|
58
|
-
this.routes = res['data']
|
|
59
|
-
this.preventListUpdate = false;
|
|
60
|
-
this.utils.clearOptions();
|
|
61
|
-
this.routes.forEach((ele: Route) => { this.utils.makeOptions(ele) });
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
resetSearch() { this.changeNav.emit('Addroute') }
|
|
66
|
-
ngOnDestroy(): void {
|
|
67
|
-
this.destroyer$.next(true);
|
|
68
|
-
this.destroyer$.unsubscribe();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<div class="nav_body">
|
|
2
|
-
<div class="search-panel">
|
|
3
|
-
<div class="datepicker">
|
|
4
|
-
<mat-form-field>
|
|
5
|
-
<mat-label>Choose a date</mat-label>
|
|
6
|
-
<input readonly matInput (click)="picker.open()" [disabled]="loaderVal" [(ngModel)]="dateValue" [matDatepicker]="picker" (dateChange)="getDate($event)">
|
|
7
|
-
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
|
|
8
|
-
<mat-datepicker #picker></mat-datepicker>
|
|
9
|
-
</mat-form-field>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="search">
|
|
12
|
-
<form [formGroup]="filterForm">
|
|
13
|
-
<mat-form-field class="full-width" [class.disabled]="loaderVal">
|
|
14
|
-
<input matInput [matChipInputFor]="chipList" formControlName="search" [matAutocomplete]="auto"
|
|
15
|
-
[disabled]="loaderVal" placeholder="Search">
|
|
16
|
-
<mat-icon matSuffix *ngIf="!utils.conveySearchIcon(filterForm.value.search)">search</mat-icon>
|
|
17
|
-
<button mat-button matSuffix mat-icon-button aria-label="Clear" *ngIf="utils.conveySearchIcon(filterForm.value.search)" (click)="filterForm.reset()">
|
|
18
|
-
<mat-icon>close</mat-icon>
|
|
19
|
-
</button>
|
|
20
|
-
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete">
|
|
21
|
-
<mat-option *ngFor="let option of filteredOptions | async" (onSelectionChange)="filterSearch($event)"
|
|
22
|
-
[value]="option">
|
|
23
|
-
{{option.type | titlecase }}: {{option['label']}}
|
|
24
|
-
</mat-option>
|
|
25
|
-
</mat-autocomplete>
|
|
26
|
-
</mat-form-field>
|
|
27
|
-
</form>
|
|
28
|
-
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
<div class="chip-list">
|
|
32
|
-
<mat-chip-list #chipList aria-label="Filter selection">
|
|
33
|
-
<mat-chip *ngFor="let filter of filters" (removed)="removeFromFilter(filter)">
|
|
34
|
-
{{filter.type | titlecase }}: {{filter.name}}
|
|
35
|
-
<button matChipRemove>
|
|
36
|
-
<mat-icon>cancel</mat-icon>
|
|
37
|
-
</button>
|
|
38
|
-
</mat-chip>
|
|
39
|
-
</mat-chip-list>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
<app-route-jobcode-list [type]="'jobcode'" [searchTerm]="filters" [data]="listData" [loader]="loaderVal" (clearJobDetailsFromList)="clearJobDetails.emit(true)" (showAllRoute)="filters = []; clearJobDetails.emit(true)" (emitroute)="getRoute($event)"></app-route-jobcode-list>
|
|
43
|
-
</div>
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, EventEmitter, Output, OnDestroy } from '@angular/core';
|
|
2
|
-
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
3
|
-
import { map, Observable, startWith } from 'rxjs';
|
|
4
|
-
import { FormControl, FormGroup } from '@angular/forms';
|
|
5
|
-
interface Filter { name?: string; type: string; value: any; label?: string; }
|
|
6
|
-
import { Subject, takeUntil } from 'rxjs';
|
|
7
|
-
import { Route, UtilsService } from 'coolmap-services';
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'app-job-code-nav',
|
|
11
|
-
templateUrl: './job-code-nav.component.html',
|
|
12
|
-
styleUrls: ['./job-code-nav.component.scss']
|
|
13
|
-
})
|
|
14
|
-
export class JobCodeNavComponent implements OnInit, OnDestroy {
|
|
15
|
-
filterForm = new FormGroup({ search: new FormControl() });
|
|
16
|
-
listData: Route[] = [];
|
|
17
|
-
loaderVal: boolean = false;
|
|
18
|
-
dateValue = new Date();
|
|
19
|
-
@Output() jobemit = new EventEmitter();
|
|
20
|
-
value = '';
|
|
21
|
-
filteredOptions!: Observable<any[]> | undefined;
|
|
22
|
-
filters: Filter[] = [];
|
|
23
|
-
@Output() clearJobDetails = new EventEmitter();
|
|
24
|
-
private destroyer$ = new Subject<boolean>();
|
|
25
|
-
|
|
26
|
-
constructor(public utils: UtilsService) {
|
|
27
|
-
utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
|
|
28
|
-
if (res) { this.loaderVal = false } else this.loaderVal = true
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
ngOnInit(): void { this.loadData(this.utils.getDateFormat(new Date())) }
|
|
32
|
-
loadData(value: string) {
|
|
33
|
-
this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''),
|
|
34
|
-
map(value => this.utils.filter(value, this.filters)),
|
|
35
|
-
);
|
|
36
|
-
this.utils.preventnavChange.next(false);
|
|
37
|
-
this.loaderVal = true;
|
|
38
|
-
this.utils.postdata('coolmap/jobs_report_v2', { date: value }).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
39
|
-
if (typeof res['data'] !== 'string') {
|
|
40
|
-
if (res['data'].length > 0) this.listData = res['data'].map((ele: Route) => {ele['date'] = value; return ele});
|
|
41
|
-
this.listData.forEach((ele: Route) => { this.utils.makeOptions(ele) });
|
|
42
|
-
} else this.listData = [];
|
|
43
|
-
this.clearJobDetails.emit(true);
|
|
44
|
-
this.utils.clearViewRouteforJobCode.next(true);
|
|
45
|
-
this.filters = [];
|
|
46
|
-
if (typeof res['data'] === 'string') this.utils.preventnavChange.next(true);
|
|
47
|
-
}, (err) => { if (err) this.utils.preventnavChange.next(true) });
|
|
48
|
-
}
|
|
49
|
-
getRoute(job: Route) { if(job['type'] === 'jobcode'){ this.jobemit.emit(job)} }
|
|
50
|
-
getDate(ev: MatDatepickerInputEvent<Date>){this.loadData(this.utils.getDateFormat(ev.value))}
|
|
51
|
-
filterSearch(e: any): void {
|
|
52
|
-
this.filterForm.controls.search.setValue(null);
|
|
53
|
-
this.filterForm.controls.search.updateValueAndValidity();
|
|
54
|
-
this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value}]
|
|
55
|
-
}
|
|
56
|
-
removeFromFilter(filter: any): void {
|
|
57
|
-
const index = this.filters.indexOf(filter);
|
|
58
|
-
if (index >= 0) { this.filters = [] }
|
|
59
|
-
}
|
|
60
|
-
ngOnDestroy(): void {
|
|
61
|
-
this.destroyer$.next(true);
|
|
62
|
-
this.destroyer$.unsubscribe();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<div class="nav">
|
|
2
|
-
<button (click)="openDrawer()" class="toggle">
|
|
3
|
-
<img src="assets/images/toggle.svg" alt="" />
|
|
4
|
-
</button>
|
|
5
|
-
|
|
6
|
-
<ul class="m-100">
|
|
7
|
-
<li [ngClass]="{'active': navValue === 'Jobcode'}">
|
|
8
|
-
<a mat-raised-button #tooltip="matTooltip" matTooltip="Job Code" aria-label="Job-code" (click)="chnageNav('Jobcode')">
|
|
9
|
-
<img src="assets/images/job-code.svg" alt="" />
|
|
10
|
-
</a>
|
|
11
|
-
</li>
|
|
12
|
-
|
|
13
|
-
<li [ngClass]="{'active': navValue === 'Addroute', 'disabled': !isnavChange }">
|
|
14
|
-
<a mat-raised-button #tooltip="matTooltip" matTooltip="View Route" aria-label="View-route" (click)="chnageNav('Addroute')">
|
|
15
|
-
<img src="assets/images/route.svg" alt="" />
|
|
16
|
-
</a>
|
|
17
|
-
</li>
|
|
18
|
-
</ul>
|
|
19
|
-
</div>
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
@import "../../../assets/variable.scss";
|
|
2
|
-
|
|
3
|
-
.nav {
|
|
4
|
-
background: $grey;
|
|
5
|
-
height: 100vh;
|
|
6
|
-
padding: 15px 0;
|
|
7
|
-
display: flex;
|
|
8
|
-
@include align-center;
|
|
9
|
-
flex-direction: column;
|
|
10
|
-
button {
|
|
11
|
-
background: $white;
|
|
12
|
-
border-radius: 15px;
|
|
13
|
-
padding: 5px 6px;
|
|
14
|
-
img {
|
|
15
|
-
width: 28px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
ul {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
@include align-center;
|
|
22
|
-
li {
|
|
23
|
-
margin: 10px 0px;
|
|
24
|
-
padding: 0 5px 0 5px;
|
|
25
|
-
border-right: 2px solid $grey;
|
|
26
|
-
&:hover {
|
|
27
|
-
border-right: 2px solid $blue;
|
|
28
|
-
padding: 0 5px 0 5px;
|
|
29
|
-
}
|
|
30
|
-
&.disabled{
|
|
31
|
-
a{
|
|
32
|
-
pointer-events: none;
|
|
33
|
-
opacity: 0.5;
|
|
34
|
-
}
|
|
35
|
-
&:hover{
|
|
36
|
-
border-right: 2px solid $grey;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
a {
|
|
41
|
-
padding: 6px 0;
|
|
42
|
-
display: block;
|
|
43
|
-
border-radius: 15px;
|
|
44
|
-
min-width: 42px;
|
|
45
|
-
box-shadow: none;
|
|
46
|
-
line-height: 30px;
|
|
47
|
-
img {
|
|
48
|
-
width: 27px;
|
|
49
|
-
}
|
|
50
|
-
&:hover {
|
|
51
|
-
background: $white;
|
|
52
|
-
img {
|
|
53
|
-
filter: invert(0.2) sepia(1) saturate(8) hue-rotate(180deg);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
&.active {
|
|
58
|
-
border-right: 2px solid $blue;
|
|
59
|
-
a {
|
|
60
|
-
background: $white;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Output, OnDestroy } from '@angular/core';
|
|
2
|
-
import { CoolmapService, UtilsService } from 'coolmap-services';
|
|
3
|
-
import { Subject, takeUntil } from 'rxjs';
|
|
4
|
-
|
|
5
|
-
@Component({
|
|
6
|
-
selector: 'app-nav',
|
|
7
|
-
templateUrl: './nav.component.html',
|
|
8
|
-
styleUrls: ['./nav.component.scss']
|
|
9
|
-
})
|
|
10
|
-
export class NavComponent implements OnDestroy {
|
|
11
|
-
@Output() drawer = new EventEmitter<boolean>();
|
|
12
|
-
@Output() changeNav = new EventEmitter<string>();
|
|
13
|
-
navValue: string = 'Jobcode';
|
|
14
|
-
isnavChange: boolean = true;
|
|
15
|
-
paddinForJobCode = { top: 0, bottom: 250, left: 500, right: 400 };
|
|
16
|
-
paddinForViewRoute = { top: 0, bottom: 400, left: 400, right: 0 };
|
|
17
|
-
private destroyer$ = new Subject<boolean>();
|
|
18
|
-
|
|
19
|
-
constructor(private utils: UtilsService, private coolMap: CoolmapService) {
|
|
20
|
-
this.utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => { this.isnavChange = res })
|
|
21
|
-
this.coolMap.setPadding(this.paddinForJobCode);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
openDrawer() { this.drawer.emit(true) }
|
|
25
|
-
chnageNav(name: string): void {
|
|
26
|
-
if (this.isnavChange) {
|
|
27
|
-
this.changeNav.emit(name); this.navValue = name; this.coolMap.clearBound();
|
|
28
|
-
if (name === 'Addroute') { this.coolMap.setPadding(this.paddinForViewRoute) }
|
|
29
|
-
else { this.coolMap.setPadding(this.paddinForJobCode) }
|
|
30
|
-
this.utils.clearOptions();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
ngOnDestroy(): void {
|
|
35
|
-
this.destroyer$.next(true);
|
|
36
|
-
this.destroyer$.unsubscribe();
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<div class="innerbox">
|
|
2
|
-
<div class="inputarea">
|
|
3
|
-
<input type="checkbox" name="selectroute" [checked]="route['isSelected']" (change)="$event ? selectRoute(route) : null" />
|
|
4
|
-
<label> </label>
|
|
5
|
-
<div class="border"></div>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="job_intro">
|
|
8
|
-
<div class="heading">
|
|
9
|
-
<h2>
|
|
10
|
-
{{route['order_number'] ? route['order_number'] : ''}}
|
|
11
|
-
</h2>
|
|
12
|
-
|
|
|
13
|
-
<span>
|
|
14
|
-
{{route['customer_name']}}
|
|
15
|
-
</span>
|
|
16
|
-
|
|
|
17
|
-
<span>
|
|
18
|
-
{{route['project']}}
|
|
19
|
-
</span>
|
|
20
|
-
</div>
|
|
21
|
-
<div class="destinationprt">
|
|
22
|
-
<span style="padding-left: 0;">
|
|
23
|
-
{{route['pickup_location']}}
|
|
24
|
-
</span>
|
|
25
|
-
<b>></b>
|
|
26
|
-
<span>
|
|
27
|
-
{{route['delivery_location']}}
|
|
28
|
-
</span>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="mat_cat">
|
|
31
|
-
<span>
|
|
32
|
-
{{route['material']}}
|
|
33
|
-
</span>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="statusbar">
|
|
37
|
-
<div class="status_percent">
|
|
38
|
-
<span class="done" [style]="'width:'+calculateStatusPercentage('done',route['values'])+'%'"></span>
|
|
39
|
-
<span class="ongoing" [style]="'width:'+calculateStatusPercentage('ongoing', route['values'])+'%'"> </span>
|
|
40
|
-
<span class="open" [style]="'width:'+calculateStatusPercentage('open', route['values'])+'%'"> </span>
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="statusarea">
|
|
45
|
-
<div class="statusunit" [ngClass]="route['unit']">{{route['unit']}}</div>
|
|
46
|
-
<div class="driver_icon" (mouseover)="toggleDriverlist(true, route)" (mouseout)="toggleDriverlist(false, route, true)"
|
|
47
|
-
mat-raised-button #tooltip="matTooltip" matTooltip="Click on icon to show the driver list" matTooltipPosition="above"
|
|
48
|
-
(click)="toggleDriverlist('click', route)">
|
|
49
|
-
<img src="assets/images/driver_icon.png" [alt]="" />
|
|
50
|
-
</div>
|
|
51
|
-
<div class="infoicon" (click)="setRouteItem()" (mouseover)="toggleJobCodeDetails(true, route)"
|
|
52
|
-
(mouseout)="toggleJobCodeDetails(false, route)">
|
|
53
|
-
<img src="assets/images/info_icon.png" [alt]="" />
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
@import "../../../../assets/variable.scss";
|
|
2
|
-
.innerbox{
|
|
3
|
-
display: flex;
|
|
4
|
-
justify-content: space-between;
|
|
5
|
-
.inputarea {
|
|
6
|
-
display: flex;
|
|
7
|
-
align-items: center;
|
|
8
|
-
width: 6%;
|
|
9
|
-
input[type="checkbox"] {
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
margin-right: 10px;
|
|
13
|
-
opacity: 0;
|
|
14
|
-
position: absolute;
|
|
15
|
-
left: 0px;
|
|
16
|
-
margin-left: 0;
|
|
17
|
-
top: 0;
|
|
18
|
-
z-index: 3;
|
|
19
|
-
cursor: pointer;
|
|
20
|
-
&:checked+label {
|
|
21
|
-
background: url("../../../../../assets/images/fill-radio.png") 10px 11px no-repeat;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
label {
|
|
25
|
-
background: url("../../../../../assets/images/blank-radio.png") 10px 11px no-repeat;
|
|
26
|
-
width: 100%;
|
|
27
|
-
position: relative;
|
|
28
|
-
z-index: 2;
|
|
29
|
-
font-size: 12px;
|
|
30
|
-
color: #878787;
|
|
31
|
-
height: 100%;
|
|
32
|
-
position: absolute;
|
|
33
|
-
top: 0px;
|
|
34
|
-
left: 0;
|
|
35
|
-
}
|
|
36
|
-
.border {
|
|
37
|
-
position: absolute;
|
|
38
|
-
width: 100%;
|
|
39
|
-
height: 100%;
|
|
40
|
-
left: 0px;
|
|
41
|
-
right: 0;
|
|
42
|
-
top: -1px;
|
|
43
|
-
border-radius: 15px;
|
|
44
|
-
}
|
|
45
|
-
input {
|
|
46
|
-
&:checked~.border {
|
|
47
|
-
border-left: 3px solid $green;
|
|
48
|
-
border-right: 1px solid $green;
|
|
49
|
-
border-top: 1px solid $green;
|
|
50
|
-
border-bottom: 1px solid $green;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
h2 {
|
|
54
|
-
margin-left: 10px;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
overflow: hidden;
|
|
57
|
-
text-overflow: ellipsis;
|
|
58
|
-
max-width: 214px;
|
|
59
|
-
padding-left: 16px;
|
|
60
|
-
margin-bottom: 5px;
|
|
61
|
-
margin-top: 0;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
.job_intro{
|
|
65
|
-
width: 80%;
|
|
66
|
-
.heading{
|
|
67
|
-
display: flex;
|
|
68
|
-
font-size: 0.8rem;
|
|
69
|
-
h2{
|
|
70
|
-
margin: 0 4px 0 0;
|
|
71
|
-
font-size: 0.8rem;
|
|
72
|
-
}
|
|
73
|
-
span{
|
|
74
|
-
white-space: nowrap;
|
|
75
|
-
overflow: hidden;
|
|
76
|
-
text-overflow: ellipsis;
|
|
77
|
-
width: 100px;
|
|
78
|
-
padding: 0 3px;
|
|
79
|
-
display: block;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
.destinationprt{
|
|
83
|
-
display: flex;
|
|
84
|
-
margin-top: 10px;
|
|
85
|
-
font-size: 0.8rem;
|
|
86
|
-
span{
|
|
87
|
-
white-space: nowrap;
|
|
88
|
-
overflow: hidden;
|
|
89
|
-
text-overflow: ellipsis;
|
|
90
|
-
width: 132px;
|
|
91
|
-
padding: 0 5px;
|
|
92
|
-
display: block;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
.mat_cat{
|
|
96
|
-
margin-top: 10px;
|
|
97
|
-
font-size: 0.8rem;
|
|
98
|
-
}
|
|
99
|
-
.statusbar{
|
|
100
|
-
width: 100%;
|
|
101
|
-
position: relative;
|
|
102
|
-
height: 5px;
|
|
103
|
-
margin-top: 10px;
|
|
104
|
-
.status_percent{
|
|
105
|
-
position: absolute;
|
|
106
|
-
left: 0;
|
|
107
|
-
display: flex;
|
|
108
|
-
width: 100%;
|
|
109
|
-
height: 100%;
|
|
110
|
-
span{
|
|
111
|
-
display: block;
|
|
112
|
-
}
|
|
113
|
-
.done{
|
|
114
|
-
background: #008000;
|
|
115
|
-
}
|
|
116
|
-
.ongoing{
|
|
117
|
-
background: #ffcc00;
|
|
118
|
-
}
|
|
119
|
-
.open{
|
|
120
|
-
background: #bfbfbf;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
.statusarea{
|
|
126
|
-
display: flex;
|
|
127
|
-
flex-direction: column;
|
|
128
|
-
align-items: center;
|
|
129
|
-
width: 10%;
|
|
130
|
-
.statusunit{
|
|
131
|
-
border-radius: 30px;
|
|
132
|
-
font-size: 0;
|
|
133
|
-
color: $white;
|
|
134
|
-
text-transform: capitalize;
|
|
135
|
-
font-weight: 500;
|
|
136
|
-
width: 20px;
|
|
137
|
-
height: 20px;
|
|
138
|
-
text-align: center;
|
|
139
|
-
line-height: 20px;
|
|
140
|
-
&::first-letter{
|
|
141
|
-
font-size: 0.8rem;
|
|
142
|
-
}
|
|
143
|
-
&.routestatus{
|
|
144
|
-
right: 10px;
|
|
145
|
-
}
|
|
146
|
-
&.Ton {
|
|
147
|
-
background: $green;
|
|
148
|
-
}
|
|
149
|
-
&.Load {
|
|
150
|
-
background: $blue;
|
|
151
|
-
}
|
|
152
|
-
&.Hourly {
|
|
153
|
-
background: $orenge;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
.driver_icon, .infoicon{
|
|
157
|
-
z-index: 9999;
|
|
158
|
-
img{
|
|
159
|
-
width: 20px;
|
|
160
|
-
height: 20px;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
.driver_icon{
|
|
164
|
-
margin: 5px 0;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { JobCodeListCardComponent } from './job-code-list-card.component';
|
|
4
|
-
|
|
5
|
-
describe('JobCodeListCardComponent', () => {
|
|
6
|
-
let component: JobCodeListCardComponent;
|
|
7
|
-
let fixture: ComponentFixture<JobCodeListCardComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ JobCodeListCardComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(JobCodeListCardComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
-
import { Route, UtilsService } from 'coolmap-services';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'app-job-code-list-card',
|
|
6
|
-
templateUrl: './job-code-list-card.component.html',
|
|
7
|
-
styleUrls: ['./job-code-list-card.component.scss']
|
|
8
|
-
})
|
|
9
|
-
export class JobCodeListCardComponent {
|
|
10
|
-
@Input() route!: Route;
|
|
11
|
-
@Output() routeSeletion = new EventEmitter();
|
|
12
|
-
@Output() toggleDrivermenu = new EventEmitter();
|
|
13
|
-
@Input() emitJobdetails: any;
|
|
14
|
-
@Input() preventCloseDetails!: boolean;
|
|
15
|
-
constructor(public utils: UtilsService) { }
|
|
16
|
-
|
|
17
|
-
selectRoute(route: Route) { this.routeSeletion.emit(route) }
|
|
18
|
-
toggleDriverlist(mouseevntType: boolean | string, route: Route, isHoverOut?: boolean) {
|
|
19
|
-
const data = { mouseevntType, route, isHoverOut }
|
|
20
|
-
this.toggleDrivermenu.emit(data);
|
|
21
|
-
if (mouseevntType === 'click') this.utils.setdictValue('driver-details', JSON.stringify(this.route));
|
|
22
|
-
}
|
|
23
|
-
toggleJobCodeDetails(mouseEventType: boolean, route: Route) {
|
|
24
|
-
if (mouseEventType) { route['type'] = 'jobcode'; this.emitJobdetails.emitroute.emit(route) }
|
|
25
|
-
else if(!mouseEventType && this.preventCloseDetails){
|
|
26
|
-
route = this.utils.getdictValue('route-details');
|
|
27
|
-
route['type'] = 'jobcode'; this.emitJobdetails.emitroute.emit(route)
|
|
28
|
-
}
|
|
29
|
-
else if (!mouseEventType && !this.preventCloseDetails) this.emitJobdetails.clearJobDetailsFromList.emit(true);
|
|
30
|
-
}
|
|
31
|
-
calculateStatusPercentage(type: string, route: any) {
|
|
32
|
-
const total = route['Done'] + route['Ongoing'] + route['Open'];
|
|
33
|
-
if (type === 'done') { return Math.round((100 * route['Done']) / total) }
|
|
34
|
-
else if (type === 'ongoing') { return Math.round((100 * route['Ongoing']) / total) }
|
|
35
|
-
else if (type === 'open') { return Math.round((100 * route['Open']) / total) }
|
|
36
|
-
else { return null }
|
|
37
|
-
}
|
|
38
|
-
setRouteItem(){
|
|
39
|
-
this.utils.preVentJobdetailclose.next(true);
|
|
40
|
-
this.utils.setdictValue('route-details', JSON.stringify(this.route));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<div class="scrollprt addroutelist" [class.viewroute]="visiblesection('addroute')"
|
|
2
|
-
[class.jobList]="visiblesection('jobcode')">
|
|
3
|
-
<button (click)="showRoute()" [disabled]="loader" *ngIf="selectedRoute.selected.length" class="show_routebtn">Show all
|
|
4
|
-
route</button>
|
|
5
|
-
<perfect-scrollbar [class.jobscroll]="visiblesection('jobcode')">
|
|
6
|
-
<mat-spinner *ngIf="loader"></mat-spinner>
|
|
7
|
-
<ul *ngIf="!loader && data.length > 0">
|
|
8
|
-
<li [class.active]="route['isActive'] && visiblesection('addroute')" *ngFor="let route of data">
|
|
9
|
-
<app-job-code-list-card *ngIf="visiblesection('jobcode')" (toggleDrivermenu)="toggleDrivermenu($event)"
|
|
10
|
-
(routeSeletion)="selectRoute($event)" [preventCloseDetails]="preventDetailsClose" [emitJobdetails]="{emitroute, clearJobDetailsFromList}" [route]="checkroutes(route)"></app-job-code-list-card>
|
|
11
|
-
<app-view-route-list-card [emitrouteevent]="emitroute" *ngIf="visiblesection('addroute')"
|
|
12
|
-
[route]="route"></app-view-route-list-card>
|
|
13
|
-
</li>
|
|
14
|
-
</ul>
|
|
15
|
-
<p *ngIf="!loader && data.length === 0">{{visiblesection('addroute') ? 'No Route found' : 'No Job code found.'}}</p>
|
|
16
|
-
</perfect-scrollbar>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div class="driver_list" *ngIf="isDriverList">
|
|
20
|
-
<div class="driver_headingprt">
|
|
21
|
-
<h2>Driver List</h2>
|
|
22
|
-
<button *ngIf="driverList.driver_list?.length > 0" (click)="isSmsList = true">SMS</button>
|
|
23
|
-
<div class="closebtn" (click)="isDriverList = false; preventMouseout = false; isSmsList = false">
|
|
24
|
-
<mat-icon>clear</mat-icon>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
<ul class="driverList" *ngIf="driverList && driverList.driver_list">
|
|
28
|
-
<li *ngFor="let driver of driverList?.driver_list">
|
|
29
|
-
<img src="assets/images/driver_icon.png" [alt]="driver['driver_name']" />
|
|
30
|
-
<div class="driver_detail">
|
|
31
|
-
<b>{{driver['driver_name']}}</b> <span>{{driver['trucking_company']}}</span>
|
|
32
|
-
<div class="cont_del">
|
|
33
|
-
<small>Driver contact: <b>{{driver['driver_phone'] ? driver['driver_phone'] : 'N/A'}}</b></small>
|
|
34
|
-
<small>Company contact: <b>{{driver['trucking_company_phone'] ? driver['trucking_company_phone'] : 'N/A'}}</b></small>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
</li>
|
|
38
|
-
<p *ngIf="driverList.driver_list?.length === 0" style="font-weight:700; text-align:center;">
|
|
39
|
-
No Driver found
|
|
40
|
-
</p>
|
|
41
|
-
</ul>
|
|
42
|
-
<div class="smslist" *ngIf="isSmsList">
|
|
43
|
-
<div class="heading">
|
|
44
|
-
<h2>SMS All Drivers</h2>
|
|
45
|
-
<div class="closebtn" (click)="isSmsList = false">
|
|
46
|
-
<mat-icon>clear</mat-icon>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<div class="detailprt">
|
|
50
|
-
<app-sms-card-details-overview [jobValue]="driverList"></app-sms-card-details-overview>
|
|
51
|
-
<div class="form_input">
|
|
52
|
-
<mat-form-field class="example-full-width">
|
|
53
|
-
<textarea matInput placeholder="Text here..." autocomplete="nope" column="10"
|
|
54
|
-
[formControl]="driverMessage"></textarea>
|
|
55
|
-
<mat-hint>{{driverMessage.value?.length}} / 256</mat-hint>
|
|
56
|
-
</mat-form-field>
|
|
57
|
-
<button *ngIf="!messageLoader" [disabled]="!driverMessage.value || driverMessage.invalid" (click)="sendMessage()">
|
|
58
|
-
Send SMS
|
|
59
|
-
</button>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
<div class="loader">
|
|
63
|
-
<mat-spinner *ngIf="messageLoader"></mat-spinner>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|