@aggdirect/coolmap 2.6.8 → 2.7.0

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.
Files changed (109) hide show
  1. package/esm2022/aggdirect-coolmap.mjs +5 -0
  2. package/esm2022/lib/component/add-route/add-route.component.mjs +348 -0
  3. package/esm2022/lib/component/job-code/job-code.component.mjs +192 -0
  4. package/esm2022/lib/component/map/map.component.mjs +39 -0
  5. package/esm2022/lib/component/nav/layout/add-route-nav/add-route-nav.component.mjs +152 -0
  6. package/esm2022/lib/component/nav/layout/job-code-nav/job-code-nav.component.mjs +147 -0
  7. package/esm2022/lib/component/nav/nav.component.mjs +54 -0
  8. package/esm2022/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.mjs +77 -0
  9. package/esm2022/lib/component/route-jobcode-list/route-jobcode-list.component.mjs +321 -0
  10. package/esm2022/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.mjs +19 -0
  11. package/esm2022/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.mjs +37 -0
  12. package/esm2022/lib/component/shared/dialog/dialog.component.mjs +31 -0
  13. package/esm2022/lib/component/shared/estimation-display/estimation-display.component.mjs +18 -0
  14. package/esm2022/lib/component/shared/job-route-list/job-route-list.component.mjs +79 -0
  15. package/esm2022/lib/component/shared/jobcode-overview/jobcode-overview.component.mjs +24 -0
  16. package/esm2022/lib/component/shared/jobcode-status/jobcode-status.component.mjs +15 -0
  17. package/esm2022/lib/component/shared/route-info-card/route-info-card.component.mjs +57 -0
  18. package/esm2022/lib/coolmap.module.mjs +186 -0
  19. package/esm2022/public-api.mjs +19 -0
  20. package/fesm2022/aggdirect-coolmap.mjs +1672 -0
  21. package/fesm2022/aggdirect-coolmap.mjs.map +1 -0
  22. package/index.d.ts +5 -0
  23. package/lib/component/add-route/add-route.component.d.ts +61 -0
  24. package/lib/component/job-code/job-code.component.d.ts +42 -0
  25. package/lib/component/map/map.component.d.ts +15 -0
  26. package/lib/component/nav/layout/add-route-nav/add-route-nav.component.d.ts +49 -0
  27. package/lib/component/nav/layout/job-code-nav/job-code-nav.component.d.ts +42 -0
  28. package/lib/component/nav/nav.component.d.ts +31 -0
  29. package/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.d.ts +20 -0
  30. package/lib/component/route-jobcode-list/route-jobcode-list.component.d.ts +42 -0
  31. package/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.d.ts +9 -0
  32. package/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.d.ts +12 -0
  33. package/lib/component/shared/dialog/dialog.component.d.ts +13 -0
  34. package/lib/component/shared/estimation-display/estimation-display.component.d.ts +8 -0
  35. package/lib/component/shared/job-route-list/job-route-list.component.d.ts +26 -0
  36. package/lib/component/shared/jobcode-overview/jobcode-overview.component.d.ts +10 -0
  37. package/lib/component/shared/jobcode-status/jobcode-status.component.d.ts +7 -0
  38. package/lib/component/shared/route-info-card/route-info-card.component.d.ts +29 -0
  39. package/lib/coolmap.module.d.ts +44 -0
  40. package/package.json +22 -5
  41. package/{src/public-api.ts → public-api.d.ts} +0 -8
  42. package/karma.conf.js +0 -44
  43. package/ng-package.json +0 -7
  44. package/src/assets/mixin.scss +0 -28
  45. package/src/assets/palette.scss +0 -24
  46. package/src/assets/variable.scss +0 -15
  47. package/src/lib/component/add-route/add-route.component.html +0 -136
  48. package/src/lib/component/add-route/add-route.component.scss +0 -236
  49. package/src/lib/component/add-route/add-route.component.spec.ts +0 -23
  50. package/src/lib/component/add-route/add-route.component.ts +0 -295
  51. package/src/lib/component/job-code/job-code.component.html +0 -79
  52. package/src/lib/component/job-code/job-code.component.scss +0 -396
  53. package/src/lib/component/job-code/job-code.component.ts +0 -157
  54. package/src/lib/component/map/map.component.css +0 -0
  55. package/src/lib/component/map/map.component.html +0 -4
  56. package/src/lib/component/map/map.component.spec.ts +0 -23
  57. package/src/lib/component/map/map.component.ts +0 -34
  58. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.html +0 -46
  59. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.scss +0 -18
  60. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.spec.ts +0 -23
  61. package/src/lib/component/nav/layout/add-route-nav/add-route-nav.component.ts +0 -131
  62. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.html +0 -48
  63. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.scss +0 -24
  64. package/src/lib/component/nav/layout/job-code-nav/job-code-nav.component.ts +0 -154
  65. package/src/lib/component/nav/nav.component.html +0 -19
  66. package/src/lib/component/nav/nav.component.scss +0 -67
  67. package/src/lib/component/nav/nav.component.ts +0 -38
  68. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.html +0 -56
  69. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.scss +0 -168
  70. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.spec.ts +0 -23
  71. package/src/lib/component/route-jobcode-list/job-code-list-card/job-code-list-card.component.ts +0 -43
  72. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.html +0 -66
  73. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.scss +0 -232
  74. package/src/lib/component/route-jobcode-list/route-jobcode-list.component.ts +0 -234
  75. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.html +0 -7
  76. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.scss +0 -10
  77. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.spec.ts +0 -23
  78. package/src/lib/component/route-jobcode-list/sms-card-details-overview/sms-card-details-overview.component.ts +0 -15
  79. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.html +0 -28
  80. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.scss +0 -172
  81. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.spec.ts +0 -23
  82. package/src/lib/component/route-jobcode-list/view-route-list-card/view-route-list-card.component.ts +0 -20
  83. package/src/lib/component/shared/dialog/dialog.component.html +0 -7
  84. package/src/lib/component/shared/dialog/dialog.component.scss +0 -30
  85. package/src/lib/component/shared/dialog/dialog.component.ts +0 -18
  86. package/src/lib/component/shared/estimation-display/estimation-display.component.html +0 -7
  87. package/src/lib/component/shared/estimation-display/estimation-display.component.scss +0 -7
  88. package/src/lib/component/shared/estimation-display/estimation-display.component.ts +0 -13
  89. package/src/lib/component/shared/job-route-list/job-route-list.component.html +0 -30
  90. package/src/lib/component/shared/job-route-list/job-route-list.component.scss +0 -15
  91. package/src/lib/component/shared/job-route-list/job-route-list.component.spec.ts +0 -23
  92. package/src/lib/component/shared/job-route-list/job-route-list.component.ts +0 -54
  93. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.html +0 -11
  94. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.scss +0 -13
  95. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.spec.ts +0 -23
  96. package/src/lib/component/shared/jobcode-overview/jobcode-overview.component.ts +0 -19
  97. package/src/lib/component/shared/jobcode-status/jobcode-status.component.html +0 -5
  98. package/src/lib/component/shared/jobcode-status/jobcode-status.component.scss +0 -40
  99. package/src/lib/component/shared/jobcode-status/jobcode-status.component.spec.ts +0 -23
  100. package/src/lib/component/shared/jobcode-status/jobcode-status.component.ts +0 -11
  101. package/src/lib/component/shared/route-info-card/route-info-card.component.html +0 -11
  102. package/src/lib/component/shared/route-info-card/route-info-card.component.scss +0 -50
  103. package/src/lib/component/shared/route-info-card/route-info-card.component.spec.ts +0 -23
  104. package/src/lib/component/shared/route-info-card/route-info-card.component.ts +0 -69
  105. package/src/lib/coolmap.module.ts +0 -117
  106. package/src/test.ts +0 -27
  107. package/tsconfig.lib.json +0 -15
  108. package/tsconfig.lib.prod.json +0 -10
  109. package/tsconfig.spec.json +0 -17
@@ -1,46 +0,0 @@
1
- <div class="nav_body">
2
- <div class="logo">
3
- <img src="assets/images/logo.png" alt="logo" />
4
- </div>
5
- <div class="heading m-20">
6
- <h1>View Route</h1>
7
- <button mat-raised-button (click)="showAddForm()">
8
- <mat-icon>add_circle_outline</mat-icon> Add route
9
- </button>
10
- </div>
11
-
12
- <div class="search-panel">
13
- <div class="w-100">
14
- <form [formGroup]="filterForm">
15
- <mat-form-field class="full-width" [class.disabled]="loaderVal">
16
- <input matInput [matChipInputFor]="chipList" formControlName="search" [matAutocomplete]="auto"
17
- [disabled]="loaderVal" placeholder="Search">
18
- <mat-icon matSuffix *ngIf="!utils.conveySearchIcon(filterForm.value.search)">search</mat-icon>
19
- <button mat-button matSuffix mat-icon-button aria-label="Clear" *ngIf="utils.conveySearchIcon(filterForm.value.search)"
20
- (click)="filterForm.reset()">
21
- <mat-icon>close</mat-icon>
22
- </button>
23
- <mat-autocomplete autoActiveFirstOption #auto="matAutocomplete" class="whole_width">
24
- <mat-option *ngFor="let option of filteredOptions | async" (onSelectionChange)="filterSearch($event)"
25
- [value]="option">
26
- {{option.type | titlecase }}: {{option['label']}}
27
- </mat-option>
28
- </mat-autocomplete>
29
- </mat-form-field>
30
- </form>
31
- <div class="chip-list">
32
- <mat-chip-grid #chipList aria-label="Filter selection">
33
- @for (filter of filters; track filter) {
34
- <mat-chip-row class="chip-grid" (removed)="removeFromFilter(filter)">
35
- {{filter.type | titlecase }}: {{filter.name}}
36
- <button matChipRemove>
37
- <mat-icon>cancel</mat-icon>
38
- </button>
39
- </mat-chip-row>
40
- }
41
- </mat-chip-grid>
42
- </div>
43
- </div>
44
- </div>
45
- <app-route-jobcode-list [type]="'addroute'" [currentNav]="navValue" [searchTerm]="filters" [data]="routes" [loader]="loaderVal" (emitroute)="getRoute($event)"></app-route-jobcode-list>
46
- </div>
@@ -1,18 +0,0 @@
1
- .chip-grid {
2
- width: auto;
3
- height: auto;
4
- }
5
-
6
- :host ::ng-deep .mdc-evolution-chip-set__chips {
7
- max-width: 100%;
8
- }
9
-
10
- :host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__cell--primary,
11
- :host ::ng-deep .mat-mdc-standard-chip .mdc-evolution-chip__action--primary,
12
- :host ::ng-deep .mat-mdc-standard-chip .mat-mdc-chip-action-label {
13
- overflow: hidden;
14
- }
15
-
16
- :host ::ng-deep .mat-mdc-standard-chip.mdc-evolution-chip--with-trailing-action .mdc-evolution-chip__action--trailing {
17
- padding: auto;
18
- }
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { AddRouteNavComponent } from './add-route-nav.component';
4
-
5
- describe('AddRouteNavComponent', () => {
6
- let component: AddRouteNavComponent;
7
- let fixture: ComponentFixture<AddRouteNavComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ AddRouteNavComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(AddRouteNavComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,131 +0,0 @@
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.materialLabel = this.getMaterialName(ele);
120
- ele.material = this.getMaterialName(ele).split('|')[0].trim();
121
- this.utils.makeOptions(ele)
122
- });
123
- }
124
- });
125
- }
126
- resetSearch() { this.changeNav.emit('Addroute') }
127
- ngOnDestroy(): void {
128
- this.destroyer$.next(true);
129
- this.destroyer$.unsubscribe();
130
- }
131
- }
@@ -1,48 +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
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>
@@ -1,24 +0,0 @@
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
- // }
@@ -1,154 +0,0 @@
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
- let projectName = window.location.href.split('project=').pop();
98
- projectName = projectName.toLowerCase()
99
-
100
- this.listData = this.listData.filter(ele => {
101
- const project = ele.project.toLowerCase();
102
- let adjustedProject = project.replace(" ", "_");
103
-
104
- return adjustedProject === projectName
105
- });
106
- this.listData.forEach((ele: Route) => {
107
-
108
- this.utils.makeOptions(ele);
109
- });
110
-
111
- } else this.listData = [];
112
- this.clearJobDetails.emit(true);
113
- this.utils.clearViewRouteforJobCode.next(true);
114
- this.filters = [];
115
- if (typeof res['data'] === 'string')
116
- this.utils.preventnavChange.next(true);
117
- },
118
- (err) => {
119
- if (err) this.utils.preventnavChange.next(true);
120
- }
121
- );
122
- }
123
-
124
- getRoute(job: Route) {
125
- if (job['type'] === 'jobcode') {
126
- this.jobemit.emit(job);
127
- }
128
- }
129
- getDate(ev: MatDatepickerInputEvent<Date>) {
130
- this.loadData(this.utils.getDateFormat(ev.value));
131
- }
132
-
133
- filterSearch(e: any): void {
134
- this.filterForm.controls.search.setValue(null);
135
- this.filterForm.controls.search.updateValueAndValidity();
136
- this.filters = [
137
- {
138
- name: e.source.value.label,
139
- type: e.source.value.type,
140
- value: e.source.value,
141
- },
142
- ];
143
- }
144
- removeFromFilter(filter: any): void {
145
- const index = this.filters.indexOf(filter);
146
- if (index >= 0) {
147
- this.filters = [];
148
- }
149
- }
150
- ngOnDestroy(): void {
151
- this.destroyer$.next(true);
152
- this.destroyer$.unsubscribe();
153
- }
154
- }
@@ -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,67 +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: 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
- }
@@ -1,38 +0,0 @@
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
- }
@@ -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>&nbsp;</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>