kwikid-agent-dashboard 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kwikid-agent-dashboard.umd.js +411 -812
- package/bundles/kwikid-agent-dashboard.umd.js.map +1 -1
- package/esm2015/lib/components/customer-details/customer-details.component.js +27 -14
- package/esm2015/lib/components/customer-list/customer-list.component.js +21 -20
- package/esm2015/lib/components/customer-tile/customer-tile.component.js +22 -85
- package/esm2015/lib/kwikid-agent-dashboard.component.js +26 -32
- package/esm2015/lib/services/agent.service.js +118 -0
- package/esm2015/lib/services/map.service.js +214 -61
- package/fesm2015/kwikid-agent-dashboard.js +336 -754
- package/fesm2015/kwikid-agent-dashboard.js.map +1 -1
- package/lib/components/customer-details/customer-details.component.d.ts +9 -6
- package/lib/components/customer-list/customer-list.component.d.ts +5 -5
- package/lib/components/customer-tile/customer-tile.component.d.ts +6 -52
- package/lib/kwikid-agent-dashboard.component.d.ts +8 -10
- package/lib/services/agent.service.d.ts +70 -0
- package/lib/services/map.service.d.ts +29 -13
- package/package.json +3 -1
- package/esm2015/lib/services/info-window.service.js +0 -185
- package/esm2015/lib/services/user.service.js +0 -453
- package/lib/services/info-window.service.d.ts +0 -98
- package/lib/services/user.service.d.ts +0 -192
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.
|
|
5
|
-
})(this, (function (exports, i0,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('leaflet'), require('leaflet-routing-machine'), require('kwikid-toolkit'), require('@angular/common/http'), require('kwikui'), require('@angular/common'), require('@angular/forms'), require('@taiga-ui/cdk'), require('@angular/cdk/scrolling'), require('kwikid-forms'), require('@taiga-ui/addon-mobile')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'leaflet', 'leaflet-routing-machine', 'kwikid-toolkit', '@angular/common/http', 'kwikui', '@angular/common', '@angular/forms', '@taiga-ui/cdk', '@angular/cdk/scrolling', 'kwikid-forms', '@taiga-ui/addon-mobile'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.L, null, global.kwikidToolkit, global.ng.common.http, global.i2, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i7, global["@taiga-ui/addon-mobile"]));
|
|
5
|
+
})(this, (function (exports, i0, googleMaps, i10, L, leafletRoutingMachine, kwikidToolkit, i3$1, i2, i5, i5$1, i9, i3, i7, addonMobile) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
26
|
-
var
|
|
27
|
-
var
|
|
26
|
+
var i10__namespace = /*#__PURE__*/_interopNamespace(i10);
|
|
27
|
+
var L__namespace = /*#__PURE__*/_interopNamespace(L);
|
|
28
28
|
var i3__namespace$1 = /*#__PURE__*/_interopNamespace(i3$1);
|
|
29
29
|
var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
|
|
30
|
-
var
|
|
30
|
+
var i5__namespace = /*#__PURE__*/_interopNamespace(i5);
|
|
31
31
|
var i5__namespace$1 = /*#__PURE__*/_interopNamespace(i5$1);
|
|
32
|
-
var
|
|
32
|
+
var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
|
|
33
33
|
var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
|
|
34
|
-
var
|
|
34
|
+
var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
|
|
35
35
|
|
|
36
36
|
/******************************************************************************
|
|
37
37
|
Copyright (c) Microsoft Corporation.
|
|
@@ -497,190 +497,17 @@
|
|
|
497
497
|
__disposeResources: __disposeResources,
|
|
498
498
|
};
|
|
499
499
|
|
|
500
|
-
var
|
|
501
|
-
function
|
|
502
|
-
this.mapDirectionsService = mapDirectionsService;
|
|
503
|
-
this.markers = [];
|
|
504
|
-
this.directionsRenderOption = {};
|
|
505
|
-
}
|
|
506
|
-
MapService.prototype.getMarkers = function () {
|
|
507
|
-
return this.markers;
|
|
508
|
-
};
|
|
509
|
-
MapService.prototype.setMarkers = function (markers) {
|
|
510
|
-
this.markers = markers;
|
|
511
|
-
};
|
|
512
|
-
MapService.prototype.initMap = function () {
|
|
513
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
514
|
-
var _a;
|
|
515
|
-
return __generator(this, function (_b) {
|
|
516
|
-
switch (_b.label) {
|
|
517
|
-
case 0:
|
|
518
|
-
_a = this;
|
|
519
|
-
return [4 /*yield*/, this.getPosition()];
|
|
520
|
-
case 1:
|
|
521
|
-
_a.myPosition = _b.sent();
|
|
522
|
-
this.map = {
|
|
523
|
-
zoom: 10,
|
|
524
|
-
center: this.myPosition,
|
|
525
|
-
streetViewControl: false,
|
|
526
|
-
mapTypeControl: false,
|
|
527
|
-
fullscreenControl: false,
|
|
528
|
-
zoomControl: false
|
|
529
|
-
};
|
|
530
|
-
return [2 /*return*/];
|
|
531
|
-
}
|
|
532
|
-
});
|
|
533
|
-
});
|
|
534
|
-
};
|
|
535
|
-
MapService.prototype.plotMarkers = function (customers) {
|
|
536
|
-
var _this = this;
|
|
537
|
-
this.markers = [];
|
|
538
|
-
var path = [];
|
|
539
|
-
this.markers.push(this.myPosition);
|
|
540
|
-
var request = {
|
|
541
|
-
origin: this.myPosition,
|
|
542
|
-
destination: this.myPosition,
|
|
543
|
-
waypoints: path,
|
|
544
|
-
optimizeWaypoints: true,
|
|
545
|
-
travelMode: google.maps.TravelMode.DRIVING
|
|
546
|
-
};
|
|
547
|
-
this.directionsRenderOption = {
|
|
548
|
-
suppressMarkers: true
|
|
549
|
-
};
|
|
550
|
-
this.directionsResults$ = this.mapDirectionsService
|
|
551
|
-
.route(request)
|
|
552
|
-
.pipe(operators.map(function (response) { return response.result; }));
|
|
553
|
-
this.directionsResults$.subscribe(function (val) {
|
|
554
|
-
customers = _this.sortList(val.routes[0].waypoint_order, customers);
|
|
555
|
-
customers.map(function (customer) {
|
|
556
|
-
path.push({
|
|
557
|
-
location: _this.getLatLng(customer.task_details.customer_details.location),
|
|
558
|
-
stopover: true
|
|
559
|
-
});
|
|
560
|
-
_this.markers.push(_this.getLatLng(customer.task_details.customer_details.location));
|
|
561
|
-
});
|
|
562
|
-
});
|
|
563
|
-
return this.directionsResults$;
|
|
564
|
-
};
|
|
565
|
-
MapService.prototype.getPosition = function () {
|
|
566
|
-
return new Promise(function (resolve, reject) {
|
|
567
|
-
navigator.geolocation.watchPosition(function (resp) {
|
|
568
|
-
resolve({
|
|
569
|
-
lng: resp.coords.longitude,
|
|
570
|
-
lat: resp.coords.latitude
|
|
571
|
-
});
|
|
572
|
-
}, function (err) {
|
|
573
|
-
reject(err);
|
|
574
|
-
});
|
|
575
|
-
});
|
|
576
|
-
};
|
|
577
|
-
MapService.prototype.getLatLng = function (data) {
|
|
578
|
-
var url = data.split('@');
|
|
579
|
-
var lat_long_match = url[1].split(',');
|
|
580
|
-
var lat = Number(lat_long_match[0]);
|
|
581
|
-
var long = Number(lat_long_match[1]);
|
|
582
|
-
return { lat: lat, lng: long };
|
|
583
|
-
};
|
|
584
|
-
MapService.prototype.sortList = function (order, customersData) {
|
|
585
|
-
var c = [];
|
|
586
|
-
for (var i = 0; i < customersData.length; i++) {
|
|
587
|
-
var customer = customersData[order[i]];
|
|
588
|
-
c.push(customer);
|
|
589
|
-
}
|
|
590
|
-
return c;
|
|
591
|
-
};
|
|
592
|
-
return MapService;
|
|
593
|
-
}());
|
|
594
|
-
/** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: i5__namespace.MapDirectionsService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
595
|
-
/** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
|
|
596
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
|
|
597
|
-
type: i0.Injectable,
|
|
598
|
-
args: [{
|
|
599
|
-
providedIn: 'root'
|
|
600
|
-
}]
|
|
601
|
-
}], ctorParameters: function () { return [{ type: i5__namespace.MapDirectionsService }]; }, propDecorators: { directionsRenders: [{
|
|
602
|
-
type: i0.ViewChildren,
|
|
603
|
-
args: ['directionsRender']
|
|
604
|
-
}] } });
|
|
605
|
-
|
|
606
|
-
var UserService = /** @class */ (function () {
|
|
607
|
-
function UserService() {
|
|
500
|
+
var AgentService = /** @class */ (function () {
|
|
501
|
+
function AgentService() {
|
|
608
502
|
this.isListOpen = true;
|
|
609
503
|
this.showMapview = false;
|
|
610
|
-
this.
|
|
504
|
+
this.addTaskForm = {
|
|
611
505
|
key: 'ADD_TASK',
|
|
612
506
|
title: 'Add Task',
|
|
613
507
|
fields: [
|
|
614
508
|
{
|
|
615
509
|
key: 'name',
|
|
616
510
|
label: 'Customer Name',
|
|
617
|
-
disabled: false,
|
|
618
|
-
messages: [],
|
|
619
|
-
default: {
|
|
620
|
-
value: {
|
|
621
|
-
is_found: false,
|
|
622
|
-
value: '',
|
|
623
|
-
sources: [
|
|
624
|
-
{
|
|
625
|
-
key: 'OBJECT',
|
|
626
|
-
props: {
|
|
627
|
-
object: {
|
|
628
|
-
key: 'ALL_FORMS_DATA',
|
|
629
|
-
path: '$.ADD_TASK.name'
|
|
630
|
-
}
|
|
631
|
-
},
|
|
632
|
-
value: '',
|
|
633
|
-
validation: {
|
|
634
|
-
is_valid: false,
|
|
635
|
-
triggers: ['ON_INIT'],
|
|
636
|
-
rules: [
|
|
637
|
-
{
|
|
638
|
-
id: '1',
|
|
639
|
-
key: 'VALUE_CHECK',
|
|
640
|
-
props: {
|
|
641
|
-
value: {
|
|
642
|
-
source: {
|
|
643
|
-
key: 'OBJECT',
|
|
644
|
-
props: {
|
|
645
|
-
object: {
|
|
646
|
-
key: 'ALL_FORMS_DATA',
|
|
647
|
-
path: '$.ADD_TASK.name'
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
},
|
|
652
|
-
pattern: {
|
|
653
|
-
key: 'IS_NOT_EMPTY'
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
],
|
|
658
|
-
actions: [
|
|
659
|
-
{
|
|
660
|
-
id: '1',
|
|
661
|
-
key: 'SET_FIELD_DEFAULT_VALUE',
|
|
662
|
-
condition: '1',
|
|
663
|
-
props: {
|
|
664
|
-
fieldKey: 'name',
|
|
665
|
-
value: {
|
|
666
|
-
source: {
|
|
667
|
-
key: 'OBJECT',
|
|
668
|
-
props: {
|
|
669
|
-
object: {
|
|
670
|
-
key: 'ALL_FORMS_DATA',
|
|
671
|
-
path: '$.ADD_TASK.name'
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
]
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
]
|
|
682
|
-
}
|
|
683
|
-
},
|
|
684
511
|
validators: {
|
|
685
512
|
required: true
|
|
686
513
|
},
|
|
@@ -694,73 +521,6 @@
|
|
|
694
521
|
{
|
|
695
522
|
key: 'phone',
|
|
696
523
|
label: 'Phone Number',
|
|
697
|
-
disabled: false,
|
|
698
|
-
messages: [],
|
|
699
|
-
default: {
|
|
700
|
-
value: {
|
|
701
|
-
is_found: false,
|
|
702
|
-
value: '',
|
|
703
|
-
sources: [
|
|
704
|
-
{
|
|
705
|
-
key: 'OBJECT',
|
|
706
|
-
props: {
|
|
707
|
-
object: {
|
|
708
|
-
key: 'ALL_FORMS_DATA',
|
|
709
|
-
path: '$.ADD_TASK.phone'
|
|
710
|
-
}
|
|
711
|
-
},
|
|
712
|
-
value: '',
|
|
713
|
-
validation: {
|
|
714
|
-
is_valid: false,
|
|
715
|
-
triggers: ['ON_INIT'],
|
|
716
|
-
rules: [
|
|
717
|
-
{
|
|
718
|
-
id: '1',
|
|
719
|
-
key: 'VALUE_CHECK',
|
|
720
|
-
props: {
|
|
721
|
-
value: {
|
|
722
|
-
source: {
|
|
723
|
-
key: 'OBJECT',
|
|
724
|
-
props: {
|
|
725
|
-
object: {
|
|
726
|
-
key: 'ALL_FORMS_DATA',
|
|
727
|
-
path: '$.ADD_TASK.phone'
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
},
|
|
732
|
-
pattern: {
|
|
733
|
-
key: 'IS_NOT_EMPTY'
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
],
|
|
738
|
-
actions: [
|
|
739
|
-
{
|
|
740
|
-
id: '1',
|
|
741
|
-
key: 'SET_FIELD_DEFAULT_VALUE',
|
|
742
|
-
condition: '1',
|
|
743
|
-
props: {
|
|
744
|
-
fieldKey: 'phone',
|
|
745
|
-
value: {
|
|
746
|
-
source: {
|
|
747
|
-
key: 'OBJECT',
|
|
748
|
-
props: {
|
|
749
|
-
object: {
|
|
750
|
-
key: 'ALL_FORMS_DATA',
|
|
751
|
-
path: '$.ADD_TASK.phone'
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
]
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
]
|
|
762
|
-
}
|
|
763
|
-
},
|
|
764
524
|
validators: {
|
|
765
525
|
required: true
|
|
766
526
|
},
|
|
@@ -776,73 +536,6 @@
|
|
|
776
536
|
{
|
|
777
537
|
key: 'address',
|
|
778
538
|
label: 'Address',
|
|
779
|
-
disabled: false,
|
|
780
|
-
messages: [],
|
|
781
|
-
default: {
|
|
782
|
-
value: {
|
|
783
|
-
is_found: false,
|
|
784
|
-
value: '',
|
|
785
|
-
sources: [
|
|
786
|
-
{
|
|
787
|
-
key: 'OBJECT',
|
|
788
|
-
props: {
|
|
789
|
-
object: {
|
|
790
|
-
key: 'ALL_FORMS_DATA',
|
|
791
|
-
path: '$.ADD_TASK.address'
|
|
792
|
-
}
|
|
793
|
-
},
|
|
794
|
-
value: '',
|
|
795
|
-
validation: {
|
|
796
|
-
is_valid: false,
|
|
797
|
-
triggers: ['ON_INIT'],
|
|
798
|
-
rules: [
|
|
799
|
-
{
|
|
800
|
-
id: '1',
|
|
801
|
-
key: 'VALUE_CHECK',
|
|
802
|
-
props: {
|
|
803
|
-
value: {
|
|
804
|
-
source: {
|
|
805
|
-
key: 'OBJECT',
|
|
806
|
-
props: {
|
|
807
|
-
object: {
|
|
808
|
-
key: 'ALL_FORMS_DATA',
|
|
809
|
-
path: '$.ADD_TASK.address'
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
},
|
|
814
|
-
pattern: {
|
|
815
|
-
key: 'IS_NOT_EMPTY'
|
|
816
|
-
}
|
|
817
|
-
}
|
|
818
|
-
}
|
|
819
|
-
],
|
|
820
|
-
actions: [
|
|
821
|
-
{
|
|
822
|
-
id: '1',
|
|
823
|
-
key: 'SET_FIELD_DEFAULT_VALUE',
|
|
824
|
-
condition: '1',
|
|
825
|
-
props: {
|
|
826
|
-
fieldKey: 'address',
|
|
827
|
-
value: {
|
|
828
|
-
source: {
|
|
829
|
-
key: 'OBJECT',
|
|
830
|
-
props: {
|
|
831
|
-
object: {
|
|
832
|
-
key: 'ALL_FORMS_DATA',
|
|
833
|
-
path: '$.ADD_TASK.address'
|
|
834
|
-
}
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
]
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
]
|
|
844
|
-
}
|
|
845
|
-
},
|
|
846
539
|
validators: {
|
|
847
540
|
required: true
|
|
848
541
|
},
|
|
@@ -856,73 +549,6 @@
|
|
|
856
549
|
{
|
|
857
550
|
key: 'city',
|
|
858
551
|
label: 'City',
|
|
859
|
-
disabled: false,
|
|
860
|
-
messages: [],
|
|
861
|
-
default: {
|
|
862
|
-
value: {
|
|
863
|
-
is_found: false,
|
|
864
|
-
value: '',
|
|
865
|
-
sources: [
|
|
866
|
-
{
|
|
867
|
-
key: 'OBJECT',
|
|
868
|
-
props: {
|
|
869
|
-
object: {
|
|
870
|
-
key: 'ALL_FORMS_DATA',
|
|
871
|
-
path: '$.ADD_TASK.city'
|
|
872
|
-
}
|
|
873
|
-
},
|
|
874
|
-
value: '',
|
|
875
|
-
validation: {
|
|
876
|
-
is_valid: false,
|
|
877
|
-
triggers: ['ON_INIT'],
|
|
878
|
-
rules: [
|
|
879
|
-
{
|
|
880
|
-
id: '1',
|
|
881
|
-
key: 'VALUE_CHECK',
|
|
882
|
-
props: {
|
|
883
|
-
value: {
|
|
884
|
-
source: {
|
|
885
|
-
key: 'OBJECT',
|
|
886
|
-
props: {
|
|
887
|
-
object: {
|
|
888
|
-
key: 'ALL_FORMS_DATA',
|
|
889
|
-
path: '$.ADD_TASK.city'
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
},
|
|
894
|
-
pattern: {
|
|
895
|
-
key: 'IS_NOT_EMPTY'
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
],
|
|
900
|
-
actions: [
|
|
901
|
-
{
|
|
902
|
-
id: '1',
|
|
903
|
-
key: 'SET_FIELD_DEFAULT_VALUE',
|
|
904
|
-
condition: '1',
|
|
905
|
-
props: {
|
|
906
|
-
fieldKey: 'city',
|
|
907
|
-
value: {
|
|
908
|
-
source: {
|
|
909
|
-
key: 'OBJECT',
|
|
910
|
-
props: {
|
|
911
|
-
object: {
|
|
912
|
-
key: 'ALL_FORMS_DATA',
|
|
913
|
-
path: '$.ADD_TASK.city'
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
]
|
|
921
|
-
}
|
|
922
|
-
}
|
|
923
|
-
]
|
|
924
|
-
}
|
|
925
|
-
},
|
|
926
552
|
validators: {
|
|
927
553
|
required: true
|
|
928
554
|
},
|
|
@@ -936,73 +562,6 @@
|
|
|
936
562
|
{
|
|
937
563
|
key: 'location',
|
|
938
564
|
label: 'Location URL',
|
|
939
|
-
disabled: false,
|
|
940
|
-
messages: [],
|
|
941
|
-
default: {
|
|
942
|
-
value: {
|
|
943
|
-
is_found: false,
|
|
944
|
-
value: '',
|
|
945
|
-
sources: [
|
|
946
|
-
{
|
|
947
|
-
key: 'OBJECT',
|
|
948
|
-
props: {
|
|
949
|
-
object: {
|
|
950
|
-
key: 'ALL_FORMS_DATA',
|
|
951
|
-
path: '$.ADD_TASK.location'
|
|
952
|
-
}
|
|
953
|
-
},
|
|
954
|
-
value: '',
|
|
955
|
-
validation: {
|
|
956
|
-
is_valid: false,
|
|
957
|
-
triggers: ['ON_INIT'],
|
|
958
|
-
rules: [
|
|
959
|
-
{
|
|
960
|
-
id: '1',
|
|
961
|
-
key: 'VALUE_CHECK',
|
|
962
|
-
props: {
|
|
963
|
-
value: {
|
|
964
|
-
source: {
|
|
965
|
-
key: 'OBJECT',
|
|
966
|
-
props: {
|
|
967
|
-
object: {
|
|
968
|
-
key: 'ALL_FORMS_DATA',
|
|
969
|
-
path: '$.ADD_TASK.location'
|
|
970
|
-
}
|
|
971
|
-
}
|
|
972
|
-
}
|
|
973
|
-
},
|
|
974
|
-
pattern: {
|
|
975
|
-
key: 'IS_NOT_EMPTY'
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
],
|
|
980
|
-
actions: [
|
|
981
|
-
{
|
|
982
|
-
id: '1',
|
|
983
|
-
key: 'SET_FIELD_DEFAULT_VALUE',
|
|
984
|
-
condition: '1',
|
|
985
|
-
props: {
|
|
986
|
-
fieldKey: 'location',
|
|
987
|
-
value: {
|
|
988
|
-
source: {
|
|
989
|
-
key: 'OBJECT',
|
|
990
|
-
props: {
|
|
991
|
-
object: {
|
|
992
|
-
key: 'ALL_FORMS_DATA',
|
|
993
|
-
path: '$.ADD_TASK.location'
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
}
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
]
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
]
|
|
1004
|
-
}
|
|
1005
|
-
},
|
|
1006
565
|
validators: {
|
|
1007
566
|
required: true
|
|
1008
567
|
},
|
|
@@ -1037,27 +596,297 @@
|
|
|
1037
596
|
}
|
|
1038
597
|
};
|
|
1039
598
|
}
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
this.
|
|
599
|
+
AgentService.prototype.ngOnInit = function () { };
|
|
600
|
+
AgentService.prototype.setAgentConfig = function (config) {
|
|
601
|
+
this.config = config;
|
|
1043
602
|
};
|
|
1044
|
-
|
|
603
|
+
AgentService.prototype.toggleMapview = function () {
|
|
1045
604
|
this.showMapview = !this.showMapview;
|
|
1046
605
|
};
|
|
1047
|
-
return
|
|
606
|
+
return AgentService;
|
|
1048
607
|
}());
|
|
1049
|
-
/** @nocollapse */
|
|
1050
|
-
/** @nocollapse */
|
|
1051
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type:
|
|
608
|
+
/** @nocollapse */ AgentService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, deps: [], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
609
|
+
/** @nocollapse */ AgentService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, providedIn: 'root' });
|
|
610
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: AgentService, decorators: [{
|
|
1052
611
|
type: i0.Injectable,
|
|
1053
612
|
args: [{
|
|
1054
613
|
providedIn: 'root'
|
|
1055
614
|
}]
|
|
1056
615
|
}], ctorParameters: function () { return []; } });
|
|
1057
616
|
|
|
617
|
+
var MapService = /** @class */ (function () {
|
|
618
|
+
function MapService(agentService) {
|
|
619
|
+
this.agentService = agentService;
|
|
620
|
+
this.allMarkers = [];
|
|
621
|
+
}
|
|
622
|
+
// To Initialize Map
|
|
623
|
+
MapService.prototype.initMap = function () {
|
|
624
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
625
|
+
var _g;
|
|
626
|
+
return __generator(this, function (_h) {
|
|
627
|
+
switch (_h.label) {
|
|
628
|
+
case 0:
|
|
629
|
+
_g = this;
|
|
630
|
+
return [4 /*yield*/, this.getPosition()];
|
|
631
|
+
case 1:
|
|
632
|
+
_g.myPosition = _h.sent();
|
|
633
|
+
this.map = L__namespace.map('map', {
|
|
634
|
+
center: [this.myPosition.lat, this.myPosition.lng],
|
|
635
|
+
zoom: 13
|
|
636
|
+
});
|
|
637
|
+
L__namespace.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
|
|
638
|
+
return [2 /*return*/];
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
});
|
|
642
|
+
};
|
|
643
|
+
// To Add Marker in Map
|
|
644
|
+
MapService.prototype.addMarker = function (_g) {
|
|
645
|
+
var lat = _g.lat, lng = _g.lng, title = _g.title, color = _g.color;
|
|
646
|
+
L__namespace.marker([lat, lng], {
|
|
647
|
+
icon: L__namespace.icon({
|
|
648
|
+
iconUrl: color == 'red' ? 'assets/map-marker-0.png' : 'assets/map-marker-1.png'
|
|
649
|
+
})
|
|
650
|
+
})
|
|
651
|
+
.addTo(this.map)
|
|
652
|
+
.bindPopup(title);
|
|
653
|
+
};
|
|
654
|
+
// To Plot Directions for All Tasks
|
|
655
|
+
MapService.prototype.plotDirectionsForAllTasks = function (tasks) {
|
|
656
|
+
var _this = this;
|
|
657
|
+
if (this.map) {
|
|
658
|
+
this.allMarkers = [];
|
|
659
|
+
// Create Agent Marker & Plot It.
|
|
660
|
+
var myMarker = {
|
|
661
|
+
lat: this.myPosition.lat,
|
|
662
|
+
lng: this.myPosition.lng,
|
|
663
|
+
title: 0,
|
|
664
|
+
color: 'red'
|
|
665
|
+
};
|
|
666
|
+
this.addMarker(myMarker);
|
|
667
|
+
this.allMarkers.push(myMarker);
|
|
668
|
+
// Create Markers for all Tasks
|
|
669
|
+
tasks.map(function (task, index) {
|
|
670
|
+
var marker = _this.getLatLng(_this.getLocation(task), index);
|
|
671
|
+
_this.allMarkers.push(marker);
|
|
672
|
+
});
|
|
673
|
+
// Run Algorithm to get optimized Routes
|
|
674
|
+
var startingPoint = this.allMarkers[0];
|
|
675
|
+
var unvisitedWaypoints = this.allMarkers.slice(1);
|
|
676
|
+
var optimizedRoute = this.nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
|
|
677
|
+
// Sort All Markers as per optimized routes
|
|
678
|
+
this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
|
|
679
|
+
// Sort All Tasks as per optimized routes
|
|
680
|
+
tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
|
|
681
|
+
// Plot Markers for All Tasks
|
|
682
|
+
tasks.map(function (task, index) {
|
|
683
|
+
var marker = _this.getLatLng(_this.getLocation(task), index);
|
|
684
|
+
_this.addMarker(marker);
|
|
685
|
+
});
|
|
686
|
+
// Set Styles for all Task Routes
|
|
687
|
+
var styles = [
|
|
688
|
+
{ color: 'blue', opacity: 1, weight: 8 },
|
|
689
|
+
{ color: 'white', opacity: 0.6, weight: 12 }
|
|
690
|
+
];
|
|
691
|
+
// Set Routes for all Tasks
|
|
692
|
+
this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
|
|
693
|
+
this.fitMapBounds();
|
|
694
|
+
}
|
|
695
|
+
return tasks;
|
|
696
|
+
};
|
|
697
|
+
// To plot Direction for selected Task
|
|
698
|
+
MapService.prototype.plotDirectionsForSelectedTask = function (index) {
|
|
699
|
+
if (index !== null) {
|
|
700
|
+
// Remove Previously Selected Task Route
|
|
701
|
+
if (this.selectedTaskRoutes) {
|
|
702
|
+
this.map.removeControl(this.selectedTaskRoutes);
|
|
703
|
+
}
|
|
704
|
+
// Remove All Tasks Routes
|
|
705
|
+
if (this.allTasksRoutes) {
|
|
706
|
+
this.map.removeControl(this.allTasksRoutes);
|
|
707
|
+
}
|
|
708
|
+
var taskMarker = this.allMarkers[index + 1];
|
|
709
|
+
// If Location is Available in Task Details
|
|
710
|
+
if (taskMarker.color != 'red') {
|
|
711
|
+
var markers = [this.allMarkers[0], taskMarker];
|
|
712
|
+
var styles = [
|
|
713
|
+
{ color: 'green', opacity: 1, weight: 8 },
|
|
714
|
+
{ color: 'white', opacity: 0.4, weight: 12 }
|
|
715
|
+
];
|
|
716
|
+
this.selectedTaskRoutes = this.setRoutes(markers, styles);
|
|
717
|
+
this.setSelectedTaskDistanceAndTime();
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
alert('No Location Available');
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
// Set All Tasks Routes Again & Remove Selected Tasks route
|
|
724
|
+
else {
|
|
725
|
+
if (this.selectedTaskRoutes) {
|
|
726
|
+
this.map.removeControl(this.selectedTaskRoutes);
|
|
727
|
+
}
|
|
728
|
+
this.map.addControl(this.allTasksRoutes);
|
|
729
|
+
this.selectedTaskRoutes = undefined;
|
|
730
|
+
}
|
|
731
|
+
this.fitMapBounds();
|
|
732
|
+
};
|
|
733
|
+
// Get Distance & Time of Selected Task
|
|
734
|
+
MapService.prototype.getSelectedTaskDistanceAndTime = function () {
|
|
735
|
+
return this.selectedTaskDistanceAndTime;
|
|
736
|
+
};
|
|
737
|
+
// Set Distance & Time of Selected Task
|
|
738
|
+
MapService.prototype.setSelectedTaskDistanceAndTime = function () {
|
|
739
|
+
this.selectedTaskRoutes.on('routesfound', function (e) {
|
|
740
|
+
var routes = e.routes;
|
|
741
|
+
var summary = routes[0].summary;
|
|
742
|
+
var distance = summary.totalDistance / 1000;
|
|
743
|
+
var time = Math.round((summary.totalTime % 3600) / 60);
|
|
744
|
+
this.selectedTaskDistanceAndTime = {
|
|
745
|
+
distance: distance,
|
|
746
|
+
time: time
|
|
747
|
+
};
|
|
748
|
+
});
|
|
749
|
+
};
|
|
750
|
+
// To sort Task as per nearest distance
|
|
751
|
+
MapService.prototype.sortTasksAsPerDistance = function (order, tasks, isMarker) {
|
|
752
|
+
var sortedTasks = [];
|
|
753
|
+
for (var i = 0; i < tasks.length; i++) {
|
|
754
|
+
var title = isMarker ? order[i].title : order[i].title - 1;
|
|
755
|
+
var task = tasks[title];
|
|
756
|
+
sortedTasks.push(task);
|
|
757
|
+
}
|
|
758
|
+
return sortedTasks;
|
|
759
|
+
};
|
|
760
|
+
// To set routes in the maps
|
|
761
|
+
MapService.prototype.setRoutes = function (markers, styles) {
|
|
762
|
+
return L__namespace.Routing.control({
|
|
763
|
+
waypoints: markers,
|
|
764
|
+
lineOptions: {
|
|
765
|
+
styles: styles
|
|
766
|
+
},
|
|
767
|
+
createMarker: function () {
|
|
768
|
+
return null;
|
|
769
|
+
},
|
|
770
|
+
routeWhileDragging: true
|
|
771
|
+
}).addTo(this.map);
|
|
772
|
+
};
|
|
773
|
+
// To set view point on the map
|
|
774
|
+
MapService.prototype.fitMapBounds = function () {
|
|
775
|
+
var markerLatLngs = this.allMarkers.map(function (marker) { return L__namespace.latLng(marker.lat, marker.lng); });
|
|
776
|
+
this.map.fitBounds(markerLatLngs);
|
|
777
|
+
};
|
|
778
|
+
// To get Current Position
|
|
779
|
+
MapService.prototype.getPosition = function () {
|
|
780
|
+
return new Promise(function (resolve, reject) {
|
|
781
|
+
navigator.geolocation.watchPosition(function (resp) {
|
|
782
|
+
resolve({
|
|
783
|
+
lng: resp.coords.longitude,
|
|
784
|
+
lat: resp.coords.latitude
|
|
785
|
+
});
|
|
786
|
+
}, function (err) {
|
|
787
|
+
reject(err);
|
|
788
|
+
});
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
// To extract Location from the Task Details
|
|
792
|
+
MapService.prototype.getLocation = function (task) {
|
|
793
|
+
var _a, _b, _c, _d, _e, _f;
|
|
794
|
+
if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
|
|
795
|
+
var location = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskLocationPath);
|
|
796
|
+
return location;
|
|
797
|
+
}
|
|
798
|
+
else {
|
|
799
|
+
return ((_d = (_c = (_b = (_a = task === null || task === void 0 ? void 0 : task.extras) === null || _a === void 0 ? void 0 : _a.task_details) === null || _b === void 0 ? void 0 : _b.customer_details) === null || _c === void 0 ? void 0 : _c.location) !== null && _d !== void 0 ? _d : (_f = (_e = task === null || task === void 0 ? void 0 : task.task_details) === null || _e === void 0 ? void 0 : _e.customer_details) === null || _f === void 0 ? void 0 : _f.location);
|
|
800
|
+
}
|
|
801
|
+
};
|
|
802
|
+
// To get Latitude & Longitude from Task Location
|
|
803
|
+
MapService.prototype.getLatLng = function (data, index) {
|
|
804
|
+
try {
|
|
805
|
+
var url = data.split('@');
|
|
806
|
+
var lat_long_match = url[1].split(',');
|
|
807
|
+
var lat = Number(lat_long_match[0]);
|
|
808
|
+
var long = Number(lat_long_match[1]);
|
|
809
|
+
return { lat: lat, lng: long, title: index + 1, color: 'blue' };
|
|
810
|
+
}
|
|
811
|
+
catch (_a) {
|
|
812
|
+
// If could not find Google Maps Location URL in Task
|
|
813
|
+
return {
|
|
814
|
+
lat: this.myPosition.lat,
|
|
815
|
+
lng: this.myPosition.lng,
|
|
816
|
+
title: index + 1,
|
|
817
|
+
color: 'red'
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
// To Calculate Distance between two markers
|
|
822
|
+
MapService.prototype.calculateDistance = function (point1, point2) {
|
|
823
|
+
var lat1 = point1.lat;
|
|
824
|
+
var lng1 = point1.lng;
|
|
825
|
+
var lat2 = point2.lat;
|
|
826
|
+
var lng2 = point2.lng;
|
|
827
|
+
var R = 6371; // Earth radius in kilometers
|
|
828
|
+
var dLat = (lat2 - lat1) * (Math.PI / 180);
|
|
829
|
+
var dLng = (lng2 - lng1) * (Math.PI / 180);
|
|
830
|
+
var a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
|
831
|
+
Math.cos((lat1 * Math.PI) / 180) *
|
|
832
|
+
Math.cos((lat2 * Math.PI) / 180) *
|
|
833
|
+
Math.sin(dLng / 2) *
|
|
834
|
+
Math.sin(dLng / 2);
|
|
835
|
+
var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
836
|
+
var distance = R * c;
|
|
837
|
+
return distance;
|
|
838
|
+
};
|
|
839
|
+
// To calculate nearest distance from marker
|
|
840
|
+
MapService.prototype.nearestNeighborAlgorithm = function (startingPoint, unvisitedPoints) {
|
|
841
|
+
var e_1, _g;
|
|
842
|
+
var currentPoint = startingPoint;
|
|
843
|
+
var path = [currentPoint];
|
|
844
|
+
var visitedPoints = new Set([currentPoint]);
|
|
845
|
+
while (unvisitedPoints.length > 0) {
|
|
846
|
+
var nearestPoint = null;
|
|
847
|
+
var minDistance = Number.POSITIVE_INFINITY;
|
|
848
|
+
try {
|
|
849
|
+
for (var unvisitedPoints_1 = (e_1 = void 0, __values(unvisitedPoints)), unvisitedPoints_1_1 = unvisitedPoints_1.next(); !unvisitedPoints_1_1.done; unvisitedPoints_1_1 = unvisitedPoints_1.next()) {
|
|
850
|
+
var point = unvisitedPoints_1_1.value;
|
|
851
|
+
var distance = this.calculateDistance(currentPoint, point);
|
|
852
|
+
if (distance < minDistance) {
|
|
853
|
+
minDistance = distance;
|
|
854
|
+
nearestPoint = point;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
}
|
|
858
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
859
|
+
finally {
|
|
860
|
+
try {
|
|
861
|
+
if (unvisitedPoints_1_1 && !unvisitedPoints_1_1.done && (_g = unvisitedPoints_1.return)) _g.call(unvisitedPoints_1);
|
|
862
|
+
}
|
|
863
|
+
finally { if (e_1) throw e_1.error; }
|
|
864
|
+
}
|
|
865
|
+
path.push(nearestPoint);
|
|
866
|
+
visitedPoints.add(nearestPoint);
|
|
867
|
+
currentPoint = nearestPoint;
|
|
868
|
+
unvisitedPoints = unvisitedPoints.filter(function (point) { return !visitedPoints.has(point); });
|
|
869
|
+
}
|
|
870
|
+
return path;
|
|
871
|
+
};
|
|
872
|
+
return MapService;
|
|
873
|
+
}());
|
|
874
|
+
/** @nocollapse */ MapService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, deps: [{ token: AgentService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
875
|
+
/** @nocollapse */ MapService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, providedIn: 'root' });
|
|
876
|
+
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: MapService, decorators: [{
|
|
877
|
+
type: i0.Injectable,
|
|
878
|
+
args: [{
|
|
879
|
+
providedIn: 'root'
|
|
880
|
+
}]
|
|
881
|
+
}], ctorParameters: function () { return [{ type: AgentService }]; }, propDecorators: { directionsRenders: [{
|
|
882
|
+
type: i0.ViewChildren,
|
|
883
|
+
args: ['directionsRender']
|
|
884
|
+
}] } });
|
|
885
|
+
|
|
1058
886
|
var CustomerDetailsComponent = /** @class */ (function () {
|
|
1059
|
-
function CustomerDetailsComponent(
|
|
1060
|
-
this.
|
|
887
|
+
function CustomerDetailsComponent(agentService, mapService) {
|
|
888
|
+
this.agentService = agentService;
|
|
889
|
+
this.mapService = mapService;
|
|
1061
890
|
this.customer = {
|
|
1062
891
|
agent_id: 'sparkcpaital_dev_agent_1',
|
|
1063
892
|
client_name: 'sparkcpaital_dev',
|
|
@@ -1094,7 +923,17 @@
|
|
|
1094
923
|
CustomerDetailsComponent.prototype.ngOnInit = function () {
|
|
1095
924
|
var _a, _b, _c;
|
|
1096
925
|
this.viewTaskDetails =
|
|
1097
|
-
(_c = (_b = (_a = this.
|
|
926
|
+
(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
|
|
927
|
+
};
|
|
928
|
+
CustomerDetailsComponent.prototype.getTaskCreationTime = function (task) {
|
|
929
|
+
var _a;
|
|
930
|
+
if (kwikidToolkit.checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
|
|
931
|
+
var time = kwikidToolkit.getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
|
|
932
|
+
return this.convertEpochToDate(time);
|
|
933
|
+
}
|
|
934
|
+
else {
|
|
935
|
+
return this.convertEpochToDate((_a = task === null || task === void 0 ? void 0 : task.task_creation_time) !== null && _a !== void 0 ? _a : task === null || task === void 0 ? void 0 : task.start_time);
|
|
936
|
+
}
|
|
1098
937
|
};
|
|
1099
938
|
CustomerDetailsComponent.prototype.convertToTitleCase = function (inputString) {
|
|
1100
939
|
inputString = inputString.replace('$.task_details.customer_details.', '');
|
|
@@ -1118,19 +957,20 @@
|
|
|
1118
957
|
CustomerDetailsComponent.prototype.goToMaps = function (location) {
|
|
1119
958
|
window.open("" + location, '_blank');
|
|
1120
959
|
};
|
|
1121
|
-
CustomerDetailsComponent.prototype.
|
|
960
|
+
CustomerDetailsComponent.prototype.handleOnClickNext = function (e) {
|
|
1122
961
|
this.nextStep.emit(e);
|
|
1123
962
|
};
|
|
1124
963
|
CustomerDetailsComponent.prototype.close = function () {
|
|
1125
|
-
this.
|
|
964
|
+
this.agentService.isShowTaskDetails = undefined;
|
|
965
|
+
this.mapService.plotDirectionsForSelectedTask(null);
|
|
1126
966
|
};
|
|
1127
967
|
CustomerDetailsComponent.prototype.handleOnClickRemoveTask = function (task) {
|
|
1128
968
|
this.removeTask.emit(task);
|
|
1129
969
|
};
|
|
1130
970
|
return CustomerDetailsComponent;
|
|
1131
971
|
}());
|
|
1132
|
-
/** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token:
|
|
1133
|
-
/** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer",
|
|
972
|
+
/** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
973
|
+
/** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, ngImport: i0__namespace, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">Task Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n\n <div class=\"customer-details-table\">\n <div\n class=\"customer-details-table-data\"\n *ngFor=\"let taskData of viewTaskDetails\"\n >\n <div class=\"customer-details-table-detail-value\">\n {{ getTaskDetails(taskData) }}\n </div>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Task Created on: {{ getTaskCreationTime(customer) }}\n </div>\n\n <div class=\"customer-details-actions\">\n <div class=\"customer-details-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'SHARE_JOURNEY_LINK' })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.task_details?.customer_details?.location)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\n ></kwikui-button>\n </div>\n </div>\n </div>\n</div>\n", styles: [".customer-details-wrapper{display:flex;flex-direction:column;align-items:stretch;overflow:hidden;grid-gap:.5rem;gap:.5rem;padding:1.5rem;height:100%;width:100%}.customer-details-wrapper .customer-details-heading{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:1rem 0;font-size:1.5rem;font-weight:600}.customer-details-wrapper .customer-details-body{display:flex;flex-direction:column;grid-gap:1.25rem;gap:1.25rem}.customer-details-wrapper .customer-details-body .customer-details-user-id{font-size:1.25rem;font-weight:500;padding:.5rem 0}.customer-details-wrapper .customer-details-body .customer-details-table{display:flex;grid-gap:.5rem;gap:.5rem;flex-direction:column}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-name{font-weight:500}.customer-details-wrapper .customer-details-body .customer-details-table .customer-details-table-data .customer-details-table-detail-value{word-wrap:break-word}.customer-details-wrapper .customer-details-body .customer-details-date{padding-top:1rem}.customer-details-wrapper .customer-details-body .customer-details-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;padding:1rem 0}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons{padding-right:.2rem;display:flex;flex-direction:row;grid-gap:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.customer-details-wrapper .customer-details-body .customer-details-actions .customer-details-journey-buttons .customer-share-link{font-size:.7rem}\n"], components: [{ type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1134
974
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, decorators: [{
|
|
1135
975
|
type: i0.Component,
|
|
1136
976
|
args: [{
|
|
@@ -1138,9 +978,9 @@
|
|
|
1138
978
|
templateUrl: './customer-details.component.html',
|
|
1139
979
|
styleUrls: ['./customer-details.component.scss']
|
|
1140
980
|
}]
|
|
1141
|
-
}], ctorParameters: function () { return [{ type:
|
|
981
|
+
}], ctorParameters: function () { return [{ type: AgentService }, { type: MapService }]; }, propDecorators: { customer: [{
|
|
1142
982
|
type: i0.Input
|
|
1143
|
-
}],
|
|
983
|
+
}], config: [{
|
|
1144
984
|
type: i0.Input
|
|
1145
985
|
}], nextStep: [{
|
|
1146
986
|
type: i0.Output
|
|
@@ -1166,200 +1006,6 @@
|
|
|
1166
1006
|
EStatus.COMPLETE
|
|
1167
1007
|
];
|
|
1168
1008
|
|
|
1169
|
-
var InfoWindowService = /** @class */ (function () {
|
|
1170
|
-
function InfoWindowService(mapService) {
|
|
1171
|
-
this.mapService = mapService;
|
|
1172
|
-
this.config = {
|
|
1173
|
-
fields: {
|
|
1174
|
-
name: {
|
|
1175
|
-
label: 'Name',
|
|
1176
|
-
value: 'name',
|
|
1177
|
-
display: 'value',
|
|
1178
|
-
style: {
|
|
1179
|
-
fontSize: '1rem',
|
|
1180
|
-
fontWeight: 600
|
|
1181
|
-
}
|
|
1182
|
-
},
|
|
1183
|
-
phone: {
|
|
1184
|
-
label: 'Call',
|
|
1185
|
-
value: 'phone',
|
|
1186
|
-
display: 'label',
|
|
1187
|
-
style: {
|
|
1188
|
-
fontSize: '0.8rem',
|
|
1189
|
-
padding: '0.1rem 0',
|
|
1190
|
-
textAlign: 'justify'
|
|
1191
|
-
},
|
|
1192
|
-
icon: 'https://cdn-icons-png.flaticon.com/512/60/60720.png'
|
|
1193
|
-
},
|
|
1194
|
-
address: {
|
|
1195
|
-
label: 'Directions',
|
|
1196
|
-
value: 'address',
|
|
1197
|
-
display: 'label',
|
|
1198
|
-
style: {
|
|
1199
|
-
fontSize: '0.8rem',
|
|
1200
|
-
padding: '0.1rem 0'
|
|
1201
|
-
},
|
|
1202
|
-
icon: 'https://cdn-icons-png.flaticon.com/512/62/62516.png'
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
};
|
|
1206
|
-
this.mainInfoWindowStyle = {
|
|
1207
|
-
display: 'flex',
|
|
1208
|
-
'flex-direction': 'column',
|
|
1209
|
-
'justify-content': 'center',
|
|
1210
|
-
'align-items': 'stretch',
|
|
1211
|
-
gap: '0.5rem',
|
|
1212
|
-
padding: '0.5rem'
|
|
1213
|
-
};
|
|
1214
|
-
this.fieldDivStyle = {
|
|
1215
|
-
gap: ' 0.5rem',
|
|
1216
|
-
display: 'flex',
|
|
1217
|
-
'flex-direction': 'row'
|
|
1218
|
-
};
|
|
1219
|
-
}
|
|
1220
|
-
InfoWindowService.prototype.getOpenMarker = function () {
|
|
1221
|
-
return this.openMarker;
|
|
1222
|
-
};
|
|
1223
|
-
InfoWindowService.prototype.setOpenMarker = function (value) {
|
|
1224
|
-
this.openMarker = value;
|
|
1225
|
-
};
|
|
1226
|
-
/**
|
|
1227
|
-
* @description
|
|
1228
|
-
* Wrapper method to show Customer Info Window
|
|
1229
|
-
*
|
|
1230
|
-
* @function showInfo
|
|
1231
|
-
* @func showInfo
|
|
1232
|
-
* @method showInfo
|
|
1233
|
-
*/
|
|
1234
|
-
InfoWindowService.prototype.showCustomerInformation = function (customer, marker) {
|
|
1235
|
-
var map = this.mapService.map;
|
|
1236
|
-
var contentString = this.createInfoContent(customer);
|
|
1237
|
-
var infowindow = new google.maps.InfoWindow({
|
|
1238
|
-
content: contentString
|
|
1239
|
-
});
|
|
1240
|
-
this.addEventListeners(customer, infowindow);
|
|
1241
|
-
this.closeLastOpenedInfoWindow();
|
|
1242
|
-
infowindow.open(map, marker);
|
|
1243
|
-
this.lastInfoWindowOpened = infowindow;
|
|
1244
|
-
this.mapService.map = Object.assign(Object.assign({}, this.mapService.map), { center: marker.getPosition });
|
|
1245
|
-
// map.setCenter(marker.getPosition());
|
|
1246
|
-
return { infowindow: infowindow };
|
|
1247
|
-
};
|
|
1248
|
-
InfoWindowService.prototype.addEventListeners = function (customer, infowindow) {
|
|
1249
|
-
// chnage -
|
|
1250
|
-
var addressLink = "http://maps.google.com/?q=" + customer.extras.loc[0] + ", " + customer.extras.loc[1];
|
|
1251
|
-
google.maps.event.addListener(infowindow, 'domready', function () {
|
|
1252
|
-
document.getElementById('Call').addEventListener('click', function (e) {
|
|
1253
|
-
window.open("tel:" + customer.extras.phone, '_self');
|
|
1254
|
-
});
|
|
1255
|
-
document
|
|
1256
|
-
.getElementById('Directions')
|
|
1257
|
-
.addEventListener('click', function (e) {
|
|
1258
|
-
window.open("" + addressLink, '_blank');
|
|
1259
|
-
});
|
|
1260
|
-
document
|
|
1261
|
-
.getElementsByClassName('gm-ui-hover-effect')[0]
|
|
1262
|
-
.setAttribute('style', ' background: none;\
|
|
1263
|
-
display: block; \
|
|
1264
|
-
border: 0px; \
|
|
1265
|
-
margin: 0px; \
|
|
1266
|
-
padding: 0px; \
|
|
1267
|
-
text-transform: none; \
|
|
1268
|
-
appearance: none; \
|
|
1269
|
-
position: absolute; \
|
|
1270
|
-
cursor: pointer; \
|
|
1271
|
-
user-select: none; \
|
|
1272
|
-
top: 0px; \
|
|
1273
|
-
right: 0px; \
|
|
1274
|
-
width: 30px; \
|
|
1275
|
-
height: 30px; \
|
|
1276
|
-
');
|
|
1277
|
-
});
|
|
1278
|
-
};
|
|
1279
|
-
/**
|
|
1280
|
-
* @description
|
|
1281
|
-
* Wrapper method to close Last Info Window
|
|
1282
|
-
*
|
|
1283
|
-
* @function closeLastOpenedInfoWindow
|
|
1284
|
-
* @func closeLastOpenedInfoWindow
|
|
1285
|
-
* @method closeLastOpenedInfoWindow
|
|
1286
|
-
*/
|
|
1287
|
-
InfoWindowService.prototype.closeLastOpenedInfoWindow = function () {
|
|
1288
|
-
if (this.lastInfoWindowOpened) {
|
|
1289
|
-
this.lastInfoWindowOpened.close();
|
|
1290
|
-
}
|
|
1291
|
-
};
|
|
1292
|
-
/**
|
|
1293
|
-
* @description
|
|
1294
|
-
* Closes the previously opened info window.
|
|
1295
|
-
*
|
|
1296
|
-
* @function infoData
|
|
1297
|
-
* @func infoData
|
|
1298
|
-
* @method infoData
|
|
1299
|
-
*/
|
|
1300
|
-
InfoWindowService.prototype.createInfoContent = function (customer) {
|
|
1301
|
-
var content = "<div style='padding:4px; font-family: Manrope;' >";
|
|
1302
|
-
content += this.createFields(customer, this.config.fields);
|
|
1303
|
-
content += '</div>';
|
|
1304
|
-
return content;
|
|
1305
|
-
};
|
|
1306
|
-
/**
|
|
1307
|
-
* @description
|
|
1308
|
-
* Wrapper method to create Fields Container
|
|
1309
|
-
*
|
|
1310
|
-
* @function createFields
|
|
1311
|
-
* @func createFields
|
|
1312
|
-
* @method createFields
|
|
1313
|
-
*/
|
|
1314
|
-
InfoWindowService.prototype.createFields = function (customer, fields) {
|
|
1315
|
-
var e_1, _a;
|
|
1316
|
-
var _div = document.createElement('div');
|
|
1317
|
-
for (var property in this.mainInfoWindowStyle)
|
|
1318
|
-
_div.style[property] = this.mainInfoWindowStyle[property];
|
|
1319
|
-
try {
|
|
1320
|
-
for (var _b = __values(Object.keys(fields)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1321
|
-
var key = _c.value;
|
|
1322
|
-
var field = fields[key];
|
|
1323
|
-
var _fieldDiv = document.createElement('div');
|
|
1324
|
-
_fieldDiv.setAttribute('id', field.label);
|
|
1325
|
-
for (var property in this.fieldDivStyle)
|
|
1326
|
-
_fieldDiv.style[property] = this.fieldDivStyle[property];
|
|
1327
|
-
for (var property in field.style)
|
|
1328
|
-
_fieldDiv.style[property] = field.style[property];
|
|
1329
|
-
var string = field.display == 'label' ? field.label : customer.extras[field.value];
|
|
1330
|
-
if (field.icon) {
|
|
1331
|
-
var _icon = document.createElement('img');
|
|
1332
|
-
_icon.src = field.icon;
|
|
1333
|
-
_icon.style.width = field.style.fontSize;
|
|
1334
|
-
_icon.style.height = field.style.fontSize;
|
|
1335
|
-
_fieldDiv.appendChild(_icon);
|
|
1336
|
-
}
|
|
1337
|
-
var _fieldText = document.createElement('div');
|
|
1338
|
-
_fieldText.innerHTML = string;
|
|
1339
|
-
_fieldDiv.appendChild(_fieldText);
|
|
1340
|
-
_div.appendChild(_fieldDiv);
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1344
|
-
finally {
|
|
1345
|
-
try {
|
|
1346
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1347
|
-
}
|
|
1348
|
-
finally { if (e_1) throw e_1.error; }
|
|
1349
|
-
}
|
|
1350
|
-
return _div.outerHTML;
|
|
1351
|
-
};
|
|
1352
|
-
return InfoWindowService;
|
|
1353
|
-
}());
|
|
1354
|
-
/** @nocollapse */ InfoWindowService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
|
|
1355
|
-
/** @nocollapse */ InfoWindowService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, providedIn: 'root' });
|
|
1356
|
-
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: InfoWindowService, decorators: [{
|
|
1357
|
-
type: i0.Injectable,
|
|
1358
|
-
args: [{
|
|
1359
|
-
providedIn: 'root'
|
|
1360
|
-
}]
|
|
1361
|
-
}], ctorParameters: function () { return [{ type: MapService }]; } });
|
|
1362
|
-
|
|
1363
1009
|
var StatusPillComponent = /** @class */ (function () {
|
|
1364
1010
|
function StatusPillComponent() {
|
|
1365
1011
|
}
|
|
@@ -1375,7 +1021,7 @@
|
|
|
1375
1021
|
return StatusPillComponent;
|
|
1376
1022
|
}());
|
|
1377
1023
|
/** @nocollapse */ StatusPillComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1378
|
-
/** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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:
|
|
1024
|
+
/** @nocollapse */ StatusPillComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, ngImport: i0__namespace, 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__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1379
1025
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: StatusPillComponent, decorators: [{
|
|
1380
1026
|
type: i0.Component,
|
|
1381
1027
|
args: [{
|
|
@@ -1388,41 +1034,14 @@
|
|
|
1388
1034
|
}] } });
|
|
1389
1035
|
|
|
1390
1036
|
var CustomerTileComponent = /** @class */ (function () {
|
|
1391
|
-
|
|
1392
|
-
* @description
|
|
1393
|
-
*
|
|
1394
|
-
* @constructor
|
|
1395
|
-
*/
|
|
1396
|
-
function CustomerTileComponent(mapService, infoWindowService, userService, hostElement) {
|
|
1037
|
+
function CustomerTileComponent(mapService, agentService, hostElement) {
|
|
1397
1038
|
this.mapService = mapService;
|
|
1398
|
-
this.
|
|
1399
|
-
this.userService = userService;
|
|
1039
|
+
this.agentService = agentService;
|
|
1400
1040
|
this.hostElement = hostElement;
|
|
1401
|
-
/**
|
|
1402
|
-
* @description
|
|
1403
|
-
* Determines Customer Data
|
|
1404
|
-
*
|
|
1405
|
-
* @default
|
|
1406
|
-
* `{}`
|
|
1407
|
-
*/
|
|
1408
1041
|
this.customer = {};
|
|
1409
|
-
/**
|
|
1410
|
-
* @description
|
|
1411
|
-
* Determines Index of Customer Data in Customer List
|
|
1412
|
-
*
|
|
1413
|
-
* @default
|
|
1414
|
-
*
|
|
1415
|
-
*/
|
|
1416
1042
|
this.index = undefined;
|
|
1417
1043
|
this.isMobileView = false;
|
|
1418
1044
|
this.viewTaskDetails = [];
|
|
1419
|
-
/**
|
|
1420
|
-
* @description
|
|
1421
|
-
* Emitter to emit next Step
|
|
1422
|
-
*
|
|
1423
|
-
* @emits KwikIDAgentDashboardComponent#nextStep
|
|
1424
|
-
* @fires KwikIDAgentDashboardComponent#nextStep
|
|
1425
|
-
*/
|
|
1426
1045
|
this.nextStep = new i0.EventEmitter();
|
|
1427
1046
|
this.removeTask = new i0.EventEmitter();
|
|
1428
1047
|
}
|
|
@@ -1434,66 +1053,35 @@
|
|
|
1434
1053
|
this.isMobileView = false;
|
|
1435
1054
|
}
|
|
1436
1055
|
};
|
|
1437
|
-
/**
|
|
1438
|
-
* @description
|
|
1439
|
-
* To set Google Maps API on script
|
|
1440
|
-
*
|
|
1441
|
-
* @ngOnInit
|
|
1442
|
-
*/
|
|
1443
1056
|
CustomerTileComponent.prototype.ngOnInit = function () {
|
|
1444
1057
|
var _a, _b, _c;
|
|
1445
1058
|
this.viewTaskDetails =
|
|
1446
|
-
(_c = (_b = (_a = this.
|
|
1059
|
+
(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.viewTaskDetails) !== null && _c !== void 0 ? _c : this.viewTaskDetails;
|
|
1447
1060
|
};
|
|
1448
1061
|
CustomerTileComponent.prototype.getTaskDetails = function (taskData) {
|
|
1449
1062
|
return kwikidToolkit.getObjectValueFromPath(this.customer, taskData);
|
|
1450
1063
|
};
|
|
1451
1064
|
CustomerTileComponent.prototype.openDetails = function () {
|
|
1452
|
-
if (this.
|
|
1453
|
-
this.
|
|
1065
|
+
if (this.agentService.isShowTaskDetails !== this.index) {
|
|
1066
|
+
this.agentService.isShowTaskDetails = this.index;
|
|
1067
|
+
this.mapService.plotDirectionsForSelectedTask(this.index);
|
|
1454
1068
|
}
|
|
1455
1069
|
else {
|
|
1456
|
-
this.
|
|
1070
|
+
this.agentService.isShowTaskDetails = undefined;
|
|
1071
|
+
this.mapService.plotDirectionsForSelectedTask(null);
|
|
1457
1072
|
}
|
|
1458
1073
|
};
|
|
1459
|
-
CustomerTileComponent.prototype.tileClick = function () {
|
|
1460
|
-
this.openDetails();
|
|
1461
|
-
if (this.index == this.infoWindowService.getOpenMarker()) {
|
|
1462
|
-
this.infoWindowService.setOpenMarker(null);
|
|
1463
|
-
//this.infoWindowService.lastInfoWindowOpened.close();
|
|
1464
|
-
}
|
|
1465
|
-
else {
|
|
1466
|
-
this.showDetails(this.customer, this.index);
|
|
1467
|
-
}
|
|
1468
|
-
};
|
|
1469
|
-
/**
|
|
1470
|
-
* @description
|
|
1471
|
-
* Wrapper method to show Customer Info Window
|
|
1472
|
-
*
|
|
1473
|
-
* @function showDetails
|
|
1474
|
-
* @func showDetails
|
|
1475
|
-
* @method showDetails
|
|
1476
|
-
*/
|
|
1477
|
-
CustomerTileComponent.prototype.showDetails = function (customer, index) {
|
|
1478
|
-
var markers = this.mapService.getMarkers();
|
|
1479
|
-
var marker = markers[index + 1];
|
|
1480
|
-
// let { infowindow } = this.infoWindowService.showCustomerInformation(
|
|
1481
|
-
// customer,
|
|
1482
|
-
// marker
|
|
1483
|
-
// );
|
|
1484
|
-
this.infoWindowService.setOpenMarker(index);
|
|
1485
|
-
};
|
|
1486
1074
|
CustomerTileComponent.prototype.getClass = function () {
|
|
1487
|
-
var string =
|
|
1488
|
-
if (this.
|
|
1489
|
-
string +=
|
|
1075
|
+
var string = 'customer-tile-wrapper';
|
|
1076
|
+
if (this.agentService.isShowTaskDetails == this.index) {
|
|
1077
|
+
string += ' customer-tile-active';
|
|
1490
1078
|
}
|
|
1491
1079
|
return string;
|
|
1492
1080
|
};
|
|
1493
1081
|
CustomerTileComponent.prototype.goToMaps = function (location) {
|
|
1494
1082
|
window.open("" + location, '_blank');
|
|
1495
1083
|
};
|
|
1496
|
-
CustomerTileComponent.prototype.
|
|
1084
|
+
CustomerTileComponent.prototype.handleOnClickNext = function (e) {
|
|
1497
1085
|
this.nextStep.emit(e);
|
|
1498
1086
|
};
|
|
1499
1087
|
CustomerTileComponent.prototype.handleOnClickRemoveTask = function (task) {
|
|
@@ -1501,8 +1089,8 @@
|
|
|
1501
1089
|
};
|
|
1502
1090
|
return CustomerTileComponent;
|
|
1503
1091
|
}());
|
|
1504
|
-
/** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token:
|
|
1505
|
-
/** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index",
|
|
1092
|
+
/** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1093
|
+
/** @nocollapse */ CustomerTileComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, ngImport: i0__namespace, template: "<div [ngClass]=\"getClass()\">\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n {{\n config?.dashboard?.taskIdentifier\n ? getTaskDetails(config?.dashboard?.taskIdentifier)\n : customer.user_id\n }}\n </div>\n <status-pill\n *ngIf=\"config?.dashboard?.isShowTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\n </div>\n <kwikui-button\n *ngIf=\"!agentService.isMobileView && !agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronLeftLarge'\n : 'tuiIconChevronRightLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"agentService.isMobileView || agentService.showMapview\"\n [icon]=\"\n agentService.isShowTaskDetails == index\n ? 'tuiIconChevronUpLarge'\n : 'tuiIconChevronDownLarge'\n \"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"openDetails()\"\n ></kwikui-button>\n </div>\n <div\n [ngClass]=\"\n index == agentService.isShowTaskDetails &&\n (agentService.isMobileView || agentService.showMapview)\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 viewTaskDetails\"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n {{ getTaskDetails(taskData) }}\n </div>\n <div\n *ngIf=\"\n agentService.config?.dashboard?.isShowMaps &&\n agentService.config?.dashboard?.isShowDistanceAndTime &&\n mapService.getSelectedTaskDistanceAndTime()\n \"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n Distance: {{ mapService.getSelectedTaskDistanceAndTime()?.distance }} |\n Time: {{ mapService.getSelectedTaskDistanceAndTime()?.time }}\n </div>\n </div>\n <div class=\"customer-tile-secondary-container-actions\">\n <div class=\"customer-tile-secondary-container-task-buttons\">\n <kwikui-button\n *ngIf=\"config.dashboard?.isAllowRemoveTask\"\n [icon]=\"'tuiIconTrash2'\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"handleOnClickRemoveTask(customer)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config.dashboard?.isShowCopyLink\"\n icon=\"tuiIconCopy\"\n [shape]=\"'rounded'\"\n appearance=\"icon\"\n size=\"s\"\n (onClick)=\"\n handleOnClickNext({\n customer: customer,\n stepType: 'SHARE_JOURNEY_LINK'\n })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-tile-secondary-container-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.task_details?.customer_details?.location\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.task_details.customer_details.location)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status !== 'complete' &&\n customer.session_status !== ''\n \"\n label=\"Edit Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'EDIT_JOURNEY' })\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n customer.session_status == ''\n \"\n label=\"Start Journey\"\n appearance=\"primary\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n handleOnClickNext({ customer: customer, stepType: 'START_JOURNEY' })\n \"\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;word-wrap:break-word}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center}.customer-tile-wrapper .customer-tile-secondary-container .customer-tile-secondary-container-actions .customer-tile-secondary-container-task-buttons{display:flex;flex-direction:row;align-items:center;justify-content:flex-start}.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:.2rem;gap:.2rem;align-items:center;justify-content:flex-end}.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}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i5__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1506
1094
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, decorators: [{
|
|
1507
1095
|
type: i0.Component,
|
|
1508
1096
|
args: [{
|
|
@@ -1510,22 +1098,19 @@
|
|
|
1510
1098
|
templateUrl: './customer-tile.component.html',
|
|
1511
1099
|
styleUrls: ['./customer-tile.component.scss']
|
|
1512
1100
|
}]
|
|
1513
|
-
}], ctorParameters: function () { return [{ type: MapService }, { type:
|
|
1101
|
+
}], ctorParameters: function () { return [{ type: MapService }, { type: AgentService }, { type: i0__namespace.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
|
|
1514
1102
|
type: i0.HostListener,
|
|
1515
1103
|
args: ['window:resize', ['$event']]
|
|
1516
1104
|
}], customer: [{
|
|
1517
1105
|
type: i0.Input
|
|
1518
1106
|
}], index: [{
|
|
1519
1107
|
type: i0.Input
|
|
1520
|
-
}],
|
|
1108
|
+
}], config: [{
|
|
1521
1109
|
type: i0.Input
|
|
1522
1110
|
}], nextStep: [{
|
|
1523
1111
|
type: i0.Output
|
|
1524
1112
|
}], removeTask: [{
|
|
1525
1113
|
type: i0.Output
|
|
1526
|
-
}], infoWindow: [{
|
|
1527
|
-
type: i0.ViewChild,
|
|
1528
|
-
args: [i5.MapInfoWindow]
|
|
1529
1114
|
}] } });
|
|
1530
1115
|
|
|
1531
1116
|
var Ng2SearchPipe = /** @class */ (function () {
|
|
@@ -1604,7 +1189,7 @@
|
|
|
1604
1189
|
this.fromDate = this.getDate(null);
|
|
1605
1190
|
this.toDate = this.getDate(null);
|
|
1606
1191
|
this.dateRangeFormControl = new i5$1.FormControl({
|
|
1607
|
-
value: new
|
|
1192
|
+
value: new i9.TuiDayRange(new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate()), new i9.TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate())),
|
|
1608
1193
|
disabled: false
|
|
1609
1194
|
});
|
|
1610
1195
|
this.formGroup.addControl('dateRange', this.dateRangeFormControl);
|
|
@@ -1619,7 +1204,7 @@
|
|
|
1619
1204
|
return __generator(this, function (_c) {
|
|
1620
1205
|
switch (_c.label) {
|
|
1621
1206
|
case 0:
|
|
1622
|
-
if (!this.
|
|
1207
|
+
if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 3];
|
|
1623
1208
|
return [4 /*yield*/, this.mapService.initMap()];
|
|
1624
1209
|
case 1:
|
|
1625
1210
|
_c.sent();
|
|
@@ -1637,14 +1222,26 @@
|
|
|
1637
1222
|
}); }, 1000);
|
|
1638
1223
|
};
|
|
1639
1224
|
CustomerListComponent.prototype.ngOnChanges = function () {
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1225
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1226
|
+
var _b;
|
|
1227
|
+
return __generator(this, function (_c) {
|
|
1228
|
+
switch (_c.label) {
|
|
1229
|
+
case 0:
|
|
1230
|
+
if (!this.config.dashboard.isShowMaps) return [3 /*break*/, 2];
|
|
1231
|
+
_b = this;
|
|
1232
|
+
return [4 /*yield*/, this.plotMarkers(this.customers)];
|
|
1233
|
+
case 1:
|
|
1234
|
+
_b.filteredData = _c.sent();
|
|
1235
|
+
return [3 /*break*/, 3];
|
|
1236
|
+
case 2:
|
|
1237
|
+
this.filteredData = this.customers;
|
|
1238
|
+
_c.label = 3;
|
|
1239
|
+
case 3: return [2 /*return*/];
|
|
1240
|
+
}
|
|
1241
|
+
});
|
|
1242
|
+
});
|
|
1646
1243
|
};
|
|
1647
|
-
CustomerListComponent.prototype.
|
|
1244
|
+
CustomerListComponent.prototype.handleOnClickNext = function (e) {
|
|
1648
1245
|
this.nextStep.emit(e);
|
|
1649
1246
|
};
|
|
1650
1247
|
CustomerListComponent.prototype.getDate = function (d) {
|
|
@@ -1660,18 +1257,23 @@
|
|
|
1660
1257
|
return today;
|
|
1661
1258
|
};
|
|
1662
1259
|
CustomerListComponent.prototype.plotMarkers = function (customers) {
|
|
1663
|
-
var _this = this;
|
|
1664
1260
|
var _a;
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1261
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
1262
|
+
return __generator(this, function (_b) {
|
|
1263
|
+
switch (_b.label) {
|
|
1264
|
+
case 0:
|
|
1265
|
+
if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
|
|
1266
|
+
customers = customers.filter(function (customer) {
|
|
1267
|
+
return customer.status !== EStatus.COMPLETE;
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
return [4 /*yield*/, this.mapService.plotDirectionsForAllTasks(customers)];
|
|
1271
|
+
case 1:
|
|
1272
|
+
customers = _b.sent();
|
|
1273
|
+
return [2 /*return*/, customers];
|
|
1274
|
+
}
|
|
1668
1275
|
});
|
|
1669
|
-
}
|
|
1670
|
-
var directionsResults$ = this.mapService.plotMarkers(customers);
|
|
1671
|
-
directionsResults$.subscribe(function (val) {
|
|
1672
|
-
_this.filteredData = _this.mapService.sortList(val.routes[0].waypoint_order, customers);
|
|
1673
1276
|
});
|
|
1674
|
-
return customers;
|
|
1675
1277
|
};
|
|
1676
1278
|
CustomerListComponent.prototype.getTuiDate = function (event) {
|
|
1677
1279
|
var year = event.year;
|
|
@@ -1701,7 +1303,7 @@
|
|
|
1701
1303
|
return CustomerListComponent;
|
|
1702
1304
|
}());
|
|
1703
1305
|
/** @nocollapse */ CustomerListComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, deps: [{ token: MapService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1704
|
-
/** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers",
|
|
1306
|
+
/** @nocollapse */ CustomerListComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerListComponent, selector: "customer-list", inputs: { customers: "customers", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", filterTaskList: "filterTaskList" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"customer-list-wrapper\">\n <div class=\"customer-list-filter\" [formGroup]=\"formGroup\">\n <kwikui-input-date-range\n *ngIf=\"config?.dashboard?.isShowDateFilter\"\n [label]=\"'Date Range'\"\n [id]=\"'dateRange'\"\n [size]=\"'m'\"\n [maxLength]=\"maxLength\"\n [formControlName]=\"'dateRange'\"\n [formControl]=\"dateRangeFormControl\"\n (getKeyValue)=\"onDateRangeChange($event)\"\n ></kwikui-input-date-range>\n <kwikui-input\n *ngIf=\"config?.dashboard?.isAllowSearchFilter\"\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 [config]=\"config\"\n [index]=\"index\"\n (nextStep)=\"handleOnClickNext($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 {{config?.dashboard?.emptyTaskListMessage ?? '0 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: i2__namespace.KwikUIInputDateRangeComponent, selector: "kwikui-input-date-range", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "max", "maxLength", "min", "minLength", "placeholder", "postfix", "prefix", "properties", "size", "validators"], outputs: ["getKeyValue"] }, { type: i2__namespace.KwikUIInputComponent, selector: "kwikui-input", inputs: ["case", "disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "placeholder", "postfix", "prefix", "properties", "size", "type", "validators"], outputs: ["getKeyValue"] }, { type: i3__namespace.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "config"], outputs: ["nextStep", "removeTask"] }], directives: [{ type: i5__namespace$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i5__namespace$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5__namespace$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i5__namespace$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i5__namespace$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3__namespace.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i3__namespace.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe } });
|
|
1705
1307
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerListComponent, decorators: [{
|
|
1706
1308
|
type: i0.Component,
|
|
1707
1309
|
args: [{
|
|
@@ -1711,7 +1313,7 @@
|
|
|
1711
1313
|
}]
|
|
1712
1314
|
}], ctorParameters: function () { return [{ type: MapService }]; }, propDecorators: { customers: [{
|
|
1713
1315
|
type: i0.Input
|
|
1714
|
-
}],
|
|
1316
|
+
}], config: [{
|
|
1715
1317
|
type: i0.Input
|
|
1716
1318
|
}], nextStep: [{
|
|
1717
1319
|
type: i0.Output
|
|
@@ -1722,53 +1324,47 @@
|
|
|
1722
1324
|
}] } });
|
|
1723
1325
|
|
|
1724
1326
|
var KwikIDAgentDashboardComponent = /** @class */ (function () {
|
|
1725
|
-
function KwikIDAgentDashboardComponent(mapService,
|
|
1327
|
+
function KwikIDAgentDashboardComponent(mapService, agentService, httpClient, hostElement, dialogService) {
|
|
1726
1328
|
this.mapService = mapService;
|
|
1727
|
-
this.
|
|
1329
|
+
this.agentService = agentService;
|
|
1728
1330
|
this.httpClient = httpClient;
|
|
1729
1331
|
this.hostElement = hostElement;
|
|
1730
1332
|
this.dialogService = dialogService;
|
|
1731
|
-
this.
|
|
1333
|
+
this.config = {};
|
|
1732
1334
|
this.taskList = [];
|
|
1733
1335
|
this.nextStep = new i0.EventEmitter();
|
|
1734
1336
|
this.addTask = new i0.EventEmitter();
|
|
1735
1337
|
this.removeTask = new i0.EventEmitter();
|
|
1736
1338
|
this.filterTaskList = new i0.EventEmitter();
|
|
1737
1339
|
this.loading = true;
|
|
1738
|
-
this.options = {
|
|
1739
|
-
stops: ['calc(5rem + 74vw)', 'calc(9rem + 74vw)']
|
|
1740
|
-
};
|
|
1741
1340
|
this.open = false;
|
|
1742
1341
|
this.allFormsData = {};
|
|
1743
1342
|
this.String = String;
|
|
1744
|
-
this.apiLoaded = httpClient
|
|
1745
|
-
.jsonp('https://maps.googleapis.com/maps/api/js?key=AIzaSyA63JY0ja6ZGIR796vJqZARc0c2j8Vgpik&v=3.exp&libraries=geometry,drawing,places', 'callback')
|
|
1746
|
-
.pipe(operators.map(function () { return true; }), operators.catchError(function () { return rxjs.of(false); }));
|
|
1747
1343
|
}
|
|
1748
1344
|
KwikIDAgentDashboardComponent.prototype.windowResizeWatcher = function () {
|
|
1749
1345
|
if (this.hostElement.nativeElement.offsetWidth < 600) {
|
|
1750
1346
|
this.isMobileView = true;
|
|
1751
|
-
this.
|
|
1347
|
+
this.agentService.isMobileView = true;
|
|
1752
1348
|
}
|
|
1753
1349
|
else {
|
|
1754
1350
|
this.isMobileView = false;
|
|
1755
|
-
this.
|
|
1351
|
+
this.agentService.isMobileView = false;
|
|
1756
1352
|
}
|
|
1757
1353
|
};
|
|
1758
1354
|
KwikIDAgentDashboardComponent.prototype.ngOnInit = function () {
|
|
1759
1355
|
var _this = this;
|
|
1760
1356
|
var _a, _b, _c, _d, _e, _f;
|
|
1761
|
-
this.
|
|
1762
|
-
this.
|
|
1763
|
-
(_c = (_b = (_a = this.
|
|
1764
|
-
this.
|
|
1765
|
-
(_f = (_e = (_d = this.
|
|
1357
|
+
this.agentService.config = this.config;
|
|
1358
|
+
this.agentService.showMapview =
|
|
1359
|
+
(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.isShowMaps) !== null && _c !== void 0 ? _c : false;
|
|
1360
|
+
this.agentService.addTaskForm =
|
|
1361
|
+
(_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.dashboard) === null || _e === void 0 ? void 0 : _e.addTaskForm) !== null && _f !== void 0 ? _f : this.agentService.addTaskForm;
|
|
1766
1362
|
this.loading = false;
|
|
1767
1363
|
setTimeout(function () {
|
|
1768
1364
|
_this.windowResizeWatcher();
|
|
1769
1365
|
}, 1000);
|
|
1770
1366
|
};
|
|
1771
|
-
KwikIDAgentDashboardComponent.prototype.
|
|
1367
|
+
KwikIDAgentDashboardComponent.prototype.handleOnClickNext = function (e) {
|
|
1772
1368
|
this.nextStep.emit(e);
|
|
1773
1369
|
};
|
|
1774
1370
|
KwikIDAgentDashboardComponent.prototype.handleOnClickAddTask = function (task) {
|
|
@@ -1808,8 +1404,8 @@
|
|
|
1808
1404
|
KwikIDAgentDashboardComponent.prototype.handleOnClickViewForms = function (e) { };
|
|
1809
1405
|
return KwikIDAgentDashboardComponent;
|
|
1810
1406
|
}());
|
|
1811
|
-
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token:
|
|
1812
|
-
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵ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" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: i5.MapInfoWindow, descendants: true }], ngImport: i0__namespace, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <div class=\"dashboard-header\">\n <img\n *ngIf=\"\n userService.agentConfig.clientLogo &&\n userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n [src]=\"userService.agentConfig.clientLogo\"\n class=\"dashboard-header-client-logo\"\n />\n <div\n *ngIf=\"\n !userService.agentConfig.clientLogo ||\n !userService.agentConfig?.dashboardConfig?.showClientLogo\n \"\n class=\"dashboard-header-client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ userService.agentConfig.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"userService.agentConfig?.dashboardConfig?.allowAddTask\"\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 <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\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>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ userService.agentConfig.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ userService.agentConfig.agentId }}\n </div>\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.dashboardConfig.showMaps\"\n id=\"\"\n label=\"{{\n userService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n userService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"userService.toggleMapview()\"\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 <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({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </div>\n\n <div class=\"dashboard-body\">\n <div\n *ngIf=\"apiLoaded | async\"\n [class]=\"userService.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\n class=\"task-details\"\n *ngIf=\"\n !userService.isMobileView && userService.showTaskDetails != undefined && !userService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[userService.showTaskDetails]\"\n [agentConfig]=\"agentConfig\"\n (nextStep)=\"goToNextStep($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !userService.isMobileView &&\n userService.showTaskDetails == undefined &&\n !userService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\"/>\n <div class=\"\">Select a Task to view it's details.</div>\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\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [formConfig]=\"userService.addTaskFormConfig\"\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-logo{max-height:50px;padding-left:1rem}.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:flex-end;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 .task-details{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 .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.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-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: i5__namespace.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: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "agentConfig"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "agentConfig"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i8__namespace.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i11__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace.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: i5__namespace.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }, { type: i5__namespace.MapInfoWindow, selector: "map-info-window", inputs: ["options", "position"], outputs: ["closeclick", "contentChanged", "domready", "positionChanged", "zindexChanged"], exportAs: ["mapInfoWindow"] }], pipes: { "async": i6__namespace.AsyncPipe } });
|
|
1407
|
+
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, deps: [{ token: MapService }, { token: AgentService }, { token: i3__namespace$1.HttpClient }, { token: i0__namespace.ElementRef }, { token: i10.TuiDialogService }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1408
|
+
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { config: "config", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: googleMaps.MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0__namespace, template: "<div class=\"kwikid-agent-dashboard\" *ngIf=\"!loading\">\n <div class=\"wrapper\">\n <header>\n <img\n *ngIf=\"\n agentService.config?.clientLogo &&\n agentService.config?.dashboard?.isShowClientLogo\n \"\n [src]=\"agentService.config.clientLogo\"\n class=\"client-logo\"\n />\n <div\n *ngIf=\"\n !agentService.config.clientLogo ||\n !agentService.config?.dashboard?.isShowClientLogo\n \"\n class=\"client-name\"\n >\n <kwikui-button\n [icon]=\"'tuiIconLink'\"\n appearance=\"mono\"\n size=\"m\"\n ></kwikui-button>\n\n {{ agentService.config.clientName }}\n </div>\n <div>\n <kwikui-button\n *ngIf=\"agentService.config?.dashboard?.isAllowAddTask\"\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 appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n [icon]=\"'tuiIconRefreshCwLarge'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\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>\n <ng-template #dropdownContent>\n <div class=\"menu-dropdown\">\n <div class=\"menu-dropdown-header\">\n <div class=\"menu-dropdown-header-agent-name\">\n {{ agentService.config.agentName }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID: {{ agentService.config.agentId }}\n </div>\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.config.dashboard.isShowMaps\"\n id=\"\"\n label=\"{{\n agentService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n icon=\"{{\n agentService.showMapview ? 'tuiIconEyeOff' : 'tuiIconEye'\n }}\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n styles=\"padding: 0rem !important\"\n (onClick)=\"agentService.toggleMapview()\"\n ></kwikui-button>\n </div>\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)=\"handleOnClickNext({ stepType: 'LOGOUT' })\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n </header>\n\n <div class=\"dashboard-body\">\n <div [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\">\n <div id=\"map\" style=\"height: 100%\"></div>\n </div>\n\n <div\n class=\"task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails != undefined &&\n !agentService.showMapview\n \"\n >\n <customer-details\n [customer]=\"taskList[agentService.isShowTaskDetails]\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n ></customer-details>\n </div>\n\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.isShowTaskDetails == undefined &&\n !agentService.showMapview\n \"\n >\n <img src=\"assets/No-Results.jpg\" class=\"no-task-img\" alt=\"No Task\" />\n <div class=\"\">Select a Task to view it's details.</div>\n </div>\n\n <div class=\"customer-list\">\n <customer-list\n [customers]=\"taskList\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n\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\n icon=\"tuiIconX\"\n id=\"\"\n styles=\"\"\n type=\"button\"\n appearance=\"mono\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"observer.complete()\"\n ></kwikui-button>\n </div>\n <kwikid-form-view\n [allFormsData]=\"allFormsData\"\n [formConfig]=\"agentService.addTaskForm\"\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 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:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper header .client-logo{height:100%;padding-left:1rem}.kwikid-agent-dashboard .wrapper 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 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:4rem;border:1px solid #fafafa;box-shadow:0 2px 10px -6px #000}.kwikid-agent-dashboard .wrapper 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:flex-end;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 .task-details{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 .no-task-details{width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;grid-gap:.5rem;gap:.5rem;overflow:hidden;color:#555}.kwikid-agent-dashboard .wrapper .dashboard-body .no-task-details .no-task-img{height:100px;width:100px}.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-header .menu-dropdown-header-agent-name{font-size:1.2rem;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}\n"], components: [{ type: i2__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }, { type: CustomerDetailsComponent, selector: "customer-details", inputs: ["customer", "config"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "config"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i7__namespace.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i5__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9__namespace.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i10__namespace.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i10__namespace.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i10__namespace.TuiDropdownPositionDirective, selector: "[tuiDropdown]:not([tuiDropdownCustomPosition]):not([tuiDropdownSided])" }, { type: i10__namespace.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i10__namespace.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
|
|
1813
1409
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardComponent, decorators: [{
|
|
1814
1410
|
type: i0.Component,
|
|
1815
1411
|
args: [{
|
|
@@ -1818,14 +1414,14 @@
|
|
|
1818
1414
|
styleUrls: ['./kwikid-agent-dashboard.component.scss']
|
|
1819
1415
|
}]
|
|
1820
1416
|
}], ctorParameters: function () {
|
|
1821
|
-
return [{ type: MapService }, { type:
|
|
1417
|
+
return [{ type: MapService }, { type: AgentService }, { type: i3__namespace$1.HttpClient }, { type: i0__namespace.ElementRef }, { type: i10__namespace.TuiDialogService, decorators: [{
|
|
1822
1418
|
type: i0.Inject,
|
|
1823
|
-
args: [
|
|
1419
|
+
args: [i10.TuiDialogService]
|
|
1824
1420
|
}] }];
|
|
1825
1421
|
}, propDecorators: { windowResizeWatcher: [{
|
|
1826
1422
|
type: i0.HostListener,
|
|
1827
1423
|
args: ['window:resize', ['$event']]
|
|
1828
|
-
}],
|
|
1424
|
+
}], config: [{
|
|
1829
1425
|
type: i0.Input
|
|
1830
1426
|
}], taskList: [{
|
|
1831
1427
|
type: i0.Input
|
|
@@ -1839,7 +1435,10 @@
|
|
|
1839
1435
|
type: i0.Output
|
|
1840
1436
|
}], infoWindow: [{
|
|
1841
1437
|
type: i0.ViewChild,
|
|
1842
|
-
args: [
|
|
1438
|
+
args: [googleMaps.MapInfoWindow, { static: false }]
|
|
1439
|
+
}], mapElement: [{
|
|
1440
|
+
type: i0.ViewChild,
|
|
1441
|
+
args: ['map', { static: true }]
|
|
1843
1442
|
}] } });
|
|
1844
1443
|
|
|
1845
1444
|
var KwikIDAgentDashboardModule = /** @class */ (function () {
|
|
@@ -1853,7 +1452,7 @@
|
|
|
1853
1452
|
CustomerTileComponent,
|
|
1854
1453
|
Ng2SearchPipe,
|
|
1855
1454
|
StatusPillComponent,
|
|
1856
|
-
CustomerDetailsComponent], imports: [
|
|
1455
|
+
CustomerDetailsComponent], imports: [i5.CommonModule,
|
|
1857
1456
|
i3$1.HttpClientModule,
|
|
1858
1457
|
i5$1.FormsModule,
|
|
1859
1458
|
i5$1.ReactiveFormsModule,
|
|
@@ -1864,20 +1463,20 @@
|
|
|
1864
1463
|
i2.KwikUIInputSelectModule,
|
|
1865
1464
|
i2.KwikUITableModule,
|
|
1866
1465
|
i2.KwikUITablePaginationModule,
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1466
|
+
i7.KwikIDFormViewModule,
|
|
1467
|
+
i10.TuiRootModule,
|
|
1468
|
+
i10.TuiDialogModule,
|
|
1469
|
+
i10.TuiDropdownModule,
|
|
1871
1470
|
addonMobile.TuiSidebarModule,
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1471
|
+
i9.TuiActiveZoneModule,
|
|
1472
|
+
i10.TuiGroupModule,
|
|
1473
|
+
i10.TuiSvgModule,
|
|
1875
1474
|
i3.ScrollingModule,
|
|
1876
|
-
|
|
1475
|
+
googleMaps.GoogleMapsModule,
|
|
1877
1476
|
i3$1.HttpClientModule,
|
|
1878
1477
|
i3$1.HttpClientJsonpModule], exports: [KwikIDAgentDashboardComponent] });
|
|
1879
1478
|
/** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: KwikIDAgentDashboardModule, imports: [[
|
|
1880
|
-
|
|
1479
|
+
i5.CommonModule,
|
|
1881
1480
|
i3$1.HttpClientModule,
|
|
1882
1481
|
i5$1.FormsModule,
|
|
1883
1482
|
i5$1.ReactiveFormsModule,
|
|
@@ -1888,16 +1487,16 @@
|
|
|
1888
1487
|
i2.KwikUIInputSelectModule,
|
|
1889
1488
|
i2.KwikUITableModule,
|
|
1890
1489
|
i2.KwikUITablePaginationModule,
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1490
|
+
i7.KwikIDFormViewModule,
|
|
1491
|
+
i10.TuiRootModule,
|
|
1492
|
+
i10.TuiDialogModule,
|
|
1493
|
+
i10.TuiDropdownModule,
|
|
1895
1494
|
addonMobile.TuiSidebarModule,
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1495
|
+
i9.TuiActiveZoneModule,
|
|
1496
|
+
i10.TuiGroupModule,
|
|
1497
|
+
i10.TuiSvgModule,
|
|
1899
1498
|
i3.ScrollingModule,
|
|
1900
|
-
|
|
1499
|
+
googleMaps.GoogleMapsModule,
|
|
1901
1500
|
i3$1.HttpClientModule,
|
|
1902
1501
|
i3$1.HttpClientJsonpModule
|
|
1903
1502
|
]] });
|
|
@@ -1913,7 +1512,7 @@
|
|
|
1913
1512
|
CustomerDetailsComponent
|
|
1914
1513
|
],
|
|
1915
1514
|
imports: [
|
|
1916
|
-
|
|
1515
|
+
i5.CommonModule,
|
|
1917
1516
|
i3$1.HttpClientModule,
|
|
1918
1517
|
i5$1.FormsModule,
|
|
1919
1518
|
i5$1.ReactiveFormsModule,
|
|
@@ -1924,16 +1523,16 @@
|
|
|
1924
1523
|
i2.KwikUIInputSelectModule,
|
|
1925
1524
|
i2.KwikUITableModule,
|
|
1926
1525
|
i2.KwikUITablePaginationModule,
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1526
|
+
i7.KwikIDFormViewModule,
|
|
1527
|
+
i10.TuiRootModule,
|
|
1528
|
+
i10.TuiDialogModule,
|
|
1529
|
+
i10.TuiDropdownModule,
|
|
1931
1530
|
addonMobile.TuiSidebarModule,
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1531
|
+
i9.TuiActiveZoneModule,
|
|
1532
|
+
i10.TuiGroupModule,
|
|
1533
|
+
i10.TuiSvgModule,
|
|
1935
1534
|
i3.ScrollingModule,
|
|
1936
|
-
|
|
1535
|
+
googleMaps.GoogleMapsModule,
|
|
1937
1536
|
i3$1.HttpClientModule,
|
|
1938
1537
|
i3$1.HttpClientJsonpModule
|
|
1939
1538
|
],
|