kwikid-agent-dashboard 0.0.30 → 0.0.31
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 +31 -57
- package/bundles/kwikid-agent-dashboard.umd.js.map +1 -1
- package/esm2015/lib/components/customer-details/customer-details.component.js +3 -31
- package/esm2015/lib/components/customer-tile/customer-tile.component.js +2 -2
- package/esm2015/lib/kwikid-agent-dashboard.component.js +13 -4
- package/esm2015/lib/services/google-maps.service.js +11 -19
- package/esm2015/lib/services/open-street-maps.service.js +6 -4
- package/fesm2015/kwikid-agent-dashboard.js +28 -54
- package/fesm2015/kwikid-agent-dashboard.js.map +1 -1
- package/lib/components/customer-details/customer-details.component.d.ts +1 -29
- package/lib/kwikid-agent-dashboard.component.d.ts +2 -0
- package/lib/services/google-maps.service.d.ts +0 -2
- package/package.json +1 -1
|
@@ -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('kwikid-toolkit'), require('rxjs'), require('rxjs
|
|
3
|
-
typeof define === 'function' && define.amd ? define('kwikid-agent-dashboard', ['exports', '@angular/core', '@angular/google-maps', '@taiga-ui/core', 'kwikid-toolkit', 'rxjs', 'rxjs
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["kwikid-agent-dashboard"] = {}, global.ng.core, global.ng.googleMaps, global["@taiga-ui/core"], global.kwikidToolkit, global.rxjs, global.rxjs
|
|
5
|
-
})(this, (function (exports, i0, i2, i11, kwikidToolkit,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/google-maps'), require('@taiga-ui/core'), require('kwikid-toolkit'), require('rxjs/operators'), require('rxjs'), require('@angular/common/http'), require('kwikui'), require('leaflet'), require('leaflet-routing-machine'), 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', 'kwikid-toolkit', 'rxjs/operators', 'rxjs', '@angular/common/http', 'kwikui', 'leaflet', 'leaflet-routing-machine', '@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.kwikidToolkit, global.rxjs.operators, global.rxjs, global.ng.common.http, global.i4, global.L, null, global.ng.common, global.ng.forms, global["@taiga-ui/cdk"], global.ng.cdk.scrolling, global.i8, global["@taiga-ui/addon-mobile"]));
|
|
5
|
+
})(this, (function (exports, i0, i2, i11, kwikidToolkit, operators, rxjs, i3, i4, L, leafletRoutingMachine, i6, i7, i10, i5, i8, addonMobile) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -761,15 +761,6 @@
|
|
|
761
761
|
});
|
|
762
762
|
});
|
|
763
763
|
};
|
|
764
|
-
// Load Google Maps
|
|
765
|
-
GoogleMapsService.prototype.loadMaps = function (apiKey) {
|
|
766
|
-
var url = "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&v=3.exp&libraries=geometry,drawing,places";
|
|
767
|
-
this.apiKey = apiKey;
|
|
768
|
-
return this.httpClient.jsonp(url, 'callback').pipe(operators.map(function () { return true; }), operators.catchError(function () {
|
|
769
|
-
console.error('Error loading Google Maps JavaScript API.');
|
|
770
|
-
return rxjs.of(false);
|
|
771
|
-
}));
|
|
772
|
-
};
|
|
773
764
|
// To Initialize Google Maps
|
|
774
765
|
GoogleMapsService.prototype.initializeMap = function () {
|
|
775
766
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -834,7 +825,7 @@
|
|
|
834
825
|
isValidLocation = kwikidToolkit.isNotEmptyArray(data === null || data === void 0 ? void 0 : data.results);
|
|
835
826
|
location = isValidLocation
|
|
836
827
|
? (_m = (_l = data === null || data === void 0 ? void 0 : data.results[0]) === null || _l === void 0 ? void 0 : _l.geometry) === null || _m === void 0 ? void 0 : _m.location
|
|
837
|
-
:
|
|
828
|
+
: { lat: null, lng: null };
|
|
838
829
|
// Set Location validation & Google Maps URL
|
|
839
830
|
location['isValidLocation'] = isValidLocation;
|
|
840
831
|
location['googleMapsUrl'] = "https://www.google.com/maps/place/" + (location === null || location === void 0 ? void 0 : location.lat) + "," + (location === null || location === void 0 ? void 0 : location.lng);
|
|
@@ -896,11 +887,13 @@
|
|
|
896
887
|
case 0:
|
|
897
888
|
path = [];
|
|
898
889
|
promises = tasks.map(function (task) {
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
890
|
+
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
891
|
+
path.push({
|
|
892
|
+
location: task,
|
|
893
|
+
stopover: true
|
|
894
|
+
});
|
|
895
|
+
_this.allMarkers.push(task);
|
|
896
|
+
}
|
|
904
897
|
});
|
|
905
898
|
return [4 /*yield*/, Promise.all(promises)];
|
|
906
899
|
case 1:
|
|
@@ -963,7 +956,7 @@
|
|
|
963
956
|
if (index != null) {
|
|
964
957
|
var taskMarker = this.allMarkers[index + 1];
|
|
965
958
|
// If Location is Available in Task Details
|
|
966
|
-
if (taskMarker.isValidLocation) {
|
|
959
|
+
if (taskMarker === null || taskMarker === void 0 ? void 0 : taskMarker.isValidLocation) {
|
|
967
960
|
var request = {
|
|
968
961
|
origin: this.myPosition,
|
|
969
962
|
destination: taskMarker,
|
|
@@ -1058,7 +1051,7 @@
|
|
|
1058
1051
|
isValidLocation = kwikidToolkit.isNotEmptyArray(data) && ((_l = data[0]) === null || _l === void 0 ? void 0 : _l.lat) & ((_m = data[0]) === null || _m === void 0 ? void 0 : _m.lon);
|
|
1059
1052
|
location = isValidLocation
|
|
1060
1053
|
? { lat: (_o = data[0]) === null || _o === void 0 ? void 0 : _o.lat, lng: (_p = data[0]) === null || _p === void 0 ? void 0 : _p.lon }
|
|
1061
|
-
:
|
|
1054
|
+
: { lat: null, lng: null };
|
|
1062
1055
|
// Set Location validation & Google Maps URL
|
|
1063
1056
|
location['isValidLocation'] = isValidLocation;
|
|
1064
1057
|
location['color'] = isValidLocation ? 'blue' : 'red';
|
|
@@ -1176,8 +1169,10 @@
|
|
|
1176
1169
|
tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
|
|
1177
1170
|
// Plot Markers for All Tasks
|
|
1178
1171
|
tasks.map(function (task) {
|
|
1179
|
-
|
|
1180
|
-
|
|
1172
|
+
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
1173
|
+
var marker = _this.getLocation(task);
|
|
1174
|
+
_this.addMarker(marker);
|
|
1175
|
+
}
|
|
1181
1176
|
});
|
|
1182
1177
|
styles = [
|
|
1183
1178
|
{ color: 'blue', opacity: 1, weight: 8 },
|
|
@@ -1323,35 +1318,7 @@
|
|
|
1323
1318
|
this.googleMapsService = googleMapsService;
|
|
1324
1319
|
this.openStreetMapsService = openStreetMapsService;
|
|
1325
1320
|
this.cdr = cdr;
|
|
1326
|
-
this.customer = {
|
|
1327
|
-
agent_id: 'sparkcpaital_dev_agent_1',
|
|
1328
|
-
client_name: 'sparkcpaital_dev',
|
|
1329
|
-
extras: {},
|
|
1330
|
-
session_status: '',
|
|
1331
|
-
task_completed_time: '',
|
|
1332
|
-
task_creation_time: '1679469532.340057',
|
|
1333
|
-
task_details: {
|
|
1334
|
-
customer_details: {
|
|
1335
|
-
email: 'gaurang.thakkar1997@gmail.com',
|
|
1336
|
-
phone: '9930607033',
|
|
1337
|
-
lc_lg_code: 'LC123456',
|
|
1338
|
-
branch_code: 'HDFC56475H',
|
|
1339
|
-
business_code: 'ABCD12345H'
|
|
1340
|
-
},
|
|
1341
|
-
link_details: {
|
|
1342
|
-
queryParams: {
|
|
1343
|
-
autoSendMobileOtp: true,
|
|
1344
|
-
client_id: 'sparkcpaital_dev',
|
|
1345
|
-
mobileOtpVerification: true,
|
|
1346
|
-
mobile_number: '9930607033',
|
|
1347
|
-
user_id: '9930607033'
|
|
1348
|
-
}
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
|
-
task_id: 'sparkcpaital_dev_4632c291-1b4c-4f5b-bb95-f9acaab45e27',
|
|
1352
|
-
task_schedule_time: '1679469532.340057',
|
|
1353
|
-
user_id: '9930607033'
|
|
1354
|
-
};
|
|
1321
|
+
this.customer = {};
|
|
1355
1322
|
this.viewTaskDetails = [];
|
|
1356
1323
|
this.nextStep = new i0.EventEmitter();
|
|
1357
1324
|
this.removeTask = new i0.EventEmitter();
|
|
@@ -1408,7 +1375,7 @@
|
|
|
1408
1375
|
return CustomerDetailsComponent;
|
|
1409
1376
|
}());
|
|
1410
1377
|
/** @nocollapse */ CustomerDetailsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: GoogleMapsService }, { token: OpenStreetMapsService }, { token: i0__namespace.ChangeDetectorRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1411
|
-
/** @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" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">User Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n <kwikui-label-value-pair\n [data]=\"customer\"\n [field]=\"config?.dashboard?.taskIdentifier ?? {value:'$.user_id', type: 'string'} \"\n ></kwikui-label-value-pair>\n\n <status-pill\n *ngIf=\"config?.dashboard?.isShowTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\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 <kwikui-label-value-pair\n [field]=\"taskData\"\n [data]=\"customer\"\n ></kwikui-label-value-pair>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Created at: {{ 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({\n customer: customer,\n stepType: 'SHARE_JOURNEY_LINK'\n })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.
|
|
1378
|
+
/** @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" }, usesOnChanges: true, ngImport: i0__namespace, template: "<div class=\"customer-details-wrapper\">\n <div class=\"customer-details-heading\">User Details</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n <kwikui-label-value-pair\n [data]=\"customer\"\n [field]=\"config?.dashboard?.taskIdentifier ?? {value:'$.user_id', type: 'string'} \"\n ></kwikui-label-value-pair>\n\n <status-pill\n *ngIf=\"config?.dashboard?.isShowTaskStatus\"\n [status]=\"customer.session_status\"\n ></status-pill>\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 <kwikui-label-value-pair\n [field]=\"taskData\"\n [data]=\"customer\"\n ></kwikui-label-value-pair>\n </div>\n </div>\n\n <div class=\"customer-details-date\">\n Created at: {{ 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({\n customer: customer,\n stepType: 'SHARE_JOURNEY_LINK'\n })\n \"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-journey-buttons\">\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isShowMaps &&\n customer?.isValidLocation\n \"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"\n goToMaps(customer?.googleMapsUrl)\n \"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n agentService.canStartJourney(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:auto;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{display:flex;flex-direction:row;grid-gap:.6rem;gap:.6rem;align-items:center;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}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{border-radius:10px}::-webkit-scrollbar-thumb{background:lightgray;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:gray}\n"], components: [{ type: i4__namespace.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["field", "data"] }, { type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i4__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0__namespace.ChangeDetectionStrategy.Default });
|
|
1412
1379
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerDetailsComponent, decorators: [{
|
|
1413
1380
|
type: i0.Component,
|
|
1414
1381
|
args: [{
|
|
@@ -1494,7 +1461,7 @@
|
|
|
1494
1461
|
return CustomerTileComponent;
|
|
1495
1462
|
}());
|
|
1496
1463
|
/** @nocollapse */ CustomerTileComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, deps: [{ token: GoogleMapsService }, { token: OpenStreetMapsService }, { token: AgentService }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
1497
|
-
/** @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\n [ngClass]=\"\n index == agentService.isShowTaskDetails\n ? 'customer-tile-wrapper customer-tile-active'\n : 'customer-tile-wrapper'\n \"\n>\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n <kwikui-label-value-pair\n [data]=\"customer\"\n [field]=\"config?.dashboard?.taskIdentifier ?? {value:'$.user_id', type: 'string'} \"\n ></kwikui-label-value-pair>\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 <kwikui-label-value-pair\n [field]=\"taskData\"\n [data]=\"customer\"\n ></kwikui-label-value-pair>\n </div>\n <!-- <div\n *ngIf=\"\n agentService.config?.dashboard?.maps?.sho &&\n agentService.config?.dashboard?.isShowDistanceAndTime &&\n openStreetMapsService.getSelectedTaskDistanceAndTime()\n \"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n Distance: {{ openStreetMapsService.getSelectedTaskDistanceAndTime()?.distance }} |\n Time: {{ openStreetMapsService.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=\"
|
|
1464
|
+
/** @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\n [ngClass]=\"\n index == agentService.isShowTaskDetails\n ? 'customer-tile-wrapper customer-tile-active'\n : 'customer-tile-wrapper'\n \"\n>\n <div class=\"customer-tile-primary-container\">\n <div class=\"customer-tile-primary-container-data\">\n <div class=\"customer-tile-primary-container-userid\">\n <kwikui-label-value-pair\n [data]=\"customer\"\n [field]=\"config?.dashboard?.taskIdentifier ?? {value:'$.user_id', type: 'string'} \"\n ></kwikui-label-value-pair>\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 <kwikui-label-value-pair\n [field]=\"taskData\"\n [data]=\"customer\"\n ></kwikui-label-value-pair>\n </div>\n <!-- <div\n *ngIf=\"\n agentService.config?.dashboard?.maps?.sho &&\n agentService.config?.dashboard?.isShowDistanceAndTime &&\n openStreetMapsService.getSelectedTaskDistanceAndTime()\n \"\n class=\"customer-tile-secondary-container-custom-details\"\n >\n Distance: {{ openStreetMapsService.getSelectedTaskDistanceAndTime()?.distance }} |\n Time: {{ openStreetMapsService.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=\"config.dashboard?.isShowMaps && customer?.isValidLocation\"\n label=\"Show Directions\"\n appearance=\"flat\"\n size=\"s\"\n styles=\"font-size:0.7rem;\"\n (onClick)=\"goToMaps(customer.googleMapsUrl)\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"\n config.dashboard?.isAllowStartJourney &&\n agentService.canStartJourney(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: i4__namespace.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["field", "data"] }, { type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i4__namespace.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type"], outputs: ["onClick"] }], directives: [{ type: i6__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i6__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
1498
1465
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0__namespace, type: CustomerTileComponent, decorators: [{
|
|
1499
1466
|
type: i0.Component,
|
|
1500
1467
|
args: [{
|
|
@@ -1784,9 +1751,7 @@
|
|
|
1784
1751
|
(_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;
|
|
1785
1752
|
if (((_h = (_g = this.config) === null || _g === void 0 ? void 0 : _g.dashboard) === null || _h === void 0 ? void 0 : _h.mapType) == 'google-maps' &&
|
|
1786
1753
|
kwikidToolkit.isNotEmptyValue((_k = (_j = this.config) === null || _j === void 0 ? void 0 : _j.dashboard) === null || _k === void 0 ? void 0 : _k.googleMapsAPIKey)) {
|
|
1787
|
-
this.
|
|
1788
|
-
.loadMaps((_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.dashboard) === null || _m === void 0 ? void 0 : _m.googleMapsAPIKey)
|
|
1789
|
-
.subscribe(function (loaded) {
|
|
1754
|
+
this.loadMaps((_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.dashboard) === null || _m === void 0 ? void 0 : _m.googleMapsAPIKey).subscribe(function (loaded) {
|
|
1790
1755
|
_this.mapsLoaded = loaded;
|
|
1791
1756
|
if (loaded) {
|
|
1792
1757
|
console.log('Google Maps JavaScript API loaded successfully.');
|
|
@@ -1810,6 +1775,15 @@
|
|
|
1810
1775
|
});
|
|
1811
1776
|
});
|
|
1812
1777
|
};
|
|
1778
|
+
// Load Google Maps
|
|
1779
|
+
KwikIDAgentDashboardComponent.prototype.loadMaps = function (apiKey) {
|
|
1780
|
+
var url = "https://maps.googleapis.com/maps/api/js?key=" + apiKey + "&v=3.exp&libraries=geometry,drawing,places";
|
|
1781
|
+
this.googleMapsService.apiKey = apiKey;
|
|
1782
|
+
return this.httpClient.jsonp(url, 'callback').pipe(operators.map(function () { return true; }), operators.catchError(function () {
|
|
1783
|
+
console.error('Error loading Google Maps JavaScript API.');
|
|
1784
|
+
return rxjs.of(false);
|
|
1785
|
+
}));
|
|
1786
|
+
};
|
|
1813
1787
|
KwikIDAgentDashboardComponent.prototype.handleOnClickNext = function (e) {
|
|
1814
1788
|
this.nextStep.emit(e);
|
|
1815
1789
|
};
|