kwikid-agent-dashboard 0.0.3 → 0.0.4

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 (36) hide show
  1. package/bundles/kwikid-agent-dashboard.umd.js +805 -578
  2. package/bundles/kwikid-agent-dashboard.umd.js.map +1 -1
  3. package/esm2015/lib/components/customer-list/customer-list.component.js +56 -68
  4. package/esm2015/lib/components/customer-tile/customer-tile.component.js +30 -24
  5. package/esm2015/lib/components/customer-tile/status-pill/status-pill.component.js +29 -0
  6. package/esm2015/lib/components/customer-tile/status-pill/status-pill.definitions.js +18 -0
  7. package/esm2015/lib/kwikid-agent-dashboard.component.js +507 -124
  8. package/esm2015/lib/kwikid-agent-dashboard.module.js +54 -27
  9. package/esm2015/lib/pipes/search-filter.pipe.js +62 -0
  10. package/esm2015/lib/services/info-window.service.js +5 -3
  11. package/esm2015/lib/services/map.service.js +50 -124
  12. package/fesm2015/kwikid-agent-dashboard.js +764 -513
  13. package/fesm2015/kwikid-agent-dashboard.js.map +1 -1
  14. package/lib/components/customer-list/customer-list.component.d.ts +19 -58
  15. package/lib/components/customer-tile/customer-tile.component.d.ts +7 -10
  16. package/lib/components/customer-tile/status-pill/status-pill.component.d.ts +10 -0
  17. package/lib/components/customer-tile/status-pill/status-pill.definitions.d.ts +10 -0
  18. package/lib/kwikid-agent-dashboard.component.d.ts +132 -95
  19. package/lib/kwikid-agent-dashboard.module.d.ts +13 -12
  20. package/lib/pipes/search-filter.pipe.d.ts +25 -0
  21. package/lib/services/map.service.d.ts +15 -16
  22. package/package.json +4 -2
  23. package/esm2015/lib/components/add-customer/add-customer.component.js +0 -66
  24. package/esm2015/lib/components/menu/menu.component.js +0 -34
  25. package/esm2015/lib/services/agent.service.js +0 -47
  26. package/esm2015/lib/services/customer.service.js +0 -20
  27. package/esm2015/lib/shared/interfaces/customer.js +0 -2
  28. package/esm2015/lib/svgs/kyc-pending/kyc-pending.component.js +0 -18
  29. package/esm2015/lib/svgs/kyc-success/kyc-success.component.js +0 -18
  30. package/lib/components/add-customer/add-customer.component.d.ts +0 -16
  31. package/lib/components/menu/menu.component.d.ts +0 -18
  32. package/lib/services/agent.service.d.ts +0 -18
  33. package/lib/services/customer.service.d.ts +0 -9
  34. package/lib/shared/interfaces/customer.d.ts +0 -16
  35. package/lib/svgs/kyc-pending/kyc-pending.component.d.ts +0 -8
  36. package/lib/svgs/kyc-success/kyc-success.component.d.ts +0 -8
@@ -1,157 +1,84 @@
1
- import { __awaiter } from 'tslib';
2
1
  import * as i0 from '@angular/core';
3
- import { Injectable, EventEmitter, Component, Output, Input, ViewChild, NgModule } from '@angular/core';
4
- import * as i5 from 'kwikui';
5
- import { KwikUIButtonModule, KwikUIButtonIconModule, KwikUIInputModule, KwikUIInputDateModule, KwikUISelectComboboxModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
2
+ import { Injectable, ViewChildren, Component, Input, EventEmitter, Output, ViewChild, Pipe, Inject, NgModule } from '@angular/core';
3
+ import * as i4 from '@angular/google-maps';
4
+ import { MapInfoWindow, GoogleMapsModule } from '@angular/google-maps';
5
+ import * as i9 from '@taiga-ui/core';
6
+ import { TuiDialogService, TuiRootModule, TuiDialogModule, TuiDropdownModule, TuiGroupModule, TuiSvgModule } from '@taiga-ui/core';
7
+ import { of } from 'rxjs';
8
+ import { map, catchError } from 'rxjs/operators';
9
+ import { __awaiter } from 'tslib';
10
+ import * as i2 from '@angular/common/http';
11
+ import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
12
+ import * as i4$1 from 'kwikui';
13
+ import { KwikUIButtonModule, KwikUIButtonIconModule, KwikUIInputModule, KwikUIInputDateModule, KwikUIInputDateRangeModule, KwikUISelectComboboxModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
6
14
  import * as i5$1 from '@angular/forms';
7
15
  import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
8
- import { TuiDay, TuiActiveZoneModule } from '@taiga-ui/cdk';
9
- import * as i6 from '@angular/common';
16
+ import * as i8 from '@taiga-ui/cdk';
17
+ import { TuiDayRange, TuiDay, TuiActiveZoneModule } from '@taiga-ui/cdk';
18
+ import * as i3 from '@angular/cdk/scrolling';
19
+ import { ScrollingModule } from '@angular/cdk/scrolling';
20
+ import { isEmptyValue, getObjectValueFromPath } from 'kwikid-toolkit';
21
+ import * as i5 from '@angular/common';
10
22
  import { CommonModule } from '@angular/common';
11
- import { HttpClientModule } from '@angular/common/http';
12
- import { RouterTestingModule } from '@angular/router/testing';
23
+ import * as i6 from 'kwikid-forms';
24
+ import { KwikIDFormViewModule } from 'kwikid-forms';
13
25
  import { TuiSidebarModule } from '@taiga-ui/addon-mobile';
14
26
 
15
- class AgentService {
16
- constructor() {
17
- this.agentConfig = {};
18
- this.showMenu = false;
19
- this.showMapview = true;
20
- this.addTask = false;
21
- }
22
- getAgentConfig() {
23
- return this.agentConfig;
24
- }
25
- setAgentConfig(agentConfig) {
26
- this.agentConfig = agentConfig;
27
- }
28
- setMapview(value) {
29
- this.showMapview = value;
30
- }
31
- getAddTask() {
32
- return this.addTask;
33
- }
34
- setAddTask(value) {
35
- this.addTask = value;
36
- this.setMenu(false);
37
- }
38
- toggleMapview() {
39
- this.showMapview = !this.showMapview;
40
- }
41
- getMenu() {
42
- return this.showMenu;
43
- }
44
- setMenu(value) {
45
- this.showMenu = value;
46
- }
47
- toggleMenu() {
48
- this.showMenu = !this.showMenu;
49
- }
50
- }
51
- /** @nocollapse */ AgentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
52
- /** @nocollapse */ AgentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, providedIn: 'root' });
53
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, decorators: [{
54
- type: Injectable,
55
- args: [{
56
- providedIn: 'root'
57
- }]
58
- }] });
59
-
60
27
  class MapService {
61
- constructor(agentService) {
62
- this.agentService = agentService;
63
- this.allCustomersMarkers = [];
64
- }
65
- getMyPosition() {
66
- return this.myPosition;
67
- }
68
- getMap() {
69
- return this.map;
70
- }
71
- setMap(map) {
72
- this.map = map;
28
+ constructor(mapDirectionsService) {
29
+ this.mapDirectionsService = mapDirectionsService;
30
+ this.markers = [];
31
+ this.directionsRenderOption = {};
73
32
  }
74
33
  getMarkers() {
75
- return this.allCustomersMarkers;
34
+ return this.markers;
76
35
  }
77
36
  setMarkers(markers) {
78
- this.allCustomersMarkers = markers;
37
+ this.markers = markers;
79
38
  }
80
- initMap(mapElement) {
39
+ initMap() {
81
40
  return __awaiter(this, void 0, void 0, function* () {
82
- this.myPosition = yield this.getPosition().then((pos) => {
83
- return {
84
- lat: pos.lat,
85
- lng: pos.lng
86
- };
87
- });
88
- this.map = new google.maps.Map(mapElement.nativeElement, {
41
+ this.myPosition = yield this.getPosition();
42
+ this.map = {
89
43
  zoom: 10,
90
44
  center: this.myPosition,
91
45
  streetViewControl: false,
92
46
  mapTypeControl: false,
93
47
  fullscreenControl: false,
94
- zoomControl: false,
95
- });
48
+ zoomControl: false
49
+ };
96
50
  });
97
51
  }
98
52
  plotMarkers(customers) {
99
- return __awaiter(this, void 0, void 0, function* () {
100
- let path = [];
101
- const marker = new google.maps.Marker({
102
- position: this.myPosition,
103
- map: this.map,
104
- animation: google.maps.Animation.DROP
53
+ this.markers = [];
54
+ let path = [];
55
+ this.markers.push(this.myPosition);
56
+ customers.map((customer) => {
57
+ path.push({
58
+ location: this.getLatLng(customer.task_details.customer_details.location),
59
+ stopover: true
105
60
  });
106
- let origin = marker.getPosition();
107
- customers.map((customer) => {
108
- path.push({
109
- location: this.getLatLng(customer.extras.loc),
110
- stopover: true
111
- });
112
- });
113
- customers = yield this.calcRoute(customers, origin, path);
114
- customers.map((customer, index) => {
115
- const marker = new google.maps.Marker({
116
- position: this.getLatLng(customer.extras.loc),
117
- map: this.map,
118
- animation: google.maps.Animation.DROP,
119
- label: {
120
- text: String(index + 1),
121
- color: '#FFF'
122
- }
123
- });
124
- this.allCustomersMarkers.push(marker);
125
- });
126
- return customers;
127
61
  });
128
- }
129
- calcRoute(customers, origin, waypoints) {
130
- return __awaiter(this, void 0, void 0, function* () {
131
- let directionsService = new google.maps.DirectionsService();
132
- let directionsRenderer = new google.maps.DirectionsRenderer({
133
- suppressMarkers: true
134
- });
135
- const destination = new google.maps.LatLng(19.0996079, 72.9144412);
136
- directionsRenderer.setMap(this.map);
137
- let request = {
138
- origin: origin,
139
- destination: destination,
140
- waypoints: waypoints,
141
- optimizeWaypoints: true,
142
- travelMode: 'DRIVING'
143
- };
144
- let sortList = this.sortList;
145
- let customersData = customers;
146
- yield directionsService.route(request, function (result, status) {
147
- if (status == 'OK') {
148
- directionsRenderer.setDirections(result);
149
- customersData = sortList(result.routes[0].waypoint_order, customersData);
150
- }
62
+ const request = {
63
+ origin: this.myPosition,
64
+ destination: this.myPosition,
65
+ waypoints: path,
66
+ optimizeWaypoints: true,
67
+ travelMode: google.maps.TravelMode.DRIVING
68
+ };
69
+ this.directionsRenderOption = {
70
+ suppressMarkers: true
71
+ };
72
+ this.directionsResults$ = this.mapDirectionsService
73
+ .route(request)
74
+ .pipe(map((response) => response.result));
75
+ this.directionsResults$.subscribe((val) => {
76
+ customers = this.sortList(val.routes[0].waypoint_order, customers);
77
+ customers.map((customer) => {
78
+ this.markers.push(this.getLatLng(customer.task_details.customer_details.location));
151
79
  });
152
- this.allCustomersDirections = directionsRenderer;
153
- return customersData;
154
80
  });
81
+ return this.directionsResults$;
155
82
  }
156
83
  getPosition() {
157
84
  return new Promise((resolve, reject) => {
@@ -166,7 +93,11 @@ class MapService {
166
93
  });
167
94
  }
168
95
  getLatLng(data) {
169
- return new google.maps.LatLng(data[0], data[1]);
96
+ let url = data.split('@');
97
+ let lat_long_match = url[1].split(',');
98
+ let lat = Number(lat_long_match[0]);
99
+ let long = Number(lat_long_match[1]);
100
+ return { lat: lat, lng: long };
170
101
  }
171
102
  sortList(order, customersData) {
172
103
  let c = [];
@@ -176,105 +107,17 @@ class MapService {
176
107
  }
177
108
  return c;
178
109
  }
179
- plotHistoryCustomer(customer) {
180
- if (this.historyCustomerMarker)
181
- this.setMarkersMap(null, null);
182
- this.agentService.toggleMenu();
183
- const marker = new google.maps.Marker({
184
- position: this.getLatLng(customer.loc),
185
- map: this.map,
186
- animation: google.maps.Animation.DROP,
187
- label: {
188
- text: 'C',
189
- color: '#FFF'
190
- }
191
- });
192
- this.historyCustomerMarker = marker;
193
- let directionsService = new google.maps.DirectionsService();
194
- let directionsRenderer = new google.maps.DirectionsRenderer({
195
- suppressMarkers: true
196
- });
197
- directionsRenderer.setMap(this.map);
198
- let request = {
199
- origin: this.myPosition,
200
- destination: marker.getPosition(),
201
- optimizeWaypoints: true,
202
- travelMode: 'DRIVING'
203
- };
204
- directionsService.route(request, function (result, status) {
205
- if (status == 'OK') {
206
- directionsRenderer.setDirections(result);
207
- }
208
- });
209
- this.historyCustomerDirections = directionsRenderer;
210
- this.setMarkersMap(null, this.map);
211
- return marker;
212
- }
213
- setMarkersMap(all, history) {
214
- this.allCustomersMarkers.map((marker) => {
215
- marker.setMap(all);
216
- });
217
- this.allCustomersDirections.setMap(all);
218
- this.historyCustomerMarker.setMap(history);
219
- this.historyCustomerDirections.setMap(history);
220
- }
221
110
  }
222
- /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Injectable });
111
+ /** @nocollapse */ MapService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, deps: [{ token: i4.MapDirectionsService }], target: i0.ɵɵFactoryTarget.Injectable });
223
112
  /** @nocollapse */ MapService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, providedIn: 'root' });
224
113
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapService, decorators: [{
225
114
  type: Injectable,
226
115
  args: [{
227
116
  providedIn: 'root'
228
117
  }]
229
- }], ctorParameters: function () { return [{ type: AgentService }]; } });
230
-
231
- class CustomerService {
232
- constructor() { }
233
- getCustomers() {
234
- return this.customersData;
235
- }
236
- setCustomers(customers) {
237
- this.customersData = customers;
238
- }
239
- }
240
- /** @nocollapse */ CustomerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
241
- /** @nocollapse */ CustomerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, providedIn: 'root' });
242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerService, decorators: [{
243
- type: Injectable,
244
- args: [{
245
- providedIn: 'root'
246
- }]
247
- }], ctorParameters: function () { return []; } });
248
-
249
- class MenuComponent {
250
- /**
251
- * @description
252
- *
253
- * @constructor
254
- */
255
- constructor(agentService) {
256
- this.agentService = agentService;
257
- this.nextStep = new EventEmitter();
258
- }
259
- ngOnInit() { }
260
- goToNextStep(e) {
261
- this.nextStep.emit(e);
262
- }
263
- refresh() {
264
- window.location.reload();
265
- }
266
- }
267
- /** @nocollapse */ MenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MenuComponent, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Component });
268
- /** @nocollapse */ MenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MenuComponent, selector: "menu", outputs: { nextStep: "nextStep" }, ngImport: i0, template: "<div class=\"menu-container\">\n <div class=\"menu-option\">\n <div class=\"agent-name\">Agent Name</div>\n <div class=\"agent-id\">1234-5678-9012</div>\n </div>\n <hr />\n <div class=\"menu-option\" (click)=\"agentService.toggleMapview()\">\n {{ agentService.showMapview ? 'Hide Maps' : 'Show Maps' }}\n </div>\n <div class=\"menu-option\" (click)=\"agentService.setAddTask(true)\">\n Add Task\n </div>\n <div class=\"menu-option\" (click)=\"refresh()\">Refresh</div>\n <hr />\n <div class=\"menu-option\" (onClick)=\"goToNextStep('logout')\">Logout</div>\n</div>\n", styles: [".menu-container{position:absolute;top:8%;right:0;background-color:#fafafa;width:-moz-fit-content;width:fit-content;border-radius:1rem;z-index:1001;box-shadow:0 4px 8px #0000001a;transition:\"0.15s linear 0s\"}.t-wrapper{padding:1.25rem!important}.agent-name{font-size:.9rem;font-weight:600}.agent-id{font-size:.7rem}.menu-option{padding:.25rem 1.5rem;display:flex;flex-direction:column;align-items:center;justify-content:center}hr{border:none!important;background-color:#ddd}\n"] });
269
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MenuComponent, decorators: [{
270
- type: Component,
271
- args: [{
272
- selector: 'menu',
273
- templateUrl: './menu.component.html',
274
- styleUrls: ['./menu.component.css']
275
- }]
276
- }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { nextStep: [{
277
- type: Output
118
+ }], ctorParameters: function () { return [{ type: i4.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
119
+ type: ViewChildren,
120
+ args: ['directionsRender']
278
121
  }] } });
279
122
 
280
123
  class InfoWindowService {
@@ -343,7 +186,7 @@ class InfoWindowService {
343
186
  * @method showInfo
344
187
  */
345
188
  showCustomerInformation(customer, marker) {
346
- let map = this.mapService.getMap();
189
+ let map = this.mapService.map;
347
190
  let contentString = this.createInfoContent(customer);
348
191
  let infowindow = new google.maps.InfoWindow({
349
192
  content: contentString
@@ -352,10 +195,12 @@ class InfoWindowService {
352
195
  this.closeLastOpenedInfoWindow();
353
196
  infowindow.open(map, marker);
354
197
  this.lastInfoWindowOpened = infowindow;
355
- map.setCenter(marker.getPosition());
198
+ this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
199
+ // map.setCenter(marker.getPosition());
356
200
  return { infowindow: infowindow };
357
201
  }
358
202
  addEventListeners(customer, infowindow) {
203
+ // chnage -
359
204
  let addressLink = `http://maps.google.com/?q=${customer.extras.loc[0]}, ${customer.extras.loc[1]}`;
360
205
  google.maps.event.addListener(infowindow, 'domready', function () {
361
206
  document.getElementById('Call').addEventListener('click', function (e) {
@@ -457,39 +302,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
457
302
  }]
458
303
  }], ctorParameters: function () { return [{ type: MapService }]; } });
459
304
 
460
- class KycSuccessComponent {
461
- constructor() { }
462
- ngOnInit() {
463
- }
464
- }
465
- /** @nocollapse */ KycSuccessComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycSuccessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
466
- /** @nocollapse */ KycSuccessComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KycSuccessComponent, selector: "svg-kyc-success", ngImport: i0, template: "<svg\n class=\"status\"\n xmlns=\"http://www.w3.org/2000/svg\"\n x=\"0px\"\n y=\"0px\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0,0,256,256\"\n style=\"fill: #000000\"\n>\n <g transform=\"translate(64,64) scale(0.5,0.5)\">\n <g\n fill=\"#20c997\"\n fill-rule=\"nonzero\"\n stroke=\"none\"\n stroke-width=\"1\"\n stroke-linecap=\"butt\"\n stroke-linejoin=\"miter\"\n stroke-miterlimit=\"10\"\n stroke-dasharray=\"\"\n stroke-dashoffset=\"0\"\n font-family=\"none\"\n font-weight=\"none\"\n font-size=\"none\"\n text-anchor=\"none\"\n style=\"mix-blend-mode: normal\"\n >\n <path d=\"M-128,384v-512h512v512z\" id=\"bgRectangle\"></path>\n </g>\n <g\n fill=\"#ffffff\"\n fill-rule=\"nonzero\"\n stroke=\"none\"\n stroke-width=\"1\"\n stroke-linecap=\"butt\"\n stroke-linejoin=\"miter\"\n stroke-miterlimit=\"10\"\n stroke-dasharray=\"\"\n stroke-dashoffset=\"0\"\n font-family=\"none\"\n font-weight=\"none\"\n font-size=\"none\"\n text-anchor=\"none\"\n style=\"mix-blend-mode: normal\"\n >\n <g transform=\"scale(8,8)\">\n <path\n d=\"M28.28125,6.28125l-17.28125,17.28125l-7.28125,-7.28125l-1.4375,1.4375l8,8l0.71875,0.6875l0.71875,-0.6875l18,-18z\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n", styles: [".status{border-radius:1.5rem}\n"] });
467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycSuccessComponent, decorators: [{
468
- type: Component,
469
- args: [{
470
- selector: 'svg-kyc-success',
471
- templateUrl: './kyc-success.component.html',
472
- styleUrls: ['./kyc-success.component.css']
473
- }]
474
- }], ctorParameters: function () { return []; } });
305
+ var EStatus;
306
+ (function (EStatus) {
307
+ EStatus["NOT_STARTED"] = "not started";
308
+ EStatus["ON_GOING"] = "on going";
309
+ EStatus["AUDITING"] = "auditing";
310
+ EStatus["REJECTED"] = "rejected";
311
+ EStatus["AFTER_AUDIT"] = "after audit";
312
+ EStatus["COMPLETE"] = "complete";
313
+ })(EStatus || (EStatus = {}));
314
+ const VStatus = [
315
+ EStatus.NOT_STARTED,
316
+ EStatus.ON_GOING,
317
+ EStatus.AUDITING,
318
+ EStatus.REJECTED,
319
+ EStatus.AFTER_AUDIT,
320
+ EStatus.COMPLETE
321
+ ];
475
322
 
476
- class KycPendingComponent {
477
- constructor() { }
323
+ class StatusPillComponent {
478
324
  ngOnInit() {
325
+ if (isEmptyValue(this.status)) {
326
+ this.status = EStatus.NOT_STARTED;
327
+ }
328
+ }
329
+ getStatusPillClass(status) {
330
+ let newStatus = status.replace(' ', '-');
331
+ return `status-pill ${newStatus}`;
479
332
  }
480
333
  }
481
- /** @nocollapse */ KycPendingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycPendingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
482
- /** @nocollapse */ KycPendingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KycPendingComponent, selector: "svg-kyc-pending", ngImport: i0, template: "<svg\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"status\"\n x=\"0px\"\n y=\"0px\"\n width=\"32\"\n height=\"32\"\n viewBox=\"0,0,256,256\"\n style=\"fill: #000000\"\n>\n <g transform=\"translate(32,32) scale(0.75,0.75)\">\n <g\n fill=\"#fcb919\"\n fill-rule=\"nonzero\"\n stroke=\"none\"\n stroke-width=\"1\"\n stroke-linecap=\"butt\"\n stroke-linejoin=\"miter\"\n stroke-miterlimit=\"10\"\n stroke-dasharray=\"\"\n stroke-dashoffset=\"0\"\n font-family=\"none\"\n font-weight=\"none\"\n font-size=\"none\"\n text-anchor=\"none\"\n style=\"mix-blend-mode: normal\"\n >\n <path\n d=\"M-42.66667,298.66667v-341.33333h341.33333v341.33333z\"\n id=\"bgRectangle\"\n ></path>\n </g>\n <g\n fill=\"#ffffff\"\n fill-rule=\"nonzero\"\n stroke=\"none\"\n stroke-width=\"1\"\n stroke-linecap=\"butt\"\n stroke-linejoin=\"miter\"\n stroke-miterlimit=\"10\"\n stroke-dasharray=\"\"\n stroke-dashoffset=\"0\"\n font-family=\"none\"\n font-weight=\"none\"\n font-size=\"none\"\n text-anchor=\"none\"\n style=\"mix-blend-mode: normal\"\n >\n <g transform=\"scale(8,8)\">\n <path\n d=\"M16,4c-6.61719,0 -12,5.38281 -12,12c0,6.61719 5.38281,12 12,12c6.61719,0 12,-5.38281 12,-12c0,-6.61719 -5.38281,-12 -12,-12zM16,6c5.53516,0 10,4.46484 10,10c0,5.53516 -4.46484,10 -10,10c-5.53516,0 -10,-4.46484 -10,-10c0,-5.53516 4.46484,-10 10,-10zM15,8v9h7v-2h-5v-7z\"\n ></path>\n </g>\n </g>\n </g>\n</svg>\n", styles: [".status{border-radius:1.5rem}\n"] });
483
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KycPendingComponent, decorators: [{
334
+ /** @nocollapse */ StatusPillComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
335
+ /** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{status}}</div>\n", styles: [".status-pill{background-color:#555;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#fff}.complete{background-color:var(--tui-positive)}.rejected{background-color:var(--tui-negative)}.auditing{background-color:var(--tui-primary)}.on-going{background-color:var(--tui-primary)}.after-audit{background-color:var(--tui-warning-fill);color:#222}\n"], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, decorators: [{
484
337
  type: Component,
485
338
  args: [{
486
- selector: 'svg-kyc-pending',
487
- templateUrl: './kyc-pending.component.html',
488
- styleUrls: ['./kyc-pending.component.css']
339
+ selector: 'status-pill',
340
+ templateUrl: './status-pill.component.html',
341
+ styleUrls: ['./status-pill.component.css']
489
342
  }]
490
- }], ctorParameters: function () { return []; } });
343
+ }], propDecorators: { status: [{
344
+ type: Input
345
+ }] } });
491
346
 
492
347
  class CustomerTileComponent {
348
+ /**
349
+ * @description
350
+ *
351
+ * @constructor
352
+ */
493
353
  constructor(mapService, infoWindowService) {
494
354
  this.mapService = mapService;
495
355
  this.infoWindowService = infoWindowService;
@@ -517,11 +377,7 @@ class CustomerTileComponent {
517
377
  * @fires KwikIDAgentDashboardComponent#nextStep
518
378
  */
519
379
  this.nextStep = new EventEmitter();
520
- this.removeTask = new EventEmitter(); /**
521
- * @description
522
- *
523
- * @constructor
524
- */
380
+ this.removeTask = new EventEmitter();
525
381
  }
526
382
  /**
527
383
  * @description
@@ -530,11 +386,14 @@ class CustomerTileComponent {
530
386
  * @ngOnInit
531
387
  */
532
388
  ngOnInit() { }
389
+ getTaskDetails(taskData) {
390
+ return getObjectValueFromPath(this.customer, taskData);
391
+ }
533
392
  tileClick() {
534
- console.log("Tile Click", this.index);
393
+ console.log('Tile Click', this.index);
535
394
  if (this.index == this.infoWindowService.getOpenMarker()) {
536
395
  this.infoWindowService.setOpenMarker(null);
537
- this.infoWindowService.lastInfoWindowOpened.close();
396
+ //this.infoWindowService.lastInfoWindowOpened.close();
538
397
  }
539
398
  else {
540
399
  this.showDetails(this.customer, this.index);
@@ -550,18 +409,14 @@ class CustomerTileComponent {
550
409
  */
551
410
  showDetails(customer, index) {
552
411
  let markers = this.mapService.getMarkers();
553
- let marker = markers[index];
554
- let { infowindow } = this.infoWindowService.showCustomerInformation(customer, marker);
412
+ console.log('Markers', markers);
413
+ let marker = markers[index + 1];
414
+ // let { infowindow } = this.infoWindowService.showCustomerInformation(
415
+ // customer,
416
+ // marker
417
+ // );
555
418
  this.infoWindowService.setOpenMarker(index);
556
419
  }
557
- /**
558
- * @description
559
- * Wrapper method to fire click event for next step.
560
- *
561
- * @function goToNextStep
562
- * @func goToNextStep
563
- * @method goToNextStep
564
- */
565
420
  goToNextStep(e) {
566
421
  this.nextStep.emit(e);
567
422
  }
@@ -570,7 +425,7 @@ class CustomerTileComponent {
570
425
  }
571
426
  }
572
427
  /** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: MapService }, { token: InfoWindowService }], target: i0.ɵɵFactoryTarget.Component });
573
- /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-tile-wrapper\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <ng-container *ngIf=\"customer.kycComplete\">\n <svg-kyc-success></svg-kyc-success>\n </ng-container>\n <ng-container *ngIf=\"!customer.kycComplete\">\n <svg-kyc-pending></svg-kyc-pending>\n </ng-container>\n <div class=\"customer-tile-prtimary-container-name-phone\">\n <div class=\"customer-tile-primary-container-name\">\n {{ customer.extras.name }}\n </div>\n <div class=\"customer-tile-primary-container-phone\">\n {{ customer.extras.phone }}\n </div>\n </div>\n </div>\n <kwikui-button-icon\n [icon]=\"\n index == infoWindowService.getOpenMarker()\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"tileClick()\"\n ></kwikui-button-icon>\n </div>\n <div\n [ngClass]=\"\n index == infoWindowService.getOpenMarker()\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div class=\"customer-tile-secondary-container-address\">\n {{ customer.extras.address }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <kwikui-button-icon\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button-icon>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n label=\"Share Link\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToNextStep({ customer: customer, process: 'share' })\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"!customer.kycComplete\"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToNextStep({ customer: customer, process: 'kyc' })\"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:nowrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-status{border-radius:1.5rem}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-name{font-weight:600;line-height:1rem}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-phone{font-size:.7rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.6rem;grid-gap:.2rem;gap:.2rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-session-id{width:100%;height:100%;line-height:.9rem;text-align:justify}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-address{width:100%;height:100%;line-height:.9rem;text-align:justify}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.8rem;gap:.8rem;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}\n"], components: [{ type: KycSuccessComponent, selector: "svg-kyc-success" }, { type: KycPendingComponent, selector: "svg-kyc-pending" }, { type: i5.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: i5.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
428
+ /** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", taskDetails: "taskDetails" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div class=\"customer-tile-wrapper\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{ customer.user_id }}\n </div>\n <status-pill [status]=\"customer.session_status\"></status-pill>\n </div>\n <kwikui-button-icon\n [icon]=\"\n index == infoWindowService.getOpenMarker()\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"tileClick()\"\n ></kwikui-button-icon>\n </div>\n <div\n [ngClass]=\"\n index == infoWindowService.getOpenMarker()\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <div\n *ngFor=\"let taskData of this.taskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <kwikui-button-icon\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button-icon>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n label=\"Share Link\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToNextStep({ customer: customer, process: 'share' })\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"customer.session_status !== 'complete'\"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToNextStep({ customer: customer, process: 'edit' })\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"customer.session_status == ''\"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToNextStep({ customer: customer, process: 'kyc' })\"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-tile-wrapper{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto;grid-gap:.5rem;gap:.5rem;padding:1rem;border-bottom:.5px solid #ddd}.customer-tile-wrapper .customer-tile-primary-container{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;width:100%;height:100%}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data{padding-left:.2rem;grid-gap:.6rem;gap:.6rem;display:flex;flex-direction:row;flex-wrap:wrap;align-content:stretch;justify-content:space-evenly;align-items:center}.customer-tile-wrapper .customer-tile-primary-container .customer-tile-primary-container-data .customer-tile-primary-container-userid{font-weight:500;font-size:1.1rem;line-height:1rem}.customer-tile-wrapper .customer-tile-secondary-container{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data{padding:.4rem .2rem;display:flex;flex-direction:column;font-size:.7rem;grid-gap:.3rem;gap:.3rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-data .customer-tile-secondary-container-custom-details{width:100%;height:100%;line-height:.9rem}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:nowrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.8rem;gap:.8rem;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-journey-buttons .customer-share-link{font-size:.7rem}.customer-tile-wrapper .data-collasped{display:none}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i4$1.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: i4$1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
574
429
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, decorators: [{
575
430
  type: Component,
576
431
  args: [{
@@ -582,67 +437,110 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
582
437
  type: Input
583
438
  }], index: [{
584
439
  type: Input
440
+ }], taskDetails: [{
441
+ type: Input
585
442
  }], nextStep: [{
586
443
  type: Output
587
444
  }], removeTask: [{
588
445
  type: Output
446
+ }], infoWindow: [{
447
+ type: ViewChild,
448
+ args: [MapInfoWindow]
589
449
  }] } });
590
450
 
591
- class CustomerListComponent {
451
+ class Ng2SearchPipe {
452
+ /**
453
+ * @param items object from array
454
+ * @param term term's search
455
+ * @param excludes array of strings which will ignored during search
456
+ */
457
+ transform(items, term, excludes = []) {
458
+ if (!term || !items)
459
+ return items;
460
+ return Ng2SearchPipe.filter(items, term, excludes);
461
+ }
592
462
  /**
593
- * @description
594
463
  *
595
- * @constructor
464
+ * @param items List of items to filter
465
+ * @param term a string term to compare with every property of the list
466
+ * @param excludes List of keys which will be ignored during search
467
+ *
596
468
  */
597
- constructor(mapService, infoWindowService) {
469
+ static filter(items, term, excludes) {
470
+ const toCompare = term.toLowerCase();
471
+ function checkInside(item, term) {
472
+ if (typeof item === 'string' &&
473
+ item.toString().toLowerCase().includes(toCompare)) {
474
+ return true;
475
+ }
476
+ for (let property in item) {
477
+ if (item[property] === null ||
478
+ item[property] == undefined ||
479
+ excludes.includes(property)) {
480
+ continue;
481
+ }
482
+ if (typeof item[property] === 'object') {
483
+ if (checkInside(item[property], term)) {
484
+ return true;
485
+ }
486
+ }
487
+ else if (item[property].toString().toLowerCase().includes(toCompare)) {
488
+ return true;
489
+ }
490
+ }
491
+ return false;
492
+ }
493
+ return items.filter(function (item) {
494
+ return checkInside(item, term);
495
+ });
496
+ }
497
+ }
498
+ /** @nocollapse */ Ng2SearchPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
499
+ /** @nocollapse */ Ng2SearchPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe, name: "filter", pure: false });
500
+ /** @nocollapse */ Ng2SearchPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe });
501
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe, decorators: [{
502
+ type: Pipe,
503
+ args: [{
504
+ name: 'filter',
505
+ pure: false
506
+ }]
507
+ }, {
508
+ type: Injectable
509
+ }] });
510
+
511
+ class CustomerListComponent {
512
+ constructor(mapService) {
598
513
  this.mapService = mapService;
599
- this.infoWindowService = infoWindowService;
600
- /**
601
- * @description
602
- * Emitter to emit next Step
603
- *
604
- * @emits KwikIDAgentDashboardComponent#nextStep
605
- * @fires KwikIDAgentDashboardComponent#nextStep
606
- */
607
514
  this.nextStep = new EventEmitter();
608
515
  this.removeTask = new EventEmitter();
516
+ this.filterTaskList = new EventEmitter();
609
517
  this.filteredData = [];
610
518
  this.formGroup = new FormGroup({});
611
- this.fromDate = this.getDate();
612
- this.toDate = this.getDate();
613
- this.fromDateFormControl = new FormControl({
614
- value: new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
519
+ this.fromDate = this.getDate(null);
520
+ this.toDate = this.getDate(null);
521
+ this.dateRangeFormControl = new FormControl({
522
+ value: new TuiDayRange(new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
615
523
  disabled: false
616
524
  });
617
- this.formGroup.addControl('fromDate', this.fromDateFormControl);
618
- this.toDateFormControl = new FormControl({
619
- value: new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()),
620
- disabled: false
621
- });
622
- this.formGroup.addControl('toDate', this.toDateFormControl);
525
+ this.formGroup.addControl('dateRange', this.dateRangeFormControl);
526
+ this.searchFormControl = new FormControl('');
527
+ this.formGroup.addControl('search', this.searchFormControl);
623
528
  }
624
- /**
625
- * @description
626
- * To set Google Maps API on script
627
- *
628
- * @ngOnInit
629
- */
630
- ngOnInit() {
631
- this.filteredData = this.getCustomers(this.customers);
529
+ ngOnInit() { }
530
+ ngAfterViewInit() {
531
+ setTimeout(() => __awaiter(this, void 0, void 0, function* () {
532
+ yield this.mapService.initMap();
533
+ this.filteredData = yield this.plotMarkers(this.customers);
534
+ }), 1000);
535
+ }
536
+ ngOnChanges() {
537
+ this.filteredData = this.plotMarkers(this.customers);
632
538
  }
633
- /**
634
- * @description
635
- * Wrapper method to fire click event for next step.
636
- *
637
- * @function goToNextStep
638
- * @func goToNextStep
639
- * @method goToNextStep
640
- */
641
539
  goToNextStep(e) {
642
540
  this.nextStep.emit(e);
643
541
  }
644
- getDate() {
645
- const date = new Date();
542
+ getDate(d) {
543
+ const date = d ? new Date(d) : new Date();
646
544
  const year = date.getFullYear();
647
545
  let month = date.getMonth() + 1;
648
546
  let day = date.getDate();
@@ -653,37 +551,41 @@ class CustomerListComponent {
653
551
  const today = `${year}-${month}-${day}`;
654
552
  return today;
655
553
  }
656
- getCustomers(customers) {
657
- let filterData = customers.filter((customer) => {
658
- let date = customer.date;
659
- return date >= this.fromDate && date <= this.toDate;
554
+ plotMarkers(customers) {
555
+ let directionsResults$ = this.mapService.plotMarkers(customers);
556
+ directionsResults$.subscribe((val) => {
557
+ this.filteredData = this.mapService.sortList(val.routes[0].waypoint_order, customers);
660
558
  });
661
- return filterData;
559
+ return customers;
662
560
  }
663
- onFromDateChange(event) {
664
- let year = event.value.year;
665
- let month = event.value.month + 1;
666
- let date = event.value.day;
561
+ getTuiDate(event) {
562
+ let year = event.year;
563
+ let month = event.month + 1;
564
+ let date = event.day;
667
565
  month = month < 10 ? '0' + month : month;
668
566
  date = date < 10 ? '0' + date : date;
669
- this.fromDate = `${year}-${month}-${date}`;
670
- this.filteredData = this.getCustomers(this.customers);
567
+ return `${year}-${month}-${date}`;
671
568
  }
672
- onToDateChange(event) {
673
- let year = event.value.year;
674
- let month = event.value.month + 1;
675
- let date = event.value.day;
676
- month = month < 10 ? '0' + month : month;
677
- date = date < 10 ? '0' + date : date;
678
- this.toDate = `${year}-${month}-${date}`;
679
- this.filteredData = this.getCustomers(this.customers);
569
+ onDateRangeChange(event) {
570
+ this.fromDate = this.getTuiDate(event.value.from);
571
+ this.toDate = this.getTuiDate(event.value.to);
572
+ this.handleOnFilterTaskList({
573
+ from_date: this.fromDate,
574
+ to_date: this.toDate
575
+ });
576
+ }
577
+ onSearchFilter(event) {
578
+ this.searchText = event.value;
680
579
  }
681
580
  handleOnClickRemoveTask(task) {
682
581
  this.removeTask.emit(task);
683
582
  }
583
+ handleOnFilterTaskList(filter) {
584
+ this.filterTaskList.emit(filter);
585
+ }
684
586
  }
685
- /** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: MapService }, { token: InfoWindowService }], target: i0.ɵɵFactoryTarget.Component });
686
- /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date\n [label]=\"'From Date'\"\n [id]=\"'fromDate'\"\n size=\"m\"\n [formControlName]=\"'fromDate'\"\n [formControl]=\"fromDateFormControl\"\n (getKeyValue)=\"onFromDateChange($event)\"\n ></kwikui-input-date>\n <kwikui-input-date\n [label]=\"'To Date'\"\n [id]=\"'toDate'\"\n size=\"m\"\n [formControlName]=\"'toDate'\"\n [formControl]=\"toDateFormControl\"\n (getKeyValue)=\"onToDateChange($event)\"\n ></kwikui-input-date>\n </div>\n <div class=\"customer-task-list\">\n <div *ngFor=\"let customer of filteredData; let index = index\">\n <customer-tile\n [customer]=\"customer\"\n [index]=\"index\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"customers.length === 0\">\n No Customers Left...\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column;overflow:auto}.customer-list-filter{height:80px;width:100%;display:flex;flex-direction:row;padding:1rem;grid-gap:1rem;gap:1rem;border-bottom:.5px solid #ddd}.customer-list-filter>*{width:100%}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i5.KwikUIInputDateComponent, selector: "kwikui-input-date", inputs: ["label", "id", "formControlName", "formControl", "focus", "invalid", "disabled", "placeholder", "min", "max", "validators", "properties"], outputs: ["getKeyValue"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
587
+ /** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: MapService }], target: i0.ɵɵFactoryTarget.Component });
588
+ /** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", agentConfig: "agentConfig" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n size=\"m\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n\n <kwikui-input\n [label]=\"'Search'\"\n [id]=\"'search'\"\n icon=\"tuiIconSearch\"\n size=\"m\"\n placeholder=\"Search Any Task\"\n [formControlName]=\"'search'\"\n [formControl]=\"searchFormControl\"\n (getKeyValue)=\"onSearchFilter($event)\"\n ></kwikui-input>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport itemSize=\"1\" class=\"customer-task-list-scroll\">\n <div\n *cdkVirtualFor=\"\n let customer of filteredData | filter: searchText;\n index as index\n \"\n >\n <customer-tile\n class=\"example-item\"\n [customer]=\"customer\"\n [taskDetails]=\"agentConfig?.taskDetails\"\n [index]=\"index\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div class=\"customer-list-empty\" *ngIf=\"filteredData.length === 0\">\n No Tasks for the given Date.\n </div>\n</div>\n", styles: [".customer-list-wrapper{width:100%;height:100%;display:flex;flex-direction:column}.customer-list-filter{height:-moz-fit-content;height:fit-content;width:100%;display:flex;flex-direction:column;padding:1rem;grid-gap:.8rem;gap:.8rem;border-bottom:.5px solid #ddd}.customer-list-empty{height:100%;width:100%;margin-top:.5rem;font-size:1rem;text-align:center}.customer-task-list{height:100%}.customer-task-list-scroll{height:100%;width:100%}.cdk-virtual-scroll-spacer{height:0!important}.example-item{height:50px}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i4$1.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["label", "id", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "min", "minLength", "max", "maxLength", "size", "validators", "properties"], outputs: ["getKeyValue"] }, { type: i4$1.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "size", "icon", "properties"], outputs: ["getKeyValue"] }, { type: i3.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "taskDetails"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "filter": Ng2SearchPipe } });
687
589
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, decorators: [{
688
590
  type: Component,
689
591
  args: [{
@@ -691,205 +593,525 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
691
593
  templateUrl: './customer-list.component.html',
692
594
  styleUrls: ['./customer-list.component.css']
693
595
  }]
694
- }], ctorParameters: function () { return [{ type: MapService }, { type: InfoWindowService }]; }, propDecorators: { customers: [{
596
+ }], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
597
+ type: Input
598
+ }], agentConfig: [{
695
599
  type: Input
696
600
  }], nextStep: [{
697
601
  type: Output
698
602
  }], removeTask: [{
699
603
  type: Output
700
- }] } });
701
-
702
- class AddCustomerComponent {
703
- constructor(agentService) {
704
- this.agentService = agentService;
705
- this.newCustomerFormGroup = undefined;
706
- this.addTask = new EventEmitter();
707
- this.newCustomerFormGroup = new FormGroup({
708
- name: new FormControl(''),
709
- phone: new FormControl(''),
710
- address: new FormControl('')
711
- });
712
- }
713
- ngOnInit() { }
714
- handleGetKeyValue(e) {
715
- this.newCustomerFormGroup.patchValue({
716
- [e.key]: e.value
717
- }, { emitEvent: false });
718
- }
719
- handleOnClickAddTask(e) {
720
- let newTask = {};
721
- newTask = {
722
- user_id: String(Math.floor(1000 + Math.random() * 9000)),
723
- date: this.getDate(),
724
- extras: {
725
- name: this.newCustomerFormGroup.controls.name.value,
726
- phone: this.newCustomerFormGroup.controls.phone.value,
727
- address: this.newCustomerFormGroup.controls.address.value,
728
- map: 'https: //www.google.com/maps/place/Westside+-+Borivali,+Mumbai/@19.2288067,72.853972,17z/data=!3m1!5s0x3be7b0d65d0d02dd:0x2bf11ace42a9dad8!4m12!1m6!3m5!1s0x3be7b0d6db21ad03:0xa31af1578987d699!2sBorivali+Station+West!8m2!3d19.2288016!4d72.8561607!3m4!1s0x3be7b12a0f616a41:0x1f4e031b07f5726c!8m2!3d19.2291309!4d72.8523105',
729
- loc: ['19.2288067', '72.853972']
730
- },
731
- kycComplete: false
732
- };
733
- this.addTask.emit(newTask);
734
- this.agentService.setAddTask(false);
735
- }
736
- getDate() {
737
- const date = new Date();
738
- const year = date.getFullYear();
739
- let month = date.getMonth() + 1;
740
- let day = date.getDate();
741
- if (month < 10)
742
- month = '0' + month;
743
- if (day < 10)
744
- day = '0' + day;
745
- const today = `${year}-${month}-${day}`;
746
- return today;
747
- }
748
- }
749
- /** @nocollapse */ AddCustomerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddCustomerComponent, deps: [{ token: AgentService }], target: i0.ɵɵFactoryTarget.Component });
750
- /** @nocollapse */ AddCustomerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AddCustomerComponent, selector: "add-customer", outputs: { addTask: "addTask" }, ngImport: i0, template: "<div class=\"add-customer-container\">\n <div class=\"add-customer-form\">\n <div class=\"add-customer-form-content\" [formGroup]=\"newCustomerFormGroup\">\n <div class=\"add-customer-heading\">Add Task</div>\n <kwikui-input\n type=\"text\"\n label=\"Name\"\n id=\"name\"\n size=\"m\"\n [formControlName]=\"'name'\"\n [formControl]=\"newCustomerFormGroup.controls['name']\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-input\n type=\"text\"\n label=\"Phone\"\n id=\"phone\"\n size=\"m\"\n [formControlName]=\"'phone'\"\n [formControl]=\"newCustomerFormGroup.controls['phone']\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <kwikui-input\n type=\"text\"\n label=\"Address\"\n id=\"address\"\n size=\"m\"\n [formControlName]=\"'address'\"\n [formControl]=\"newCustomerFormGroup.controls['address']\"\n (getKeyValue)=\"handleGetKeyValue($event)\"\n ></kwikui-input>\n <div class=\"add-customer-form-actions\">\n <kwikui-button\n label=\"Cancel\"\n appearance=\"flat\"\n size=\"m\"\n (onClick)=\"agentService.setAddTask(false)\"\n ></kwikui-button>\n <kwikui-button\n label=\"Submit\"\n appearance=\"primary\"\n size=\"m\"\n (onClick)=\"handleOnClickAddTask($event)\"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".add-customer-container{position:absolute;background-color:#0000004d;width:100%;height:100%;display:flex;top:0;right:0;justify-content:center;align-items:center}.add-customer-form{width:75%;height:75%;margin:auto;background-color:#fff;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.add-customer-form-content{display:flex;flex-direction:column;width:100%;height:100%;align-items:stretch;grid-gap:2rem;gap:2rem;padding:2rem}.add-customer-heading{font-size:1.3rem;font-weight:600;padding:1rem 0;border-bottom:1px solid #ddd}.add-customer-form-actions{display:flex;flex-direction:row;align-content:stretch;justify-content:flex-end}\n"], components: [{ type: i5.KwikUIInputComponent, selector: "kwikui-input", inputs: ["label", "id", "type", "formControlName", "formControl", "placeholder", "focus", "invalid", "disabled", "validators", "case", "properties"], outputs: ["getKeyValue"] }, { type: i5.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }], directives: [{ type: i5$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] });
751
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AddCustomerComponent, decorators: [{
752
- type: Component,
753
- args: [{
754
- selector: 'add-customer',
755
- templateUrl: './add-customer.component.html',
756
- styleUrls: ['./add-customer.component.css']
757
- }]
758
- }], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { addTask: [{
604
+ }], filterTaskList: [{
759
605
  type: Output
760
606
  }] } });
761
607
 
762
608
  class KwikIDAgentDashboardComponent {
763
- /**
764
- * @description
765
- *
766
- * @constructor
767
- */
768
- constructor(agentService, mapService, customerService) {
769
- this.agentService = agentService;
609
+ constructor(mapService, httpClient, hostElement, dialogService) {
770
610
  this.mapService = mapService;
771
- this.customerService = customerService;
772
- /**
773
- * @description
774
- * Stores agent Config
775
- *
776
- * @default
777
- * `{}`
778
- */
611
+ this.httpClient = httpClient;
612
+ this.hostElement = hostElement;
613
+ this.dialogService = dialogService;
779
614
  this.agentConfig = {};
780
- /**
781
- * @description
782
- * Stores list of customers
783
- *
784
- * @default
785
- * `[]`
786
- */
787
- this.customers = [];
788
- /**
789
- * @description
790
- * Stores list of customers
791
- *
792
- * @default
793
- * `[]`
794
- */
795
- this.todaysCustomers = [];
796
- /**
797
- * @description
798
- * Emitter to emit next Step
799
- *
800
- * @emits KwikIDAgentDashboardComponent#nextStep
801
- * @fires KwikIDAgentDashboardComponent#nextStep
802
- */
615
+ this.taskList = [];
803
616
  this.nextStep = new EventEmitter();
804
617
  this.addTask = new EventEmitter();
805
618
  this.removeTask = new EventEmitter();
806
- /**
807
- * @description
808
- * Describes whether API Call is in progress or not
809
- *
810
- * @default
811
- * `true`
812
- */
619
+ this.filterTaskList = new EventEmitter();
813
620
  this.loading = true;
814
- /**
815
- * @description
816
- * Describes styling of Map Container
817
- *
818
- * @default
819
- * `object`
820
- */
821
- this.mapStyle = { height: '100%', width: '100%', zIindex: -1 };
822
- }
823
- /**
824
- * @description
825
- * To set Google Maps API on script
826
- *
827
- * @ngOnInit
828
- */
829
- ngOnInit() {
621
+ this.showMapview = true;
622
+ this.isMobileView = false;
623
+ this.listOpen = true;
624
+ this.options = {
625
+ stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
626
+ };
627
+ this.open = false;
628
+ this.formConfig = {
629
+ key: 'ADD_TASK',
630
+ title: 'Add Task',
631
+ fields: [
632
+ {
633
+ key: 'name',
634
+ label: 'Customer Name',
635
+ disabled: false,
636
+ messages: [],
637
+ default: {
638
+ value: {
639
+ is_found: false,
640
+ value: '',
641
+ sources: [
642
+ {
643
+ key: 'OBJECT',
644
+ props: {
645
+ object: {
646
+ key: 'ALL_FORMS_DATA',
647
+ path: '$.ADD_TASK.name'
648
+ }
649
+ },
650
+ value: '',
651
+ validation: {
652
+ is_valid: false,
653
+ triggers: ['ON_INIT'],
654
+ rules: [
655
+ {
656
+ id: '1',
657
+ key: 'VALUE_CHECK',
658
+ props: {
659
+ value: {
660
+ source: {
661
+ key: 'OBJECT',
662
+ props: {
663
+ object: {
664
+ key: 'ALL_FORMS_DATA',
665
+ path: '$.ADD_TASK.name'
666
+ }
667
+ }
668
+ }
669
+ },
670
+ pattern: {
671
+ key: 'IS_NOT_EMPTY'
672
+ }
673
+ }
674
+ }
675
+ ],
676
+ actions: [
677
+ {
678
+ id: '1',
679
+ key: 'SET_FIELD_DEFAULT_VALUE',
680
+ condition: '1',
681
+ props: {
682
+ fieldKey: 'name',
683
+ value: {
684
+ source: {
685
+ key: 'OBJECT',
686
+ props: {
687
+ object: {
688
+ key: 'ALL_FORMS_DATA',
689
+ path: '$.ADD_TASK.name'
690
+ }
691
+ }
692
+ }
693
+ }
694
+ }
695
+ }
696
+ ]
697
+ }
698
+ }
699
+ ]
700
+ }
701
+ },
702
+ validators: {
703
+ required: true
704
+ },
705
+ properties: {
706
+ placeholder: 'Please enter the Customer Name',
707
+ readOnly: false,
708
+ case: 'default'
709
+ },
710
+ type: 'text'
711
+ },
712
+ {
713
+ key: 'phone',
714
+ label: 'Phone Number',
715
+ disabled: false,
716
+ messages: [],
717
+ default: {
718
+ value: {
719
+ is_found: false,
720
+ value: '',
721
+ sources: [
722
+ {
723
+ key: 'OBJECT',
724
+ props: {
725
+ object: {
726
+ key: 'ALL_FORMS_DATA',
727
+ path: '$.ADD_TASK.phone'
728
+ }
729
+ },
730
+ value: '',
731
+ validation: {
732
+ is_valid: false,
733
+ triggers: ['ON_INIT'],
734
+ rules: [
735
+ {
736
+ id: '1',
737
+ key: 'VALUE_CHECK',
738
+ props: {
739
+ value: {
740
+ source: {
741
+ key: 'OBJECT',
742
+ props: {
743
+ object: {
744
+ key: 'ALL_FORMS_DATA',
745
+ path: '$.ADD_TASK.phone'
746
+ }
747
+ }
748
+ }
749
+ },
750
+ pattern: {
751
+ key: 'IS_NOT_EMPTY'
752
+ }
753
+ }
754
+ }
755
+ ],
756
+ actions: [
757
+ {
758
+ id: '1',
759
+ key: 'SET_FIELD_DEFAULT_VALUE',
760
+ condition: '1',
761
+ props: {
762
+ fieldKey: 'phone',
763
+ value: {
764
+ source: {
765
+ key: 'OBJECT',
766
+ props: {
767
+ object: {
768
+ key: 'ALL_FORMS_DATA',
769
+ path: '$.ADD_TASK.phone'
770
+ }
771
+ }
772
+ }
773
+ }
774
+ }
775
+ }
776
+ ]
777
+ }
778
+ }
779
+ ]
780
+ }
781
+ },
782
+ validators: {
783
+ required: true
784
+ },
785
+ properties: {
786
+ placeholder: 'Please enter the Phone Number',
787
+ readOnly: false,
788
+ case: 'default'
789
+ },
790
+ type: 'number'
791
+ },
792
+ {
793
+ key: 'address',
794
+ label: 'Address',
795
+ disabled: false,
796
+ messages: [],
797
+ default: {
798
+ value: {
799
+ is_found: false,
800
+ value: '',
801
+ sources: [
802
+ {
803
+ key: 'OBJECT',
804
+ props: {
805
+ object: {
806
+ key: 'ALL_FORMS_DATA',
807
+ path: '$.ADD_TASK.address'
808
+ }
809
+ },
810
+ value: '',
811
+ validation: {
812
+ is_valid: false,
813
+ triggers: ['ON_INIT'],
814
+ rules: [
815
+ {
816
+ id: '1',
817
+ key: 'VALUE_CHECK',
818
+ props: {
819
+ value: {
820
+ source: {
821
+ key: 'OBJECT',
822
+ props: {
823
+ object: {
824
+ key: 'ALL_FORMS_DATA',
825
+ path: '$.ADD_TASK.address'
826
+ }
827
+ }
828
+ }
829
+ },
830
+ pattern: {
831
+ key: 'IS_NOT_EMPTY'
832
+ }
833
+ }
834
+ }
835
+ ],
836
+ actions: [
837
+ {
838
+ id: '1',
839
+ key: 'SET_FIELD_DEFAULT_VALUE',
840
+ condition: '1',
841
+ props: {
842
+ fieldKey: 'address',
843
+ value: {
844
+ source: {
845
+ key: 'OBJECT',
846
+ props: {
847
+ object: {
848
+ key: 'ALL_FORMS_DATA',
849
+ path: '$.ADD_TASK.address'
850
+ }
851
+ }
852
+ }
853
+ }
854
+ }
855
+ }
856
+ ]
857
+ }
858
+ }
859
+ ]
860
+ }
861
+ },
862
+ validators: {
863
+ required: true
864
+ },
865
+ properties: {
866
+ placeholder: 'Please enter the Address',
867
+ readOnly: false,
868
+ case: 'default'
869
+ },
870
+ type: 'text'
871
+ },
872
+ {
873
+ key: 'city',
874
+ label: 'City',
875
+ disabled: false,
876
+ messages: [],
877
+ default: {
878
+ value: {
879
+ is_found: false,
880
+ value: '',
881
+ sources: [
882
+ {
883
+ key: 'OBJECT',
884
+ props: {
885
+ object: {
886
+ key: 'ALL_FORMS_DATA',
887
+ path: '$.ADD_TASK.city'
888
+ }
889
+ },
890
+ value: '',
891
+ validation: {
892
+ is_valid: false,
893
+ triggers: ['ON_INIT'],
894
+ rules: [
895
+ {
896
+ id: '1',
897
+ key: 'VALUE_CHECK',
898
+ props: {
899
+ value: {
900
+ source: {
901
+ key: 'OBJECT',
902
+ props: {
903
+ object: {
904
+ key: 'ALL_FORMS_DATA',
905
+ path: '$.ADD_TASK.city'
906
+ }
907
+ }
908
+ }
909
+ },
910
+ pattern: {
911
+ key: 'IS_NOT_EMPTY'
912
+ }
913
+ }
914
+ }
915
+ ],
916
+ actions: [
917
+ {
918
+ id: '1',
919
+ key: 'SET_FIELD_DEFAULT_VALUE',
920
+ condition: '1',
921
+ props: {
922
+ fieldKey: 'city',
923
+ value: {
924
+ source: {
925
+ key: 'OBJECT',
926
+ props: {
927
+ object: {
928
+ key: 'ALL_FORMS_DATA',
929
+ path: '$.ADD_TASK.city'
930
+ }
931
+ }
932
+ }
933
+ }
934
+ }
935
+ }
936
+ ]
937
+ }
938
+ }
939
+ ]
940
+ }
941
+ },
942
+ validators: {
943
+ required: true
944
+ },
945
+ properties: {
946
+ placeholder: 'Please enter the City',
947
+ readOnly: false,
948
+ case: 'default'
949
+ },
950
+ type: 'text'
951
+ },
952
+ {
953
+ key: 'location',
954
+ label: 'Location URL',
955
+ disabled: false,
956
+ messages: [],
957
+ default: {
958
+ value: {
959
+ is_found: false,
960
+ value: '',
961
+ sources: [
962
+ {
963
+ key: 'OBJECT',
964
+ props: {
965
+ object: {
966
+ key: 'ALL_FORMS_DATA',
967
+ path: '$.ADD_TASK.location'
968
+ }
969
+ },
970
+ value: '',
971
+ validation: {
972
+ is_valid: false,
973
+ triggers: ['ON_INIT'],
974
+ rules: [
975
+ {
976
+ id: '1',
977
+ key: 'VALUE_CHECK',
978
+ props: {
979
+ value: {
980
+ source: {
981
+ key: 'OBJECT',
982
+ props: {
983
+ object: {
984
+ key: 'ALL_FORMS_DATA',
985
+ path: '$.ADD_TASK.location'
986
+ }
987
+ }
988
+ }
989
+ },
990
+ pattern: {
991
+ key: 'IS_NOT_EMPTY'
992
+ }
993
+ }
994
+ }
995
+ ],
996
+ actions: [
997
+ {
998
+ id: '1',
999
+ key: 'SET_FIELD_DEFAULT_VALUE',
1000
+ condition: '1',
1001
+ props: {
1002
+ fieldKey: 'location',
1003
+ value: {
1004
+ source: {
1005
+ key: 'OBJECT',
1006
+ props: {
1007
+ object: {
1008
+ key: 'ALL_FORMS_DATA',
1009
+ path: '$.ADD_TASK.location'
1010
+ }
1011
+ }
1012
+ }
1013
+ }
1014
+ }
1015
+ }
1016
+ ]
1017
+ }
1018
+ }
1019
+ ]
1020
+ }
1021
+ },
1022
+ validators: {
1023
+ required: true
1024
+ },
1025
+ properties: {
1026
+ placeholder: 'Please enter the Location URL',
1027
+ readOnly: false,
1028
+ case: 'default'
1029
+ },
1030
+ type: 'text'
1031
+ }
1032
+ ],
1033
+ properties: {
1034
+ header: {
1035
+ title: {
1036
+ hidden: true,
1037
+ label: 'Add Task'
1038
+ },
1039
+ steps: {
1040
+ hidden: true
1041
+ }
1042
+ },
1043
+ footer: {
1044
+ viewFormsButton: {
1045
+ hidden: true,
1046
+ label: 'View Forms'
1047
+ },
1048
+ saveButton: {
1049
+ hidden: false,
1050
+ label: 'Submit'
1051
+ }
1052
+ }
1053
+ }
1054
+ };
1055
+ this.allFormsData = {};
1056
+ this.String = String;
830
1057
  const DSLScript = document.createElement('script');
831
1058
  DSLScript.src = this.agentConfig.googleMapsAPI;
832
1059
  DSLScript.type = 'text/javascript';
833
1060
  document.body.appendChild(DSLScript);
834
- this.loading = false;
835
- this.agentService.setAgentConfig(this.agentConfig);
836
- this.customerService.setCustomers(this.customers);
837
- this.todaysCustomers = this.customers.filter((customer) => customer.date == this.getDate());
1061
+ this.apiLoaded = httpClient
1062
+ .jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
1063
+ .pipe(map(() => true), catchError(() => of(false)));
1064
+ }
1065
+ ngOnInit() {
838
1066
  this.agentConfig.showMaps == true || this.agentConfig.showMaps == false
839
- ? this.agentService.setMapview(this.agentConfig.showMaps)
1067
+ ? (this.showMapview = this.agentConfig.showMaps)
840
1068
  : null;
1069
+ this.loading = false;
841
1070
  }
842
- /**
843
- * @description
844
- *
845
- * @ngAfterViewInit
846
- */
847
- ngAfterViewInit() {
848
- setTimeout(() => __awaiter(this, void 0, void 0, function* () {
849
- yield this.mapService.initMap(this.mapElement);
850
- this.todaysCustomers = yield this.mapService.plotMarkers(this.todaysCustomers);
851
- }), 1000);
852
- }
853
- /**
854
- * @description
855
- * Wrapper method to fire click event for next step.
856
- *
857
- * @function goToNextStep
858
- * @func goToNextStep
859
- * @method goToNextStep
860
- */
861
1071
  goToNextStep(e) {
862
1072
  this.nextStep.emit(e);
863
1073
  }
864
- /**
865
- * @description
866
- * Wrapper method to fire click event for next step.
867
- *
868
- * @function getDate
869
- * @func getDate
870
- * @method getDate
871
- */
872
- getDate() {
873
- const date = new Date();
874
- const year = date.getFullYear();
875
- let month = date.getMonth() + 1;
876
- let day = date.getDate();
877
- if (month < 10)
878
- month = '0' + month;
879
- if (day < 10)
880
- day = '0' + day;
881
- const today = `${year}-${month}-${day}`;
882
- return today;
883
- }
884
1074
  handleOnClickAddTask(task) {
885
1075
  this.addTask.emit(task);
886
1076
  }
887
1077
  handleOnClickRemoveTask(task) {
888
1078
  this.removeTask.emit(task);
889
1079
  }
1080
+ handleOnFilterTaskList(filter) {
1081
+ this.filterTaskList.emit(filter);
1082
+ }
1083
+ refresh() {
1084
+ window.location.reload();
1085
+ }
1086
+ toggleMapview() {
1087
+ this.showMapview = !this.showMapview;
1088
+ }
1089
+ onClick() {
1090
+ this.open = !this.open;
1091
+ }
1092
+ onObscured(obscured) {
1093
+ if (obscured) {
1094
+ this.open = false;
1095
+ }
1096
+ }
1097
+ onActiveZone(active) {
1098
+ this.open = active && this.open;
1099
+ }
1100
+ showDialog(content) {
1101
+ this.dialogService
1102
+ .open(content, { closeable: false, dismissible: false })
1103
+ .subscribe();
1104
+ }
1105
+ openInfoWindow(marker) {
1106
+ this.infoWindow.open(marker);
1107
+ }
1108
+ handleOnClickSaveForm(e) {
1109
+ this.handleOnClickAddTask(e.data);
1110
+ }
1111
+ handleOnClickViewForms(e) { }
890
1112
  }
891
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: AgentService }, { token: MapService }, { token: CustomerService }], target: i0.ɵɵFactoryTarget.Component });
892
- /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentConfig: "agentConfig", customers: "customers", todaysCustomers: "todaysCustomers" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask" }, viewQueries: [{ propertyName: "mapElement", first: true, predicate: ["mapElement"], descendants: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\">\n <div ngClass=\"page-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n </div>\n <div class=\"wrapper\">\n <div class=\"dashboard-header\">\n <div class=\"dashboard-header-client-name\">\n <kwikui-button-icon\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button-icon>\n\n {{ agentConfig.clientName }}\n </div>\n <div *ngIf=\"agentService.getMenu()\">\n <menu\n (close)=\"agentService.setMenu(false)\"\n (nextStep)=\"goToNextStep($event)\"\n ></menu>\n </div>\n <kwikui-button-icon\n [icon]=\"'tuiIconMoreVertical'\"\n (onClick)=\"agentService.toggleMenu()\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button-icon>\n </div>\n\n <div class=\"dashboard-body\">\n <div\n [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\"\n #mapElement\n ></div>\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"customers\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n <div *ngIf=\"agentService.getAddTask()\">\n <add-customer (addTask)=\"handleOnClickAddTask($event)\"></add-customer>\n </div>\n</div>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid lightgray;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:center;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:300px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.page-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.page-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.page-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.page-loader .t-loader{display:none!important}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i5.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: MenuComponent, selector: "menu", outputs: ["nextStep"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers"], outputs: ["nextStep", "removeTask"] }, { type: AddCustomerComponent, selector: "add-customer", outputs: ["addTask"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
1113
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: i2.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
1114
+ /** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentConfig: "agentConfig", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }], ngImport: i0, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <div class=\"dashboard-header\">\n <div class=\"dashboard-header-client-name\">\n <kwikui-button-icon\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button-icon>\n\n {{ agentConfig.clientName }}\n </div>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button-icon\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"m\"\n [tuiDropdown]=\"dropdownContent\"\n [tuiDropdownManual]=\"open\"\n (tuiObscured)=\"onObscured($event)\"\n ></kwikui-button-icon>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <h2>{{ agentConfig.agentName }}</h2>\n <h4>Agent ID:{{ agentConfig.agentId }}</h4>\n </div>\n <hr />\n <div\n class=\"menu-dropdown-body\"\n tuiGroup\n [collapsed]=\"true\"\n [rounded]=\"false\"\n [orientation]=\"'vertical'\"\n [size]=\"'m'\"\n >\n <kwikui-button\n *ngIf=\"this.agentConfig.showMaps\"\n id=\"\"\n label=\"{{ showMapview ? 'Hide Maps' : 'Show Maps' }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{ showMapview ? 'tuiIconEyeOff' : 'tuiIconEye' }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"toggleMapview()\"\n ></kwikui-button>\n <kwikui-button\n id=\"\"\n label=\"Add Task\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconAddRowLarge'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n <kwikui-button\n id=\"\"\n label=\"Refresh\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconRefreshCw'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n </div>\n <hr />\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"goToNextStep('logout')\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n\n <div class=\"dashboard-body\">\n <div\n *ngIf=\"apiLoaded | async\"\n [class]=\"showMapview ? 'map' : 'map-hidden'\"\n >\n <google-map height=\"100%\" width=\"100%\" [options]=\"this.mapService.map\">\n <map-marker\n #marker=\"mapMarker\"\n *ngFor=\"\n let markerPosition of this.mapService.markers;\n let index = index\n \"\n [position]=\"markerPosition\"\n [label]=\"{ text: String(index), color: '#FFF' }\"\n (mapClick)=\"openInfoWindow(marker)\"\n ></map-marker>\n <map-directions-renderer\n *ngIf=\"\n this.mapService.directionsResults$ | async as directionsResults\n \"\n [directions]=\"directionsResults\"\n [options]=\"this.mapService.directionsRenderOption\"\n ></map-directions-renderer>\n <map-info-window>Info Window content</map-info-window>\n </google-map>\n </div>\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n<div class=\"kwikid-agent-dashboard-loader\" *ngIf=\"loading\">\n <span class=\"loader\"></span>\n</div>\n\n<ng-template #template let-observer>\n <div class=\"add-task-header\">\n <h2>Add Task</h2>\n <kwikui-button-icon\n icon=\"tuiIconX\"\n id=\"\"\n label=\"Close\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button-icon>\n </div>\n <kwikid-form-view\n [formConfig]=\"formConfig\"\n [allFormsData]=\"allFormsData\"\n [isMobileView]=\"true\"\n (onClickViewForms)=\"this.handleOnClickViewForms($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event)\"\n ></kwikid-form-view>\n</ng-template>\n", styles: [".kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%;position:relative}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:column;align-content:center;justify-content:center;align-items:stretch;flex:1;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{width:100%;height:100%;background-color:#fafafa;overflow:hidden}@media screen and (min-width: 600px){.kwikid-agent-dashboard{display:flex;flex-direction:column;justify-content:flex-start;align-items:stretch;align-content:center;width:100%;height:100%}.kwikid-agent-dashboard .wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-content:center;justify-content:space-between;align-items:stretch}.kwikid-agent-dashboard .wrapper .dashboard-header{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;grid-column-gap:1rem;column-gap:1rem;padding:.2rem;max-height:max-content;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper .dashboard-header .dashboard-header-client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;font-weight:600}.kwikid-agent-dashboard .wrapper .dashboard-body{display:flex;flex-direction:row-reverse;align-content:center;justify-content:center;align-items:stretch;padding:1.5rem;grid-gap:1.5rem;gap:1.5rem;overflow:auto;background-color:#fafafa}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}.kwikid-agent-dashboard .wrapper .dashboard-body .map-hidden{visibility:collapse}.kwikid-agent-dashboard .wrapper .dashboard-body .customer-list{min-width:300px;max-width:400px;width:100%;height:100%;overflow:hidden;box-shadow:#0000001a 0 4px 6px -1px,#0000000f 0 2px 4px -1px;border-radius:.5rem}}.menu{position:absolute;transition:\"0.15s linear 0s\"}.kwikid-agent-dashboard-loader{position:absolute;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.75);display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;z-index:100}.kwikid-agent-dashboard-loader .loader{width:48px;height:48px;border-radius:50%;display:inline-block;position:relative;border:3px solid;border-color:#fff #fff transparent;box-sizing:border-box;animation:rotation 1s linear infinite}.kwikid-agent-dashboard-loader .loader:after{content:\"\";box-sizing:border-box;position:absolute;left:0;right:0;top:0;bottom:0;margin:auto;border:3px solid;border-color:transparent var(--tui-primary) var(--tui-primary);width:24px;height:24px;border-radius:50%;animation:rotationBack .5s linear infinite;transform-origin:center center}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes rotationBack{0%{transform:rotate(0)}to{transform:rotate(-360deg)}}.kwikid-agent-dashboard-loader .t-loader{display:none!important}.add-task-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:.5rem 0 1rem 1rem}:host{width:100%;height:100%}::-webkit-scrollbar{width:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}.menu-dropdown{display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;grid-gap:.5rem;gap:.5rem;padding:1rem 1.5rem}.menu-dropdown .menu-dropdown-header{display:flex;flex-direction:column;align-content:flex-start;justify-content:space-between;align-items:flex-start;grid-gap:1rem;gap:1rem}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i4$1.KwikUIButtonIconComponent, selector: "kwikui-button-icon", inputs: ["disabled", "id", "showLoader", "styles", "class", "type", "appearance", "icon", "shape", "size"], outputs: ["onClick"] }, { type: i4$1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["disabled", "id", "label", "showLoader", "styles", "class", "type", "appearance", "icon", "iconRight", "shape", "size"], outputs: ["onClick"] }, { type: i4.GoogleMap, selector: "google-map", inputs: ["height", "width", "center", "zoom", "options", "mapTypeId"], outputs: ["authFailure", "boundsChanged", "centerChanged", "mapClick", "mapDblclick", "mapDrag", "mapDragend", "mapDragstart", "headingChanged", "idle", "maptypeidChanged", "mapMousemove", "mapMouseout", "mapMouseover", "projectionChanged", "mapRightclick", "tilesloaded", "tiltChanged", "zoomChanged"], exportAs: ["googleMap"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "agentConfig"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i6.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["formConfig", "formData", "isMobileView", "allFormsData"], outputs: ["onClickViewForms", "onClickSaveForm", "onClickApiCall"] }], directives: [{ type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i8.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i9.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i9.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i9.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i9.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i9.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i4.MapMarker, selector: "map-marker", inputs: ["title", "position", "label", "clickable", "options", "icon", "visible"], outputs: ["animationChanged", "mapClick", "clickableChanged", "cursorChanged", "mapDblclick", "mapDrag", "mapDragend", "draggableChanged", "mapDragstart", "flatChanged", "iconChanged", "mapMousedown", "mapMouseout", "mapMouseover", "mapMouseup", "positionChanged", "mapRightclick", "shapeChanged", "titleChanged", "visibleChanged", "zindexChanged"], exportAs: ["mapMarker"] }, { type: i4.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i4.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i5.AsyncPipe } });
893
1115
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, decorators: [{
894
1116
  type: Component,
895
1117
  args: [{
@@ -897,11 +1119,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
897
1119
  templateUrl: './kwikid-agent-dashboard.component.html',
898
1120
  styleUrls: ['./kwikid-agent-dashboard.component.scss']
899
1121
  }]
900
- }], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }, { type: CustomerService }]; }, propDecorators: { agentConfig: [{
901
- type: Input
902
- }], customers: [{
1122
+ }], ctorParameters: function () { return [{ type: MapService }, { type: i2.HttpClient }, { type: i0.ElementRef }, { type: i9.TuiDialogService, decorators: [{
1123
+ type: Inject,
1124
+ args: [TuiDialogService]
1125
+ }] }]; }, propDecorators: { agentConfig: [{
903
1126
  type: Input
904
- }], todaysCustomers: [{
1127
+ }], taskList: [{
905
1128
  type: Input
906
1129
  }], nextStep: [{
907
1130
  type: Output
@@ -909,9 +1132,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
909
1132
  type: Output
910
1133
  }], removeTask: [{
911
1134
  type: Output
912
- }], mapElement: [{
1135
+ }], filterTaskList: [{
1136
+ type: Output
1137
+ }], infoWindow: [{
913
1138
  type: ViewChild,
914
- args: ['mapElement']
1139
+ args: [MapInfoWindow, { static: false }]
915
1140
  }] } });
916
1141
 
917
1142
  class KwikIDAgentDashboardModule {
@@ -920,38 +1145,56 @@ class KwikIDAgentDashboardModule {
920
1145
  /** @nocollapse */ KwikIDAgentDashboardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, declarations: [KwikIDAgentDashboardComponent,
921
1146
  CustomerListComponent,
922
1147
  CustomerTileComponent,
923
- MenuComponent,
924
- KycSuccessComponent,
925
- KycPendingComponent,
926
- AddCustomerComponent], imports: [CommonModule,
1148
+ Ng2SearchPipe,
1149
+ StatusPillComponent], imports: [CommonModule,
927
1150
  HttpClientModule,
928
1151
  FormsModule,
929
1152
  ReactiveFormsModule,
930
- RouterTestingModule,
931
1153
  KwikUIButtonModule,
932
1154
  KwikUIButtonIconModule,
933
1155
  KwikUIInputModule,
934
1156
  KwikUIInputDateModule,
1157
+ KwikUIInputDateRangeModule,
935
1158
  KwikUISelectComboboxModule,
936
1159
  KwikUITableModule,
937
1160
  KwikUITablePaginationModule,
1161
+ KwikIDFormViewModule,
1162
+ TuiRootModule,
1163
+ TuiDialogModule,
1164
+ TuiDropdownModule,
938
1165
  TuiSidebarModule,
939
- TuiActiveZoneModule], exports: [KwikIDAgentDashboardComponent] });
1166
+ TuiActiveZoneModule,
1167
+ TuiGroupModule,
1168
+ TuiSvgModule,
1169
+ ScrollingModule,
1170
+ GoogleMapsModule,
1171
+ HttpClientModule,
1172
+ HttpClientJsonpModule], exports: [KwikIDAgentDashboardComponent] });
940
1173
  /** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, imports: [[
941
1174
  CommonModule,
942
1175
  HttpClientModule,
943
1176
  FormsModule,
944
1177
  ReactiveFormsModule,
945
- RouterTestingModule,
946
1178
  KwikUIButtonModule,
947
1179
  KwikUIButtonIconModule,
948
1180
  KwikUIInputModule,
949
1181
  KwikUIInputDateModule,
1182
+ KwikUIInputDateRangeModule,
950
1183
  KwikUISelectComboboxModule,
951
1184
  KwikUITableModule,
952
1185
  KwikUITablePaginationModule,
1186
+ KwikIDFormViewModule,
1187
+ TuiRootModule,
1188
+ TuiDialogModule,
1189
+ TuiDropdownModule,
953
1190
  TuiSidebarModule,
954
1191
  TuiActiveZoneModule,
1192
+ TuiGroupModule,
1193
+ TuiSvgModule,
1194
+ ScrollingModule,
1195
+ GoogleMapsModule,
1196
+ HttpClientModule,
1197
+ HttpClientJsonpModule
955
1198
  ]] });
956
1199
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, decorators: [{
957
1200
  type: NgModule,
@@ -960,28 +1203,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
960
1203
  KwikIDAgentDashboardComponent,
961
1204
  CustomerListComponent,
962
1205
  CustomerTileComponent,
963
- MenuComponent,
964
- KycSuccessComponent,
965
- KycPendingComponent,
966
- AddCustomerComponent,
1206
+ Ng2SearchPipe,
1207
+ StatusPillComponent
967
1208
  ],
968
1209
  imports: [
969
1210
  CommonModule,
970
1211
  HttpClientModule,
971
1212
  FormsModule,
972
1213
  ReactiveFormsModule,
973
- RouterTestingModule,
974
1214
  KwikUIButtonModule,
975
1215
  KwikUIButtonIconModule,
976
1216
  KwikUIInputModule,
977
1217
  KwikUIInputDateModule,
1218
+ KwikUIInputDateRangeModule,
978
1219
  KwikUISelectComboboxModule,
979
1220
  KwikUITableModule,
980
1221
  KwikUITablePaginationModule,
1222
+ KwikIDFormViewModule,
1223
+ TuiRootModule,
1224
+ TuiDialogModule,
1225
+ TuiDropdownModule,
981
1226
  TuiSidebarModule,
982
1227
  TuiActiveZoneModule,
1228
+ TuiGroupModule,
1229
+ TuiSvgModule,
1230
+ ScrollingModule,
1231
+ GoogleMapsModule,
1232
+ HttpClientModule,
1233
+ HttpClientJsonpModule
983
1234
  ],
984
- exports: [KwikIDAgentDashboardComponent],
1235
+ exports: [KwikIDAgentDashboardComponent]
985
1236
  }]
986
1237
  }] });
987
1238