@aggdirect/coolmap 2.6.8 → 2.6.9

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,79 +0,0 @@
1
- <div class="jobcode_detailprt" (click)="isOverlapRouteSection = false" *ngIf="jobdetail" [ngClass]="{'overlap': !isOverlapRouteSection}" cdkDrag>
2
- <span class="close"><mat-icon (click)="clearJob()">clear</mat-icon></span>
3
- <div class="job_details_area">
4
- <div class="detailnameprt">
5
- <app-jobcode-status [jobValue]="jobdetail"></app-jobcode-status>
6
- </div>
7
- <app-jobcode-overview [jobValue]="jobdetail"></app-jobcode-overview>
8
- </div>
9
- </div>
10
-
11
- <div class="route_listprt" (click)="isOverlapRouteSection = true" [ngClass]="{ 'show': isVisible, 'overlap': isOverlapRouteSection}">
12
- <div class="listing_toggle" (click)="toggleSidemenu()">
13
- <img src="assets/images/route.svg" alt="" />
14
- </div>
15
-
16
- <div class="listing_box">
17
- <div class="closebtn" (click)="toggleSidemenu()">
18
- <mat-icon>clear</mat-icon>
19
- </div>
20
-
21
- <div class="btnprt">
22
- <h2> List of Routes </h2>
23
- <button (click)="masterToggle()">{{routes && routes.length > 0 && routes.length === selectedRoute.selected.length ? 'Uncheck' : 'Check'}} All</button>
24
- </div>
25
-
26
- <app-job-route-list [routes]="routes" [masterRoutes]="masterRoutes" [selectedRoute]="selectedRoute" (changeRoutes)="routes = $event" (changeSelectedRoute)="selectedRoute = $event"></app-job-route-list>
27
- <cdk-virtual-scroll-viewport itemSize="50" class="routeList-viewport">
28
- <ul *ngIf="routes['length'] > 0">
29
- <li *ngFor="let list of routes">
30
- <div class="iconprt">
31
- <span>
32
- <input type="checkbox" [checked]="selectedRoute.isSelected(list)"
33
- (change)="$event ? selectRoute(list) : null" /><label>&nbsp;</label>
34
- <div class="border"></div>
35
- </span>
36
- <div class="statusunit" [ngClass]="list['unit']">{{list['unit']}}</div>
37
- <div class="infoicon">
38
- <img (mouseenter)="togglerouteDetails(true, list)" (mouseout)="togglerouteDetails(false, list, true)"
39
- (click)="togglerouteDetails('click', list)" src="assets/images/info_icon.png" [alt]="" />
40
- </div>
41
- <div class="infoicon" *ngIf="config.repository === 'customer'">
42
- <img src="assets/images/share_icon.png" (click)="openShareRouteModal(list)" [alt]="" />
43
- </div>
44
- </div>
45
- <div class="pickprtbox">
46
- <h2> {{list['route_name']}} </h2>
47
- <h3><ng-container *ngIf="config?.repository === 'coolmap'">{{list['customer_name']}} | </ng-container>{{config.repository === 'coolmap' ? list['material'] : list['materialLabel']}}</h3>
48
- <div class="pickdropprt">
49
- <div class="pickprt">
50
- <b>
51
- <h4>{{list['pickup_location']}}</h4>
52
- </b>
53
- </div>
54
- <div class="dropprt">
55
- <b>
56
- <h4>{{list['delivery_location']}}</h4>
57
- </b>
58
- </div>
59
- </div>
60
- </div>
61
- </li>
62
- </ul>
63
- <p style="color: #fff;" *ngIf="routes.length === 0">No Route found</p>
64
- </cdk-virtual-scroll-viewport>
65
-
66
- </div>
67
-
68
- <div class="route_detail" *ngIf="detailsCardEnable">
69
- <div class="closebtnroutedetail" (click)="detailsCardEnable = false; preventMouseout = false">
70
- <mat-icon>clear</mat-icon>
71
- </div>
72
- <lib-route-info-card [propData]="{className: 'listRoutecard', repository: config['repository']}" [popupData]="routeCardDetail"></lib-route-info-card>
73
- <div class="createTxt">
74
- <small>
75
- Created by {{routeCardDetail?.created_by_name}} on {{routeCardDetail?.created_at}}
76
- </small>
77
- </div>
78
- </div>
79
- </div>
@@ -1,396 +0,0 @@
1
- @import "../../../assets/variable.scss";
2
-
3
- .jobcode_detailprt {
4
- position: absolute;
5
- left: 20em;
6
- bottom: 10px;
7
- background: $white;
8
- padding: 15px 20px;
9
- border-radius: 20px;
10
- max-width: 350px;
11
- z-index: 999;
12
- box-shadow: 0px 0px 5px 0px rgba(0, 0, 0, 0.1);
13
- .close {
14
- box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.11);
15
- border-radius: 100%;
16
- width: 30px;
17
- height: 30px;
18
- display: flex;
19
- justify-content: center;
20
- align-items: center;
21
- cursor: pointer;
22
- background: #fff;
23
- position: absolute;
24
- top: -11px;
25
- left: -11px;
26
- }
27
- @keyframes autoslide {
28
- 100% {
29
- transform: translateX(calc(90vw - 100%));
30
- }
31
- 0% {
32
- transform: translateX(0%);
33
- }
34
- }
35
- }
36
- .route_listprt {
37
- .listing_toggle {
38
- background: $white;
39
- border-radius: 15px;
40
- padding: 5px 5px;
41
- position: absolute;
42
- right: 10px;
43
- top: 20px;
44
- cursor: pointer;
45
- img {
46
- width: 28px;
47
- }
48
- }
49
- .listing_box {
50
- background: #282828;
51
- height: 100vh;
52
- position: fixed;
53
- right: 0;
54
- top: 0;
55
- z-index: 1111;
56
- box-shadow: -3px 0px 5px 0px rgba(255, 255, 255, 0.08);
57
- transition: 0.5s;
58
- -webkit-transition: 0.5s;
59
- transition: 0.5s;
60
- -webkit-transition: 0.5s;
61
- -moz-transition: 0.5s;
62
- width: 0;
63
- border-radius: 40px 0px 0px 0px;
64
- opacity: 0;
65
- .closebtn {
66
- display: none;
67
- }
68
- ul {
69
- padding: 0 20px 0 0;
70
- li {
71
- background: #4a4a4a;
72
- padding: 10px 15px;
73
- border-radius: 15px;
74
- display: flex;
75
- margin-bottom: 10px;
76
- position: relative;
77
- height:inherit;
78
- @media (min-width:1600px) {
79
- padding: 6px 15px;
80
- margin-bottom: 5px;
81
- }
82
- .iconprt{
83
- display: flex;
84
- flex-direction: column;
85
- span {
86
- display: flex;
87
- align-items: center;
88
- margin-bottom: 32px;
89
- input[type="checkbox"] {
90
- width: 100%;
91
- height: 100%;
92
- margin-right: 10px;
93
- opacity: 0;
94
- position: absolute;
95
- left: 0px;
96
- margin-left: 0;
97
- top: 0;
98
- z-index: 3;
99
- cursor: pointer;
100
- &:checked+label {
101
- // TODO: Fix this
102
- // background: url("../../../assets/images/fill-check.png") 16px 15px no-repeat;
103
- }
104
- }
105
- label {
106
- // TODO: Fix this
107
- // background: url("../../../assets/images/blank-check.png") 16px 15px no-repeat;
108
- width: 100%;
109
- position: relative;
110
- z-index: 2;
111
- font-size: 12px;
112
- color: #878787;
113
- height: 100%;
114
- position: absolute;
115
- top: 0;
116
- left: 0;
117
- }
118
- .border {
119
- position: absolute;
120
- width: 100%;
121
- height: 100%;
122
- left: 0px;
123
- right: 0;
124
- top: 0;
125
- border-radius: 15px;
126
- }
127
- input {
128
- &:checked~.border {
129
- border-left: 1px solid $white;
130
- border-right: 1px solid $white;
131
- border-top: 1px solid $white;
132
- border-bottom: 1px solid $white;
133
- }
134
- }
135
- h2 {
136
- margin-left: 10px;
137
- white-space: nowrap;
138
- overflow: hidden;
139
- text-overflow: ellipsis;
140
- max-width: 150px;
141
- padding-left: 16px;
142
- font-size: 0.9rem;
143
- margin-bottom: 0;
144
- font-weight: normal;
145
- margin-top: 0;
146
- }
147
- }
148
- .statusunit{
149
- border-radius: 30px;
150
- font-size: 0;
151
- color: $white;
152
- text-transform: capitalize;
153
- font-weight: 500;
154
- width: 20px;
155
- height: 20px;
156
- text-align: center;
157
- line-height: 20px;
158
- margin-bottom: 7px;
159
- &::first-letter{
160
- font-size: 0.8rem;
161
- }
162
- &.Ton {
163
- background: #ff7272;
164
- }
165
- &.Load {
166
- background: #a3c52e;
167
- }
168
- &.Hourly {
169
- background: #ae23d1;
170
- }
171
- @media (min-width:1600px) {
172
- line-height: 21px;
173
- }
174
- }
175
- .infoicon{
176
- z-index: 5;
177
- cursor: pointer;
178
- img{
179
- width: 20px;
180
- height: 20px;
181
- }
182
- }
183
- }
184
- .pickprtbox{
185
- margin-left: 10px;
186
- h2{
187
- font-size: 0.9rem;
188
- margin: 7px 0 5px 0;
189
- white-space: nowrap;
190
- text-overflow: ellipsis;
191
- max-width: 195px;
192
- overflow: hidden;
193
- }
194
- }
195
-
196
-
197
- h3 {
198
- font-size: 0.8rem;
199
- color: #979797;
200
- font-weight: 600;
201
- margin-top: 0;
202
- white-space: nowrap;
203
- text-overflow: ellipsis;
204
- max-width: 195px;
205
- overflow: hidden;
206
- margin-bottom: 5px;
207
- }
208
- .pickdropprt {
209
- font-size: 0.75rem;
210
- .pickprt {
211
- position: relative;
212
- display: flex;
213
- align-items: center;
214
- padding-bottom: 10px;
215
- span {
216
- padding-left: 0;
217
- padding-right: 20px;
218
- display: block;
219
- }
220
- b {
221
- position: relative;
222
- &:after {
223
- background: #bcbcbc;
224
- width: 1px;
225
- height: 100%;
226
- left: 3px;
227
- content: "";
228
- position: absolute;
229
- top: 10px;
230
- }
231
- }
232
- h4 {
233
- position: relative;
234
- padding-left: 15px;
235
- margin: 0px 0 0 0;
236
- line-height: 18px;
237
- color: #bcbcbc;
238
- font-weight: normal;
239
- overflow: hidden;
240
- text-overflow: ellipsis;
241
- display: -webkit-box;
242
- -webkit-line-clamp: 1;
243
- -webkit-box-orient: vertical;
244
- &:before {
245
- background: #bcbcbc;
246
- top: 4px;
247
- left: 0px;
248
- position: absolute;
249
- content: "";
250
- width: 7px;
251
- height: 7px;
252
- border-radius: 100%;
253
- }
254
- }
255
- }
256
- .dropprt {
257
- position: relative;
258
- padding-bottom: 10px;
259
- display: flex;
260
- align-items: center;
261
- span {
262
- padding-left: 0;
263
- padding-right: 20px;
264
- display: block;
265
- }
266
- b {
267
- position: relative;
268
- &:after {
269
- background: #bcbcbc;
270
- width: 1px;
271
- height: 12px;
272
- left: 3px;
273
- content: "";
274
- position: absolute;
275
- top: -7px;
276
- }
277
- }
278
- h4 {
279
- position: relative;
280
- padding-left: 15px;
281
- margin: 0;
282
- line-height: 18px;
283
- color: #bcbcbc;
284
- font-weight: normal;
285
- overflow: hidden;
286
- text-overflow: ellipsis;
287
- display: -webkit-box;
288
- -webkit-line-clamp: 1;
289
- -webkit-box-orient: vertical;
290
- &:before {
291
- background: #bcbcbc;
292
- top: 4px;
293
- left: 0px;
294
- position: absolute;
295
- content: "";
296
- width: 7px;
297
- height: 7px;
298
- border-radius: 100%;
299
- }
300
- }
301
- }
302
- }
303
- }
304
- }
305
- }
306
- &.show {
307
- .listing_box {
308
- width: 300px;
309
- max-width: 300px;
310
- -webkit-box-flex: 0;
311
- flex: 0 0 350px;
312
- transition: 0.5s;
313
- -webkit-transition: 0.5s;
314
- transition: 0.5s;
315
- -webkit-transition: 0.5s;
316
- -moz-transition: 0.5s;
317
- padding: 40px 0px 40px 20px;
318
- opacity: 1;
319
- h2 {
320
- color: $white;
321
- white-space: nowrap;
322
- }
323
- .closebtn {
324
- position: absolute;
325
- left: -33px;
326
- top: 50px;
327
- background: #282828;
328
- color: $white;
329
- padding: 8px;
330
- border-top-left-radius: 15px;
331
- border-bottom-left-radius: 15px;
332
- cursor: pointer;
333
- box-shadow: -4px 2px 5px 0px rgba(255, 255, 255, 0.08);
334
- display: block;
335
- }
336
- }
337
- }
338
- }
339
- .btnprt{
340
- display: flex;
341
- justify-content: space-between;
342
- align-items: center;
343
- padding-right: 20px;
344
- h2{
345
- margin: 0;
346
- }
347
- button{
348
- font-size: 15px;
349
- padding: 8px 20px;
350
- border-radius: 5%;
351
- background-color: $blue;
352
- color: $white;
353
- border: none;
354
- border-radius: 10px;
355
- box-shadow: none;
356
- outline: none;
357
- }
358
- }
359
- .hidden {
360
- display: none;
361
- }
362
- .route_detail{
363
- background: #282828;
364
- position: absolute;
365
- width: 260px;
366
- top: 50%;
367
- transform: translateY(-50%);
368
- right: 310px;
369
- border-radius: 20px;
370
- padding: 10px;
371
- box-shadow: 0px 0px 5px 0px rgba(255,255,255,0.21);
372
- }
373
-
374
- .createTxt{
375
- small{
376
- color: #fff;
377
- font-size: 0.7rem;
378
- }
379
- }
380
- .closebtnroutedetail{
381
- box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.11);
382
- border-radius: 100%;
383
- width: 30px;
384
- height: 30px;
385
- display: flex;
386
- justify-content: center;
387
- align-items: center;
388
- cursor: pointer;
389
- background: #f5f5f5;
390
- position: absolute;
391
- top: -7px;
392
- left: -11px;
393
- }
394
- .routeList-viewport{
395
- height: 944px;
396
- }
@@ -1,157 +0,0 @@
1
- import { SelectionModel } from '@angular/cdk/collections';
2
- import { Component, OnInit, Input, Output, EventEmitter, OnDestroy, Inject } from '@angular/core';
3
- import { Subject, takeUntil } from 'rxjs';
4
- import { CoolmapConfigModel, CoolmapService, CustomerRepoDetailsModel, Route, UtilsService } from '@aggdirect/coolmap-services';
5
-
6
-
7
- @Component({
8
- selector: 'app-job-code',
9
- templateUrl: './job-code.component.html',
10
- styleUrls: ['./job-code.component.scss']
11
- })
12
- export class JobCodeComponent implements OnInit, OnDestroy {
13
- @Input() public jobdetail!: any;
14
- @Input() public customerRepoDetails!: CustomerRepoDetailsModel;
15
- isVisible: boolean = false;
16
- routes: Route[] = [];
17
- public selectedRoute = new SelectionModel<any>(true, [])
18
- @Output() public clearJobDetails = new EventEmitter();
19
- @Output() public openShareRoute = new EventEmitter(); isOverlapRouteSection = false;
20
- public destroyer$ = new Subject<boolean>();
21
- detailsCardEnable: boolean | string;
22
- preventMouseout: boolean = false;
23
- routeCardDetail: Route;
24
- preventListUpdate: boolean;
25
- masterRoutes: any;
26
- unitList: any;
27
- materialsList: any;
28
-
29
- constructor(public utils: UtilsService, public coolMap: CoolmapService,
30
- @Inject('memberData') public config: CoolmapConfigModel) {
31
- this.utils.clearViewRouteforJobCodeObserve.pipe(takeUntil(this.destroyer$)).subscribe(res => {
32
- if (res) this.coolMap.removeJobFromMap(this.selectedRoute.selected); this.selectedRoute.clear();
33
- });
34
- }
35
-
36
- ngOnInit(): void { this.checkAndCallRouteList() }
37
- checkAndCallRouteList() {
38
- this.utils.clearOptions();
39
- if (this.config.repository === 'customer') {
40
- this.utils.fetchUnitsList().then((res) => {
41
- this.unitList = res;
42
- this.utils.fetchMaterialsListForCustomer().then((res) => {
43
- this.materialsList = res;
44
- this.getRouteListForCustomer();
45
- });
46
- });
47
- } else {
48
- this.getRouteListForCoolMap()
49
- }
50
- }
51
- getUnitName(data): string {
52
- let unitName = '';
53
- this.unitList.map((res) => {
54
- if (res.id === data.unit_id) {
55
- unitName = res.type
56
- }
57
- })
58
- return unitName;
59
- }
60
-
61
- getMaterialName(data): string {
62
- let materialName = '';
63
- this.materialsList.map((res) => {
64
- if (res.sub_material_id === data.materials_id) {
65
- materialName = res.label
66
- }
67
- })
68
- return materialName;
69
- }
70
- getRouteListForCoolMap() {
71
- this.utils.getData('routes/all').pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
72
- if (res) {
73
- this.routes = res.data;
74
- this.masterRoutes = res.data;
75
- this.preventListUpdate = false;
76
- this.routes.forEach((ele: Route) => { this.utils.makeOptions(ele) });
77
- }
78
- })
79
- }
80
- getRouteListForCustomer() {
81
- const dataset = {
82
- customer_id: this.customerRepoDetails.customer.id
83
- }
84
- this.utils.postdata('routes/all', dataset).pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
85
- if (res) {
86
- this.routes = res.data;
87
- this.preventListUpdate = false;
88
- this.routes.map((ele: Route) => {
89
- ele.unit = this.getUnitName(ele);
90
- ele.materialLabel = this.getMaterialName(ele);
91
- ele.material = this.getMaterialName(ele).split('|')[0].trim();
92
- this.utils.makeOptions(ele)
93
- });
94
- this.masterRoutes = this.routes;
95
- }
96
- });
97
- }
98
-
99
- toggleSidemenu() {
100
- this.isVisible = !this.isVisible;
101
- this.detailsCardEnable = false;
102
- this.preventMouseout = false
103
- }
104
- clearJob() { this.clearJobDetails.emit(true); this.utils.preVentJobdetailclose.next(false) }
105
- selectRoute(event: Route) {
106
- const i = this.selectedRoute.selected.findIndex(ele => ele['order_number'] === event['order_number']);
107
- this.selectedRoute.toggle(event);
108
- if (!this.selectedRoute.isSelected(event) && event['route_id']) {
109
- this.coolMap.removeRouteAndMarker(event['route_id']).then((res: any) => {
110
- this.coolMap.extendReBound();
111
- });
112
- } else {
113
- this.coolMap.plotRoute(event, event['route_id'], 'jobrouteList', false, true);
114
- }
115
- }
116
- masterToggle() {
117
- if (this.routes.length === this.selectedRoute.selected.length) {
118
- this.selectedRoute.clear();
119
- this.routes.forEach(row => {
120
- this.coolMap.removeRouteAndMarker(row['route_id']).then((res: any) => { this.coolMap.extendReBound() })
121
- });
122
- } else {
123
- this.routes.forEach(row => {
124
- this.selectedRoute.select(row);
125
- this.coolMap.plotRoute(row, row['route_id'], 'jobrouteList', false, true);
126
- });
127
- }
128
- }
129
- togglerouteDetails(eventType: string | boolean, route: Route, mouseOut?: boolean) {
130
- if (typeof (eventType) === 'string') {
131
- this.preventMouseout = true; this.utils.setdictValue('route-details', JSON.stringify(route));
132
- }
133
- if (typeof (eventType) === 'boolean' && eventType && !this.preventMouseout) { this.detailsCardEnable = eventType };
134
- if (typeof (eventType) === 'boolean' && !eventType && !this.preventMouseout) { this.detailsCardEnable = eventType };
135
- if (this.preventMouseout && !this.detailsCardEnable) this.preventMouseout = false;
136
- if (mouseOut) {
137
- if (this.preventMouseout) {
138
- route = this.utils.getdictValue('route-details');
139
- this.routeCardDetail = route;
140
- }
141
- if (!this.preventMouseout) {
142
- this.routeCardDetail = route
143
- }
144
- } else {
145
- this.routeCardDetail = route
146
- }
147
- this.routeCardDetail['created_at'] = this.utils.getDateFormat(new Date(this.routeCardDetail['created_at']), '/');
148
- }
149
-
150
- openShareRouteModal(data) {
151
- this.openShareRoute.emit(data);
152
- }
153
- ngOnDestroy(): void {
154
- this.destroyer$.next(true);
155
- this.destroyer$.unsubscribe();
156
- }
157
- }
File without changes
@@ -1,4 +0,0 @@
1
- <div>
2
- <mat-progress-bar *ngIf="enableProgress" mode="indeterminate"></mat-progress-bar>
3
- <div #map class="coolmap" style="height: 100vh;"></div>
4
- </div>
@@ -1,23 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { MapComponent } from './map.component';
4
-
5
- describe('MapComponent', () => {
6
- let component: MapComponent;
7
- let fixture: ComponentFixture<MapComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [ MapComponent ]
12
- })
13
- .compileComponents();
14
-
15
- fixture = TestBed.createComponent(MapComponent);
16
- component = fixture.componentInstance;
17
- fixture.detectChanges();
18
- });
19
-
20
- it('should create', () => {
21
- expect(component).toBeTruthy();
22
- });
23
- });
@@ -1,34 +0,0 @@
1
- import { Component, ElementRef, OnDestroy, ViewChild } from '@angular/core';
2
- import { Subject, takeUntil } from 'rxjs';
3
- import { CoolmapService } from '@aggdirect/coolmap-services';
4
-
5
-
6
-
7
- @Component({
8
- selector: 'app-map',
9
- templateUrl: './map.component.html',
10
- styleUrls: ['./map.component.css']
11
- })
12
- export class MapComponent implements OnDestroy {
13
- @ViewChild('map', { static: true }) public mapDiv!: ElementRef;
14
- enableProgress: boolean = true;
15
- public destroyer$ = new Subject<boolean>();
16
-
17
- constructor( public coolmapService: CoolmapService ) { }
18
-
19
- ngAfterViewInit() {
20
- this.coolmapService.reintiatecoolmap.pipe(takeUntil(this.destroyer$)).subscribe((res: any) => {
21
- this.enableProgress = true;
22
- if (res) {
23
- this.coolmapService.initiateMapForAddRoute(this.mapDiv.nativeElement).then((res) => {
24
- this.enableProgress = false;
25
- })
26
- }
27
- });
28
- }
29
-
30
- ngOnDestroy(): void {
31
- this.destroyer$.next(true);
32
- this.destroyer$.unsubscribe();
33
- }
34
- }