@aggdirect/coolmap 2.9.6 → 2.9.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 +10 -19
- 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 +172 -0
- package/src/lib/component/add-route/add-route.component.scss +243 -0
- package/src/lib/component/add-route/add-route.component.spec.ts +23 -0
- package/src/lib/component/add-route/add-route.component.ts +394 -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 +146 -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 +130 -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 +143 -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 +73 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +227 -0
- package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +233 -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 +46 -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 +19 -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 +74 -0
- package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.css +3 -0
- package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.html +6 -0
- package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.spec.ts +23 -0
- package/src/lib/component/shared/searchoptiongroup/searchoptiongroup.component.ts +21 -0
- package/src/lib/coolmap.module.ts +120 -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 -433
- package/esm2022/lib/component/job-code/job-code.component.mjs +0 -181
- 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 -151
- package/esm2022/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +0 -150
- 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 -319
- 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 -62
- package/esm2022/lib/component/shared/searchoptiongroup/searchoptiongroup.component.mjs +0 -25
- package/esm2022/lib/coolmap.module.mjs +0 -193
- package/esm2022/public-api.mjs +0 -19
- package/fesm2022/aggdirect-coolmap.mjs +0 -1778
- 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 -73
- package/lib/component/job-code/job-code.component.d.ts +0 -41
- 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 -32
- package/lib/component/shared/searchoptiongroup/searchoptiongroup.component.d.ts +0 -14
- package/lib/coolmap.module.d.ts +0 -46
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { Component, EventEmitter, Output, Input, SimpleChanges, OnDestroy, Inject } from '@angular/core';
|
|
2
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
3
|
+
import { CoolmapConfigModel, CustomerRepoDetailsModel, Route, UtilsService } from '@aggdirect/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() public changeNav = new EventEmitter<string | any>();
|
|
26
|
+
@Input() public navValue: string = '';
|
|
27
|
+
@Output() public addemit = new EventEmitter();
|
|
28
|
+
@Input() public updateRouteList: boolean = false;
|
|
29
|
+
@Input() public customerRepoDetails!: CustomerRepoDetailsModel;
|
|
30
|
+
|
|
31
|
+
public destroyer$ = new Subject<boolean>();
|
|
32
|
+
preventListUpdate: boolean = false;
|
|
33
|
+
unitList: any;
|
|
34
|
+
materialsList: any;
|
|
35
|
+
constructor(public utils: UtilsService,
|
|
36
|
+
@Inject('memberData') private config: CoolmapConfigModel) {
|
|
37
|
+
this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(startWith(''),
|
|
38
|
+
map(value => this.utils.filter(value, this.filters)));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
showAddForm() { this.changeNav.emit('addForm'); this.addemit.emit('') }
|
|
42
|
+
filterSearch(e: any): void {
|
|
43
|
+
this.changeNav.emit({ type: 'Addroute' });
|
|
44
|
+
this.preventListUpdate = true;
|
|
45
|
+
this.filterForm.controls.search.setValue(null);
|
|
46
|
+
this.filters = [{ name: e.source.value.label, type: e.source.value.type, value: e.source.value }]
|
|
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 = [] }
|
|
52
|
+
}
|
|
53
|
+
ngAfterViewInit(): void {
|
|
54
|
+
this.checkAndCallRouteList();
|
|
55
|
+
}
|
|
56
|
+
ngOnChanges(changes: SimpleChanges) {
|
|
57
|
+
if (changes['updateRouteList'] && changes['updateRouteList']['currentValue']) this.checkAndCallRouteList();
|
|
58
|
+
if (changes['navValue'] && (changes['navValue']['previousValue'] === 'addForm') && !this.preventListUpdate) this.checkAndCallRouteList();
|
|
59
|
+
}
|
|
60
|
+
getRoute(event: Route) { if (event['type'] === 'editroute') { this.addemit.emit(event) } }
|
|
61
|
+
|
|
62
|
+
checkAndCallRouteList() {
|
|
63
|
+
if (this.config.repository === 'customer') {
|
|
64
|
+
this.utils.fetchUnitsList().then((res) => {
|
|
65
|
+
this.unitList = res;
|
|
66
|
+
this.utils.fetchMaterialsListForCustomer().then((res) => {
|
|
67
|
+
this.materialsList = res;
|
|
68
|
+
this.getRouteListForCustomer();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
this.getRouteListForCoolMap()
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
getUnitName(data): string {
|
|
76
|
+
let unitName = '';
|
|
77
|
+
this.unitList.map((res) => {
|
|
78
|
+
if (res.id === data.unit_id) {
|
|
79
|
+
unitName = res.type
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
return unitName;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
getMaterialName(data): string {
|
|
86
|
+
let materialName = '';
|
|
87
|
+
this.materialsList.map((res) => {
|
|
88
|
+
if (res.sub_material_id === data.materials_id) {
|
|
89
|
+
materialName = res.label
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
return materialName;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
getRouteListForCoolMap() {
|
|
96
|
+
this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
97
|
+
if (res) {
|
|
98
|
+
this.filters = [];
|
|
99
|
+
this.routes = res['data']
|
|
100
|
+
this.preventListUpdate = false;
|
|
101
|
+
this.utils.clearOptions();
|
|
102
|
+
this.routes.forEach((ele: Route) => { this.utils.makeOptions(ele) });
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
getRouteListForCustomer() {
|
|
108
|
+
const dataset = {
|
|
109
|
+
customer_id: this.customerRepoDetails.customer.id
|
|
110
|
+
}
|
|
111
|
+
this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
|
|
112
|
+
if (res) {
|
|
113
|
+
this.filters = [];
|
|
114
|
+
this.routes = res['data']
|
|
115
|
+
this.preventListUpdate = false;
|
|
116
|
+
this.utils.clearOptions();
|
|
117
|
+
this.routes.map((ele: Route) => {
|
|
118
|
+
ele.unit = this.getUnitName(ele);
|
|
119
|
+
ele.material = this.getMaterialName(ele).split('|')[0].trim();
|
|
120
|
+
this.utils.makeOptions(ele)
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
resetSearch() { this.changeNav.emit('Addroute') }
|
|
126
|
+
ngOnDestroy(): void {
|
|
127
|
+
this.destroyer$.next(true);
|
|
128
|
+
this.destroyer$.unsubscribe();
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
|
18
|
+
matSuffix
|
|
19
|
+
mat-icon-button
|
|
20
|
+
aria-label="Clear"
|
|
21
|
+
*ngIf="utils.conveySearchIcon(filterForm.value.search)" (click)="filterForm.reset()">
|
|
22
|
+
<mat-icon>close</mat-icon>
|
|
23
|
+
</button>
|
|
24
|
+
<mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" class="whole_width">
|
|
25
|
+
<mat-option *ngFor="let option of filteredOptions | async" (onSelectionChange)="filterSearch($event)"
|
|
26
|
+
[value]="option">
|
|
27
|
+
{{option.type | titlecase }}: {{option['label']}}
|
|
28
|
+
</mat-option>
|
|
29
|
+
</mat-autocomplete>
|
|
30
|
+
</mat-form-field>
|
|
31
|
+
</form>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="chip-list">
|
|
35
|
+
<mat-chip-grid #chipList aria-label="Filter selection">
|
|
36
|
+
@for (filter of filters; track filter) {
|
|
37
|
+
<mat-chip-row class="chip-grid" (removed)="removeFromFilter(filter)">
|
|
38
|
+
{{filter.type | titlecase }}: {{filter.name}}
|
|
39
|
+
<button matChipRemove>
|
|
40
|
+
<mat-icon>cancel</mat-icon>
|
|
41
|
+
</button>
|
|
42
|
+
</mat-chip-row>
|
|
43
|
+
}
|
|
44
|
+
</mat-chip-grid>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<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>
|
|
48
|
+
</div>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.search-panel{
|
|
2
|
+
.datepicker, .search{
|
|
3
|
+
width: 47%;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.chip-grid {
|
|
8
|
+
width: auto;
|
|
9
|
+
height: auto;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// :host ::ng-deep .mdc-evolution-chip-set__chips {
|
|
13
|
+
// max-width: 100%;
|
|
14
|
+
// }
|
|
15
|
+
|
|
16
|
+
// :host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,
|
|
17
|
+
// :host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,
|
|
18
|
+
// :host ::ng-deep .mat-mdc-standard-chip .mat-mdc-chip-action-label {
|
|
19
|
+
// overflow: hidden;
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
// :host ::ng-deep .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing {
|
|
23
|
+
// padding: auto;
|
|
24
|
+
// }
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Component,
|
|
3
|
+
EventEmitter,
|
|
4
|
+
Output,
|
|
5
|
+
OnDestroy,
|
|
6
|
+
Inject,
|
|
7
|
+
Input,
|
|
8
|
+
OnChanges,
|
|
9
|
+
SimpleChanges,
|
|
10
|
+
} from '@angular/core';
|
|
11
|
+
import { MatDatepickerInputEvent } from '@angular/material/datepicker';
|
|
12
|
+
import { map, Observable, startWith } from 'rxjs';
|
|
13
|
+
import { FormControl, FormGroup } from '@angular/forms';
|
|
14
|
+
interface Filter {
|
|
15
|
+
name?: string;
|
|
16
|
+
type: string;
|
|
17
|
+
value: any;
|
|
18
|
+
label?: string;
|
|
19
|
+
}
|
|
20
|
+
import { Subject, takeUntil } from 'rxjs';
|
|
21
|
+
import {
|
|
22
|
+
CoolmapConfigModel,
|
|
23
|
+
CustomerRepoDetailsModel,
|
|
24
|
+
Route,
|
|
25
|
+
UtilsService,
|
|
26
|
+
} from '@aggdirect/coolmap-services';
|
|
27
|
+
|
|
28
|
+
@Component({
|
|
29
|
+
selector: 'app-job-code-nav',
|
|
30
|
+
templateUrl: './job-code-nav.component.html',
|
|
31
|
+
styleUrls: ['./job-code-nav.component.scss'],
|
|
32
|
+
})
|
|
33
|
+
export class JobCodeNavComponent implements OnDestroy, OnChanges {
|
|
34
|
+
filterForm = new FormGroup({ search: new FormControl() });
|
|
35
|
+
listData: Route[] = [];
|
|
36
|
+
loaderVal: boolean = false;
|
|
37
|
+
dateValue = new Date();
|
|
38
|
+
@Output() public jobemit = new EventEmitter();
|
|
39
|
+
value = '';
|
|
40
|
+
filteredOptions!: Observable<any[]> | undefined;
|
|
41
|
+
filters: Filter[] = [];
|
|
42
|
+
@Output() public clearJobDetails = new EventEmitter();
|
|
43
|
+
public destroyer$ = new Subject<boolean>();
|
|
44
|
+
@Input() public customerRepoDetails!: CustomerRepoDetailsModel;
|
|
45
|
+
selectedDate: string;
|
|
46
|
+
|
|
47
|
+
constructor(
|
|
48
|
+
public utils: UtilsService,
|
|
49
|
+
@Inject('memberData') private config: CoolmapConfigModel
|
|
50
|
+
) {
|
|
51
|
+
this.selectedDate = this.utils.getDateFormat(new Date());
|
|
52
|
+
utils.navChangeObserve.pipe(takeUntil(this.destroyer$)).subscribe((res) => {
|
|
53
|
+
if (res) {
|
|
54
|
+
this.loaderVal = false;
|
|
55
|
+
} else this.loaderVal = true;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
59
|
+
if (
|
|
60
|
+
changes['customerRepoDetails'] &&
|
|
61
|
+
changes['customerRepoDetails']['currentValue']
|
|
62
|
+
) {
|
|
63
|
+
this.loadData(this.selectedDate);
|
|
64
|
+
this.filters = [];
|
|
65
|
+
this.utils.clearViewRouteforJobCode.next(true);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
loadData(value: string) {
|
|
69
|
+
this.selectedDate = value;
|
|
70
|
+
this.filteredOptions = this.filterForm.get('search')?.valueChanges.pipe(
|
|
71
|
+
startWith(''),
|
|
72
|
+
map((value) => this.utils.filter(value, this.filters))
|
|
73
|
+
);
|
|
74
|
+
this.utils.preventnavChange.next(false);
|
|
75
|
+
this.loaderVal = true;
|
|
76
|
+
let dataSet;
|
|
77
|
+
if (this.config.repository === 'customer') {
|
|
78
|
+
dataSet = {
|
|
79
|
+
date: value,
|
|
80
|
+
customer_id: this.customerRepoDetails.customer.id,
|
|
81
|
+
project_id: this.customerRepoDetails.projectId,
|
|
82
|
+
};
|
|
83
|
+
} else {
|
|
84
|
+
dataSet = { date: value };
|
|
85
|
+
}
|
|
86
|
+
this.utils
|
|
87
|
+
.postdata('jobs_report_v2', dataSet)
|
|
88
|
+
.pipe(takeUntil(this.destroyer$))
|
|
89
|
+
.subscribe(
|
|
90
|
+
(res: any) => {
|
|
91
|
+
if (typeof res['data'] !== 'string') {
|
|
92
|
+
if (res['data'].length > 0) {
|
|
93
|
+
this.listData = res['data'].map((ele: Route) => {
|
|
94
|
+
ele['date'] = value;
|
|
95
|
+
return ele;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
this.listData.forEach((ele: Route) => {
|
|
99
|
+
this.utils.makeOptions(ele);
|
|
100
|
+
});
|
|
101
|
+
} else this.listData = [];
|
|
102
|
+
this.clearJobDetails.emit(true);
|
|
103
|
+
this.utils.clearViewRouteforJobCode.next(true);
|
|
104
|
+
this.filters = [];
|
|
105
|
+
if (typeof res['data'] === 'string') this.utils.preventnavChange.next(true);
|
|
106
|
+
},
|
|
107
|
+
(err) => {
|
|
108
|
+
if (err) this.utils.preventnavChange.next(true);
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getRoute(job: Route) {
|
|
114
|
+
if (job['type'] === 'jobcode') {
|
|
115
|
+
this.jobemit.emit(job);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
getDate(ev: MatDatepickerInputEvent<Date>) {
|
|
119
|
+
this.loadData(this.utils.getDateFormat(ev.value));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
filterSearch(e: any): void {
|
|
123
|
+
this.filterForm.controls.search.setValue(null);
|
|
124
|
+
this.filterForm.controls.search.updateValueAndValidity();
|
|
125
|
+
this.filters = [
|
|
126
|
+
{
|
|
127
|
+
name: e.source.value.label,
|
|
128
|
+
type: e.source.value.type,
|
|
129
|
+
value: e.source.value,
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
removeFromFilter(filter: any): void {
|
|
134
|
+
const index = this.filters.indexOf(filter);
|
|
135
|
+
if (index >= 0) {
|
|
136
|
+
this.filters = [];
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
ngOnDestroy(): void {
|
|
140
|
+
this.destroyer$.next(true);
|
|
141
|
+
this.destroyer$.unsubscribe();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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>
|
|
@@ -0,0 +1,67 @@
|
|
|
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: 0!important;
|
|
42
|
+
display: flex;
|
|
43
|
+
border-radius: 15px;
|
|
44
|
+
min-width: 42px;
|
|
45
|
+
box-shadow: none;
|
|
46
|
+
align-items: center;
|
|
47
|
+
height: 42px;
|
|
48
|
+
line-height: 10px;
|
|
49
|
+
img {
|
|
50
|
+
width: 27px;
|
|
51
|
+
}
|
|
52
|
+
&:hover {
|
|
53
|
+
background: $white;
|
|
54
|
+
img {
|
|
55
|
+
filter: invert(0.2) sepia(1) saturate(8) hue-rotate(180deg);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
&.active {
|
|
60
|
+
border-right: 2px solid $blue;
|
|
61
|
+
a {
|
|
62
|
+
background: $white;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Component, EventEmitter, Output, OnDestroy } from '@angular/core';
|
|
2
|
+
import { CoolmapService, UtilsService } from '@aggdirect/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() public drawer = new EventEmitter<boolean>();
|
|
12
|
+
@Output() public 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
|
+
public destroyer$ = new Subject<boolean>();
|
|
18
|
+
|
|
19
|
+
constructor(public utils: UtilsService, public 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
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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" *ngIf="config.repository !== 'customer'" (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
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
input[type="checkbox"] {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
margin-right: 10px;
|
|
12
|
+
opacity: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
left: 0px;
|
|
15
|
+
margin-left: 0;
|
|
16
|
+
top: 0;
|
|
17
|
+
z-index: 3;
|
|
18
|
+
cursor: pointer;
|
|
19
|
+
&:checked+label {
|
|
20
|
+
// TODO: Fix
|
|
21
|
+
// background: url("../../../../../assets/images/fill-radio.png") 10px 11px no-repeat;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
label {
|
|
25
|
+
// TODO: Fix
|
|
26
|
+
// background: url("../../../../../assets/images/blank-radio.png") 10px 11px no-repeat;
|
|
27
|
+
width: 100%;
|
|
28
|
+
position: relative;
|
|
29
|
+
z-index: 2;
|
|
30
|
+
font-size: 12px;
|
|
31
|
+
color: #878787;
|
|
32
|
+
height: 100%;
|
|
33
|
+
position: absolute;
|
|
34
|
+
top: 0px;
|
|
35
|
+
left: 0;
|
|
36
|
+
}
|
|
37
|
+
.border {
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
left: 0px;
|
|
42
|
+
right: 0;
|
|
43
|
+
top: -1px;
|
|
44
|
+
border-radius: 15px;
|
|
45
|
+
}
|
|
46
|
+
input {
|
|
47
|
+
&:checked~.border {
|
|
48
|
+
border-left: 3px solid $green;
|
|
49
|
+
border-right: 1px solid $green;
|
|
50
|
+
border-top: 1px solid $green;
|
|
51
|
+
border-bottom: 1px solid $green;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
h2 {
|
|
55
|
+
margin-left: 10px;
|
|
56
|
+
white-space: nowrap;
|
|
57
|
+
overflow: hidden;
|
|
58
|
+
text-overflow: ellipsis;
|
|
59
|
+
max-width: 214px;
|
|
60
|
+
padding-left: 16px;
|
|
61
|
+
margin-bottom: 5px;
|
|
62
|
+
margin-top: 0;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
.job_intro{
|
|
66
|
+
width: 90%;
|
|
67
|
+
.heading{
|
|
68
|
+
display: flex;
|
|
69
|
+
font-size: 0.8rem;
|
|
70
|
+
h2{
|
|
71
|
+
margin: 0 4px 0 0;
|
|
72
|
+
font-size: 0.8rem;
|
|
73
|
+
}
|
|
74
|
+
span{
|
|
75
|
+
white-space: nowrap;
|
|
76
|
+
overflow: hidden;
|
|
77
|
+
text-overflow: ellipsis;
|
|
78
|
+
width: 100px;
|
|
79
|
+
padding: 0 3px;
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
.destinationprt{
|
|
84
|
+
display: flex;
|
|
85
|
+
margin-top: 10px;
|
|
86
|
+
font-size: 0.8rem;
|
|
87
|
+
span{
|
|
88
|
+
white-space: nowrap;
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
width: 132px;
|
|
92
|
+
padding: 0 5px;
|
|
93
|
+
display: block;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.mat_cat{
|
|
97
|
+
margin-top: 10px;
|
|
98
|
+
font-size: 0.8rem;
|
|
99
|
+
}
|
|
100
|
+
.statusbar{
|
|
101
|
+
width: 100%;
|
|
102
|
+
position: relative;
|
|
103
|
+
height: 5px;
|
|
104
|
+
margin-top: 10px;
|
|
105
|
+
.status_percent{
|
|
106
|
+
position: absolute;
|
|
107
|
+
left: 0;
|
|
108
|
+
display: flex;
|
|
109
|
+
width: 100%;
|
|
110
|
+
height: 100%;
|
|
111
|
+
span{
|
|
112
|
+
display: block;
|
|
113
|
+
}
|
|
114
|
+
.done{
|
|
115
|
+
background: #008000;
|
|
116
|
+
}
|
|
117
|
+
.ongoing{
|
|
118
|
+
background: #ffcc00;
|
|
119
|
+
}
|
|
120
|
+
.open{
|
|
121
|
+
background: #bfbfbf;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
.statusarea{
|
|
127
|
+
display: flex;
|
|
128
|
+
flex-direction: column;
|
|
129
|
+
align-items: center;
|
|
130
|
+
width: 10%;
|
|
131
|
+
.statusunit{
|
|
132
|
+
border-radius: 30px;
|
|
133
|
+
font-size: 0;
|
|
134
|
+
color: $white;
|
|
135
|
+
text-transform: capitalize;
|
|
136
|
+
font-weight: 500;
|
|
137
|
+
width: 20px;
|
|
138
|
+
height: 20px;
|
|
139
|
+
text-align: center;
|
|
140
|
+
line-height: 20px;
|
|
141
|
+
&::first-letter{
|
|
142
|
+
font-size: 0.8rem;
|
|
143
|
+
}
|
|
144
|
+
&.routestatus{
|
|
145
|
+
right: 10px;
|
|
146
|
+
}
|
|
147
|
+
&.Ton {
|
|
148
|
+
background: $green;
|
|
149
|
+
}
|
|
150
|
+
&.Load {
|
|
151
|
+
background: $blue;
|
|
152
|
+
}
|
|
153
|
+
&.Hourly {
|
|
154
|
+
background: $orenge;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.driver_icon, .infoicon{
|
|
158
|
+
z-index: 9999;
|
|
159
|
+
img{
|
|
160
|
+
width: 20px;
|
|
161
|
+
height: 20px;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.driver_icon{
|
|
165
|
+
margin: 5px 0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|