kwikid-agent-dashboard 0.0.37 → 0.0.39
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 +3655 -1317
- package/bundles/kwikid-agent-dashboard.umd.js.map +1 -1
- package/esm2015/lib/kwikid-agent-dashboard.component.js +39 -120
- package/esm2015/lib/kwikid-agent-dashboard.module.js +26 -35
- package/esm2015/lib/v1/components/action-button/action-button.component.js +91 -0
- package/esm2015/lib/v1/components/customer-details/customer-details.component.js +139 -0
- package/esm2015/lib/v1/components/customer-list/customer-list.component.js +201 -0
- package/esm2015/lib/v1/components/customer-tile/customer-tile.component.js +137 -0
- package/esm2015/lib/v1/components/customer-tile/status-pill/status-pill.component.js +54 -0
- package/esm2015/lib/v1/components/customer-tile/status-pill/status-pill.definitions.js +36 -0
- package/esm2015/lib/v1/helpers/maps.helpers.js +46 -0
- package/esm2015/lib/v1/kwikid-agent-dashboard.component.js +177 -0
- package/esm2015/lib/v1/kwikid-agent-dashboard.module.js +120 -0
- package/esm2015/lib/v1/pipes/search-filter.pipe.js +62 -0
- package/esm2015/lib/v1/services/agent.service.js +149 -0
- package/esm2015/lib/v1/services/google-maps.service.js +201 -0
- package/esm2015/lib/v1/services/open-street-maps.service.js +252 -0
- package/esm2015/lib/v2/components/agent-info/agent-info.component.js +20 -0
- package/esm2015/lib/v2/components/agent-info/agent-info.module.js +37 -0
- package/esm2015/lib/v2/components/bottom-sheet/bottom-sheet.component.js +111 -0
- package/esm2015/lib/v2/components/bottom-sheet/bottom-sheet.module.js +41 -0
- package/esm2015/lib/v2/components/components.module.js +79 -0
- package/esm2015/lib/v2/components/map-view/map-view.component.js +39 -0
- package/esm2015/lib/v2/components/map-view/map-view.module.js +37 -0
- package/esm2015/lib/v2/components/primary-actions/primary-actions.component.js +65 -0
- package/esm2015/lib/v2/components/primary-actions/primary-actions.module.js +54 -0
- package/esm2015/lib/v2/components/task-detail/task-detail.component.js +82 -0
- package/esm2015/lib/v2/components/task-detail/task-detail.module.js +41 -0
- package/esm2015/lib/v2/components/task-item/task-item.component.js +107 -0
- package/esm2015/lib/v2/components/task-item/task-item.constant.js +12 -0
- package/esm2015/lib/v2/components/task-item/task-item.module.js +45 -0
- package/esm2015/lib/v2/components/task-item-status/task-item-status.component.js +51 -0
- package/esm2015/lib/v2/components/task-item-status/task-item-status.module.js +19 -0
- package/esm2015/lib/v2/components/task-list/task-list.component.js +186 -0
- package/esm2015/lib/v2/components/task-list/task-list.module.js +57 -0
- package/esm2015/lib/v2/components/task-list-search/task-list-search.component.js +118 -0
- package/esm2015/lib/v2/components/task-list-search/task-list-search.module.js +41 -0
- package/esm2015/lib/v2/components/task-preview/task-preview.component.js +30 -0
- package/esm2015/lib/v2/components/task-preview/task-preview.module.js +37 -0
- package/esm2015/lib/v2/helpers/array.helper.js +10 -0
- package/esm2015/lib/v2/helpers/date.helplers.js +17 -0
- package/esm2015/lib/v2/kwikid-agent-dashboard.component.js +61 -0
- package/esm2015/lib/v2/kwikid-agent-dashboard.module.js +45 -0
- package/esm2015/lib/v2/layout/layout-body/layout-body.component.js +274 -0
- package/esm2015/lib/v2/layout/layout-body/layout-body.module.js +55 -0
- package/esm2015/lib/v2/layout/layout-header/layout-header.component.js +60 -0
- package/esm2015/lib/v2/layout/layout-header/layout-header.module.js +48 -0
- package/esm2015/lib/v2/layout/layout.module.js +18 -0
- package/esm2015/lib/v2/pipes/search-filter.pipe.js +62 -0
- package/fesm2015/kwikid-agent-dashboard.js +3255 -1100
- package/fesm2015/kwikid-agent-dashboard.js.map +1 -1
- package/lib/kwikid-agent-dashboard.component.d.ts +11 -36
- package/lib/kwikid-agent-dashboard.module.d.ts +13 -16
- package/lib/v1/components/action-button/action-button.component.d.ts +18 -0
- package/lib/{components → v1/components}/customer-details/customer-details.component.d.ts +13 -6
- package/lib/{components → v1/components}/customer-list/customer-list.component.d.ts +25 -15
- package/lib/{components → v1/components}/customer-tile/customer-tile.component.d.ts +12 -5
- package/lib/{components → v1/components}/customer-tile/status-pill/status-pill.component.d.ts +6 -2
- package/lib/{components → v1/components}/customer-tile/status-pill/status-pill.definitions.d.ts +1 -1
- package/lib/v1/kwikid-agent-dashboard.component.d.ts +54 -0
- package/lib/v1/kwikid-agent-dashboard.module.d.ts +23 -0
- package/lib/{pipes → v1/pipes}/search-filter.pipe.d.ts +1 -1
- package/lib/{services → v1/services}/agent.service.d.ts +1 -1
- package/lib/{services → v1/services}/google-maps.service.d.ts +4 -4
- package/lib/{services → v1/services}/open-street-maps.service.d.ts +5 -5
- package/lib/v2/components/agent-info/agent-info.component.d.ts +8 -0
- package/lib/v2/components/agent-info/agent-info.module.d.ts +11 -0
- package/lib/v2/components/bottom-sheet/bottom-sheet.component.d.ts +24 -0
- package/lib/v2/components/bottom-sheet/bottom-sheet.module.d.ts +12 -0
- package/lib/v2/components/components.module.d.ts +15 -0
- package/lib/v2/components/map-view/map-view.component.d.ts +10 -0
- package/lib/v2/components/map-view/map-view.module.d.ts +11 -0
- package/lib/v2/components/primary-actions/primary-actions.component.d.ts +14 -0
- package/lib/v2/components/primary-actions/primary-actions.module.d.ts +13 -0
- package/lib/v2/components/task-detail/task-detail.component.d.ts +23 -0
- package/lib/v2/components/task-detail/task-detail.module.d.ts +12 -0
- package/lib/v2/components/task-item/task-item.component.d.ts +23 -0
- package/lib/v2/components/task-item/task-item.constant.d.ts +11 -0
- package/lib/v2/components/task-item/task-item.module.d.ts +13 -0
- package/lib/v2/components/task-item-status/task-item-status.component.d.ts +14 -0
- package/lib/v2/components/task-item-status/task-item-status.module.d.ts +9 -0
- package/lib/v2/components/task-list/task-list.component.d.ts +45 -0
- package/lib/v2/components/task-list/task-list.module.d.ts +16 -0
- package/lib/v2/components/task-list-search/task-list-search.component.d.ts +34 -0
- package/lib/v2/components/task-list-search/task-list-search.module.d.ts +12 -0
- package/lib/v2/components/task-preview/task-preview.component.d.ts +11 -0
- package/lib/v2/components/task-preview/task-preview.module.d.ts +11 -0
- package/lib/v2/helpers/array.helper.d.ts +1 -0
- package/lib/v2/helpers/date.helplers.d.ts +3 -0
- package/lib/v2/kwikid-agent-dashboard.component.d.ts +17 -0
- package/lib/v2/kwikid-agent-dashboard.module.d.ts +13 -0
- package/lib/v2/layout/layout-body/layout-body.component.d.ts +42 -0
- package/lib/v2/layout/layout-body/layout-body.module.d.ts +14 -0
- package/lib/v2/layout/layout-header/layout-header.component.d.ts +20 -0
- package/lib/v2/layout/layout-header/layout-header.module.d.ts +13 -0
- package/lib/v2/layout/layout.module.d.ts +8 -0
- package/lib/v2/pipes/search-filter.pipe.d.ts +25 -0
- package/package.json +2 -2
- package/esm2015/lib/components/customer-details/customer-details.component.js +0 -90
- package/esm2015/lib/components/customer-list/customer-list.component.js +0 -165
- package/esm2015/lib/components/customer-tile/customer-tile.component.js +0 -87
- package/esm2015/lib/components/customer-tile/status-pill/status-pill.component.js +0 -32
- package/esm2015/lib/components/customer-tile/status-pill/status-pill.definitions.js +0 -36
- package/esm2015/lib/helpers/maps.helpers.js +0 -46
- package/esm2015/lib/pipes/search-filter.pipe.js +0 -62
- package/esm2015/lib/services/agent.service.js +0 -153
- package/esm2015/lib/services/google-maps.service.js +0 -201
- package/esm2015/lib/services/open-street-maps.service.js +0 -252
- /package/lib/{helpers → v1/helpers}/maps.helpers.d.ts +0 -0
|
@@ -1,882 +1,3033 @@
|
|
|
1
|
-
import { __awaiter } from 'tslib';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
2
|
+
import { EventEmitter, Component, Input, Output, ChangeDetectionStrategy, ViewChild, Inject, HostListener, Injectable, ViewChildren, Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import { __awaiter, __decorate } from 'tslib';
|
|
4
|
+
import * as i1 from 'kwikui';
|
|
5
|
+
import { KwikUIButtonModule, KwikUIInputModule, KwikUIInputDateModule, KwikUIInputDateRangeModule, KwikUIInputSelectModule, KwikUILabelValuePairModule, KwikUITableModule, KwikUITablePaginationModule, KwikUIModule, KwikUILoaderModule } from 'kwikui';
|
|
6
|
+
import * as i2 from '@taiga-ui/cdk';
|
|
7
|
+
import { ALWAYS_FALSE_HANDLER, TuiDay, TuiDayRange, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
8
|
+
import * as i3 from '@taiga-ui/core';
|
|
9
|
+
import { TuiDialogService, TuiRootModule, TuiDialogModule, TuiDropdownModule, TuiGroupModule, TuiSvgModule, TuiHostedDropdownModule, TuiDataListModule, TuiButtonModule } from '@taiga-ui/core';
|
|
10
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
11
|
+
import * as i8 from '@taiga-ui/addon-preview';
|
|
12
|
+
import { TuiPreviewDialogService, TuiPreviewActionModule, TuiPreviewModule } from '@taiga-ui/addon-preview';
|
|
13
|
+
import { logMethod, checkObjectPathExists, checkObjectKeyExists, convertSnakeCaseToNormalText, isNotEmptyValue, getObjectValueFromPath, isNotEmptyArray, isEmptyValue, RuleEngine, getObjectDeepCopy } from 'kwikid-toolkit';
|
|
14
|
+
import * as i1$1 from '@taiga-ui/kit';
|
|
15
|
+
import { TuiItemsWithMoreModule, TuiBadgeModule, TuiAccordionModule, TuiPaginationModule } from '@taiga-ui/kit';
|
|
16
|
+
import * as i7 from '@angular/common';
|
|
17
|
+
import { CommonModule } from '@angular/common';
|
|
18
|
+
import * as i6 from '@taiga-ui/core/directives/dropdown';
|
|
19
|
+
import * as i3$1 from 'kwikid-forms';
|
|
20
|
+
import { KwikIDFormViewModule, KwikIDFormsModule } from 'kwikid-forms';
|
|
21
|
+
import * as i2$1 from '@angular/forms';
|
|
22
|
+
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
23
|
+
import * as i2$2 from '@angular/google-maps';
|
|
5
24
|
import { MapInfoWindow, GoogleMapsModule } from '@angular/google-maps';
|
|
6
|
-
import * as i11 from '@taiga-ui/core';
|
|
7
|
-
import { TuiDialogService, TuiRootModule, TuiDialogModule, TuiDropdownModule, TuiGroupModule, TuiSvgModule } from '@taiga-ui/core';
|
|
8
|
-
import { getObjectValueFromPath, checkObjectPathExists, isNotEmptyArray, isEmptyValue, isNotEmptyValue } from 'kwikid-toolkit';
|
|
9
25
|
import { map, catchError } from 'rxjs/operators';
|
|
10
26
|
import { of } from 'rxjs';
|
|
11
|
-
import * as i3 from '@angular/common/http';
|
|
27
|
+
import * as i3$2 from '@angular/common/http';
|
|
12
28
|
import { HttpClientModule, HttpClientJsonpModule } from '@angular/common/http';
|
|
13
|
-
import * as i4 from 'kwikui';
|
|
14
|
-
import { KwikUIButtonModule, KwikUIInputModule, KwikUIInputDateModule, KwikUIInputDateRangeModule, KwikUIInputSelectModule, KwikUILabelValuePairModule, KwikUITableModule, KwikUITablePaginationModule } from 'kwikui';
|
|
15
29
|
import * as L from 'leaflet';
|
|
16
30
|
import 'leaflet-routing-machine';
|
|
17
|
-
import * as i6 from '@angular/common';
|
|
18
|
-
import { CommonModule } from '@angular/common';
|
|
19
|
-
import * as i7 from '@angular/forms';
|
|
20
|
-
import { FormGroup, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
21
|
-
import * as i10 from '@taiga-ui/cdk';
|
|
22
|
-
import { TuiDay, TuiDayRange, TuiActiveZoneModule } from '@taiga-ui/cdk';
|
|
23
31
|
import * as i5 from '@angular/cdk/scrolling';
|
|
24
32
|
import { ScrollingModule } from '@angular/cdk/scrolling';
|
|
25
|
-
import * as i8 from 'kwikid-forms';
|
|
26
|
-
import { KwikIDFormViewModule } from 'kwikid-forms';
|
|
27
33
|
import { TuiSidebarModule } from '@taiga-ui/addon-mobile';
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let currentPoint = startingPoint;
|
|
50
|
-
const path = [currentPoint];
|
|
51
|
-
const visitedPoints = new Set([currentPoint]);
|
|
52
|
-
while (unvisitedPoints.length > 0) {
|
|
53
|
-
let nearestPoint = null;
|
|
54
|
-
let minDistance = Number.POSITIVE_INFINITY;
|
|
55
|
-
for (const point of unvisitedPoints) {
|
|
56
|
-
const distance = calculateDistance(currentPoint, point);
|
|
57
|
-
if (distance < minDistance) {
|
|
58
|
-
minDistance = distance;
|
|
59
|
-
nearestPoint = point;
|
|
60
|
-
}
|
|
35
|
+
class LayoutHeaderComponent {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.config = {};
|
|
38
|
+
this.agentInfo = {};
|
|
39
|
+
this.onGetTaskList = new EventEmitter();
|
|
40
|
+
this.onClickPerformAction = new EventEmitter();
|
|
41
|
+
this.open = false;
|
|
42
|
+
}
|
|
43
|
+
ngOnInit() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
45
|
+
}
|
|
46
|
+
refreshPage() {
|
|
47
|
+
this.handleOnGetTaskList({});
|
|
48
|
+
}
|
|
49
|
+
onClick() {
|
|
50
|
+
this.open = !this.open;
|
|
51
|
+
}
|
|
52
|
+
onObscured(obscured) {
|
|
53
|
+
if (obscured) {
|
|
54
|
+
this.open = false;
|
|
61
55
|
}
|
|
62
|
-
path.push(nearestPoint);
|
|
63
|
-
visitedPoints.add(nearestPoint);
|
|
64
|
-
currentPoint = nearestPoint;
|
|
65
|
-
unvisitedPoints = unvisitedPoints.filter((point) => !visitedPoints.has(point));
|
|
66
56
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
EStatus.COMPLETE,
|
|
99
|
-
EStatus.WAITING,
|
|
100
|
-
EStatus.SESSION_EXPIRED,
|
|
101
|
-
EStatus.KYC_REJECTED,
|
|
102
|
-
EStatus.KYC_REQUEST_REJECTED,
|
|
103
|
-
EStatus.KYC_REQUEST_ACCEPTED,
|
|
104
|
-
EStatus.KYC_RESULT_REJECTED,
|
|
105
|
-
EStatus.KYC_RESULT_APPROVED,
|
|
106
|
-
EStatus.KYC_RESULT_PARTIAL_UPDATE,
|
|
107
|
-
EStatus.KYC_RESULT_UNDER_REVIEW
|
|
108
|
-
];
|
|
57
|
+
onActiveZone(active) {
|
|
58
|
+
this.open = active && this.open;
|
|
59
|
+
}
|
|
60
|
+
logout() {
|
|
61
|
+
this.handleOnClickPerformAction({ action: { type: "logout" } });
|
|
62
|
+
}
|
|
63
|
+
handleOnGetTaskList(event) {
|
|
64
|
+
this.onGetTaskList.emit(event);
|
|
65
|
+
}
|
|
66
|
+
handleOnClickPerformAction(event) {
|
|
67
|
+
this.onClickPerformAction.emit(event);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
/** @nocollapse */ LayoutHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
71
|
+
/** @nocollapse */ LayoutHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: LayoutHeaderComponent, selector: "layout-header", inputs: { config: "config", agentInfo: "agentInfo" }, outputs: { onGetTaskList: "onGetTaskList", onClickPerformAction: "onClickPerformAction" }, ngImport: i0, template: "<div id=\"header-container\">\n <div id=\"client-information-wrapper\">\n <img\n id=\"client-logo\"\n [src]=\"config?.theme?.clientLogo\"\n />\n </div>\n <div id=\"actions-wrapper\">\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconSettingsLarge'\"\n (onClick)=\"onClick()\"\n appearance=\"mono\"\n size=\"l\"\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 {{ agentInfo?.agent_name ?? \"Welcome\" }}\n </div>\n <div class=\"menu-dropdown-header-agent-id\">\n Agent ID:\n {{ agentInfo?.agent_id }}\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 appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n label=\"Refresh\"\n [icon]=\"'tuiIconRefreshCw'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refreshPage()\"\n ></kwikui-button>\n </div>\n <hr />\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"logout()\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n </div>\n</div>\n", styles: ["#header-container{display:flex;align-items:center;justify-content:space-between;height:100%;width:100%;padding:1rem}#header-container #client-information-wrapper{height:100%;width:100%}#header-container #client-information-wrapper #client-logo{height:100%}#header-container #client-information-wrapper #client-name{height:100%;width:100%;font-size:1.25rem;font-weight:600}#header-container #actions-wrapper{display:flex;flex-direction:row;align-items:center}#header-container #actions-wrapper>*{margin-right:.5rem}.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:.5rem;gap:.5rem}.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: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }], directives: [{ type: i2.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i3.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i3.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i3.TuiDropdownPositionDirective, selector: "[tuiDropdown]" }, { type: i3.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i3.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }] });
|
|
72
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderComponent, decorators: [{
|
|
73
|
+
type: Component,
|
|
74
|
+
args: [{
|
|
75
|
+
selector: "layout-header",
|
|
76
|
+
templateUrl: "./layout-header.component.html",
|
|
77
|
+
styleUrls: ["./layout-header.component.scss"]
|
|
78
|
+
}]
|
|
79
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], agentInfo: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], onGetTaskList: [{
|
|
84
|
+
type: Output
|
|
85
|
+
}], onClickPerformAction: [{
|
|
86
|
+
type: Output
|
|
87
|
+
}] } });
|
|
109
88
|
|
|
110
|
-
class
|
|
89
|
+
class PrimaryActionsComponent {
|
|
111
90
|
constructor() {
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
this.addTaskForm = {
|
|
115
|
-
key: 'ADD_TASK',
|
|
116
|
-
title: 'Add Task',
|
|
117
|
-
fields: [
|
|
118
|
-
{
|
|
119
|
-
key: 'name',
|
|
120
|
-
label: 'Customer Name',
|
|
121
|
-
validators: {
|
|
122
|
-
required: true
|
|
123
|
-
},
|
|
124
|
-
properties: {
|
|
125
|
-
placeholder: 'Please enter the Customer Name',
|
|
126
|
-
readOnly: false,
|
|
127
|
-
case: 'default'
|
|
128
|
-
},
|
|
129
|
-
type: 'text'
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
key: 'phone',
|
|
133
|
-
label: 'Phone Number',
|
|
134
|
-
validators: {
|
|
135
|
-
required: true
|
|
136
|
-
},
|
|
137
|
-
properties: {
|
|
138
|
-
countryCode: '+91',
|
|
139
|
-
removeCountryCodeFromValue: true,
|
|
140
|
-
phoneMaskAfterCountryCode: '##########',
|
|
141
|
-
placeholder: 'Please enter your Mobile Number',
|
|
142
|
-
readOnly: false
|
|
143
|
-
},
|
|
144
|
-
type: 'phone'
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
key: 'address',
|
|
148
|
-
label: 'Address',
|
|
149
|
-
validators: {
|
|
150
|
-
required: true
|
|
151
|
-
},
|
|
152
|
-
properties: {
|
|
153
|
-
placeholder: 'Please enter the Address',
|
|
154
|
-
readOnly: false,
|
|
155
|
-
case: 'default'
|
|
156
|
-
},
|
|
157
|
-
type: 'text'
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
key: 'city',
|
|
161
|
-
label: 'City',
|
|
162
|
-
validators: {
|
|
163
|
-
required: true
|
|
164
|
-
},
|
|
165
|
-
properties: {
|
|
166
|
-
placeholder: 'Please enter the City',
|
|
167
|
-
readOnly: false,
|
|
168
|
-
case: 'default'
|
|
169
|
-
},
|
|
170
|
-
type: 'text'
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
key: 'location',
|
|
174
|
-
label: 'Location URL',
|
|
175
|
-
validators: {
|
|
176
|
-
required: true
|
|
177
|
-
},
|
|
178
|
-
properties: {
|
|
179
|
-
placeholder: 'Please enter the Location URL',
|
|
180
|
-
readOnly: false,
|
|
181
|
-
case: 'default'
|
|
182
|
-
},
|
|
183
|
-
type: 'text'
|
|
184
|
-
}
|
|
185
|
-
],
|
|
186
|
-
properties: {
|
|
187
|
-
header: {
|
|
188
|
-
title: {
|
|
189
|
-
hidden: true,
|
|
190
|
-
label: 'Add Task'
|
|
191
|
-
},
|
|
192
|
-
steps: {
|
|
193
|
-
hidden: true
|
|
194
|
-
},
|
|
195
|
-
logo: {
|
|
196
|
-
hidden: true
|
|
197
|
-
}
|
|
198
|
-
},
|
|
199
|
-
footer: {
|
|
200
|
-
viewFormsButton: {
|
|
201
|
-
hidden: true,
|
|
202
|
-
label: 'View Forms'
|
|
203
|
-
},
|
|
204
|
-
saveButton: {
|
|
205
|
-
hidden: false,
|
|
206
|
-
label: 'Submit'
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
this.notRequiredStatus = [
|
|
212
|
-
EStatus.REJECTED,
|
|
213
|
-
EStatus.AFTER_AUDIT,
|
|
214
|
-
EStatus.COMPLETE,
|
|
215
|
-
EStatus.SESSION_EXPIRED,
|
|
216
|
-
EStatus.KYC_REJECTED,
|
|
217
|
-
EStatus.KYC_RESULT_APPROVED,
|
|
218
|
-
EStatus.KYC_RESULT_REJECTED,
|
|
219
|
-
EStatus.KYC_RESULT_UNDER_REVIEW,
|
|
220
|
-
EStatus.KYC_REQUEST_REJECTED
|
|
221
|
-
];
|
|
222
|
-
}
|
|
223
|
-
ngOnInit() { }
|
|
224
|
-
setAgentConfig(config) {
|
|
225
|
-
this.config = config;
|
|
91
|
+
this.primaryActionsConfig = [];
|
|
92
|
+
this.onClickPrimaryAction = new EventEmitter();
|
|
226
93
|
}
|
|
227
|
-
|
|
228
|
-
this
|
|
94
|
+
ngOnInit() {
|
|
95
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
229
96
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
97
|
+
ngOnChanges(changes) {
|
|
98
|
+
const verifyChange = (key) => {
|
|
99
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
100
|
+
};
|
|
101
|
+
for (const change of Object.entries(changes)) {
|
|
102
|
+
const key = change[0];
|
|
103
|
+
const value = change[1].currentValue;
|
|
235
104
|
}
|
|
236
|
-
|
|
237
|
-
|
|
105
|
+
if (verifyChange("primaryActionsConfig")) {
|
|
106
|
+
this.primaryActionsConfig = changes.primaryActionsConfig.currentValue;
|
|
107
|
+
this.primaryActionsConfig.map(ALWAYS_FALSE_HANDLER);
|
|
238
108
|
}
|
|
239
109
|
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
110
|
+
handleOnInitPrimaryActionsConfig() {
|
|
111
|
+
this.primaryActionsConfig = this.primaryActionsConfig;
|
|
112
|
+
this.primaryActionsConfig.map(ALWAYS_FALSE_HANDLER);
|
|
113
|
+
}
|
|
114
|
+
handleOnClickPrimaryAction(event) {
|
|
115
|
+
this.onClickPrimaryAction.emit(event);
|
|
116
|
+
}
|
|
117
|
+
trackByFn(index, item) {
|
|
118
|
+
return index; // or unique identifier if available
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/** @nocollapse */ PrimaryActionsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
122
|
+
/** @nocollapse */ PrimaryActionsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: PrimaryActionsComponent, selector: "primary-actions", inputs: { primaryActionsConfig: "primaryActionsConfig" }, outputs: { onClickPrimaryAction: "onClickPrimaryAction" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"primary-actions-container\">\n <tui-items-with-more\n tuiGroup\n [itemsLimit]=\"1\"\n >\n <ng-container *ngFor=\"let item of primaryActionsConfig; let index = index\">\n <kwikui-button\n *tuiItem\n [label]=\"item.label\"\n appearance=\"primary\"\n shape=\"rounded\"\n size=\"m\"\n styles=\"width: max-content; margin-right: 1rem; box-shadow: #32325d40 0 13px 27px -5px, #0000004d 0 8px 16px -8px;\"\n [icon]=\"item.props.iconLeft || ''\"\n [iconRight]=\"item.props.iconRight || ''\"\n (onClick)=\"handleOnClickPrimaryAction(item)\"\n ></kwikui-button>\n </ng-container>\n <ng-template\n let-lastIndex\n tuiMore\n >\n <tui-hosted-dropdown\n tuiDropdownAlign=\"right\"\n class=\"item\"\n [content]=\"dropdown\"\n >\n <kwikui-button\n appearance=\"primary\"\n shape=\"rounded\"\n size=\"m\"\n icon=\"tuiIconMoreVertical\"\n styles=\"\n box-shadow: #32325d40 0 13px 27px -5px, #0000004d 0 8px 16px -8px;\n \"\n ></kwikui-button>\n <ng-template #dropdown>\n <tui-data-list size=\"l\">\n <ng-container\n *ngFor=\"let item of primaryActionsConfig; let index = index\"\n >\n <kwikui-button\n *ngIf=\"index > lastIndex\"\n tuiOption\n [label]=\"item.label\"\n appearance=\"primary\"\n shape=\"rounded\"\n size=\"m\"\n styles=\"width: calc(100% - 1rem); margin: 0.5rem;\"\n [icon]=\"item.props.iconLeft || ''\"\n [iconRight]=\"item.props.iconRight || ''\"\n (onClick)=\"handleOnClickPrimaryAction(item)\"\n ></kwikui-button>\n </ng-container>\n </tui-data-list>\n </ng-template>\n </tui-hosted-dropdown>\n </ng-template>\n </tui-items-with-more>\n</div>\n", styles: ["::-webkit-scrollbar{width:8px!important}::-webkit-scrollbar-track{border-radius:8px!important}::-webkit-scrollbar-thumb{background:lightgray!important;border-radius:8px!important}::-webkit-scrollbar-thumb:hover{background:gray!important}#primary-actions-container{width:-moz-fit-content;width:fit-content;margin-left:auto}@media only screen and (max-width: 600px){#primary-actions-container{display:flex;flex-direction:row;flex-wrap:nowrap;grid-gap:1.5rem;gap:1.5rem;align-items:flex-start;justify-content:flex-start}}::ng-deep .t-empty{display:none!important}\n"], components: [{ type: i1$1.TuiItemsWithMoreComponent, selector: "tui-items-with-more" }, { type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i3.TuiHostedDropdownComponent, selector: "tui-hosted-dropdown", inputs: ["content", "sided", "canOpen", "open"], outputs: ["openChange", "focusedChange"] }, { type: i3.TuiDataListComponent, selector: "tui-data-list", inputs: ["role", "emptyContent", "size"] }], directives: [{ type: i1$1.TuiItemsWithMoreDirective, selector: "tui-items-with-more", inputs: ["itemsLimit", "required"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.TuiItemDirective, selector: "[tuiItem]" }, { type: i1$1.TuiMoreDirective, selector: "[tuiMore]" }, { type: i6.TuiDropdownOptionsDirective, selector: "[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]", inputs: ["tuiDropdownAlign", "tuiDropdownAppearance", "tuiDropdownDirection", "tuiDropdownLimitWidth", "tuiDropdownMinHeight", "tuiDropdownMaxHeight", "tuiDropdownOffset"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
123
|
+
__decorate([
|
|
124
|
+
logMethod
|
|
125
|
+
], PrimaryActionsComponent.prototype, "handleOnInitPrimaryActionsConfig", null);
|
|
126
|
+
__decorate([
|
|
127
|
+
logMethod
|
|
128
|
+
], PrimaryActionsComponent.prototype, "handleOnClickPrimaryAction", null);
|
|
129
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsComponent, decorators: [{
|
|
130
|
+
type: Component,
|
|
131
|
+
args: [{
|
|
132
|
+
selector: "primary-actions",
|
|
133
|
+
templateUrl: "./primary-actions.component.html",
|
|
134
|
+
styleUrls: ["./primary-actions.component.scss"],
|
|
135
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
136
|
+
}]
|
|
137
|
+
}], ctorParameters: function () { return []; }, propDecorators: { primaryActionsConfig: [{
|
|
138
|
+
type: Input
|
|
139
|
+
}], onClickPrimaryAction: [{
|
|
140
|
+
type: Output
|
|
141
|
+
}], handleOnInitPrimaryActionsConfig: [], handleOnClickPrimaryAction: [] } });
|
|
142
|
+
|
|
143
|
+
class MapViewComponent {
|
|
144
|
+
constructor() {
|
|
145
|
+
this.mapConfig = {
|
|
146
|
+
isMapHidden: true
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
ngOnInit() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
151
|
+
}
|
|
152
|
+
ngOnChanges(changes) {
|
|
153
|
+
const verifyChange = (key) => {
|
|
154
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
155
|
+
};
|
|
156
|
+
for (const change of Object.entries(changes)) {
|
|
157
|
+
const key = change[0];
|
|
158
|
+
const value = change[1].currentValue;
|
|
245
159
|
}
|
|
246
|
-
|
|
247
|
-
|
|
160
|
+
if (verifyChange("mapConfig")) {
|
|
161
|
+
this.mapConfig = changes.mapConfig.currentValue;
|
|
248
162
|
}
|
|
249
163
|
}
|
|
250
164
|
}
|
|
251
|
-
/** @nocollapse */
|
|
252
|
-
/** @nocollapse */
|
|
253
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
254
|
-
type:
|
|
165
|
+
/** @nocollapse */ MapViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
166
|
+
/** @nocollapse */ MapViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: MapViewComponent, selector: "map-view", inputs: { mapConfig: "mapConfig" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"map-view-container\">\n <iframe\n *ngIf=\"!mapConfig?.isMapHidden\"\n src=\"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d942.4620332111369!2d72.89243374854026!3d19.114317185214237!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3be7c90062467355%3A0xbc5e9528a3783c2b!2sBoomerang!5e0!3m2!1sen!2sin!4v1708350741641!5m2!1sen!2sin\"\n width=\"600\"\n height=\"450\"\n style=\"border: 0\"\n allowfullscreen=\"\"\n loading=\"lazy\"\n referrerpolicy=\"no-referrer-when-downgrade\"\n ></iframe>\n</div>\n", styles: [".map-view-container{width:100%;height:100%}.map-view-container iframe{width:100%!important;height:100%!important;position:relative}\n"], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewComponent, decorators: [{
|
|
168
|
+
type: Component,
|
|
255
169
|
args: [{
|
|
256
|
-
|
|
170
|
+
selector: "map-view",
|
|
171
|
+
templateUrl: "./map-view.component.html",
|
|
172
|
+
styleUrls: ["./map-view.component.scss"]
|
|
257
173
|
}]
|
|
258
|
-
}], ctorParameters: function () { return []; }
|
|
174
|
+
}], ctorParameters: function () { return []; }, propDecorators: { mapConfig: [{
|
|
175
|
+
type: Input
|
|
176
|
+
}] } });
|
|
259
177
|
|
|
260
|
-
class
|
|
261
|
-
constructor(
|
|
262
|
-
this.
|
|
263
|
-
this.
|
|
264
|
-
this.httpClient = httpClient;
|
|
265
|
-
this.allMarkers = [];
|
|
178
|
+
class TaskItemStatusComponent {
|
|
179
|
+
constructor() {
|
|
180
|
+
this.styles = {};
|
|
181
|
+
this.value = "";
|
|
266
182
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
navigator.geolocation.watchPosition((resp) => {
|
|
271
|
-
resolve({
|
|
272
|
-
lng: resp.coords.longitude,
|
|
273
|
-
lat: resp.coords.latitude
|
|
274
|
-
});
|
|
275
|
-
}, (err) => {
|
|
276
|
-
reject(err);
|
|
277
|
-
});
|
|
183
|
+
ngOnInit() {
|
|
184
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
185
|
+
this.setupStatus();
|
|
278
186
|
});
|
|
279
187
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
};
|
|
292
|
-
});
|
|
188
|
+
ngOnChanges(changes) {
|
|
189
|
+
const verifyChange = (key) => {
|
|
190
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
191
|
+
};
|
|
192
|
+
if (verifyChange("config")) {
|
|
193
|
+
this.config = changes.config.currentValue;
|
|
194
|
+
}
|
|
195
|
+
if (verifyChange("status")) {
|
|
196
|
+
this.status = changes.status.currentValue;
|
|
197
|
+
this.setupStatus();
|
|
198
|
+
}
|
|
293
199
|
}
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
// Get address string from multiple paths
|
|
303
|
-
const config = this.agentService.config.dashboard.taskLocationPaths;
|
|
304
|
-
const address = addressConcator(task, config);
|
|
305
|
-
// Encode the Address in URI
|
|
306
|
-
encodedAddres = encodeURI(address);
|
|
307
|
-
}
|
|
308
|
-
// If Fetch Address from Single Path
|
|
309
|
-
else if (checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
|
|
310
|
-
// Get Address from Single Path
|
|
311
|
-
const config = this.agentService.config.dashboard.taskLocationPath;
|
|
312
|
-
const address = getObjectValueFromPath(task, config);
|
|
313
|
-
// Encode the Address in URI
|
|
314
|
-
encodedAddres = encodeURI(address);
|
|
315
|
-
}
|
|
316
|
-
// Default Address Paths Avaiable
|
|
317
|
-
else {
|
|
318
|
-
const address = (_k = (_j = (_g = (_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.address) !== 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.address) !== null && _g !== void 0 ? _g : (_h = task === null || task === void 0 ? void 0 : task.extras) === null || _h === void 0 ? void 0 : _h.address) !== null && _j !== void 0 ? _j : task === null || task === void 0 ? void 0 : task.address) !== null && _k !== void 0 ? _k : '';
|
|
319
|
-
// Encode the Address in URI
|
|
320
|
-
encodedAddres = encodeURI(address);
|
|
321
|
-
}
|
|
322
|
-
// URL to geocode Address String to Latitude & Longitude
|
|
323
|
-
const url = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.apiKey}&address=${encodedAddres}`;
|
|
324
|
-
const response = yield fetch(url);
|
|
325
|
-
const data = yield response.json();
|
|
326
|
-
// Set Location {lat: LAT, lng: LNG} from address geocoded
|
|
327
|
-
const isValidLocation = isNotEmptyArray(data === null || data === void 0 ? void 0 : data.results);
|
|
328
|
-
const location = isValidLocation
|
|
329
|
-
? (_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
|
|
330
|
-
: { lat: null, lng: null };
|
|
331
|
-
// Set Location validation & Google Maps URL
|
|
332
|
-
location['isValidLocation'] = isValidLocation;
|
|
333
|
-
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}`;
|
|
334
|
-
resolve(location);
|
|
335
|
-
}));
|
|
336
|
-
});
|
|
200
|
+
setupStatus() {
|
|
201
|
+
var _a, _b;
|
|
202
|
+
if (checkObjectPathExists(this.config, "mapping") &&
|
|
203
|
+
checkObjectKeyExists(this.config.mapping, this.status)) {
|
|
204
|
+
this.styles = this.config.mapping[this.status];
|
|
205
|
+
this.value =
|
|
206
|
+
(_b = (_a = this.config.mapping[this.status]) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : convertSnakeCaseToNormalText(this.status);
|
|
207
|
+
}
|
|
337
208
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
task
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
209
|
+
}
|
|
210
|
+
/** @nocollapse */ TaskItemStatusComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
211
|
+
/** @nocollapse */ TaskItemStatusComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskItemStatusComponent, selector: "task-item-status", inputs: { config: "config", status: "status" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"task-iem-status-container\"\n [style]=\"styles\"\n>\n {{ value }}\n</div>\n", styles: [".task-iem-status-container{width:-moz-fit-content;width:fit-content;padding:0 .4rem;font-size:.7rem;border-radius:1rem}\n"] });
|
|
212
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusComponent, decorators: [{
|
|
213
|
+
type: Component,
|
|
214
|
+
args: [{
|
|
215
|
+
selector: "task-item-status",
|
|
216
|
+
templateUrl: "./task-item-status.component.html",
|
|
217
|
+
styleUrls: ["./task-item-status.component.scss"]
|
|
218
|
+
}]
|
|
219
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], status: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}] } });
|
|
224
|
+
|
|
225
|
+
class TaskDetailComponent {
|
|
226
|
+
constructor() {
|
|
227
|
+
this.config = {};
|
|
228
|
+
this.taskDetail = {};
|
|
229
|
+
this.data = [];
|
|
230
|
+
this.title = undefined;
|
|
231
|
+
this.taskId = undefined;
|
|
232
|
+
this.status = undefined;
|
|
233
|
+
this.labelValuePairConfig = {};
|
|
234
|
+
this.labelValuePairData = [];
|
|
235
|
+
this.onClickCloseTaskDetail = new EventEmitter();
|
|
353
236
|
}
|
|
354
|
-
|
|
355
|
-
plotAllMarkers(tasks) {
|
|
237
|
+
ngOnInit() {
|
|
356
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
361
|
-
path.push({
|
|
362
|
-
location: task,
|
|
363
|
-
stopover: true
|
|
364
|
-
});
|
|
365
|
-
this.allMarkers.push(task);
|
|
366
|
-
}
|
|
367
|
-
});
|
|
368
|
-
yield Promise.all(promises);
|
|
369
|
-
resolve(path);
|
|
370
|
-
}));
|
|
239
|
+
this.parseData();
|
|
240
|
+
this.parseTaskId();
|
|
241
|
+
this.parseSessionStatus();
|
|
371
242
|
});
|
|
372
243
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
const optimizedRoute = nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
|
|
390
|
-
// Sort All Tasks as per optimized routes
|
|
391
|
-
tasks = optimizedRoute.slice(1);
|
|
392
|
-
this.allMarkers = [myMarker];
|
|
393
|
-
// Plot all markers & get path for directions
|
|
394
|
-
const path = yield this.plotAllMarkers(tasks);
|
|
395
|
-
// Set Directions in Google Maps
|
|
396
|
-
const request = {
|
|
397
|
-
origin: this.myPosition,
|
|
398
|
-
destination: this.myPosition,
|
|
399
|
-
waypoints: path,
|
|
400
|
-
travelMode: google.maps.TravelMode.DRIVING
|
|
401
|
-
};
|
|
402
|
-
this.directionsRenderOption = {
|
|
403
|
-
suppressMarkers: true
|
|
404
|
-
};
|
|
405
|
-
this.directionsResults$ = this.mapDirectionsService
|
|
406
|
-
.route(request)
|
|
407
|
-
.pipe(map((response) => response.result));
|
|
408
|
-
this.directionsResults$.subscribe((val) => { });
|
|
409
|
-
this.allDirectionsResults$ = this.directionsResults$;
|
|
410
|
-
return tasks;
|
|
411
|
-
});
|
|
244
|
+
ngOnChanges(changes) { }
|
|
245
|
+
parseData() {
|
|
246
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
247
|
+
if (checkObjectPathExists(this.config, "taskUI.details.data") &&
|
|
248
|
+
isNotEmptyValue(this.config.taskUI.details.data) &&
|
|
249
|
+
Array.isArray(this.config.taskUI.details.data) &&
|
|
250
|
+
this.config.taskUI.details.data.length > 0) {
|
|
251
|
+
const data = [];
|
|
252
|
+
this.config.taskUI.details.data.map((field) => {
|
|
253
|
+
const value = getObjectValueFromPath(this.taskDetail.data, field.path);
|
|
254
|
+
data.push({ label: field.label, value });
|
|
255
|
+
});
|
|
256
|
+
this.labelValuePairData = data;
|
|
257
|
+
this.labelValuePairConfig = (_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.taskUI) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.config) !== null && _d !== void 0 ? _d : {};
|
|
258
|
+
this.title = (_h = (_g = (_f = (_e = this.config) === null || _e === void 0 ? void 0 : _e.taskUI) === null || _f === void 0 ? void 0 : _f.details) === null || _g === void 0 ? void 0 : _g.header) === null || _h === void 0 ? void 0 : _h.title;
|
|
259
|
+
}
|
|
412
260
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
const request = {
|
|
420
|
-
origin: this.myPosition,
|
|
421
|
-
destination: taskMarker,
|
|
422
|
-
optimizeWaypoints: true,
|
|
423
|
-
travelMode: google.maps.TravelMode.DRIVING
|
|
424
|
-
};
|
|
425
|
-
this.directionsResults$ = this.mapDirectionsService
|
|
426
|
-
.route(request)
|
|
427
|
-
.pipe(map((response) => response.result));
|
|
428
|
-
this.directionsResults$.subscribe();
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
alert('No Location Available');
|
|
432
|
-
this.directionsResults$ = this.allDirectionsResults$;
|
|
433
|
-
}
|
|
261
|
+
parseSessionStatus() {
|
|
262
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
263
|
+
if (((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.utilityFlags) === null || _b === void 0 ? void 0 : _b.isShowTaskStatus) &&
|
|
264
|
+
checkObjectPathExists(this.config, "taskUI.details.header.taskStatus.path") &&
|
|
265
|
+
isNotEmptyValue(this.config.taskUI.details.header.taskStatus.path)) {
|
|
266
|
+
this.status = getObjectValueFromPath(this.taskDetail.data, (_g = (_f = (_e = (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.taskUI) === null || _d === void 0 ? void 0 : _d.details) === null || _e === void 0 ? void 0 : _e.header) === null || _f === void 0 ? void 0 : _f.taskStatus) === null || _g === void 0 ? void 0 : _g.path);
|
|
434
267
|
}
|
|
435
|
-
|
|
436
|
-
|
|
268
|
+
}
|
|
269
|
+
parseTaskId() {
|
|
270
|
+
var _a, _b, _c, _d, _e;
|
|
271
|
+
if (checkObjectPathExists(this.config, "taskUI.details.header.taskId.path") &&
|
|
272
|
+
isNotEmptyValue(this.config.taskUI.details.header.taskId.path)) {
|
|
273
|
+
this.taskId = getObjectValueFromPath(this.taskDetail.data, (_e = (_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.taskUI) === null || _b === void 0 ? void 0 : _b.details) === null || _c === void 0 ? void 0 : _c.header) === null || _d === void 0 ? void 0 : _d.taskId) === null || _e === void 0 ? void 0 : _e.path);
|
|
437
274
|
}
|
|
438
275
|
}
|
|
276
|
+
handleOnClickClose(e) {
|
|
277
|
+
this.onClickCloseTaskDetail.emit(e);
|
|
278
|
+
}
|
|
279
|
+
handleOnClickPerformAction(e) {
|
|
280
|
+
alert(`${e.id}, Action yet to be added`);
|
|
281
|
+
}
|
|
439
282
|
}
|
|
440
|
-
/** @nocollapse */
|
|
441
|
-
/** @nocollapse */
|
|
442
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
443
|
-
type:
|
|
283
|
+
/** @nocollapse */ TaskDetailComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
284
|
+
/** @nocollapse */ TaskDetailComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskDetailComponent, selector: "task-detail", inputs: { config: "config", taskDetail: "taskDetail" }, outputs: { onClickCloseTaskDetail: "onClickCloseTaskDetail" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"task-detail-container\">\n <kwikui-button\n appearance=\"primary\"\n icon=\"tuiIconChevronLeft\"\n label=\"Back\"\n size=\"s\"\n shape=\"rounded\"\n (onClick)=\"handleOnClickClose($event)\"\n ></kwikui-button>\n\n <div id=\"task-details-title\">{{ title }}</div>\n <div id=\"task-detail-header\">\n <div>{{ taskId }}</div>\n <task-item-status\n *ngIf=\"status\"\n [config]=\"config?.taskUI?.details?.header?.taskStatus\"\n [status]=\"status\"\n ></task-item-status>\n </div>\n\n <div id=\"task-details-container\">\n <kwikui-label-value-pair\n [config]=\"labelValuePairConfig\"\n [data]=\"labelValuePairData\"\n ></kwikui-label-value-pair>\n </div>\n\n <div\n id=\"task-detail-footer\"\n *ngIf=\"\n config?.taskUI?.details?.action &&\n config?.taskUI?.details?.action?.length > 0\n \"\n >\n <ng-container *ngFor=\"let action of config?.taskUI?.details?.action\">\n <kwikui-button\n [label]=\"action.label\"\n appearance=\"primary\"\n size=\"s\"\n shape=\"rounded\"\n (onClick)=\"handleOnClickPerformAction(action)\"\n ></kwikui-button>\n </ng-container>\n </div>\n</div>\n", styles: ["#task-detail-container{padding:1rem;font-size:1rem;display:flex;flex-direction:column;grid-gap:.5rem;gap:.5rem}#task-details-title{font-weight:600;font-size:1.5rem;margin:.5rem 0}#task-detail-header{display:flex;flex-direction:row;grid-gap:.5rem;gap:.5rem}#task-detail-footer{display:flex;flex-direction:row;grid-gap:.5rem;gap:.5rem}\n"], components: [{ type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: TaskItemStatusComponent, selector: "task-item-status", inputs: ["config", "status"] }, { type: i1.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["config", "data", "id"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
285
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailComponent, decorators: [{
|
|
286
|
+
type: Component,
|
|
444
287
|
args: [{
|
|
445
|
-
|
|
288
|
+
selector: "task-detail",
|
|
289
|
+
templateUrl: "./task-detail.component.html",
|
|
290
|
+
styleUrls: ["./task-detail.component.scss"]
|
|
446
291
|
}]
|
|
447
|
-
}], ctorParameters: function () { return [
|
|
448
|
-
type:
|
|
449
|
-
|
|
292
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
293
|
+
type: Input
|
|
294
|
+
}], taskDetail: [{
|
|
295
|
+
type: Input
|
|
296
|
+
}], onClickCloseTaskDetail: [{
|
|
297
|
+
type: Output
|
|
450
298
|
}] } });
|
|
451
299
|
|
|
452
|
-
class
|
|
453
|
-
constructor(
|
|
454
|
-
this.
|
|
455
|
-
this.
|
|
456
|
-
this.
|
|
457
|
-
this.
|
|
300
|
+
class BottomSheetComponent {
|
|
301
|
+
constructor() {
|
|
302
|
+
this.isSwipeActive = false;
|
|
303
|
+
this.swipeDirection = null;
|
|
304
|
+
this.height = 320; // Initial height of the bottom sheet
|
|
305
|
+
this.minHeight = 54; // Initial height of the bottom sheet
|
|
458
306
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
return new Promise((resolve, reject) => {
|
|
462
|
-
navigator.geolocation.watchPosition((resp) => {
|
|
463
|
-
resolve({
|
|
464
|
-
lng: resp.coords.longitude,
|
|
465
|
-
lat: resp.coords.latitude
|
|
466
|
-
});
|
|
467
|
-
}, (err) => {
|
|
468
|
-
reject(err);
|
|
469
|
-
});
|
|
470
|
-
});
|
|
307
|
+
ngOnInit() {
|
|
308
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
471
309
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
let encodedAddres;
|
|
478
|
-
// If Fetch Address from Multiple Paths
|
|
479
|
-
if (checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPaths')) {
|
|
480
|
-
// Get address string from multiple paths
|
|
481
|
-
const config = this.agentService.config.dashboard.taskLocationPaths;
|
|
482
|
-
const address = addressConcator(task, config);
|
|
483
|
-
// Encode the Address in URI
|
|
484
|
-
encodedAddres = encodeURI(address);
|
|
485
|
-
}
|
|
486
|
-
// If Fetch Address from Single Path
|
|
487
|
-
else if (checkObjectPathExists(this.agentService.config, 'dashboard.taskLocationPath')) {
|
|
488
|
-
// Get Address from Single Path
|
|
489
|
-
const config = this.agentService.config.dashboard.taskLocationPath;
|
|
490
|
-
const address = getObjectValueFromPath(task, config);
|
|
491
|
-
// Encode the Address in URI
|
|
492
|
-
encodedAddres = encodeURI(address);
|
|
493
|
-
}
|
|
494
|
-
// Default Address Paths Avaiable
|
|
495
|
-
else {
|
|
496
|
-
const address = (_k = (_j = (_g = (_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.address) !== 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.address) !== null && _g !== void 0 ? _g : (_h = task === null || task === void 0 ? void 0 : task.extras) === null || _h === void 0 ? void 0 : _h.address) !== null && _j !== void 0 ? _j : task === null || task === void 0 ? void 0 : task.address) !== null && _k !== void 0 ? _k : '';
|
|
497
|
-
// Encode the Address in URI
|
|
498
|
-
encodedAddres = encodeURI(address);
|
|
499
|
-
}
|
|
500
|
-
// URL to geocode Address String to Latitude & Longitude
|
|
501
|
-
const url = `https://nominatim.openstreetmap.org/search?q=${encodedAddres}&format=json`;
|
|
502
|
-
const response = yield fetch(url);
|
|
503
|
-
const data = yield response.json();
|
|
504
|
-
// Set Location {lat: LAT, lng: LNG} from address geocoded
|
|
505
|
-
const isValidLocation = isNotEmptyArray(data) && ((_l = data[0]) === null || _l === void 0 ? void 0 : _l.lat) & ((_m = data[0]) === null || _m === void 0 ? void 0 : _m.lon);
|
|
506
|
-
const location = isValidLocation
|
|
507
|
-
? { lat: (_o = data[0]) === null || _o === void 0 ? void 0 : _o.lat, lng: (_p = data[0]) === null || _p === void 0 ? void 0 : _p.lon }
|
|
508
|
-
: { lat: null, lng: null };
|
|
509
|
-
// Set Location validation & Google Maps URL
|
|
510
|
-
location['isValidLocation'] = isValidLocation;
|
|
511
|
-
location['color'] = isValidLocation ? 'blue' : 'red';
|
|
512
|
-
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}`;
|
|
513
|
-
resolve(location);
|
|
514
|
-
}));
|
|
515
|
-
});
|
|
310
|
+
onMouseStart(event) {
|
|
311
|
+
event.preventDefault();
|
|
312
|
+
this.isSwipeActive = true;
|
|
313
|
+
this.startY = event.clientY;
|
|
314
|
+
this.startHeight = this.parentElement.nativeElement.clientHeight;
|
|
516
315
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
let markers = [];
|
|
522
|
-
markers.push(myMarker);
|
|
523
|
-
const promises = tasks.map((task) => __awaiter(this, void 0, void 0, function* () {
|
|
524
|
-
const marker = yield this.getLocation(task);
|
|
525
|
-
task = Object.assign(Object.assign({}, task), marker);
|
|
526
|
-
markers.push(task);
|
|
527
|
-
}));
|
|
528
|
-
yield Promise.all(promises);
|
|
529
|
-
resolve(markers);
|
|
530
|
-
}));
|
|
531
|
-
});
|
|
316
|
+
onMouseMove(event) {
|
|
317
|
+
if (this.isSwipeActive) {
|
|
318
|
+
this.resize(event.clientY);
|
|
319
|
+
}
|
|
532
320
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
536
|
-
console.log('Running Init Open Street Maps');
|
|
537
|
-
this.myPosition = yield this.getPosition();
|
|
538
|
-
this.map = L.map('map', {
|
|
539
|
-
center: [this.myPosition.lat, this.myPosition.lng],
|
|
540
|
-
zoom: 11
|
|
541
|
-
});
|
|
542
|
-
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(this.map);
|
|
543
|
-
});
|
|
321
|
+
onMouseEnd(event) {
|
|
322
|
+
this.isSwipeActive = false;
|
|
544
323
|
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
? 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-0.png'
|
|
551
|
-
: 'https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-1.png'
|
|
552
|
-
})
|
|
553
|
-
})
|
|
554
|
-
.addTo(this.map)
|
|
555
|
-
.bindPopup(title);
|
|
324
|
+
onTouchStart(event) {
|
|
325
|
+
event.preventDefault();
|
|
326
|
+
this.isSwipeActive = true;
|
|
327
|
+
this.startY = event.touches[0].clientY;
|
|
328
|
+
this.startHeight = this.parentElement.nativeElement.clientHeight;
|
|
556
329
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
// Create Agent Marker & Plot It.
|
|
563
|
-
const myMarker = {
|
|
564
|
-
lat: this.myPosition.lat,
|
|
565
|
-
lng: this.myPosition.lng,
|
|
566
|
-
title: 0,
|
|
567
|
-
color: 'red'
|
|
568
|
-
};
|
|
569
|
-
this.addMarker(myMarker);
|
|
570
|
-
this.allMarkers.push(myMarker);
|
|
571
|
-
// Create Markers for all Tasks
|
|
572
|
-
this.allMarkers = yield this.getMarkersLocation(myMarker, tasks);
|
|
573
|
-
// Run Algorithm to get optimized Routes
|
|
574
|
-
const startingPoint = this.allMarkers[0];
|
|
575
|
-
const unvisitedWaypoints = this.allMarkers.slice(1);
|
|
576
|
-
const optimizedRoute = nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
|
|
577
|
-
// Sort All Markers as per optimized routes
|
|
578
|
-
this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
|
|
579
|
-
// Sort All Tasks as per optimized routes
|
|
580
|
-
tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
|
|
581
|
-
// Plot Markers for All Tasks
|
|
582
|
-
tasks.map((task) => {
|
|
583
|
-
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
584
|
-
const marker = this.getLocation(task);
|
|
585
|
-
this.addMarker(marker);
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
// Set Styles for all Task Routes
|
|
589
|
-
const styles = [
|
|
590
|
-
{ color: 'blue', opacity: 1, weight: 8 },
|
|
591
|
-
{ color: 'white', opacity: 0.6, weight: 12 }
|
|
592
|
-
];
|
|
593
|
-
// Set Routes for all Tasks
|
|
594
|
-
this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
|
|
595
|
-
this.fitMapBounds();
|
|
596
|
-
}
|
|
597
|
-
return tasks;
|
|
598
|
-
});
|
|
330
|
+
onTouchMove(event) {
|
|
331
|
+
event.preventDefault(); // Prevent scrolling while dragging
|
|
332
|
+
if (this.isSwipeActive) {
|
|
333
|
+
this.resize(event.touches[0].clientY);
|
|
334
|
+
}
|
|
599
335
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
336
|
+
onTouchEnd(event) {
|
|
337
|
+
this.isSwipeActive = false;
|
|
338
|
+
}
|
|
339
|
+
resize(clientY) {
|
|
340
|
+
const deltaY = clientY - this.startY;
|
|
341
|
+
const newHeight = this.startHeight - deltaY;
|
|
342
|
+
if (newHeight > this.startHeight) {
|
|
343
|
+
this.swipeDirection = "UP";
|
|
344
|
+
}
|
|
345
|
+
if (newHeight < this.startHeight) {
|
|
346
|
+
this.swipeDirection = "DOWN";
|
|
347
|
+
}
|
|
348
|
+
const maxHeight = window.innerHeight - 180;
|
|
349
|
+
if (newHeight >= this.minHeight && newHeight <= maxHeight) {
|
|
350
|
+
// this.height = newHeight;
|
|
351
|
+
this.parentElement.nativeElement.style.height = `${newHeight}px`;
|
|
352
|
+
}
|
|
353
|
+
else if (newHeight < this.minHeight) {
|
|
354
|
+
this.parentElement.nativeElement.style.height = `${this.minHeight}px`;
|
|
355
|
+
}
|
|
356
|
+
else if (newHeight > maxHeight) {
|
|
357
|
+
this.parentElement.nativeElement.style.height = `${maxHeight}px`;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
preventMouseOrTouchEvents(event) {
|
|
361
|
+
event.stopPropagation();
|
|
362
|
+
return undefined;
|
|
363
|
+
}
|
|
364
|
+
removeEventListeners() {
|
|
365
|
+
document.removeEventListener("mousedown", this.onMouseStart.bind(this));
|
|
366
|
+
document.removeEventListener("mousemove", this.onMouseMove.bind(this));
|
|
367
|
+
document.removeEventListener("mouseup", this.onMouseEnd.bind(this));
|
|
368
|
+
document.removeEventListener("touchend", this.onTouchMove.bind(this));
|
|
369
|
+
document.removeEventListener("touchmove", this.onTouchEnd.bind(this));
|
|
370
|
+
document.removeEventListener("touchstart", this.onTouchEnd.bind(this));
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/** @nocollapse */ BottomSheetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
374
|
+
/** @nocollapse */ BottomSheetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: BottomSheetComponent, selector: "bottom-sheet", viewQueries: [{ propertyName: "parentElement", first: true, predicate: ["parentElement"], descendants: true, static: true }], ngImport: i0, template: "<div\n #parentElement\n class=\"bottom-sheet\"\n [style.height.px]=\"height\"\n>\n <div\n class=\"top-holder\"\n (mousedown)=\"onMouseStart($event)\"\n (mousemove)=\"onMouseMove($event)\"\n (mouseup)=\"onMouseEnd($event)\"\n (touchend)=\"onTouchEnd($event)\"\n (touchmove)=\"onTouchMove($event)\"\n (touchstart)=\"onTouchStart($event)\"\n >\n <tui-svg\n *ngIf=\"isSwipeActive && swipeDirection == 'UP'\"\n src=\"tuiIconChevronUpLarge\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"isSwipeActive && swipeDirection == 'DOWN'\"\n src=\"tuiIconChevronDownLarge\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"!isSwipeActive\"\n src=\"tuiIconHrLarge\"\n ></tui-svg>\n </div>\n <!-- Use ng-content to project content into the component -->\n <div class=\"bottom-sheet-content-container\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".bottom-sheet{position:absolute;bottom:0;left:0;width:100%;background-color:#fff;box-shadow:0 -2px 6px #0000001a;overflow:auto;resize:vertical;border-top-right-radius:1rem;border-top-left-radius:1rem;display:flex;flex-direction:column;z-index:5;padding-top:1rem}.top-holder{width:100%;height:40px;display:flex;flex-direction:row;align-content:center;justify-content:center;align-items:center;cursor:grab;z-index:1}.top-holder:focus,.top-holder:focus-within,.top-holder:active{cursor:grabbing}.resize-handle{position:absolute;bottom:0;left:0;width:100%;height:10px;cursor:ns-resize;background-color:transparent}.bottom-sheet-content-container{width:100%;height:100%;position:relative;z-index:1;overflow:auto}\n"], components: [{ type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
375
|
+
__decorate([
|
|
376
|
+
logMethod
|
|
377
|
+
], BottomSheetComponent.prototype, "onMouseStart", null);
|
|
378
|
+
__decorate([
|
|
379
|
+
logMethod
|
|
380
|
+
], BottomSheetComponent.prototype, "onMouseEnd", null);
|
|
381
|
+
__decorate([
|
|
382
|
+
logMethod
|
|
383
|
+
], BottomSheetComponent.prototype, "onTouchStart", null);
|
|
384
|
+
__decorate([
|
|
385
|
+
logMethod
|
|
386
|
+
], BottomSheetComponent.prototype, "onTouchMove", null);
|
|
387
|
+
__decorate([
|
|
388
|
+
logMethod
|
|
389
|
+
], BottomSheetComponent.prototype, "onTouchEnd", null);
|
|
390
|
+
__decorate([
|
|
391
|
+
logMethod
|
|
392
|
+
], BottomSheetComponent.prototype, "preventMouseOrTouchEvents", null);
|
|
393
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetComponent, decorators: [{
|
|
394
|
+
type: Component,
|
|
395
|
+
args: [{
|
|
396
|
+
selector: "bottom-sheet",
|
|
397
|
+
templateUrl: "./bottom-sheet.component.html",
|
|
398
|
+
styleUrls: ["./bottom-sheet.component.scss"]
|
|
399
|
+
}]
|
|
400
|
+
}], ctorParameters: function () { return []; }, propDecorators: { parentElement: [{
|
|
401
|
+
type: ViewChild,
|
|
402
|
+
args: ["parentElement", { static: true }]
|
|
403
|
+
}], onMouseStart: [], onMouseEnd: [], onTouchStart: [], onTouchMove: [], onTouchEnd: [], preventMouseOrTouchEvents: [] } });
|
|
404
|
+
|
|
405
|
+
const padZeroValuesInStart = (value, digits = 2) => {
|
|
406
|
+
return String(value).padStart(digits, "0");
|
|
407
|
+
};
|
|
408
|
+
const convertKwikUIDateToStringFormat = (event) => {
|
|
409
|
+
const { year } = event;
|
|
410
|
+
const month = padZeroValuesInStart(event.month + 1, 2);
|
|
411
|
+
const day = padZeroValuesInStart(event.day);
|
|
412
|
+
return `${year}-${month}-${day}`;
|
|
413
|
+
};
|
|
414
|
+
const convertNormalDateToStringFormat = (value) => {
|
|
415
|
+
const date = value ? new Date(value) : new Date();
|
|
416
|
+
const year = date.getFullYear();
|
|
417
|
+
const month = padZeroValuesInStart(date.getMonth() + 1);
|
|
418
|
+
const day = padZeroValuesInStart(date.getDate());
|
|
419
|
+
return `${year}-${month}-${day}`;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
const sortItems = (data, key, sortInAscendingOrder) => {
|
|
423
|
+
if (!data || data.length === 0) {
|
|
424
|
+
return data; // Skip sorting if no items are available
|
|
425
|
+
}
|
|
426
|
+
const sortedData = sortInAscendingOrder
|
|
427
|
+
? data.sort((a, b) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0))
|
|
428
|
+
: data.sort((b, a) => (a[key] > b[key] ? 1 : b[key] > a[key] ? -1 : 0));
|
|
429
|
+
return sortedData;
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
class TaskListSearchComponent {
|
|
433
|
+
constructor() {
|
|
434
|
+
// Search Text
|
|
435
|
+
this.searchText = "";
|
|
436
|
+
this.formGroup = new FormGroup({});
|
|
437
|
+
this.sortInAscendingOrder = true;
|
|
438
|
+
// Date Range Values
|
|
439
|
+
this.start_time = undefined;
|
|
440
|
+
this.end_time = undefined;
|
|
441
|
+
this.max = new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
|
|
442
|
+
// Sorting Variables
|
|
443
|
+
this.sortFilterOptions = ["name", "session_status", "mobile_number"];
|
|
444
|
+
this.activeSearchAction = undefined;
|
|
445
|
+
this.onFilterTasksByText = new EventEmitter();
|
|
446
|
+
this.onFilterTasksByDate = new EventEmitter();
|
|
447
|
+
this.onChangeSortFilter = new EventEmitter();
|
|
448
|
+
}
|
|
449
|
+
ngOnInit() {
|
|
450
|
+
this.handleSearchAndSortFormControls();
|
|
451
|
+
this.handleInitialDateRange();
|
|
452
|
+
}
|
|
453
|
+
handleOnClickSearchType(type) {
|
|
454
|
+
if (this.activeSearchAction !== type) {
|
|
455
|
+
this.activeSearchAction = type;
|
|
625
456
|
}
|
|
626
|
-
// Set All Tasks Routes Again & Remove Selected Tasks route
|
|
627
457
|
else {
|
|
628
|
-
|
|
629
|
-
this.map.removeControl(this.selectedTaskRoutes);
|
|
630
|
-
}
|
|
631
|
-
this.map.addControl(this.allTasksRoutes);
|
|
632
|
-
this.selectedTaskRoutes = undefined;
|
|
458
|
+
this.activeSearchAction = undefined;
|
|
633
459
|
}
|
|
634
|
-
this.fitMapBounds();
|
|
635
460
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
461
|
+
handleInitialDateRange() {
|
|
462
|
+
var _a, _b, _c, _d, _e, _f;
|
|
463
|
+
const searchFilterStartPoint = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.extendedFlags) === null || _b === void 0 ? void 0 : _b.searchFilterStartPoint) !== null && _c !== void 0 ? _c : {
|
|
464
|
+
day: 0,
|
|
465
|
+
month: 0,
|
|
466
|
+
year: 0
|
|
467
|
+
};
|
|
468
|
+
const currentDate = new Date();
|
|
469
|
+
const startDate = new Date((_d = currentDate.getFullYear() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.year)) !== null && _d !== void 0 ? _d : 0, (_e = currentDate.getMonth() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.month)) !== null && _e !== void 0 ? _e : 0, (_f = currentDate.getDate() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.day)) !== null && _f !== void 0 ? _f : 0);
|
|
470
|
+
this.searchDateFormControl = new FormControl({
|
|
471
|
+
value: new TuiDayRange(new TuiDay(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()), this.max),
|
|
472
|
+
disabled: false
|
|
473
|
+
});
|
|
474
|
+
this.formGroup.addControl("search-date", this.searchDateFormControl);
|
|
475
|
+
this.start_time = convertNormalDateToStringFormat(startDate);
|
|
476
|
+
this.end_time = convertNormalDateToStringFormat(null);
|
|
477
|
+
// To get Tasks for First Time
|
|
478
|
+
this.onFilterTasksByDate.emit({
|
|
479
|
+
start_time: this.start_time,
|
|
480
|
+
end_time: this.end_time
|
|
481
|
+
});
|
|
639
482
|
}
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this.
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
this.
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
483
|
+
handleSearchAndSortFormControls() {
|
|
484
|
+
var _a, _b, _c;
|
|
485
|
+
this.searchTextFormControl = new FormControl("");
|
|
486
|
+
this.formGroup.addControl("search-text", this.searchTextFormControl);
|
|
487
|
+
this.sortFilterKeyFormControl = new FormControl("");
|
|
488
|
+
this.formGroup.addControl("sort-filter", this.sortFilterKeyFormControl);
|
|
489
|
+
this.sortFilterOptions =
|
|
490
|
+
(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.extendedFlags) === null || _b === void 0 ? void 0 : _b.sortFilterKeys) !== null && _c !== void 0 ? _c : this.sortFilterOptions;
|
|
491
|
+
}
|
|
492
|
+
handleOnChangeSearchText(event) {
|
|
493
|
+
this.onFilterTasksByText.emit({ text: event.value });
|
|
494
|
+
}
|
|
495
|
+
handleOnChangeDateRange(event) {
|
|
496
|
+
this.handleChangeDateRangeFormat(event);
|
|
497
|
+
this.onFilterTasksByDate.emit({
|
|
498
|
+
start_time: this.start_time,
|
|
499
|
+
end_time: this.end_time
|
|
651
500
|
});
|
|
652
501
|
}
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
502
|
+
handleOnChangeSortFilter(event) {
|
|
503
|
+
this.onChangeSortFilter.emit({
|
|
504
|
+
sortFilterKey: this.sortFilterKeyFormControl.value,
|
|
505
|
+
sortFilterOrder: this.sortInAscendingOrder
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
handleOnClickChangeSortOrder() {
|
|
509
|
+
this.sortInAscendingOrder = !this.sortInAscendingOrder;
|
|
510
|
+
this.handleOnChangeSortFilter(false);
|
|
511
|
+
}
|
|
512
|
+
handleChangeDateRangeFormat(event) {
|
|
513
|
+
this.start_time = convertKwikUIDateToStringFormat(event.value.from);
|
|
514
|
+
this.end_time = convertKwikUIDateToStringFormat(event.value.to);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
/** @nocollapse */ TaskListSearchComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
518
|
+
/** @nocollapse */ TaskListSearchComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskListSearchComponent, selector: "task-list-search", inputs: { config: "config" }, outputs: { onFilterTasksByText: "onFilterTasksByText", onFilterTasksByDate: "onFilterTasksByDate", onChangeSortFilter: "onChangeSortFilter" }, ngImport: i0, template: "<div\n class=\"task-list-search-container\"\n [formGroup]=\"formGroup\"\n>\n <div class=\"task-list-search-icons\">\n <kwikui-button\n appearance=\"mono\"\n icon=\"tuiIconSearchLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('search-text')\"\n ></kwikui-button>\n <kwikui-button\n appearance=\"mono\"\n icon=\"tuiIconCalendarLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('search-date')\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"config?.utilityFlags?.isAllowSortTasks\"\n appearance=\"mono\"\n icon=\"tuiIconFilterLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('sort-filter')\"\n ></kwikui-button>\n </div>\n\n <div\n class=\"task-list-search-action\"\n *ngIf=\"activeSearchAction\"\n >\n <kwikui-input-date-range\n *ngIf=\"activeSearchAction == 'search-date'\"\n class=\"task-list-date-box\"\n label=\"Search by Date Range\"\n id=\"dateRange\"\n size=\"m\"\n [max]=\"max\"\n [maxLength]=\"maxLength\"\n formControlName=\"search-date\"\n [formControl]=\"searchDateFormControl\"\n (getKeyValue)=\"handleOnChangeDateRange($event)\"\n ></kwikui-input-date-range>\n\n <kwikui-input\n *ngIf=\"activeSearchAction == 'search-text'\"\n label=\"Search\"\n id=\"search\"\n icon=\"tuiIconSearch\"\n placeholder=\"Search any task from here\"\n size=\"m\"\n [formControl]=\"searchTextFormControl\"\n formControlName=\"search-text\"\n (getKeyValue)=\"handleOnChangeSearchText($event)\"\n ></kwikui-input>\n\n <div\n *ngIf=\"activeSearchAction == 'sort-filter'\"\n class=\"task-list-sort-action\"\n >\n <kwikui-button\n appearance=\"outline\"\n [icon]=\"\n sortInAscendingOrder\n ? 'tuiIconChevronsUpLarge'\n : 'tuiIconChevronsDownLarge'\n \"\n size=\"m\"\n type=\"button\"\n (onClick)=\"handleOnClickChangeSortOrder()\"\n ></kwikui-button>\n <kwikui-input-select\n class=\"task-list-sort-key\"\n formControlName=\"sort-filter\"\n label=\"Sort By Key\"\n size=\"m\"\n [formControl]=\"sortFilterKeyFormControl\"\n [options]=\"sortFilterOptions\"\n [searchable]=\"false\"\n (getKeyValue)=\"handleOnChangeSortFilter($event)\"\n ></kwikui-input-select>\n </div>\n </div>\n</div>\n", styles: [".task-list-search-container{width:100%}.task-list-search-container .task-list-search-icons{display:flex;justify-content:flex-end;align-items:center;flex-direction:row;grid-gap:.5rem;gap:.5rem}.task-list-search-container .task-list-search-action{margin-top:.5rem}.task-list-search-container .task-list-search-action .task-list-sort-action{display:flex;flex-direction:row;grid-gap:.5rem;gap:.5rem}.task-list-search-container .task-list-search-action .task-list-sort-action .task-list-sort-key{flex:1}\n"], components: [{ type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i1.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: i1.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: i1.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }], directives: [{ type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
519
|
+
__decorate([
|
|
520
|
+
logMethod
|
|
521
|
+
], TaskListSearchComponent.prototype, "handleOnChangeSearchText", null);
|
|
522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchComponent, decorators: [{
|
|
523
|
+
type: Component,
|
|
524
|
+
args: [{
|
|
525
|
+
selector: "task-list-search",
|
|
526
|
+
templateUrl: "./task-list-search.component.html",
|
|
527
|
+
styleUrls: ["./task-list-search.component.scss"],
|
|
528
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
529
|
+
}]
|
|
530
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
531
|
+
type: Input
|
|
532
|
+
}], onFilterTasksByText: [{
|
|
533
|
+
type: Output
|
|
534
|
+
}], onFilterTasksByDate: [{
|
|
535
|
+
type: Output
|
|
536
|
+
}], onChangeSortFilter: [{
|
|
537
|
+
type: Output
|
|
538
|
+
}], handleOnChangeSearchText: [] } });
|
|
539
|
+
|
|
540
|
+
const PREVIEW_DATA_DEFAULT_CONFIG = {
|
|
541
|
+
separator: ":",
|
|
542
|
+
orientation: "horizontal",
|
|
543
|
+
placeholder: "-",
|
|
544
|
+
customStyles: {
|
|
545
|
+
label: {},
|
|
546
|
+
value: {},
|
|
547
|
+
placeholder: {},
|
|
548
|
+
container: {}
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
class TaskItemComponent {
|
|
553
|
+
constructor() {
|
|
554
|
+
this.config = {};
|
|
555
|
+
this.data = {};
|
|
556
|
+
this.header = "";
|
|
557
|
+
this.status = "";
|
|
558
|
+
this.previewConfig = {};
|
|
559
|
+
this.previewData = [];
|
|
560
|
+
this.onClickTaskItem = new EventEmitter();
|
|
561
|
+
this.onClickTaskItemViewDetail = new EventEmitter();
|
|
562
|
+
this.onClickPerformAction = new EventEmitter();
|
|
563
|
+
}
|
|
564
|
+
ngOnInit() {
|
|
565
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
566
|
+
this.parseHeader();
|
|
567
|
+
this.parseSessionStatus();
|
|
568
|
+
this.parsePreviewData();
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
parseHeader() {
|
|
572
|
+
var _a, _b, _c, _d;
|
|
573
|
+
if (checkObjectPathExists(this.config, "taskUI.header.taskId.path") &&
|
|
574
|
+
isNotEmptyValue(this.config.taskUI.header.taskId.path)) {
|
|
575
|
+
this.header = getObjectValueFromPath(this.data, (_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.taskUI) === null || _b === void 0 ? void 0 : _b.header) === null || _c === void 0 ? void 0 : _c.taskId) === null || _d === void 0 ? void 0 : _d.path);
|
|
576
|
+
}
|
|
577
|
+
if (checkObjectPathExists(this.config, "taskUI.header.taskId.maxLengthToShow") &&
|
|
578
|
+
isNotEmptyValue(this.config.taskUI.header.taskId.maxLengthToShow) &&
|
|
579
|
+
this.header.length > this.config.taskUI.header.taskId.maxLengthToShow) {
|
|
580
|
+
this.header = `${this.header.slice(0, this.config.taskUI.header.taskId.maxLengthToShow)}...`;
|
|
660
581
|
}
|
|
661
|
-
return sortedTasks;
|
|
662
582
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
createMarker: function () {
|
|
671
|
-
return null;
|
|
672
|
-
},
|
|
673
|
-
routeWhileDragging: true
|
|
674
|
-
}).addTo(this.map);
|
|
583
|
+
parseSessionStatus() {
|
|
584
|
+
var _a, _b, _c, _d, _e, _f;
|
|
585
|
+
if (((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.utilityFlags) === null || _b === void 0 ? void 0 : _b.isShowTaskStatus) &&
|
|
586
|
+
checkObjectPathExists(this.config, "taskUI.header.taskStatus.path") &&
|
|
587
|
+
isNotEmptyValue(this.config.taskUI.header.taskStatus.path)) {
|
|
588
|
+
this.status = getObjectValueFromPath(this.data, (_f = (_e = (_d = (_c = this.config) === null || _c === void 0 ? void 0 : _c.taskUI) === null || _d === void 0 ? void 0 : _d.header) === null || _e === void 0 ? void 0 : _e.taskStatus) === null || _f === void 0 ? void 0 : _f.path);
|
|
589
|
+
}
|
|
675
590
|
}
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
591
|
+
parsePreviewData() {
|
|
592
|
+
var _a, _b, _c, _d;
|
|
593
|
+
if (checkObjectPathExists(this.config, "taskUI.preview.data") &&
|
|
594
|
+
isNotEmptyValue(this.config.taskUI.preview.data) &&
|
|
595
|
+
Array.isArray(this.config.taskUI.preview.data) &&
|
|
596
|
+
this.config.taskUI.preview.data.length > 0) {
|
|
597
|
+
const previewData = [];
|
|
598
|
+
this.config.taskUI.preview.data.map((field) => {
|
|
599
|
+
const value = getObjectValueFromPath(this.data, field.path);
|
|
600
|
+
previewData.push({ label: field.label, value });
|
|
601
|
+
});
|
|
602
|
+
this.previewData = previewData;
|
|
603
|
+
this.previewConfig =
|
|
604
|
+
(_d = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.taskUI) === null || _b === void 0 ? void 0 : _b.preview) === null || _c === void 0 ? void 0 : _c.config) !== null && _d !== void 0 ? _d : PREVIEW_DATA_DEFAULT_CONFIG;
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
handleOnClickTaskItem(e, taskItemData) {
|
|
608
|
+
this.onClickTaskItem.emit({
|
|
609
|
+
data: taskItemData
|
|
610
|
+
});
|
|
611
|
+
}
|
|
612
|
+
handleOnClickTaskItemViewDetail(e, taskItemData) {
|
|
613
|
+
this.onClickTaskItemViewDetail.emit({
|
|
614
|
+
data: taskItemData
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
handleOnClickPerformAction(e, action) {
|
|
618
|
+
this.onClickPerformAction.emit({
|
|
619
|
+
action
|
|
620
|
+
});
|
|
680
621
|
}
|
|
681
622
|
}
|
|
682
|
-
/** @nocollapse */
|
|
683
|
-
/** @nocollapse */
|
|
684
|
-
|
|
685
|
-
|
|
623
|
+
/** @nocollapse */ TaskItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
624
|
+
/** @nocollapse */ TaskItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskItemComponent, selector: "task-item", inputs: { config: "config", data: "data" }, outputs: { onClickTaskItem: "onClickTaskItem", onClickTaskItemViewDetail: "onClickTaskItemViewDetail", onClickPerformAction: "onClickPerformAction" }, ngImport: i0, template: "<tui-accordion\n class=\"task-item-container\"\n (click)=\"handleOnClickTaskItem($event, data)\"\n>\n <tui-accordion-item>\n <div class=\"task-item-header\">\n <div class=\"task-item-id\">{{ header }}</div>\n <task-item-status\n *ngIf=\"status\"\n [config]=\"config?.taskUI?.header?.taskStatus\"\n [status]=\"status\"\n ></task-item-status>\n </div>\n <ng-template tuiAccordionItemContent>\n <div class=\"task-item-preview\">\n <kwikui-label-value-pair\n [config]=\"previewConfig\"\n [data]=\"previewData\"\n ></kwikui-label-value-pair>\n </div>\n <div class=\"task-item-footer\">\n <kwikui-button\n appearance=\"primary\"\n label=\"View Detail\"\n shape=\"rounded\"\n size=\"s\"\n (onClick)=\"handleOnClickTaskItemViewDetail($event, data)\"\n ></kwikui-button>\n </div>\n </ng-template>\n </tui-accordion-item>\n</tui-accordion>\n", styles: [".task-item-header{display:flex;flex-direction:column}.task-item-footer{margin-top:.5rem}\n"], components: [{ type: i1$1.TuiAccordionComponent, selector: "tui-accordion", inputs: ["closeOthers", "rounded"] }, { type: i1$1.TuiAccordionItemComponent, selector: "tui-accordion-item", inputs: ["noPadding", "showArrow", "borders", "size", "disabled", "disableHover", "open", "async"], outputs: ["openChange"] }, { type: TaskItemStatusComponent, selector: "task-item-status", inputs: ["config", "status"] }, { type: i1.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["config", "data", "id"] }, { type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.TuiAccordionItemContentDirective, selector: "ng-template[tuiAccordionItemContent]" }] });
|
|
625
|
+
__decorate([
|
|
626
|
+
logMethod
|
|
627
|
+
], TaskItemComponent.prototype, "handleOnClickTaskItem", null);
|
|
628
|
+
__decorate([
|
|
629
|
+
logMethod
|
|
630
|
+
], TaskItemComponent.prototype, "handleOnClickTaskItemViewDetail", null);
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemComponent, decorators: [{
|
|
632
|
+
type: Component,
|
|
686
633
|
args: [{
|
|
687
|
-
|
|
634
|
+
selector: "task-item",
|
|
635
|
+
templateUrl: "./task-item.component.html",
|
|
636
|
+
styleUrls: ["./task-item.component.scss"]
|
|
688
637
|
}]
|
|
689
|
-
}], ctorParameters: function () { return [
|
|
690
|
-
type:
|
|
691
|
-
|
|
692
|
-
|
|
638
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
639
|
+
type: Input
|
|
640
|
+
}], data: [{
|
|
641
|
+
type: Input
|
|
642
|
+
}], onClickTaskItem: [{
|
|
643
|
+
type: Output
|
|
644
|
+
}], onClickTaskItemViewDetail: [{
|
|
645
|
+
type: Output
|
|
646
|
+
}], onClickPerformAction: [{
|
|
647
|
+
type: Output
|
|
648
|
+
}], handleOnClickTaskItem: [], handleOnClickTaskItemViewDetail: [] } });
|
|
693
649
|
|
|
694
|
-
class
|
|
650
|
+
class TaskListComponent {
|
|
651
|
+
constructor(loaderService) {
|
|
652
|
+
this.loaderService = loaderService;
|
|
653
|
+
this.config = {};
|
|
654
|
+
this.taskItems = [];
|
|
655
|
+
this.onClickTaskItemViewDetail = new EventEmitter();
|
|
656
|
+
// Pagination
|
|
657
|
+
this.paginationIndex = 0;
|
|
658
|
+
this.paginationLength = null;
|
|
659
|
+
this.activePageItems = [];
|
|
660
|
+
this.filteredItems = [];
|
|
661
|
+
this.itemPerPage = 50;
|
|
662
|
+
// Loaders
|
|
663
|
+
this.loading = false;
|
|
664
|
+
// Search Text
|
|
665
|
+
this.searchText = "";
|
|
666
|
+
// Sort Filter
|
|
667
|
+
this.sortFilterKey = "";
|
|
668
|
+
this.sortInAscendingOrder = "ASC";
|
|
669
|
+
// Date Range Values
|
|
670
|
+
this.start_time = undefined;
|
|
671
|
+
this.end_time = undefined;
|
|
672
|
+
this.max = new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
|
|
673
|
+
this.formGroup = new FormGroup({});
|
|
674
|
+
// Event Emitters
|
|
675
|
+
this.onGetTaskList = new EventEmitter();
|
|
676
|
+
}
|
|
695
677
|
ngOnInit() {
|
|
696
|
-
|
|
697
|
-
this.
|
|
678
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
679
|
+
this.toggleLoader(true);
|
|
680
|
+
// this.taskItems = Array.from({ length: 1000 }, (_, i) =>
|
|
681
|
+
// String(`test_${i}`)
|
|
682
|
+
// );
|
|
683
|
+
this.handleInitialDateRange();
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
ngOnChanges(changes) {
|
|
687
|
+
const verifyChange = (key) => {
|
|
688
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
689
|
+
};
|
|
690
|
+
if (verifyChange("taskItems")) {
|
|
691
|
+
this.toggleLoader(true);
|
|
692
|
+
this.taskItems = changes.taskItems.currentValue;
|
|
693
|
+
this.handleOnSortTaskItems(this.sortFilterKey, this.sortInAscendingOrder);
|
|
694
|
+
this.handleOnTaskItemsChange();
|
|
698
695
|
}
|
|
699
696
|
}
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
697
|
+
handleOnTaskItemsChange() {
|
|
698
|
+
this.toggleLoader(true);
|
|
699
|
+
this.handleOnFilterTaskItems();
|
|
700
|
+
this.paginationLength = Math.ceil(this.filteredItems.length / this.itemPerPage);
|
|
701
|
+
this.activePageItems = this.filteredItems.slice(this.paginationIndex * this.itemPerPage, this.paginationIndex * this.itemPerPage + this.itemPerPage);
|
|
702
|
+
this.toggleLoader(false);
|
|
703
703
|
}
|
|
704
|
-
|
|
705
|
-
|
|
704
|
+
handleInitialDateRange() {
|
|
705
|
+
var _a, _b, _c, _d, _e, _f;
|
|
706
|
+
const searchFilterStartPoint = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.extendedFlags) === null || _b === void 0 ? void 0 : _b.searchFilterStartPoint) !== null && _c !== void 0 ? _c : {
|
|
707
|
+
day: 0,
|
|
708
|
+
month: 0,
|
|
709
|
+
year: 0
|
|
710
|
+
};
|
|
711
|
+
const currentDate = new Date();
|
|
712
|
+
const startDate = new Date((_d = currentDate.getFullYear() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.year)) !== null && _d !== void 0 ? _d : 0, (_e = currentDate.getMonth() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.month)) !== null && _e !== void 0 ? _e : 0, (_f = currentDate.getDate() - (searchFilterStartPoint === null || searchFilterStartPoint === void 0 ? void 0 : searchFilterStartPoint.day)) !== null && _f !== void 0 ? _f : 0);
|
|
713
|
+
this.start_time = convertNormalDateToStringFormat(startDate);
|
|
714
|
+
this.end_time = convertNormalDateToStringFormat(null);
|
|
715
|
+
this.searchDataFormControl = new FormControl({
|
|
716
|
+
value: new TuiDayRange(new TuiDay(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()), this.max),
|
|
717
|
+
disabled: false
|
|
718
|
+
});
|
|
719
|
+
this.formGroup.addControl("searchDate", this.searchDataFormControl);
|
|
720
|
+
this.searchTextFormControl = new FormControl("");
|
|
721
|
+
this.formGroup.addControl("searchText", this.searchTextFormControl);
|
|
722
|
+
this.handleOnGetTaskItems();
|
|
723
|
+
}
|
|
724
|
+
handleOnFilterTasksByText(event) {
|
|
725
|
+
this.searchText = event === null || event === void 0 ? void 0 : event.text;
|
|
726
|
+
this.handleOnTaskItemsChange();
|
|
727
|
+
}
|
|
728
|
+
handleOnFilterTasksByDate(event) {
|
|
729
|
+
this.start_time = event.start_time;
|
|
730
|
+
this.end_time = event.end_time;
|
|
731
|
+
this.handleOnGetTaskItems();
|
|
732
|
+
}
|
|
733
|
+
handleOnGetTaskItems() {
|
|
734
|
+
this.toggleLoader(true);
|
|
735
|
+
this.onGetTaskList.emit({
|
|
736
|
+
from_date: this.start_time,
|
|
737
|
+
to_date: this.end_time
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
handleOnChangeSortFilter(event) {
|
|
741
|
+
var _a;
|
|
742
|
+
if (event && isNotEmptyValue(event.sortFilterKey)) {
|
|
743
|
+
this.sortFilterKey = event.sortFilterKey;
|
|
744
|
+
this.sortInAscendingOrder = (_a = event.sortFilterOrder) !== null && _a !== void 0 ? _a : true;
|
|
745
|
+
this.handleOnSortTaskItems(this.sortFilterKey, this.sortInAscendingOrder);
|
|
746
|
+
this.handleOnTaskItemsChange();
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
handleOnSortTaskItems(key, order) {
|
|
750
|
+
const sortedTaskItems = sortItems(this.taskItems, key, order);
|
|
751
|
+
this.taskItems = sortedTaskItems;
|
|
752
|
+
this.handleOnTaskItemsChange();
|
|
753
|
+
}
|
|
754
|
+
handleOnClickTaskItemViewDetail(e) {
|
|
755
|
+
this.onClickTaskItemViewDetail.emit(e);
|
|
756
|
+
}
|
|
757
|
+
handleOnClickChangePaginationIndex(indexOfPage) {
|
|
758
|
+
if (indexOfPage >= 0) {
|
|
759
|
+
this.paginationIndex = indexOfPage;
|
|
760
|
+
this.activePageItems = this.taskItems.slice(this.paginationIndex * this.itemPerPage, this.paginationIndex * this.itemPerPage + this.itemPerPage);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
handleOnFilterTaskItems() {
|
|
764
|
+
const lowerCaseSearchText = this.searchText.toLowerCase();
|
|
765
|
+
this.filteredItems = this.taskItems.filter((item) => {
|
|
766
|
+
return Object.values(item).some((value) =>
|
|
767
|
+
// Ensure the value can be converted to string and check if it includes the search text
|
|
768
|
+
value != null &&
|
|
769
|
+
value.toString().toLowerCase().includes(lowerCaseSearchText));
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
trackByFn(index, item) {
|
|
773
|
+
return index; // or unique identifier if available
|
|
774
|
+
}
|
|
775
|
+
toggleLoader(loader, message = undefined) {
|
|
776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
777
|
+
if (loader) {
|
|
778
|
+
this.loaderService.show({
|
|
779
|
+
fullscreen: true,
|
|
780
|
+
loaderText: message !== null && message !== void 0 ? message : "Please Wait"
|
|
781
|
+
});
|
|
782
|
+
this.loading = true;
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
this.loaderService.hide();
|
|
786
|
+
this.loading = false;
|
|
787
|
+
}
|
|
788
|
+
});
|
|
706
789
|
}
|
|
707
790
|
}
|
|
708
|
-
/** @nocollapse */
|
|
709
|
-
/** @nocollapse */
|
|
710
|
-
|
|
791
|
+
/** @nocollapse */ TaskListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListComponent, deps: [{ token: i1.KwikUILoaderService }], target: i0.ɵɵFactoryTarget.Component });
|
|
792
|
+
/** @nocollapse */ TaskListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskListComponent, selector: "task-list", inputs: { config: "config", taskItems: "taskItems" }, outputs: { onClickTaskItemViewDetail: "onClickTaskItemViewDetail", onGetTaskList: "onGetTaskList" }, usesOnChanges: true, ngImport: i0, template: "<kwikui-loader></kwikui-loader>\n<div id=\"task-list-container\">\n <div id=\"task-list-search-wrapper\">\n <task-list-search\n [config]=\"config\"\n (onFilterTasksByText)=\"handleOnFilterTasksByText($event)\"\n (onFilterTasksByDate)=\"handleOnFilterTasksByDate($event)\"\n (onChangeSortFilter)=\"handleOnChangeSortFilter($event)\"\n ></task-list-search>\n </div>\n <hr />\n <div\n itemSize=\"50\"\n class=\"virtualscroll-container\"\n *ngIf=\"activePageItems.length > 0 && !loading; else NO_TASKS\"\n >\n <div id=\"task-list-items-container\">\n <div\n *ngFor=\"let taskItem of activePageItems\"\n class=\"task-item-container\"\n >\n <task-item\n [config]=\"config\"\n [data]=\"taskItem\"\n (onClickTaskItemViewDetail)=\"handleOnClickTaskItemViewDetail($event)\"\n >\n </task-item>\n </div>\n </div>\n <div id=\"task-list-items-pagination-container\">\n <tui-pagination\n [index]=\"paginationIndex\"\n [length]=\"paginationLength\"\n (indexChange)=\"handleOnClickChangePaginationIndex($event)\"\n ></tui-pagination>\n </div>\n </div>\n <ng-template #NO_TASKS>\n <div class=\"no-tasks\">No Tasks</div>\n </ng-template>\n</div>\n", styles: ["#task-list-container{width:100%;height:100%;overflow:hidden;display:flex;flex-direction:column}#task-list-container ::-webkit-scrollbar{width:8px!important}#task-list-container ::-webkit-scrollbar-track{border-radius:10px!important}#task-list-container ::-webkit-scrollbar-thumb{background:lightgray!important;border-radius:10px!important}#task-list-container ::-webkit-scrollbar-thumb:hover{background:gray!important}#task-list-container #task-list-search-wrapper{width:100%;padding:1rem}#task-list-container .virtualscroll-container{width:100%;height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:stretch;overflow:auto}#task-list-container .no-tasks{width:100%;height:100%;display:flex;flex-direction:row;justify-content:center;align-items:center;font-size:1rem;font-weight:bold}#task-list-container #task-list-items-container{overflow:auto}#task-list-container #task-list-items-container>*:first-child{margin-top:1rem}#task-list-container #task-list-items-container .task-item-container{padding:0 1rem;margin-bottom:1rem}#task-list-container #task-list-items-pagination-container{padding:1rem}\n"], components: [{ type: i1.KwikUILoaderComponent, selector: "kwikui-loader" }, { type: TaskListSearchComponent, selector: "task-list-search", inputs: ["config"], outputs: ["onFilterTasksByText", "onFilterTasksByDate", "onChangeSortFilter"] }, { type: TaskItemComponent, selector: "task-item", inputs: ["config", "data"], outputs: ["onClickTaskItem", "onClickTaskItemViewDetail", "onClickPerformAction"] }, { type: i1$1.TuiPaginationComponent, selector: "tui-pagination", inputs: ["length", "size", "disabled", "activePadding", "sidePadding", "content", "index"], outputs: ["indexChange"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
793
|
+
__decorate([
|
|
794
|
+
logMethod
|
|
795
|
+
], TaskListComponent.prototype, "ngOnChanges", null);
|
|
796
|
+
__decorate([
|
|
797
|
+
logMethod
|
|
798
|
+
], TaskListComponent.prototype, "handleOnTaskItemsChange", null);
|
|
799
|
+
__decorate([
|
|
800
|
+
logMethod
|
|
801
|
+
], TaskListComponent.prototype, "handleOnClickTaskItemViewDetail", null);
|
|
802
|
+
__decorate([
|
|
803
|
+
logMethod
|
|
804
|
+
], TaskListComponent.prototype, "handleOnClickChangePaginationIndex", null);
|
|
805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListComponent, decorators: [{
|
|
711
806
|
type: Component,
|
|
712
807
|
args: [{
|
|
713
|
-
selector:
|
|
714
|
-
templateUrl:
|
|
715
|
-
styleUrls: [
|
|
808
|
+
selector: "task-list",
|
|
809
|
+
templateUrl: "./task-list.component.html",
|
|
810
|
+
styleUrls: ["./task-list.component.scss"],
|
|
811
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
716
812
|
}]
|
|
717
|
-
}], propDecorators: {
|
|
813
|
+
}], ctorParameters: function () { return [{ type: i1.KwikUILoaderService }]; }, propDecorators: { config: [{
|
|
718
814
|
type: Input
|
|
719
|
-
}]
|
|
815
|
+
}], taskItems: [{
|
|
816
|
+
type: Input
|
|
817
|
+
}], onClickTaskItemViewDetail: [{
|
|
818
|
+
type: Output
|
|
819
|
+
}], onGetTaskList: [{
|
|
820
|
+
type: Output
|
|
821
|
+
}], ngOnChanges: [], handleOnTaskItemsChange: [], handleOnClickTaskItemViewDetail: [], handleOnClickChangePaginationIndex: [] } });
|
|
822
|
+
|
|
823
|
+
class LayoutBodyComponent {
|
|
824
|
+
constructor(hostElement, previewDialogService, dialogs) {
|
|
825
|
+
this.hostElement = hostElement;
|
|
826
|
+
this.previewDialogService = previewDialogService;
|
|
827
|
+
this.dialogs = dialogs;
|
|
828
|
+
this.isMobileView = false;
|
|
829
|
+
this.popupFormCallback = {};
|
|
830
|
+
this.popupFormConfig = {};
|
|
831
|
+
this.popupFormData = {};
|
|
832
|
+
this.previewProperties = {
|
|
833
|
+
html: {
|
|
834
|
+
before: "",
|
|
835
|
+
after: ""
|
|
836
|
+
},
|
|
837
|
+
iframe: {
|
|
838
|
+
src: "",
|
|
839
|
+
title: ""
|
|
840
|
+
},
|
|
841
|
+
popupFormKey: "",
|
|
842
|
+
title: "",
|
|
843
|
+
unavailable: false
|
|
844
|
+
};
|
|
845
|
+
this.pageFormConfig = undefined;
|
|
846
|
+
this.pageFormData = {};
|
|
847
|
+
this.onClickApiCall = new EventEmitter();
|
|
848
|
+
this.onGetTaskList = new EventEmitter();
|
|
849
|
+
this.apiCallResponse = {};
|
|
850
|
+
this.config = {};
|
|
851
|
+
this.userConfig = {};
|
|
852
|
+
this.agentInfo = {};
|
|
853
|
+
this.taskList = [];
|
|
854
|
+
this.isShowFullTaskDetails = false;
|
|
855
|
+
this.isActiveSidebar = true;
|
|
856
|
+
this.activeTaskDetail = null;
|
|
857
|
+
}
|
|
858
|
+
// The final value should be provided to service, so that it can be used in all components
|
|
859
|
+
windowResizeWatcher() {
|
|
860
|
+
if (this.hostElement.nativeElement.offsetWidth < 720) {
|
|
861
|
+
this.isMobileView = true;
|
|
862
|
+
}
|
|
863
|
+
else {
|
|
864
|
+
this.isMobileView = false;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
ngOnInit() {
|
|
868
|
+
this.windowResizeWatcher();
|
|
869
|
+
}
|
|
870
|
+
ngOnChanges(changes) {
|
|
871
|
+
const verifyChange = (key) => {
|
|
872
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
873
|
+
};
|
|
874
|
+
for (const change of Object.entries(changes)) {
|
|
875
|
+
const key = change[0];
|
|
876
|
+
const value = change[1].currentValue;
|
|
877
|
+
}
|
|
878
|
+
if (verifyChange("taskList")) {
|
|
879
|
+
this.taskList = changes.taskList.currentValue;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
handleShowingFullTaskDetails() {
|
|
883
|
+
var _a, _b;
|
|
884
|
+
if ((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.isShowMaps) {
|
|
885
|
+
this.isShowFullTaskDetails = false;
|
|
886
|
+
}
|
|
887
|
+
else if (this.isMobileView) {
|
|
888
|
+
this.isShowFullTaskDetails = false;
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
this.isShowFullTaskDetails = true;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
handleOnClickTaskItemViewDetail(e) {
|
|
895
|
+
this.handleShowingFullTaskDetails();
|
|
896
|
+
this.handleOnClickCloseTaskDetail(e);
|
|
897
|
+
this.activeTaskDetail = e;
|
|
898
|
+
}
|
|
899
|
+
handleOnClickCloseTaskDetail(e) {
|
|
900
|
+
this.activeTaskDetail = null;
|
|
901
|
+
}
|
|
902
|
+
handleOnClickToggleSidebar(e) {
|
|
903
|
+
this.isActiveSidebar = !this.isActiveSidebar;
|
|
904
|
+
}
|
|
905
|
+
handleOnClickApiCall(e) {
|
|
906
|
+
this.onClickApiCall.emit(e);
|
|
907
|
+
}
|
|
908
|
+
handleOnGetTaskList(event) {
|
|
909
|
+
this.onGetTaskList.emit(event);
|
|
910
|
+
}
|
|
911
|
+
handleOnClickPrimaryAction(e) {
|
|
912
|
+
var _a, _b;
|
|
913
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
914
|
+
switch (e.type) {
|
|
915
|
+
case "POPUP_FORM":
|
|
916
|
+
this.popupFormConfig = yield (yield fetch((_a = e === null || e === void 0 ? void 0 : e.props) === null || _a === void 0 ? void 0 : _a.formUrl)).json();
|
|
917
|
+
console.log("popupFormConfig", this.popupFormConfig);
|
|
918
|
+
this.previewDialogRef = this.previewDialogService
|
|
919
|
+
.open(this.preview || "")
|
|
920
|
+
.subscribe({
|
|
921
|
+
next: (data) => {
|
|
922
|
+
this.popupFormCallback = {
|
|
923
|
+
popupFormData: data.data,
|
|
924
|
+
popupFormConfig: data.formConfig
|
|
925
|
+
};
|
|
926
|
+
this.popupFormConfig = {};
|
|
927
|
+
this.previewDialogRef.complete();
|
|
928
|
+
},
|
|
929
|
+
error: () => {
|
|
930
|
+
this.popupFormCallback = {
|
|
931
|
+
popupFormData: {},
|
|
932
|
+
popupFormConfig: this.popupFormConfig
|
|
933
|
+
};
|
|
934
|
+
this.popupFormConfig = {};
|
|
935
|
+
console.info("Preview error");
|
|
936
|
+
},
|
|
937
|
+
complete: () => {
|
|
938
|
+
console.info("Preview closed");
|
|
939
|
+
}
|
|
940
|
+
});
|
|
941
|
+
break;
|
|
942
|
+
case "PAGE_FORM":
|
|
943
|
+
this.pageFormConfig = yield (yield fetch((_b = e === null || e === void 0 ? void 0 : e.props) === null || _b === void 0 ? void 0 : _b.formUrl)).json();
|
|
944
|
+
break;
|
|
945
|
+
case "action_3":
|
|
946
|
+
break;
|
|
947
|
+
default:
|
|
948
|
+
break;
|
|
949
|
+
}
|
|
950
|
+
});
|
|
951
|
+
}
|
|
952
|
+
handleOnClickSaveForm(e, eventType) {
|
|
953
|
+
switch (eventType) {
|
|
954
|
+
case "POPUP_FORM":
|
|
955
|
+
this.previewDialogRef.next(e);
|
|
956
|
+
break;
|
|
957
|
+
case "PAGE_FORM":
|
|
958
|
+
this.pageFormConfig = undefined;
|
|
959
|
+
break;
|
|
960
|
+
default:
|
|
961
|
+
break;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
/** @nocollapse */ LayoutBodyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyComponent, deps: [{ token: i0.ElementRef }, { token: TuiPreviewDialogService }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
966
|
+
/** @nocollapse */ LayoutBodyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: LayoutBodyComponent, selector: "layout-body", inputs: { config: "config", userConfig: "userConfig", agentInfo: "agentInfo", taskList: "taskList" }, outputs: { onClickApiCall: "onClickApiCall", onGetTaskList: "onGetTaskList" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "preview", first: true, predicate: ["preview"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"body-container\">\n <div\n id=\"sidebar-container\"\n *ngIf=\"!isMobileView && !activeTaskDetail\"\n [class.is-hidden]=\"!isActiveSidebar\"\n >\n <div\n id=\"sidebar-toggle\"\n *ngIf=\"!isMobileView && !activeTaskDetail && !pageFormConfig\"\n [class.is-hidden]=\"!isActiveSidebar\"\n (click)=\"handleOnClickToggleSidebar($event)\"\n >\n <tui-svg\n *ngIf=\"isActiveSidebar\"\n [src]=\"'tuiIconChevronsLeftLarge'\"\n ></tui-svg>\n <tui-svg\n *ngIf=\"!isActiveSidebar\"\n [src]=\"'tuiIconChevronsRightLarge'\"\n ></tui-svg>\n </div>\n <ng-container *ngTemplateOutlet=\"TaskList\"></ng-container>\n </div>\n <div\n id=\"main-container\"\n [class.is-desktop]=\"!isMobileView\"\n >\n <div\n id=\"primary-actions-wrapper\"\n [class.is-desktop]=\"!isMobileView\"\n [class.is-nomaps]=\"config.mapConfig?.isHidden\"\n *ngIf=\"config.primaryActionsConfig\"\n >\n <primary-actions\n [primaryActionsConfig]=\"config.primaryActionsConfig\"\n (onClickPrimaryAction)=\"handleOnClickPrimaryAction($event)\"\n ></primary-actions>\n </div>\n\n <div\n class=\"kwikid-form-view-page-container\"\n *ngIf=\"pageFormConfig && pageFormConfig !== {}\"\n >\n <kwikid-form-view\n [formConfig]=\"pageFormConfig\"\n [allFormsData]=\"{}\"\n [apiCallResponse]=\"this.apiCallResponse\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event, 'PAGE_FORM')\"\n ></kwikid-form-view>\n </div>\n\n <div\n id=\"map-view-wrapper\"\n [class.is-desktop]=\"!isMobileView\"\n >\n <map-view [mapConfig]=\"config.mapConfig\"></map-view>\n </div>\n\n <div\n id=\"task-detail-wrapper\"\n *ngIf=\"activeTaskDetail && isShowFullTaskDetails\"\n [@taskDetail2InOut]\n >\n <task-detail\n [config]=\"config\"\n [taskDetail]=\"activeTaskDetail\"\n (onClickCloseTaskDetail)=\"handleOnClickCloseTaskDetail($event)\"\n ></task-detail>\n </div>\n </div>\n</div>\n\n<bottom-sheet *ngIf=\"isMobileView\">\n <!-- Content to be projected into the bottom sheet -->\n <ng-container *ngTemplateOutlet=\"TaskList\"></ng-container>\n</bottom-sheet>\n\n<ng-template #TaskList>\n <div\n id=\"task-detail-wrapper\"\n *ngIf=\"activeTaskDetail && !isShowFullTaskDetails\"\n [@taskDetailInOut]\n >\n <task-detail\n [config]=\"config\"\n [taskDetail]=\"activeTaskDetail\"\n (onClickCloseTaskDetail)=\"handleOnClickCloseTaskDetail($event)\"\n ></task-detail>\n </div>\n <div id=\"task-list-wrapper\">\n <task-list\n [config]=\"config\"\n [taskItems]=\"taskList\"\n (onClickTaskItemViewDetail)=\"handleOnClickTaskItemViewDetail($event)\"\n (onGetTaskList)=\"handleOnGetTaskList($event)\"\n [@taskListInOut]\n ></task-list>\n </div>\n</ng-template>\n\n<ng-template\n #preview\n let-preview\n>\n <tui-preview\n [rotatable]=\"false\"\n [zoomable]=\"false\"\n class=\"preview-container\"\n *ngIf=\"popupFormConfig\"\n >\n <button\n tuiIconButton\n tuiPreviewAction\n icon=\"tuiIconCloseLarge\"\n title=\"Close\"\n type=\"button\"\n (click)=\"preview.complete()\"\n ></button>\n\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"{}\"\n [apiCallResponse]=\"this.apiCallResponse\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event, 'POPUP_FORM')\"\n ></kwikid-form-view>\n </div>\n </tui-preview>\n</ng-template>\n\n<ng-template\n #content\n let-context\n>\n <div class=\"kwikid-form-view-popup-container\">\n <kwikid-form-view\n [formConfig]=\"popupFormConfig\"\n [allFormsData]=\"{}\"\n [apiCallResponse]=\"this.apiCallResponse\"\n (onClickApiCall)=\"handleOnClickApiCall($event)\"\n (onClickSaveForm)=\"this.handleOnClickSaveForm($event, 'POPUP_FORM')\"\n ></kwikid-form-view>\n </div>\n</ng-template>\n", styles: [":root,:host{display:block;width:100%;height:100%}::-webkit-scrollbar{width:8px!important}::-webkit-scrollbar-track{border-radius:10px!important}::-webkit-scrollbar-thumb{background:lightgray!important;border-radius:10px!important}::-webkit-scrollbar-thumb:hover{background:gray!important}#body-container{width:100%;height:100%;display:flex;flex-direction:row;align-items:stretch;overflow:auto;position:relative;z-index:1}#body-container #sidebar-container{width:100%;max-width:320px;height:100%;overflow-y:auto;position:relative;z-index:1;box-shadow:#32325d40 0 13px 27px -5px,#0000004d 0 8px 16px -8px;overflow-x:hidden;z-index:5}#body-container #sidebar-container.is-hidden{width:0px!important}#body-container #sidebar-container #sidebar-toggle{flex-direction:row;background:white;width:3.6rem;border-top-right-radius:1rem;border-bottom-right-radius:1rem;height:3.6rem;display:flex;justify-content:center;align-items:center;cursor:pointer;position:fixed;transform:translate(320px,1.6rem);box-shadow:#32325d40 0 13px 27px -5px,#0000004d 0 8px 16px -8px;z-index:-1}#body-container #sidebar-container #sidebar-toggle.is-hidden{transform:translateY(1.6rem)}#body-container #main-container{flex:1;height:100%;position:relative;overflow:auto;z-index:1}#body-container #main-container #primary-actions-wrapper{position:absolute;padding:0;top:1rem;left:calc(100% - 1rem);z-index:3;border-radius:.5rem;transform:translate(-100%)}#body-container #main-container #primary-actions-wrapper.is-nomaps{box-shadow:none}#body-container #main-container #map-view-wrapper{width:100%;height:100%;overflow:hidden;position:relative;z-index:2}@media only screen and (max-width: 600px){#body-container{display:flex;flex-direction:column-reverse;justify-content:space-between;align-items:stretch}#body-container #main-container{flex:1;height:100%;position:relative;overflow:auto}#body-container #main-container #primary-actions-wrapper{position:absolute;width:calc(100% - (2 * 1rem));padding:0;top:1rem;left:calc(1rem);z-index:3;border-radius:.5rem;transform:translate(0)}#body-container #main-container #primary-actions-wrapper.is-nomaps{box-shadow:none}#body-container #main-container #map-view-wrapper{width:100%;height:100%;overflow:hidden}}#task-list-wrapper{width:100%;height:100%;overflow:auto;background-color:#fff;z-index:2}#task-detail-wrapper{position:absolute;top:0px;left:0px;background-color:#fff;width:100%;height:100%;overflow:auto;z-index:3}.kwikid-form-view-popup-container{border-radius:1rem;background:var(--tui-base-01);min-width:320px;max-width:480px;padding:.5rem;height:100%;max-height:90vh;overflow:auto;width:100%}.kwikid-form-view-page-container{min-width:320px;max-width:100%;padding:.5rem;height:100%;max-height:100%;overflow:auto;width:100%}\n"], components: [{ type: i3.TuiSvgComponent, selector: "tui-svg", inputs: ["src"] }, { type: PrimaryActionsComponent, selector: "primary-actions", inputs: ["primaryActionsConfig"], outputs: ["onClickPrimaryAction"] }, { type: i3$1.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "extraData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig", "stepConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickViewFile", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }, { type: MapViewComponent, selector: "map-view", inputs: ["mapConfig"] }, { type: TaskDetailComponent, selector: "task-detail", inputs: ["config", "taskDetail"], outputs: ["onClickCloseTaskDetail"] }, { type: BottomSheetComponent, selector: "bottom-sheet" }, { type: TaskListComponent, selector: "task-list", inputs: ["config", "taskItems"], outputs: ["onClickTaskItemViewDetail", "onGetTaskList"] }, { type: i8.TuiPreviewComponent, selector: "tui-preview", inputs: ["zoomable", "rotatable"] }, { type: i3.TuiButtonComponent, selector: "button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]", inputs: ["appearance", "disabled", "icon", "iconRight", "shape", "showLoader", "size"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i8.TuiPreviewActionDirective, selector: "[tuiPreviewAction]" }], animations: [
|
|
967
|
+
trigger("taskDetailInOut", [
|
|
968
|
+
transition(":enter", [
|
|
969
|
+
style({ transform: "translateY(100%)" }),
|
|
970
|
+
animate(150)
|
|
971
|
+
]),
|
|
972
|
+
transition(":leave", [
|
|
973
|
+
animate(150, style({ transform: "translateY(100%)" }))
|
|
974
|
+
])
|
|
975
|
+
]),
|
|
976
|
+
trigger("taskDetail2InOut", [
|
|
977
|
+
transition(":enter", [
|
|
978
|
+
style({ transform: "translateX(100%)" }),
|
|
979
|
+
animate(150)
|
|
980
|
+
]),
|
|
981
|
+
transition(":leave", [
|
|
982
|
+
animate(150, style({ transform: "translateX(100%)" }))
|
|
983
|
+
])
|
|
984
|
+
]),
|
|
985
|
+
trigger("taskListInOut", [
|
|
986
|
+
transition(":enter", [
|
|
987
|
+
style({ transform: "translateY(100%)" }),
|
|
988
|
+
animate(0)
|
|
989
|
+
]),
|
|
990
|
+
transition(":leave", [
|
|
991
|
+
animate(0, style({ transform: "translateY(100%)" }))
|
|
992
|
+
])
|
|
993
|
+
])
|
|
994
|
+
] });
|
|
995
|
+
__decorate([
|
|
996
|
+
logMethod
|
|
997
|
+
], LayoutBodyComponent.prototype, "ngOnChanges", null);
|
|
998
|
+
__decorate([
|
|
999
|
+
logMethod
|
|
1000
|
+
], LayoutBodyComponent.prototype, "handleShowingFullTaskDetails", null);
|
|
1001
|
+
__decorate([
|
|
1002
|
+
logMethod
|
|
1003
|
+
], LayoutBodyComponent.prototype, "handleOnClickTaskItemViewDetail", null);
|
|
1004
|
+
__decorate([
|
|
1005
|
+
logMethod
|
|
1006
|
+
], LayoutBodyComponent.prototype, "handleOnClickCloseTaskDetail", null);
|
|
1007
|
+
__decorate([
|
|
1008
|
+
logMethod
|
|
1009
|
+
], LayoutBodyComponent.prototype, "handleOnClickToggleSidebar", null);
|
|
1010
|
+
__decorate([
|
|
1011
|
+
logMethod
|
|
1012
|
+
], LayoutBodyComponent.prototype, "handleOnClickApiCall", null);
|
|
1013
|
+
__decorate([
|
|
1014
|
+
logMethod
|
|
1015
|
+
], LayoutBodyComponent.prototype, "handleOnClickPrimaryAction", null);
|
|
1016
|
+
__decorate([
|
|
1017
|
+
logMethod
|
|
1018
|
+
], LayoutBodyComponent.prototype, "handleOnClickSaveForm", null);
|
|
1019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyComponent, decorators: [{
|
|
1020
|
+
type: Component,
|
|
1021
|
+
args: [{
|
|
1022
|
+
selector: "layout-body",
|
|
1023
|
+
templateUrl: "./layout-body.component.html",
|
|
1024
|
+
styleUrls: ["./layout-body.component.scss"],
|
|
1025
|
+
animations: [
|
|
1026
|
+
trigger("taskDetailInOut", [
|
|
1027
|
+
transition(":enter", [
|
|
1028
|
+
style({ transform: "translateY(100%)" }),
|
|
1029
|
+
animate(150)
|
|
1030
|
+
]),
|
|
1031
|
+
transition(":leave", [
|
|
1032
|
+
animate(150, style({ transform: "translateY(100%)" }))
|
|
1033
|
+
])
|
|
1034
|
+
]),
|
|
1035
|
+
trigger("taskDetail2InOut", [
|
|
1036
|
+
transition(":enter", [
|
|
1037
|
+
style({ transform: "translateX(100%)" }),
|
|
1038
|
+
animate(150)
|
|
1039
|
+
]),
|
|
1040
|
+
transition(":leave", [
|
|
1041
|
+
animate(150, style({ transform: "translateX(100%)" }))
|
|
1042
|
+
])
|
|
1043
|
+
]),
|
|
1044
|
+
trigger("taskListInOut", [
|
|
1045
|
+
transition(":enter", [
|
|
1046
|
+
style({ transform: "translateY(100%)" }),
|
|
1047
|
+
animate(0)
|
|
1048
|
+
]),
|
|
1049
|
+
transition(":leave", [
|
|
1050
|
+
animate(0, style({ transform: "translateY(100%)" }))
|
|
1051
|
+
])
|
|
1052
|
+
])
|
|
1053
|
+
]
|
|
1054
|
+
}]
|
|
1055
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i8.TuiPreviewDialogService, decorators: [{
|
|
1056
|
+
type: Inject,
|
|
1057
|
+
args: [TuiPreviewDialogService]
|
|
1058
|
+
}] }, { type: i3.TuiDialogService, decorators: [{
|
|
1059
|
+
type: Inject,
|
|
1060
|
+
args: [TuiDialogService]
|
|
1061
|
+
}] }]; }, propDecorators: { windowResizeWatcher: [{
|
|
1062
|
+
type: HostListener,
|
|
1063
|
+
args: ["window:resize", ["$event"]]
|
|
1064
|
+
}], preview: [{
|
|
1065
|
+
type: ViewChild,
|
|
1066
|
+
args: ["preview"]
|
|
1067
|
+
}], onClickApiCall: [{
|
|
1068
|
+
type: Output
|
|
1069
|
+
}], onGetTaskList: [{
|
|
1070
|
+
type: Output
|
|
1071
|
+
}], config: [{
|
|
1072
|
+
type: Input
|
|
1073
|
+
}], userConfig: [{
|
|
1074
|
+
type: Input
|
|
1075
|
+
}], agentInfo: [{
|
|
1076
|
+
type: Input
|
|
1077
|
+
}], taskList: [{
|
|
1078
|
+
type: Input
|
|
1079
|
+
}], ngOnChanges: [], handleShowingFullTaskDetails: [], handleOnClickTaskItemViewDetail: [], handleOnClickCloseTaskDetail: [], handleOnClickToggleSidebar: [], handleOnClickApiCall: [], handleOnClickPrimaryAction: [], handleOnClickSaveForm: [] } });
|
|
1080
|
+
|
|
1081
|
+
class KwikIDAgentDashboardComponentV2 {
|
|
1082
|
+
constructor() {
|
|
1083
|
+
this.config = {};
|
|
1084
|
+
this.userConfig = {};
|
|
1085
|
+
this.agentInfo = {};
|
|
1086
|
+
this.taskList = [];
|
|
1087
|
+
this.onGetTaskList = new EventEmitter();
|
|
1088
|
+
this.onClickPerformAction = new EventEmitter();
|
|
1089
|
+
}
|
|
1090
|
+
ngOnInit() {
|
|
1091
|
+
console.log("Agent Dashboard Config", this.config);
|
|
1092
|
+
console.log("User Config", this.userConfig);
|
|
1093
|
+
console.log("Agent Info", this.agentInfo);
|
|
1094
|
+
console.log("Tasks List", this.taskList);
|
|
1095
|
+
}
|
|
1096
|
+
ngOnChanges(changes) {
|
|
1097
|
+
const verifyChange = (key) => {
|
|
1098
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
1099
|
+
};
|
|
1100
|
+
for (const change of Object.entries(changes)) {
|
|
1101
|
+
const key = change[0];
|
|
1102
|
+
const value = change[1].currentValue;
|
|
1103
|
+
}
|
|
1104
|
+
if (verifyChange("taskList")) {
|
|
1105
|
+
this.taskList = changes.taskList.currentValue;
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
handleOnGetTaskList(event) {
|
|
1109
|
+
this.onGetTaskList.emit(event);
|
|
1110
|
+
}
|
|
1111
|
+
handleOnClickPerformAction(event) {
|
|
1112
|
+
this.onClickPerformAction.emit(event);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
/** @nocollapse */ KwikIDAgentDashboardComponentV2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponentV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1116
|
+
/** @nocollapse */ KwikIDAgentDashboardComponentV2.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponentV2, selector: "kwikid-agent-dashboard-v2", inputs: { config: "config", userConfig: "userConfig", agentInfo: "agentInfo", taskList: "taskList" }, outputs: { onGetTaskList: "onGetTaskList", onClickPerformAction: "onClickPerformAction" }, usesOnChanges: true, ngImport: i0, template: "<div id=\"container\">\n <div id=\"header\">\n <layout-header\n [agentInfo]=\"agentInfo\"\n [config]=\"config\"\n (onGetTaskList)=\"handleOnGetTaskList($event)\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></layout-header>\n </div>\n <div id=\"body\">\n <layout-body\n [agentInfo]=\"agentInfo\"\n [config]=\"config\"\n [taskList]=\"taskList\"\n [userConfig]=\"userConfig\"\n (onGetTaskList)=\"handleOnGetTaskList($event)\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></layout-body>\n </div>\n</div>\n", styles: [":host{position:relative;display:block;height:100%}::-webkit-scrollbar{width:8px!important}::-webkit-scrollbar-track{border-radius:8px!important}::-webkit-scrollbar-thumb{background:lightgray!important;border-radius:8px!important}::-webkit-scrollbar-thumb:hover{background:gray!important}#container{width:100%;height:100%}#container #header{width:100%;height:80px;border:1px solid red}#container #body{width:100%;height:calc(100% - 60px);border:1px solid blue;overflow:auto}\n"], components: [{ type: LayoutHeaderComponent, selector: "layout-header", inputs: ["config", "agentInfo"], outputs: ["onGetTaskList", "onClickPerformAction"] }, { type: LayoutBodyComponent, selector: "layout-body", inputs: ["config", "userConfig", "agentInfo", "taskList"], outputs: ["onClickApiCall", "onGetTaskList"] }] });
|
|
1117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponentV2, decorators: [{
|
|
1118
|
+
type: Component,
|
|
1119
|
+
args: [{
|
|
1120
|
+
selector: "kwikid-agent-dashboard-v2",
|
|
1121
|
+
templateUrl: "./kwikid-agent-dashboard.component.html",
|
|
1122
|
+
styleUrls: ["./kwikid-agent-dashboard.component.scss"]
|
|
1123
|
+
}]
|
|
1124
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
1125
|
+
type: Input
|
|
1126
|
+
}], userConfig: [{
|
|
1127
|
+
type: Input
|
|
1128
|
+
}], agentInfo: [{
|
|
1129
|
+
type: Input
|
|
1130
|
+
}], taskList: [{
|
|
1131
|
+
type: Input
|
|
1132
|
+
}], onGetTaskList: [{
|
|
1133
|
+
type: Output
|
|
1134
|
+
}], onClickPerformAction: [{
|
|
1135
|
+
type: Output
|
|
1136
|
+
}] } });
|
|
1137
|
+
|
|
1138
|
+
// To Calculate Distance between two markers
|
|
1139
|
+
const calculateDistance = (point1, point2) => {
|
|
1140
|
+
const lat1 = point1.lat;
|
|
1141
|
+
const lng1 = point1.lng;
|
|
1142
|
+
const lat2 = point2.lat;
|
|
1143
|
+
const lng2 = point2.lng;
|
|
1144
|
+
const R = 6371; // Earth radius in kilometers
|
|
1145
|
+
const dLat = (lat2 - lat1) * (Math.PI / 180);
|
|
1146
|
+
const dLng = (lng2 - lng1) * (Math.PI / 180);
|
|
1147
|
+
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
|
1148
|
+
Math.cos((lat1 * Math.PI) / 180) *
|
|
1149
|
+
Math.cos((lat2 * Math.PI) / 180) *
|
|
1150
|
+
Math.sin(dLng / 2) *
|
|
1151
|
+
Math.sin(dLng / 2);
|
|
1152
|
+
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
|
1153
|
+
const distance = R * c;
|
|
1154
|
+
return distance;
|
|
1155
|
+
};
|
|
1156
|
+
// To calculate nearest distance from marker
|
|
1157
|
+
const nearestNeighborAlgorithm = (startingPoint, unvisitedPoints) => {
|
|
1158
|
+
let currentPoint = startingPoint;
|
|
1159
|
+
const path = [currentPoint];
|
|
1160
|
+
const visitedPoints = new Set([currentPoint]);
|
|
1161
|
+
while (unvisitedPoints.length > 0) {
|
|
1162
|
+
let nearestPoint = null;
|
|
1163
|
+
let minDistance = Number.POSITIVE_INFINITY;
|
|
1164
|
+
for (const point of unvisitedPoints) {
|
|
1165
|
+
const distance = calculateDistance(currentPoint, point);
|
|
1166
|
+
if (distance < minDistance) {
|
|
1167
|
+
minDistance = distance;
|
|
1168
|
+
nearestPoint = point;
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
path.push(nearestPoint);
|
|
1172
|
+
visitedPoints.add(nearestPoint);
|
|
1173
|
+
currentPoint = nearestPoint;
|
|
1174
|
+
unvisitedPoints = unvisitedPoints.filter((point) => !visitedPoints.has(point));
|
|
1175
|
+
}
|
|
1176
|
+
return path;
|
|
1177
|
+
};
|
|
1178
|
+
const addressConcator = (data, config) => {
|
|
1179
|
+
const address = config.reduce((accumulator, currentValue) => `${accumulator} ${getObjectValueFromPath(data, currentValue)}`, "");
|
|
1180
|
+
return address;
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
var EStatus;
|
|
1184
|
+
(function (EStatus) {
|
|
1185
|
+
EStatus["NOT_STARTED"] = "not_started";
|
|
1186
|
+
EStatus["ON_GOING"] = "on_going";
|
|
1187
|
+
EStatus["AUDITING"] = "auditing";
|
|
1188
|
+
EStatus["REJECTED"] = "rejected";
|
|
1189
|
+
EStatus["AFTER_AUDIT"] = "after_audit";
|
|
1190
|
+
EStatus["COMPLETE"] = "complete";
|
|
1191
|
+
EStatus["WAITING"] = "waiting";
|
|
1192
|
+
EStatus["SESSION_EXPIRED"] = "session_expired";
|
|
1193
|
+
EStatus["KYC_REJECTED"] = "kyc_rejected";
|
|
1194
|
+
EStatus["KYC_REQUEST_REJECTED"] = "kyc_request_rejected";
|
|
1195
|
+
EStatus["KYC_REQUEST_ACCEPTED"] = "kyc_request_accepted";
|
|
1196
|
+
EStatus["KYC_RESULT_REJECTED"] = "kyc_result_rejected";
|
|
1197
|
+
EStatus["KYC_RESULT_APPROVED"] = "kyc_result_approved";
|
|
1198
|
+
EStatus["KYC_RESULT_PARTIAL_UPDATE"] = "kyc_result_partial_update";
|
|
1199
|
+
EStatus["KYC_RESULT_UNDER_REVIEW"] = "kyc_result_under_review";
|
|
1200
|
+
})(EStatus || (EStatus = {}));
|
|
1201
|
+
const VStatus = [
|
|
1202
|
+
EStatus.NOT_STARTED,
|
|
1203
|
+
EStatus.ON_GOING,
|
|
1204
|
+
EStatus.AUDITING,
|
|
1205
|
+
EStatus.REJECTED,
|
|
1206
|
+
EStatus.AFTER_AUDIT,
|
|
1207
|
+
EStatus.COMPLETE,
|
|
1208
|
+
EStatus.WAITING,
|
|
1209
|
+
EStatus.SESSION_EXPIRED,
|
|
1210
|
+
EStatus.KYC_REJECTED,
|
|
1211
|
+
EStatus.KYC_REQUEST_REJECTED,
|
|
1212
|
+
EStatus.KYC_REQUEST_ACCEPTED,
|
|
1213
|
+
EStatus.KYC_RESULT_REJECTED,
|
|
1214
|
+
EStatus.KYC_RESULT_APPROVED,
|
|
1215
|
+
EStatus.KYC_RESULT_PARTIAL_UPDATE,
|
|
1216
|
+
EStatus.KYC_RESULT_UNDER_REVIEW
|
|
1217
|
+
];
|
|
1218
|
+
|
|
1219
|
+
class AgentService {
|
|
1220
|
+
constructor() {
|
|
1221
|
+
this.isListOpen = true;
|
|
1222
|
+
this.showMapview = false;
|
|
1223
|
+
this.addTaskForm = {
|
|
1224
|
+
key: "ADD_TASK",
|
|
1225
|
+
title: "Add Task",
|
|
1226
|
+
fields: [
|
|
1227
|
+
{
|
|
1228
|
+
key: "name",
|
|
1229
|
+
label: "Customer Name",
|
|
1230
|
+
validators: {
|
|
1231
|
+
required: true
|
|
1232
|
+
},
|
|
1233
|
+
properties: {
|
|
1234
|
+
placeholder: "Please enter the Customer Name",
|
|
1235
|
+
readOnly: false,
|
|
1236
|
+
case: "default"
|
|
1237
|
+
},
|
|
1238
|
+
type: "text"
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
key: "phone",
|
|
1242
|
+
label: "Phone Number",
|
|
1243
|
+
validators: {
|
|
1244
|
+
required: true
|
|
1245
|
+
},
|
|
1246
|
+
properties: {
|
|
1247
|
+
countryCode: "+91",
|
|
1248
|
+
removeCountryCodeFromValue: true,
|
|
1249
|
+
phoneMaskAfterCountryCode: "##########",
|
|
1250
|
+
placeholder: "Please enter your Mobile Number",
|
|
1251
|
+
readOnly: false
|
|
1252
|
+
},
|
|
1253
|
+
type: "phone"
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
key: "address",
|
|
1257
|
+
label: "Address",
|
|
1258
|
+
validators: {
|
|
1259
|
+
required: true
|
|
1260
|
+
},
|
|
1261
|
+
properties: {
|
|
1262
|
+
placeholder: "Please enter the Address",
|
|
1263
|
+
readOnly: false,
|
|
1264
|
+
case: "default"
|
|
1265
|
+
},
|
|
1266
|
+
type: "text"
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
key: "city",
|
|
1270
|
+
label: "City",
|
|
1271
|
+
validators: {
|
|
1272
|
+
required: true
|
|
1273
|
+
},
|
|
1274
|
+
properties: {
|
|
1275
|
+
placeholder: "Please enter the City",
|
|
1276
|
+
readOnly: false,
|
|
1277
|
+
case: "default"
|
|
1278
|
+
},
|
|
1279
|
+
type: "text"
|
|
1280
|
+
},
|
|
1281
|
+
{
|
|
1282
|
+
key: "location",
|
|
1283
|
+
label: "Location URL",
|
|
1284
|
+
validators: {
|
|
1285
|
+
required: true
|
|
1286
|
+
},
|
|
1287
|
+
properties: {
|
|
1288
|
+
placeholder: "Please enter the Location URL",
|
|
1289
|
+
readOnly: false,
|
|
1290
|
+
case: "default"
|
|
1291
|
+
},
|
|
1292
|
+
type: "text"
|
|
1293
|
+
}
|
|
1294
|
+
],
|
|
1295
|
+
properties: {
|
|
1296
|
+
header: {
|
|
1297
|
+
title: {
|
|
1298
|
+
hidden: true,
|
|
1299
|
+
label: "Add Task"
|
|
1300
|
+
},
|
|
1301
|
+
steps: {
|
|
1302
|
+
hidden: true
|
|
1303
|
+
},
|
|
1304
|
+
logo: {
|
|
1305
|
+
hidden: true
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
footer: {
|
|
1309
|
+
viewFormsButton: {
|
|
1310
|
+
hidden: true,
|
|
1311
|
+
label: "View Forms"
|
|
1312
|
+
},
|
|
1313
|
+
saveButton: {
|
|
1314
|
+
hidden: false,
|
|
1315
|
+
label: "Submit"
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
};
|
|
1320
|
+
this.notRequiredStatus = [
|
|
1321
|
+
EStatus.REJECTED,
|
|
1322
|
+
EStatus.AFTER_AUDIT,
|
|
1323
|
+
EStatus.COMPLETE,
|
|
1324
|
+
EStatus.SESSION_EXPIRED,
|
|
1325
|
+
EStatus.KYC_REJECTED,
|
|
1326
|
+
EStatus.KYC_RESULT_APPROVED,
|
|
1327
|
+
EStatus.KYC_RESULT_REJECTED,
|
|
1328
|
+
EStatus.KYC_RESULT_UNDER_REVIEW,
|
|
1329
|
+
EStatus.KYC_REQUEST_REJECTED
|
|
1330
|
+
];
|
|
1331
|
+
}
|
|
1332
|
+
ngOnInit() { }
|
|
1333
|
+
setAgentConfig(config) {
|
|
1334
|
+
this.config = config;
|
|
1335
|
+
}
|
|
1336
|
+
toggleMapview() {
|
|
1337
|
+
this.showMapview = !this.showMapview;
|
|
1338
|
+
}
|
|
1339
|
+
canStartJourney(status) {
|
|
1340
|
+
var _a, _b;
|
|
1341
|
+
const noneEditableStatus = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.cannotStartJourney) !== null && _b !== void 0 ? _b : this.notRequiredStatus;
|
|
1342
|
+
if (noneEditableStatus.includes(status)) {
|
|
1343
|
+
return false;
|
|
1344
|
+
}
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
canPlotMarkers(status) {
|
|
1348
|
+
var _a, _b;
|
|
1349
|
+
const nonePlottingSessions = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.dontPlotMarkers) !== null && _b !== void 0 ? _b : [];
|
|
1350
|
+
if (nonePlottingSessions.includes(status)) {
|
|
1351
|
+
return false;
|
|
1352
|
+
}
|
|
1353
|
+
return true;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
/** @nocollapse */ AgentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1357
|
+
/** @nocollapse */ AgentService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, providedIn: "root" });
|
|
1358
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentService, decorators: [{
|
|
1359
|
+
type: Injectable,
|
|
1360
|
+
args: [{
|
|
1361
|
+
providedIn: "root"
|
|
1362
|
+
}]
|
|
1363
|
+
}], ctorParameters: function () { return []; } });
|
|
1364
|
+
|
|
1365
|
+
class GoogleMapsService {
|
|
1366
|
+
constructor(agentService, mapDirectionsService, httpClient) {
|
|
1367
|
+
this.agentService = agentService;
|
|
1368
|
+
this.mapDirectionsService = mapDirectionsService;
|
|
1369
|
+
this.httpClient = httpClient;
|
|
1370
|
+
this.allMarkers = [];
|
|
1371
|
+
}
|
|
1372
|
+
// To get Current Position
|
|
1373
|
+
getPosition() {
|
|
1374
|
+
return new Promise((resolve, reject) => {
|
|
1375
|
+
navigator.geolocation.watchPosition((resp) => {
|
|
1376
|
+
resolve({
|
|
1377
|
+
lng: resp.coords.longitude,
|
|
1378
|
+
lat: resp.coords.latitude
|
|
1379
|
+
});
|
|
1380
|
+
}, (err) => {
|
|
1381
|
+
reject(err);
|
|
1382
|
+
});
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
// To Initialize Google Maps
|
|
1386
|
+
initializeMap() {
|
|
1387
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1388
|
+
this.myPosition = yield this.getPosition();
|
|
1389
|
+
this.map = {
|
|
1390
|
+
zoom: 10,
|
|
1391
|
+
center: this.myPosition,
|
|
1392
|
+
streetViewControl: false,
|
|
1393
|
+
mapTypeControl: false,
|
|
1394
|
+
fullscreenControl: false,
|
|
1395
|
+
zoomControl: false
|
|
1396
|
+
};
|
|
1397
|
+
});
|
|
1398
|
+
}
|
|
1399
|
+
// To extract Location from the Task Details
|
|
1400
|
+
getLocation(task) {
|
|
1401
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1402
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
1403
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1404
|
+
let encodedAddres;
|
|
1405
|
+
// If Fetch Address from Multiple Paths
|
|
1406
|
+
if (checkObjectPathExists(this.agentService.config, "dashboard.taskLocationPaths")) {
|
|
1407
|
+
// Get address string from multiple paths
|
|
1408
|
+
const config = this.agentService.config.dashboard.taskLocationPaths;
|
|
1409
|
+
const address = addressConcator(task, config);
|
|
1410
|
+
// Encode the Address in URI
|
|
1411
|
+
encodedAddres = encodeURI(address);
|
|
1412
|
+
}
|
|
1413
|
+
// If Fetch Address from Single Path
|
|
1414
|
+
else if (checkObjectPathExists(this.agentService.config, "dashboard.taskLocationPath")) {
|
|
1415
|
+
// Get Address from Single Path
|
|
1416
|
+
const config = this.agentService.config.dashboard.taskLocationPath;
|
|
1417
|
+
const address = getObjectValueFromPath(task, config);
|
|
1418
|
+
// Encode the Address in URI
|
|
1419
|
+
encodedAddres = encodeURI(address);
|
|
1420
|
+
}
|
|
1421
|
+
// Default Address Paths Avaiable
|
|
1422
|
+
else {
|
|
1423
|
+
const address = (_k = (_j = (_g = (_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.address) !== 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.address) !== null && _g !== void 0 ? _g : (_h = task === null || task === void 0 ? void 0 : task.extras) === null || _h === void 0 ? void 0 : _h.address) !== null && _j !== void 0 ? _j : task === null || task === void 0 ? void 0 : task.address) !== null && _k !== void 0 ? _k : "";
|
|
1424
|
+
// Encode the Address in URI
|
|
1425
|
+
encodedAddres = encodeURI(address);
|
|
1426
|
+
}
|
|
1427
|
+
// URL to geocode Address String to Latitude & Longitude
|
|
1428
|
+
const url = `https://maps.googleapis.com/maps/api/geocode/json?key=${this.apiKey}&address=${encodedAddres}`;
|
|
1429
|
+
const response = yield fetch(url);
|
|
1430
|
+
const data = yield response.json();
|
|
1431
|
+
// Set Location {lat: LAT, lng: LNG} from address geocoded
|
|
1432
|
+
const isValidLocation = isNotEmptyArray(data === null || data === void 0 ? void 0 : data.results);
|
|
1433
|
+
const location = isValidLocation
|
|
1434
|
+
? (_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
|
|
1435
|
+
: { lat: null, lng: null };
|
|
1436
|
+
// Set Location validation & Google Maps URL
|
|
1437
|
+
location.isValidLocation = isValidLocation;
|
|
1438
|
+
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}`;
|
|
1439
|
+
resolve(location);
|
|
1440
|
+
}));
|
|
1441
|
+
});
|
|
1442
|
+
}
|
|
1443
|
+
// Get Tasks | Markers Location Co Ordinates
|
|
1444
|
+
getMarkersLocation(myMarker, tasks) {
|
|
1445
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1446
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
1447
|
+
const markers = [];
|
|
1448
|
+
markers.push(myMarker);
|
|
1449
|
+
const promises = tasks.map((task) => __awaiter(this, void 0, void 0, function* () {
|
|
1450
|
+
const marker = yield this.getLocation(task);
|
|
1451
|
+
task = Object.assign(Object.assign({}, task), marker);
|
|
1452
|
+
markers.push(task);
|
|
1453
|
+
}));
|
|
1454
|
+
yield Promise.all(promises);
|
|
1455
|
+
resolve(markers);
|
|
1456
|
+
}));
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
// Plot All Markers
|
|
1460
|
+
plotAllMarkers(tasks) {
|
|
1461
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1462
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
1463
|
+
const path = [];
|
|
1464
|
+
const promises = tasks.map((task) => {
|
|
1465
|
+
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
1466
|
+
path.push({
|
|
1467
|
+
location: task,
|
|
1468
|
+
stopover: true
|
|
1469
|
+
});
|
|
1470
|
+
this.allMarkers.push(task);
|
|
1471
|
+
}
|
|
1472
|
+
});
|
|
1473
|
+
yield Promise.all(promises);
|
|
1474
|
+
resolve(path);
|
|
1475
|
+
}));
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
// To Plot Directions for All Tasks
|
|
1479
|
+
plotDirectionsForAllTasks(tasks) {
|
|
1480
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1481
|
+
this.allMarkers = [];
|
|
1482
|
+
// Create Agent Marker & Plot It.
|
|
1483
|
+
const myMarker = {
|
|
1484
|
+
lat: this.myPosition.lat,
|
|
1485
|
+
lng: this.myPosition.lng,
|
|
1486
|
+
title: 0,
|
|
1487
|
+
color: "red"
|
|
1488
|
+
};
|
|
1489
|
+
// Get All Markers Location Co Ordinates
|
|
1490
|
+
const markers = yield this.getMarkersLocation(myMarker, tasks);
|
|
1491
|
+
// Run Algorithm to get optimized Routes
|
|
1492
|
+
const startingPoint = markers[0];
|
|
1493
|
+
const unvisitedWaypoints = markers.slice(1);
|
|
1494
|
+
const optimizedRoute = nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
|
|
1495
|
+
// Sort All Tasks as per optimized routes
|
|
1496
|
+
tasks = optimizedRoute.slice(1);
|
|
1497
|
+
this.allMarkers = [myMarker];
|
|
1498
|
+
// Plot all markers & get path for directions
|
|
1499
|
+
const path = yield this.plotAllMarkers(tasks);
|
|
1500
|
+
// Set Directions in Google Maps
|
|
1501
|
+
const request = {
|
|
1502
|
+
origin: this.myPosition,
|
|
1503
|
+
destination: this.myPosition,
|
|
1504
|
+
waypoints: path,
|
|
1505
|
+
travelMode: google.maps.TravelMode.DRIVING
|
|
1506
|
+
};
|
|
1507
|
+
this.directionsRenderOption = {
|
|
1508
|
+
suppressMarkers: true
|
|
1509
|
+
};
|
|
1510
|
+
this.directionsResults$ = this.mapDirectionsService
|
|
1511
|
+
.route(request)
|
|
1512
|
+
.pipe(map((response) => response.result));
|
|
1513
|
+
this.directionsResults$.subscribe((val) => { });
|
|
1514
|
+
this.allDirectionsResults$ = this.directionsResults$;
|
|
1515
|
+
return tasks;
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
// To Plot Directions for Selected Tasks
|
|
1519
|
+
plotDirectionsForSelectedTask(task) {
|
|
1520
|
+
if (task != null) {
|
|
1521
|
+
const taskMarker = task;
|
|
1522
|
+
// If Location is Available in Task Details
|
|
1523
|
+
if (taskMarker === null || taskMarker === void 0 ? void 0 : taskMarker.isValidLocation) {
|
|
1524
|
+
const request = {
|
|
1525
|
+
origin: this.myPosition,
|
|
1526
|
+
destination: taskMarker,
|
|
1527
|
+
optimizeWaypoints: true,
|
|
1528
|
+
travelMode: google.maps.TravelMode.DRIVING
|
|
1529
|
+
};
|
|
1530
|
+
this.directionsResults$ = this.mapDirectionsService
|
|
1531
|
+
.route(request)
|
|
1532
|
+
.pipe(map((response) => response.result));
|
|
1533
|
+
this.directionsResults$.subscribe();
|
|
1534
|
+
}
|
|
1535
|
+
else {
|
|
1536
|
+
alert("No Location Available");
|
|
1537
|
+
this.directionsResults$ = this.allDirectionsResults$;
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
else {
|
|
1541
|
+
this.directionsResults$ = this.allDirectionsResults$;
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
/** @nocollapse */ GoogleMapsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GoogleMapsService, deps: [{ token: AgentService }, { token: i2$2.MapDirectionsService }, { token: i3$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1546
|
+
/** @nocollapse */ GoogleMapsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GoogleMapsService, providedIn: "root" });
|
|
1547
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: GoogleMapsService, decorators: [{
|
|
1548
|
+
type: Injectable,
|
|
1549
|
+
args: [{
|
|
1550
|
+
providedIn: "root"
|
|
1551
|
+
}]
|
|
1552
|
+
}], ctorParameters: function () { return [{ type: AgentService }, { type: i2$2.MapDirectionsService }, { type: i3$2.HttpClient }]; }, propDecorators: { directionsRenders: [{
|
|
1553
|
+
type: ViewChildren,
|
|
1554
|
+
args: ["directionsRender"]
|
|
1555
|
+
}] } });
|
|
1556
|
+
|
|
1557
|
+
class OpenStreetMapsService {
|
|
1558
|
+
constructor(agentService, mapDirectionsService, httpClient) {
|
|
1559
|
+
this.agentService = agentService;
|
|
1560
|
+
this.mapDirectionsService = mapDirectionsService;
|
|
1561
|
+
this.httpClient = httpClient;
|
|
1562
|
+
this.allMarkers = [];
|
|
1563
|
+
}
|
|
1564
|
+
// To get Current Position
|
|
1565
|
+
getPosition() {
|
|
1566
|
+
return new Promise((resolve, reject) => {
|
|
1567
|
+
navigator.geolocation.watchPosition((resp) => {
|
|
1568
|
+
resolve({
|
|
1569
|
+
lng: resp.coords.longitude,
|
|
1570
|
+
lat: resp.coords.latitude
|
|
1571
|
+
});
|
|
1572
|
+
}, (err) => {
|
|
1573
|
+
reject(err);
|
|
1574
|
+
});
|
|
1575
|
+
});
|
|
1576
|
+
}
|
|
1577
|
+
// To extract Location from the Task Details
|
|
1578
|
+
getLocation(task) {
|
|
1579
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1580
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
1581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1582
|
+
let encodedAddres;
|
|
1583
|
+
// If Fetch Address from Multiple Paths
|
|
1584
|
+
if (checkObjectPathExists(this.agentService.config, "dashboard.taskLocationPaths")) {
|
|
1585
|
+
// Get address string from multiple paths
|
|
1586
|
+
const config = this.agentService.config.dashboard.taskLocationPaths;
|
|
1587
|
+
const address = addressConcator(task, config);
|
|
1588
|
+
// Encode the Address in URI
|
|
1589
|
+
encodedAddres = encodeURI(address);
|
|
1590
|
+
}
|
|
1591
|
+
// If Fetch Address from Single Path
|
|
1592
|
+
else if (checkObjectPathExists(this.agentService.config, "dashboard.taskLocationPath")) {
|
|
1593
|
+
// Get Address from Single Path
|
|
1594
|
+
const config = this.agentService.config.dashboard.taskLocationPath;
|
|
1595
|
+
const address = getObjectValueFromPath(task, config);
|
|
1596
|
+
// Encode the Address in URI
|
|
1597
|
+
encodedAddres = encodeURI(address);
|
|
1598
|
+
}
|
|
1599
|
+
// Default Address Paths Avaiable
|
|
1600
|
+
else {
|
|
1601
|
+
const address = (_k = (_j = (_g = (_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.address) !== 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.address) !== null && _g !== void 0 ? _g : (_h = task === null || task === void 0 ? void 0 : task.extras) === null || _h === void 0 ? void 0 : _h.address) !== null && _j !== void 0 ? _j : task === null || task === void 0 ? void 0 : task.address) !== null && _k !== void 0 ? _k : "";
|
|
1602
|
+
// Encode the Address in URI
|
|
1603
|
+
encodedAddres = encodeURI(address);
|
|
1604
|
+
}
|
|
1605
|
+
// URL to geocode Address String to Latitude & Longitude
|
|
1606
|
+
const url = `https://nominatim.openstreetmap.org/search?q=${encodedAddres}&format=json`;
|
|
1607
|
+
const response = yield fetch(url);
|
|
1608
|
+
const data = yield response.json();
|
|
1609
|
+
// Set Location {lat: LAT, lng: LNG} from address geocoded
|
|
1610
|
+
const isValidLocation = isNotEmptyArray(data) && ((_l = data[0]) === null || _l === void 0 ? void 0 : _l.lat) & ((_m = data[0]) === null || _m === void 0 ? void 0 : _m.lon);
|
|
1611
|
+
const location = isValidLocation
|
|
1612
|
+
? { lat: (_o = data[0]) === null || _o === void 0 ? void 0 : _o.lat, lng: (_p = data[0]) === null || _p === void 0 ? void 0 : _p.lon }
|
|
1613
|
+
: { lat: null, lng: null };
|
|
1614
|
+
// Set Location validation & Google Maps URL
|
|
1615
|
+
location.isValidLocation = isValidLocation;
|
|
1616
|
+
location.color = isValidLocation ? "blue" : "red";
|
|
1617
|
+
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}`;
|
|
1618
|
+
resolve(location);
|
|
1619
|
+
}));
|
|
1620
|
+
});
|
|
1621
|
+
}
|
|
1622
|
+
// Get Tasks | Markers Location Co Ordinates
|
|
1623
|
+
getMarkersLocation(myMarker, tasks) {
|
|
1624
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1625
|
+
return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
|
|
1626
|
+
const markers = [];
|
|
1627
|
+
markers.push(myMarker);
|
|
1628
|
+
const promises = tasks.map((task) => __awaiter(this, void 0, void 0, function* () {
|
|
1629
|
+
const marker = yield this.getLocation(task);
|
|
1630
|
+
task = Object.assign(Object.assign({}, task), marker);
|
|
1631
|
+
markers.push(task);
|
|
1632
|
+
}));
|
|
1633
|
+
yield Promise.all(promises);
|
|
1634
|
+
resolve(markers);
|
|
1635
|
+
}));
|
|
1636
|
+
});
|
|
1637
|
+
}
|
|
1638
|
+
// To Initialize Open Street Map
|
|
1639
|
+
initializeMap() {
|
|
1640
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1641
|
+
console.log("Running Init Open Street Maps");
|
|
1642
|
+
this.myPosition = yield this.getPosition();
|
|
1643
|
+
this.map = L.map("map", {
|
|
1644
|
+
center: [this.myPosition.lat, this.myPosition.lng],
|
|
1645
|
+
zoom: 11
|
|
1646
|
+
});
|
|
1647
|
+
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png").addTo(this.map);
|
|
1648
|
+
});
|
|
1649
|
+
}
|
|
1650
|
+
// To Add Open Street Marker in Map
|
|
1651
|
+
addMarker({ lat, lng, title, color }) {
|
|
1652
|
+
L.marker([lat, lng], {
|
|
1653
|
+
icon: L.icon({
|
|
1654
|
+
iconUrl: color == "red"
|
|
1655
|
+
? "https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-0.png"
|
|
1656
|
+
: "https://kwikid.s3.ap-south-1.amazonaws.com/CONFIG/USER/assets/map-marker-1.png"
|
|
1657
|
+
})
|
|
1658
|
+
})
|
|
1659
|
+
.addTo(this.map)
|
|
1660
|
+
.bindPopup(title);
|
|
1661
|
+
}
|
|
1662
|
+
// To Plot Open Street Directions for All Tasks
|
|
1663
|
+
plotDirectionsForAllTasks(tasks) {
|
|
1664
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1665
|
+
if (this.map) {
|
|
1666
|
+
this.allMarkers = [];
|
|
1667
|
+
// Create Agent Marker & Plot It.
|
|
1668
|
+
const myMarker = {
|
|
1669
|
+
lat: this.myPosition.lat,
|
|
1670
|
+
lng: this.myPosition.lng,
|
|
1671
|
+
title: 0,
|
|
1672
|
+
color: "red"
|
|
1673
|
+
};
|
|
1674
|
+
this.addMarker(myMarker);
|
|
1675
|
+
this.allMarkers.push(myMarker);
|
|
1676
|
+
// Create Markers for all Tasks
|
|
1677
|
+
this.allMarkers = yield this.getMarkersLocation(myMarker, tasks);
|
|
1678
|
+
// Run Algorithm to get optimized Routes
|
|
1679
|
+
const startingPoint = this.allMarkers[0];
|
|
1680
|
+
const unvisitedWaypoints = this.allMarkers.slice(1);
|
|
1681
|
+
const optimizedRoute = nearestNeighborAlgorithm(startingPoint, unvisitedWaypoints);
|
|
1682
|
+
// Sort All Markers as per optimized routes
|
|
1683
|
+
this.allMarkers = this.sortTasksAsPerDistance(optimizedRoute, this.allMarkers, true);
|
|
1684
|
+
// Sort All Tasks as per optimized routes
|
|
1685
|
+
tasks = this.sortTasksAsPerDistance(optimizedRoute.slice(1), tasks, false);
|
|
1686
|
+
// Plot Markers for All Tasks
|
|
1687
|
+
tasks.map((task) => {
|
|
1688
|
+
if (task === null || task === void 0 ? void 0 : task.isValidLocation) {
|
|
1689
|
+
const marker = this.getLocation(task);
|
|
1690
|
+
this.addMarker(marker);
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
// Set Styles for all Task Routes
|
|
1694
|
+
const styles = [
|
|
1695
|
+
{ color: "blue", opacity: 1, weight: 8 },
|
|
1696
|
+
{ color: "white", opacity: 0.6, weight: 12 }
|
|
1697
|
+
];
|
|
1698
|
+
// Set Routes for all Tasks
|
|
1699
|
+
this.allTasksRoutes = this.setRoutes(this.allMarkers, styles);
|
|
1700
|
+
this.fitMapBounds();
|
|
1701
|
+
}
|
|
1702
|
+
return tasks;
|
|
1703
|
+
});
|
|
1704
|
+
}
|
|
1705
|
+
// To plot Open Street Direction for selected Task
|
|
1706
|
+
plotDirectionsForSelectedTask(task) {
|
|
1707
|
+
if (task !== null) {
|
|
1708
|
+
// Remove Previously Selected Task Route
|
|
1709
|
+
if (this.selectedTaskRoutes) {
|
|
1710
|
+
this.map.removeControl(this.selectedTaskRoutes);
|
|
1711
|
+
}
|
|
1712
|
+
// Remove All Tasks Routes
|
|
1713
|
+
if (this.allTasksRoutes) {
|
|
1714
|
+
this.map.removeControl(this.allTasksRoutes);
|
|
1715
|
+
}
|
|
1716
|
+
const taskMarker = task;
|
|
1717
|
+
// If Location is Available in Task Details
|
|
1718
|
+
if (taskMarker.color != "red") {
|
|
1719
|
+
const markers = [this.allMarkers[0], taskMarker];
|
|
1720
|
+
const styles = [
|
|
1721
|
+
{ color: "green", opacity: 1, weight: 8 },
|
|
1722
|
+
{ color: "white", opacity: 0.4, weight: 12 }
|
|
1723
|
+
];
|
|
1724
|
+
this.selectedTaskRoutes = this.setRoutes(markers, styles);
|
|
1725
|
+
this.setSelectedTaskDistanceAndTime();
|
|
1726
|
+
}
|
|
1727
|
+
else {
|
|
1728
|
+
alert("No Location Available");
|
|
1729
|
+
}
|
|
1730
|
+
}
|
|
1731
|
+
// Set All Tasks Routes Again & Remove Selected Tasks route
|
|
1732
|
+
else {
|
|
1733
|
+
if (this.selectedTaskRoutes) {
|
|
1734
|
+
this.map.removeControl(this.selectedTaskRoutes);
|
|
1735
|
+
}
|
|
1736
|
+
this.map.addControl(this.allTasksRoutes);
|
|
1737
|
+
this.selectedTaskRoutes = undefined;
|
|
1738
|
+
}
|
|
1739
|
+
this.fitMapBounds();
|
|
1740
|
+
}
|
|
1741
|
+
// Get Distance & Time of Selected Task
|
|
1742
|
+
getSelectedTaskDistanceAndTime() {
|
|
1743
|
+
return this.selectedTaskDistanceAndTime;
|
|
1744
|
+
}
|
|
1745
|
+
// Set Distance & Time of Selected Task
|
|
1746
|
+
setSelectedTaskDistanceAndTime() {
|
|
1747
|
+
this.selectedTaskRoutes.on("routesfound", function (e) {
|
|
1748
|
+
const { routes } = e;
|
|
1749
|
+
const { summary } = routes[0];
|
|
1750
|
+
const distance = summary.totalDistance / 1000;
|
|
1751
|
+
const time = Math.round((summary.totalTime % 3600) / 60);
|
|
1752
|
+
this.selectedTaskDistanceAndTime = {
|
|
1753
|
+
distance,
|
|
1754
|
+
time
|
|
1755
|
+
};
|
|
1756
|
+
});
|
|
1757
|
+
}
|
|
1758
|
+
// To sort Open Street Maps Task as per nearest distance
|
|
1759
|
+
sortTasksAsPerDistance(order, tasks, isMarker) {
|
|
1760
|
+
const sortedTasks = [];
|
|
1761
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
1762
|
+
const title = isMarker ? order[i].title : order[i].title - 1;
|
|
1763
|
+
const task = tasks[title];
|
|
1764
|
+
sortedTasks.push(task);
|
|
1765
|
+
}
|
|
1766
|
+
return sortedTasks;
|
|
1767
|
+
}
|
|
1768
|
+
// To set Open Street routes in the maps
|
|
1769
|
+
setRoutes(markers, styles) {
|
|
1770
|
+
return L.Routing.control({
|
|
1771
|
+
waypoints: markers,
|
|
1772
|
+
lineOptions: {
|
|
1773
|
+
styles
|
|
1774
|
+
},
|
|
1775
|
+
createMarker() {
|
|
1776
|
+
return null;
|
|
1777
|
+
},
|
|
1778
|
+
routeWhileDragging: true
|
|
1779
|
+
}).addTo(this.map);
|
|
1780
|
+
}
|
|
1781
|
+
// To set Open Street view point on the map
|
|
1782
|
+
fitMapBounds() {
|
|
1783
|
+
const markerLatLngs = this.allMarkers.map((marker) => L.latLng(marker.lat, marker.lng));
|
|
1784
|
+
this.map.fitBounds(markerLatLngs);
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
/** @nocollapse */ OpenStreetMapsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: OpenStreetMapsService, deps: [{ token: AgentService }, { token: i2$2.MapDirectionsService }, { token: i3$2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1788
|
+
/** @nocollapse */ OpenStreetMapsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: OpenStreetMapsService, providedIn: "root" });
|
|
1789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: OpenStreetMapsService, decorators: [{
|
|
1790
|
+
type: Injectable,
|
|
1791
|
+
args: [{
|
|
1792
|
+
providedIn: "root"
|
|
1793
|
+
}]
|
|
1794
|
+
}], ctorParameters: function () { return [{ type: AgentService }, { type: i2$2.MapDirectionsService }, { type: i3$2.HttpClient }]; }, propDecorators: { directionsRenders: [{
|
|
1795
|
+
type: ViewChildren,
|
|
1796
|
+
args: ["directionsRender"]
|
|
1797
|
+
}] } });
|
|
1798
|
+
|
|
1799
|
+
class StatusPillComponent {
|
|
1800
|
+
constructor() {
|
|
1801
|
+
this.status = EStatus.WAITING;
|
|
1802
|
+
this.statusText = "";
|
|
1803
|
+
this.statusClass = {};
|
|
1804
|
+
}
|
|
1805
|
+
ngOnInit() {
|
|
1806
|
+
this.parseStatus(this.status);
|
|
1807
|
+
}
|
|
1808
|
+
ngOnChanges(changes) {
|
|
1809
|
+
const verifyChange = (key) => {
|
|
1810
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
1811
|
+
};
|
|
1812
|
+
if (verifyChange("status")) {
|
|
1813
|
+
this.status = changes.status.currentValue;
|
|
1814
|
+
this.parseStatus(this.status);
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1817
|
+
parseStatus(status) {
|
|
1818
|
+
if (isEmptyValue(status)) {
|
|
1819
|
+
this.status = EStatus.WAITING;
|
|
1820
|
+
}
|
|
1821
|
+
this.statusText = this.getStatusLabel(status);
|
|
1822
|
+
this.statusClass = this.getStatusPillClass(status);
|
|
1823
|
+
}
|
|
1824
|
+
getStatusPillClass(status) {
|
|
1825
|
+
const newStatus = status
|
|
1826
|
+
.replace("_", "-")
|
|
1827
|
+
.replace("_", "-")
|
|
1828
|
+
.replace("_", "-");
|
|
1829
|
+
return `status-pill ${newStatus}`;
|
|
1830
|
+
}
|
|
1831
|
+
getStatusLabel(status) {
|
|
1832
|
+
return status.replace("_", " ").replace("_", " ").replace("_", " ");
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
/** @nocollapse */ StatusPillComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1836
|
+
/** @nocollapse */ StatusPillComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: StatusPillComponent, selector: "status-pill", inputs: { status: "status" }, usesOnChanges: true, ngImport: i0, template: "<div [ngClass]=\"getStatusPillClass(status)\">{{ getStatusLabel(status) }}</div>\n", styles: [".status-pill{background-color:#dedede;padding:.1rem .5rem;border-radius:1rem;font-size:.7rem;color:#222}.complete,.kyc-request-accepted,.kyc-result-approved{background-color:#d7faee;color:#01663e}.rejected,.kyc-request-rejected,.kyc-result-rejected,.kyc-rejected{background:#f9dade;color:#eb3434}.auditing,.on-going,.kyc-result-partial-update,.kyc-resut-partial-update{background-color:#c1e3f4;color:#023b57}.after-audit,.waiting,.kyc-result-under-review{background-color:#f5ecb5;color:#000}\n"], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
|
|
1837
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: StatusPillComponent, decorators: [{
|
|
1838
|
+
type: Component,
|
|
1839
|
+
args: [{
|
|
1840
|
+
selector: "status-pill",
|
|
1841
|
+
templateUrl: "./status-pill.component.html",
|
|
1842
|
+
styleUrls: ["./status-pill.component.css"]
|
|
1843
|
+
}]
|
|
1844
|
+
}], propDecorators: { status: [{
|
|
1845
|
+
type: Input
|
|
1846
|
+
}] } });
|
|
1847
|
+
|
|
1848
|
+
class ActionButtonComponent {
|
|
1849
|
+
constructor() {
|
|
1850
|
+
this.action = {};
|
|
1851
|
+
this.config = {};
|
|
1852
|
+
this.customer = {};
|
|
1853
|
+
this.disabled = false;
|
|
1854
|
+
this.hidden = false;
|
|
1855
|
+
this.onClickPerformAction = new EventEmitter();
|
|
1856
|
+
this.takeAction = (action) => {
|
|
1857
|
+
switch (action.key) {
|
|
1858
|
+
case "BUTTON_DISABLE":
|
|
1859
|
+
this.disabled = true;
|
|
1860
|
+
break;
|
|
1861
|
+
case "BUTTON_ENABLE":
|
|
1862
|
+
this.disabled = false;
|
|
1863
|
+
break;
|
|
1864
|
+
case "BUTTON_HIDE":
|
|
1865
|
+
this.hidden = true;
|
|
1866
|
+
break;
|
|
1867
|
+
case "BUTTON_SHOW":
|
|
1868
|
+
this.hidden = false;
|
|
1869
|
+
break;
|
|
1870
|
+
default:
|
|
1871
|
+
break;
|
|
1872
|
+
}
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
ngOnInit() { }
|
|
1876
|
+
ngOnChanges(changes) {
|
|
1877
|
+
var _a;
|
|
1878
|
+
const verifyChange = (key) => {
|
|
1879
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
1880
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
1881
|
+
};
|
|
1882
|
+
if (verifyChange("action")) {
|
|
1883
|
+
this.action = changes.action.currentValue;
|
|
1884
|
+
}
|
|
1885
|
+
if (verifyChange("customer")) {
|
|
1886
|
+
this.customer = changes.customer.currentValue;
|
|
1887
|
+
}
|
|
1888
|
+
if ((_a = this.action) === null || _a === void 0 ? void 0 : _a.default) {
|
|
1889
|
+
this.runValidations();
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
runValidations() {
|
|
1893
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1894
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1895
|
+
yield new RuleEngine({
|
|
1896
|
+
DATA: this.customer
|
|
1897
|
+
}, this.takeAction).run({
|
|
1898
|
+
triggers: [],
|
|
1899
|
+
rules: (_c = (_b = (_a = this.action) === null || _a === void 0 ? void 0 : _a.default) === null || _b === void 0 ? void 0 : _b.rules) !== null && _c !== void 0 ? _c : [],
|
|
1900
|
+
actions: (_f = (_e = (_d = this.action) === null || _d === void 0 ? void 0 : _d.default) === null || _e === void 0 ? void 0 : _e.actions) !== null && _f !== void 0 ? _f : []
|
|
1901
|
+
});
|
|
1902
|
+
});
|
|
1903
|
+
}
|
|
1904
|
+
handleOnClickPerformAction(action, customer) {
|
|
1905
|
+
this.onClickPerformAction.emit({
|
|
1906
|
+
action,
|
|
1907
|
+
customer
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
/** @nocollapse */ ActionButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ActionButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1912
|
+
/** @nocollapse */ ActionButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: ActionButtonComponent, selector: "kwikid-action-button", inputs: { action: "action", config: "config", customer: "customer" }, outputs: { onClickPerformAction: "onClickPerformAction" }, usesOnChanges: true, ngImport: i0, template: "<kwikui-button\n *ngIf=\"!hidden\"\n appearance=\"primary\"\n [disabled]=\"disabled\"\n [label]=\"action?.label\"\n [icon]=\"action?.icon\"\n [iconRight]=\"action?.iconRight\"\n size=\"s\"\n shape=\"rounded\"\n (onClick)=\"handleOnClickPerformAction(action, customer)\"\n></kwikui-button>\n", styles: [""], components: [{ type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ActionButtonComponent, decorators: [{
|
|
1914
|
+
type: Component,
|
|
1915
|
+
args: [{
|
|
1916
|
+
selector: "kwikid-action-button",
|
|
1917
|
+
templateUrl: "./action-button.component.html",
|
|
1918
|
+
styleUrls: ["./action-button.component.css"]
|
|
1919
|
+
}]
|
|
1920
|
+
}], ctorParameters: function () { return []; }, propDecorators: { action: [{
|
|
1921
|
+
type: Input
|
|
1922
|
+
}], config: [{
|
|
1923
|
+
type: Input
|
|
1924
|
+
}], customer: [{
|
|
1925
|
+
type: Input
|
|
1926
|
+
}], onClickPerformAction: [{
|
|
1927
|
+
type: Output
|
|
1928
|
+
}] } });
|
|
1929
|
+
|
|
1930
|
+
/* eslint-disable no-empty-function */
|
|
1931
|
+
class CustomerDetailsComponent {
|
|
1932
|
+
constructor(agentService, googleMapsService, openStreetMapsService, cdr) {
|
|
1933
|
+
this.agentService = agentService;
|
|
1934
|
+
this.googleMapsService = googleMapsService;
|
|
1935
|
+
this.openStreetMapsService = openStreetMapsService;
|
|
1936
|
+
this.cdr = cdr;
|
|
1937
|
+
this.customer = {};
|
|
1938
|
+
this.title = "Session Details";
|
|
1939
|
+
this.viewTaskDetails = [];
|
|
1940
|
+
this.taskId = "";
|
|
1941
|
+
this.labelValuePairConfig = {};
|
|
1942
|
+
this.labelValuePairData = [];
|
|
1943
|
+
this.nextStep = new EventEmitter();
|
|
1944
|
+
this.removeTask = new EventEmitter();
|
|
1945
|
+
this.onClickPerformAction = new EventEmitter();
|
|
1946
|
+
}
|
|
1947
|
+
ngOnInit() {
|
|
1948
|
+
this.parseData();
|
|
1949
|
+
}
|
|
1950
|
+
ngOnChanges(changes) {
|
|
1951
|
+
const verifyChange = (key) => {
|
|
1952
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
1953
|
+
};
|
|
1954
|
+
if (verifyChange("customer")) {
|
|
1955
|
+
this.customer = changes.customer.currentValue;
|
|
1956
|
+
this.parseData();
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
parseData() {
|
|
1960
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
1961
|
+
const identifier = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.taskIdentifier) !== null && _c !== void 0 ? _c : "user_id";
|
|
1962
|
+
this.taskId = getObjectValueFromPath(this.customer, identifier);
|
|
1963
|
+
let detailsConfig = [];
|
|
1964
|
+
if (checkObjectPathExists(this.config, "dashboard.viewTaskDetails") &&
|
|
1965
|
+
isNotEmptyArray(this.config.dashboard.viewTaskDetails)) {
|
|
1966
|
+
detailsConfig = this.config.dashboard.viewTaskDetails;
|
|
1967
|
+
const data = [];
|
|
1968
|
+
detailsConfig.map((field) => {
|
|
1969
|
+
const value = getObjectValueFromPath(this.customer, field.value);
|
|
1970
|
+
data.push({ label: field.label, value });
|
|
1971
|
+
return true;
|
|
1972
|
+
});
|
|
1973
|
+
this.labelValuePairData = data;
|
|
1974
|
+
}
|
|
1975
|
+
else if (checkObjectPathExists(this.config, "dashboard.taskUI.details.data") &&
|
|
1976
|
+
isNotEmptyArray(this.config.dashboard.taskUI.details.data)) {
|
|
1977
|
+
detailsConfig = this.config.dashboard.taskUI.details.data;
|
|
1978
|
+
const data = [];
|
|
1979
|
+
detailsConfig.map((field) => {
|
|
1980
|
+
const value = getObjectValueFromPath(this.customer, field.path);
|
|
1981
|
+
data.push({ label: field.label, value });
|
|
1982
|
+
return true;
|
|
1983
|
+
});
|
|
1984
|
+
this.labelValuePairData = data;
|
|
1985
|
+
}
|
|
1986
|
+
this.labelValuePairConfig =
|
|
1987
|
+
(_h = (_g = (_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.dashboard) === null || _e === void 0 ? void 0 : _e.taskUI) === null || _f === void 0 ? void 0 : _f.details) === null || _g === void 0 ? void 0 : _g.config) !== null && _h !== void 0 ? _h : {};
|
|
1988
|
+
this.title =
|
|
1989
|
+
(_p = (_o = (_m = (_l = (_k = (_j = this.config) === null || _j === void 0 ? void 0 : _j.dashboard) === null || _k === void 0 ? void 0 : _k.taskUI) === null || _l === void 0 ? void 0 : _l.details) === null || _m === void 0 ? void 0 : _m.header) === null || _o === void 0 ? void 0 : _o.title) !== null && _p !== void 0 ? _p : this.title;
|
|
1990
|
+
}
|
|
1991
|
+
getTaskCreationTime(task) {
|
|
1992
|
+
var _a;
|
|
1993
|
+
if (checkObjectPathExists(this.agentService.config, "dashboard.taskCreationTimePath")) {
|
|
1994
|
+
const time = getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
|
|
1995
|
+
return this.convertEpochToDate(time);
|
|
1996
|
+
}
|
|
1997
|
+
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);
|
|
1998
|
+
}
|
|
1999
|
+
convertEpochToDate(epochTime) {
|
|
2000
|
+
if (typeof epochTime === "string")
|
|
2001
|
+
epochTime = Number(epochTime);
|
|
2002
|
+
const date = new Date(epochTime * 1000); // Convert to milliseconds
|
|
2003
|
+
const day = date.getDate().toString().padStart(2, "0");
|
|
2004
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0"); // Months are zero-based
|
|
2005
|
+
const year = date.getFullYear().toString();
|
|
2006
|
+
return `${day}-${month}-${year}`;
|
|
2007
|
+
}
|
|
2008
|
+
getTaskDetails(taskData) {
|
|
2009
|
+
return getObjectValueFromPath(this.customer, taskData);
|
|
2010
|
+
}
|
|
2011
|
+
goToMaps(location) {
|
|
2012
|
+
window.open(`${location}`, "_blank");
|
|
2013
|
+
}
|
|
2014
|
+
handleOnClickNext(e) {
|
|
2015
|
+
this.nextStep.emit(e);
|
|
2016
|
+
}
|
|
2017
|
+
close() {
|
|
2018
|
+
var _a, _b;
|
|
2019
|
+
this.agentService.currentTaskDetails = undefined;
|
|
2020
|
+
if (((_b = (_a = this.agentService.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.mapType) === "google-maps") {
|
|
2021
|
+
this.googleMapsService.plotDirectionsForSelectedTask(null);
|
|
2022
|
+
}
|
|
2023
|
+
else {
|
|
2024
|
+
this.openStreetMapsService.plotDirectionsForSelectedTask(null);
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
handleOnClickRemoveTask(task) {
|
|
2028
|
+
this.removeTask.emit(task);
|
|
2029
|
+
}
|
|
2030
|
+
handleOnClickPerformAction(event) {
|
|
2031
|
+
this.onClickPerformAction.emit(event);
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
2034
|
+
/** @nocollapse */ CustomerDetailsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, deps: [{ token: AgentService }, { token: GoogleMapsService }, { token: OpenStreetMapsService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2035
|
+
/** @nocollapse */ CustomerDetailsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerDetailsComponent, selector: "customer-details", inputs: { customer: "customer", config: "config" }, outputs: { nextStep: "nextStep", removeTask: "removeTask", onClickPerformAction: "onClickPerformAction" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-details-wrapper\">\n <div>\n <kwikui-button\n icon=\"tuiIconChevronLeft\"\n label=\"Back\"\n shape=\"rounded\"\n size=\"s\"\n (onClick)=\"close()\"\n ></kwikui-button>\n </div>\n <div class=\"customer-details-heading\">{{ title }}</div>\n <div class=\"customer-details-body\">\n <div class=\"customer-details-user-id\">\n {{ taskId }}\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 <kwikui-label-value-pair\n [config]=\"labelValuePairConfig\"\n [data]=\"labelValuePairData\"\n ></kwikui-label-value-pair>\n </div>\n\n <div\n class=\"customer-details-actions\"\n *ngIf=\"\n config?.dashboard?.taskUI?.details?.action &&\n config?.dashboard?.taskUI?.details?.action?.length > 0\n \"\n >\n <ng-container\n *ngFor=\"let action of config?.dashboard?.taskUI?.details?.action\"\n >\n <kwikid-action-button\n [action]=\"action\"\n [config]=\"config\"\n [customer]=\"customer\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></kwikid-action-button>\n </ng-container>\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;font-size:1rem}.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{padding:.5rem 0;display:flex;flex-wrap:wrap;align-items:center;flex-direction:row;justify-content:flex-start;grid-gap:.5rem;gap:.5rem}::-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: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i1.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["config", "data", "id"] }, { type: ActionButtonComponent, selector: "kwikid-action-button", inputs: ["action", "config", "customer"], outputs: ["onClickPerformAction"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], changeDetection: i0.ChangeDetectionStrategy.Default });
|
|
2036
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerDetailsComponent, decorators: [{
|
|
2037
|
+
type: Component,
|
|
2038
|
+
args: [{
|
|
2039
|
+
selector: "customer-details",
|
|
2040
|
+
templateUrl: "./customer-details.component.html",
|
|
2041
|
+
styleUrls: ["./customer-details.component.scss"],
|
|
2042
|
+
changeDetection: ChangeDetectionStrategy.Default
|
|
2043
|
+
}]
|
|
2044
|
+
}], ctorParameters: function () { return [{ type: AgentService }, { type: GoogleMapsService }, { type: OpenStreetMapsService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { customer: [{
|
|
2045
|
+
type: Input
|
|
2046
|
+
}], config: [{
|
|
2047
|
+
type: Input
|
|
2048
|
+
}], nextStep: [{
|
|
2049
|
+
type: Output
|
|
2050
|
+
}], removeTask: [{
|
|
2051
|
+
type: Output
|
|
2052
|
+
}], onClickPerformAction: [{
|
|
2053
|
+
type: Output
|
|
2054
|
+
}] } });
|
|
2055
|
+
|
|
2056
|
+
class CustomerTileComponent {
|
|
2057
|
+
constructor(googleMapsService, openStreetMapsService, agentService, hostElement) {
|
|
2058
|
+
this.googleMapsService = googleMapsService;
|
|
2059
|
+
this.openStreetMapsService = openStreetMapsService;
|
|
2060
|
+
this.agentService = agentService;
|
|
2061
|
+
this.hostElement = hostElement;
|
|
2062
|
+
this.customer = {};
|
|
2063
|
+
this.index = undefined;
|
|
2064
|
+
this.isMobileView = false;
|
|
2065
|
+
this.viewTaskDetails = [];
|
|
2066
|
+
this.taskId = "";
|
|
2067
|
+
this.labelValuePairConfig = {};
|
|
2068
|
+
this.labelValuePairData = [];
|
|
2069
|
+
this.onClickPerformAction = new EventEmitter();
|
|
2070
|
+
this.nextStep = new EventEmitter();
|
|
2071
|
+
this.removeTask = new EventEmitter();
|
|
2072
|
+
}
|
|
2073
|
+
windowResizeWatcher() {
|
|
2074
|
+
if (this.hostElement.nativeElement.offsetWidth < 600) {
|
|
2075
|
+
this.isMobileView = true;
|
|
2076
|
+
}
|
|
2077
|
+
else {
|
|
2078
|
+
this.isMobileView = false;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
ngOnInit() {
|
|
2082
|
+
this.parseData();
|
|
2083
|
+
}
|
|
2084
|
+
ngOnChanges(changes) {
|
|
2085
|
+
const verifyChange = (key) => {
|
|
2086
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
2087
|
+
};
|
|
2088
|
+
if (verifyChange("customer")) {
|
|
2089
|
+
this.customer = changes.customer.currentValue;
|
|
2090
|
+
this.parseData();
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
parseData() {
|
|
2094
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
2095
|
+
const identifier = (_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.taskIdentifier) !== null && _c !== void 0 ? _c : "user_id";
|
|
2096
|
+
this.taskId = getObjectValueFromPath(this.customer, identifier);
|
|
2097
|
+
let detailsConfig = [];
|
|
2098
|
+
if (checkObjectPathExists(this.config, "dashboard.viewTaskDetails") &&
|
|
2099
|
+
isNotEmptyArray(this.config.dashboard.viewTaskDetails)) {
|
|
2100
|
+
detailsConfig = this.config.dashboard.viewTaskDetails;
|
|
2101
|
+
const data = [];
|
|
2102
|
+
detailsConfig.map((field) => {
|
|
2103
|
+
console.log("vvvvv", field);
|
|
2104
|
+
const value = getObjectValueFromPath(this.customer, field.value);
|
|
2105
|
+
data.push({ label: field.label, value });
|
|
2106
|
+
return true;
|
|
2107
|
+
});
|
|
2108
|
+
this.labelValuePairData = data;
|
|
2109
|
+
}
|
|
2110
|
+
else if (checkObjectPathExists(this.config, "dashboard.taskUI.details.data") &&
|
|
2111
|
+
isNotEmptyArray(this.config.dashboard.taskUI.details.data)) {
|
|
2112
|
+
detailsConfig = this.config.dashboard.taskUI.details.data;
|
|
2113
|
+
const data = [];
|
|
2114
|
+
detailsConfig.map((field) => {
|
|
2115
|
+
const value = getObjectValueFromPath(this.customer, field.path);
|
|
2116
|
+
data.push({ label: field.label, value });
|
|
2117
|
+
return true;
|
|
2118
|
+
});
|
|
2119
|
+
this.labelValuePairData = data;
|
|
2120
|
+
}
|
|
2121
|
+
console.log("DATA", this.labelValuePairData);
|
|
2122
|
+
this.labelValuePairConfig =
|
|
2123
|
+
(_h = (_g = (_f = (_e = (_d = this.config) === null || _d === void 0 ? void 0 : _d.dashboard) === null || _e === void 0 ? void 0 : _e.taskUI) === null || _f === void 0 ? void 0 : _f.details) === null || _g === void 0 ? void 0 : _g.config) !== null && _h !== void 0 ? _h : {};
|
|
2124
|
+
}
|
|
2125
|
+
openDetails() {
|
|
2126
|
+
var _a, _b, _c, _d;
|
|
2127
|
+
const isDifferentTaskSelected = ((_a = this.agentService.currentTaskDetails) === null || _a === void 0 ? void 0 : _a.session_id) !==
|
|
2128
|
+
((_b = this.customer) === null || _b === void 0 ? void 0 : _b.session_id);
|
|
2129
|
+
if (isDifferentTaskSelected) {
|
|
2130
|
+
this.agentService.currentTaskDetails = this.customer;
|
|
2131
|
+
}
|
|
2132
|
+
else {
|
|
2133
|
+
this.agentService.currentTaskDetails = undefined;
|
|
2134
|
+
}
|
|
2135
|
+
if (this.agentService.showMapview) {
|
|
2136
|
+
if (((_d = (_c = this.agentService.config) === null || _c === void 0 ? void 0 : _c.dashboard) === null || _d === void 0 ? void 0 : _d.mapType) === "google-maps") {
|
|
2137
|
+
this.googleMapsService.plotDirectionsForSelectedTask(this.agentService.currentTaskDetails);
|
|
2138
|
+
}
|
|
2139
|
+
else {
|
|
2140
|
+
this.openStreetMapsService.plotDirectionsForSelectedTask(this.agentService.currentTaskDetails);
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
goToMaps(location) {
|
|
2145
|
+
window.open(`${location}`, "_blank");
|
|
2146
|
+
}
|
|
2147
|
+
handleOnClickPerformAction(event) {
|
|
2148
|
+
this.onClickPerformAction.emit(event);
|
|
2149
|
+
}
|
|
2150
|
+
handleOnClickNext(e) {
|
|
2151
|
+
this.nextStep.emit(e);
|
|
2152
|
+
}
|
|
2153
|
+
handleOnClickRemoveTask(task) {
|
|
2154
|
+
this.removeTask.emit(task);
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
/** @nocollapse */ CustomerTileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, deps: [{ token: GoogleMapsService }, { token: OpenStreetMapsService }, { token: AgentService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
2158
|
+
/** @nocollapse */ CustomerTileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: CustomerTileComponent, selector: "customer-tile", inputs: { customer: "customer", index: "index", config: "config" }, outputs: { onClickPerformAction: "onClickPerformAction", nextStep: "nextStep", removeTask: "removeTask" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div\n [ngClass]=\"\n customer?.session_id == agentService.currentTaskDetails?.session_id\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 {{ taskId }}\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.currentTaskDetails?.session_id == customer?.session_id\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.currentTaskDetails?.session_id == customer?.session_id\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 *ngIf=\"\n customer?.session_id == agentService.currentTaskDetails?.session_id &&\n (agentService.isMobileView || agentService.showMapview)\n \"\n [ngClass]=\"\n customer?.session_id == agentService.currentTaskDetails?.session_id &&\n (agentService.isMobileView || agentService.showMapview)\n ? 'customer-tile-secondary-container'\n : 'data-collasped'\n \"\n >\n <div class=\"customer-tile-secondary-container-data\">\n <kwikui-label-value-pair\n [config]=\"labelValuePairConfig\"\n [data]=\"labelValuePairData\"\n ></kwikui-label-value-pair>\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 <ng-container\n *ngFor=\"let action of config?.dashboard?.taskUI?.details?.action\"\n >\n <kwikid-action-button\n [action]=\"action\"\n [config]=\"config\"\n [customer]=\"customer\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></kwikid-action-button>\n </ng-container>\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;margin:1rem;padding:1rem .25rem 1rem 1rem;border-radius:1rem;border:.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:column;flex-wrap:wrap;align-content:stretch;justify-content:flex-start;align-items:flex-start}.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{padding:.5rem 0;display:flex;flex-wrap:wrap;align-items:center;flex-direction:row;justify-content:flex-start;grid-gap:.5rem;gap:.5rem}.customer-tile-wrapper .data-collasped{display:none}.customer-tile-active{background-color:#dcedfd}\n"], components: [{ type: StatusPillComponent, selector: "status-pill", inputs: ["status"] }, { type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i1.KwikUILabelValuePairComponent, selector: "kwikui-label-value-pair", inputs: ["config", "data", "id"] }, { type: ActionButtonComponent, selector: "kwikid-action-button", inputs: ["action", "config", "customer"], outputs: ["onClickPerformAction"] }], directives: [{ type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }] });
|
|
2159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerTileComponent, decorators: [{
|
|
2160
|
+
type: Component,
|
|
2161
|
+
args: [{
|
|
2162
|
+
selector: "customer-tile",
|
|
2163
|
+
templateUrl: "./customer-tile.component.html",
|
|
2164
|
+
styleUrls: ["./customer-tile.component.scss"]
|
|
2165
|
+
}]
|
|
2166
|
+
}], ctorParameters: function () { return [{ type: GoogleMapsService }, { type: OpenStreetMapsService }, { type: AgentService }, { type: i0.ElementRef }]; }, propDecorators: { windowResizeWatcher: [{
|
|
2167
|
+
type: HostListener,
|
|
2168
|
+
args: ["window:resize", ["$event"]]
|
|
2169
|
+
}], customer: [{
|
|
2170
|
+
type: Input
|
|
2171
|
+
}], index: [{
|
|
2172
|
+
type: Input
|
|
2173
|
+
}], config: [{
|
|
2174
|
+
type: Input
|
|
2175
|
+
}], onClickPerformAction: [{
|
|
2176
|
+
type: Output
|
|
2177
|
+
}], nextStep: [{
|
|
2178
|
+
type: Output
|
|
2179
|
+
}], removeTask: [{
|
|
2180
|
+
type: Output
|
|
2181
|
+
}] } });
|
|
2182
|
+
|
|
2183
|
+
class Ng2SearchPipe$1 {
|
|
2184
|
+
/**
|
|
2185
|
+
* @param items object from array
|
|
2186
|
+
* @param term term's search
|
|
2187
|
+
* @param excludes array of strings which will ignored during search
|
|
2188
|
+
*/
|
|
2189
|
+
transform(items, term, excludes = []) {
|
|
2190
|
+
if (!term || !items)
|
|
2191
|
+
return items;
|
|
2192
|
+
return Ng2SearchPipe$1.filter(items, term, excludes);
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
*
|
|
2196
|
+
* @param items List of items to filter
|
|
2197
|
+
* @param term a string term to compare with every property of the list
|
|
2198
|
+
* @param excludes List of keys which will be ignored during search
|
|
2199
|
+
*
|
|
2200
|
+
*/
|
|
2201
|
+
static filter(items, term, excludes) {
|
|
2202
|
+
const toCompare = term.toLowerCase();
|
|
2203
|
+
function checkInside(item, term) {
|
|
2204
|
+
if (typeof item === "string" &&
|
|
2205
|
+
item.toString().toLowerCase().includes(toCompare)) {
|
|
2206
|
+
return true;
|
|
2207
|
+
}
|
|
2208
|
+
for (const property in item) {
|
|
2209
|
+
if (item[property] === null ||
|
|
2210
|
+
item[property] == undefined ||
|
|
2211
|
+
excludes.includes(property)) {
|
|
2212
|
+
continue;
|
|
2213
|
+
}
|
|
2214
|
+
if (typeof item[property] === "object") {
|
|
2215
|
+
if (checkInside(item[property], term)) {
|
|
2216
|
+
return true;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
else if (item[property].toString().toLowerCase().includes(toCompare)) {
|
|
2220
|
+
return true;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
return false;
|
|
2224
|
+
}
|
|
2225
|
+
return items.filter((item) => {
|
|
2226
|
+
return checkInside(item, term);
|
|
2227
|
+
});
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
/** @nocollapse */ Ng2SearchPipe$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe$1, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
2231
|
+
/** @nocollapse */ Ng2SearchPipe$1.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe$1, name: "filter", pure: false });
|
|
2232
|
+
/** @nocollapse */ Ng2SearchPipe$1.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe$1 });
|
|
2233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe$1, decorators: [{
|
|
2234
|
+
type: Pipe,
|
|
2235
|
+
args: [{
|
|
2236
|
+
name: "filter",
|
|
2237
|
+
pure: false
|
|
2238
|
+
}]
|
|
2239
|
+
}, {
|
|
2240
|
+
type: Injectable
|
|
2241
|
+
}] });
|
|
2242
|
+
|
|
2243
|
+
class CustomerListComponent {
|
|
2244
|
+
constructor(googleMapsService, openStreetMapsService, agentService
|
|
2245
|
+
// eslint-disable-next-line no-empty-function
|
|
2246
|
+
) {
|
|
2247
|
+
this.googleMapsService = googleMapsService;
|
|
2248
|
+
this.openStreetMapsService = openStreetMapsService;
|
|
2249
|
+
this.agentService = agentService;
|
|
2250
|
+
this.nextStep = new EventEmitter();
|
|
2251
|
+
this.removeTask = new EventEmitter();
|
|
2252
|
+
this.filterTaskList = new EventEmitter();
|
|
2253
|
+
this.filteredData = [];
|
|
2254
|
+
this.formGroup = new FormGroup({});
|
|
2255
|
+
this.sortInAscendingOrder = true;
|
|
2256
|
+
this.max = new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
|
|
2257
|
+
// Sorting Variables
|
|
2258
|
+
this.sortFilterKey = "";
|
|
2259
|
+
this.sortFilterOptions = ["user_id", "session_status"];
|
|
2260
|
+
this.activeSearchAction = undefined;
|
|
2261
|
+
this.onClickPerformAction = new EventEmitter();
|
|
2262
|
+
}
|
|
2263
|
+
ngOnInit() {
|
|
2264
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2265
|
+
this.handleInitialDateRange();
|
|
2266
|
+
this.handleSearchAndSortFormControls();
|
|
2267
|
+
});
|
|
2268
|
+
}
|
|
2269
|
+
handleOnClickSearchType(type) {
|
|
2270
|
+
if (this.activeSearchAction !== type) {
|
|
2271
|
+
this.activeSearchAction = type;
|
|
2272
|
+
}
|
|
2273
|
+
else {
|
|
2274
|
+
this.activeSearchAction = undefined;
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
handleInitialDateRange() {
|
|
2278
|
+
var _a, _b, _c, _d, _e;
|
|
2279
|
+
const searchDateStart = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.searchDateStart) !== null && _b !== void 0 ? _b : {
|
|
2280
|
+
day: 0,
|
|
2281
|
+
month: 0,
|
|
2282
|
+
year: 0
|
|
2283
|
+
};
|
|
2284
|
+
const currentDate = new Date();
|
|
2285
|
+
const startDate = new Date((_c = currentDate.getFullYear() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.year)) !== null && _c !== void 0 ? _c : 0, (_d = currentDate.getMonth() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.month)) !== null && _d !== void 0 ? _d : 0, (_e = currentDate.getDate() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.day)) !== null && _e !== void 0 ? _e : 0);
|
|
2286
|
+
this.fromDate = convertNormalDateToStringFormat(startDate);
|
|
2287
|
+
this.toDate = convertNormalDateToStringFormat(null);
|
|
2288
|
+
this.searchDateFormControl = new FormControl({
|
|
2289
|
+
value: new TuiDayRange(new TuiDay(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()), this.max),
|
|
2290
|
+
disabled: false
|
|
2291
|
+
});
|
|
2292
|
+
this.formGroup.addControl("search-date", this.searchDateFormControl);
|
|
2293
|
+
}
|
|
2294
|
+
handleSearchAndSortFormControls() {
|
|
2295
|
+
var _a, _b, _c;
|
|
2296
|
+
this.searchTextFormControl = new FormControl("");
|
|
2297
|
+
this.formGroup.addControl("search-text", this.searchTextFormControl);
|
|
2298
|
+
this.sortFilterKeyFormControl = new FormControl("");
|
|
2299
|
+
this.formGroup.addControl("sort-filter", this.sortFilterKeyFormControl);
|
|
2300
|
+
this.sortFilterOptions =
|
|
2301
|
+
(_c = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.extendedFlags) === null || _b === void 0 ? void 0 : _b.sortFilterKeys) !== null && _c !== void 0 ? _c : this.sortFilterOptions;
|
|
2302
|
+
}
|
|
2303
|
+
setUpMaps() {
|
|
2304
|
+
var _a, _b;
|
|
2305
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2306
|
+
if ((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isShowMaps) {
|
|
2307
|
+
if (((_b = this.config.dashboard) === null || _b === void 0 ? void 0 : _b.mapType) === "open-street") {
|
|
2308
|
+
yield this.openStreetMapsService.initializeMap();
|
|
2309
|
+
}
|
|
2310
|
+
else {
|
|
2311
|
+
yield this.googleMapsService.initializeMap();
|
|
2312
|
+
}
|
|
2313
|
+
}
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
setCustomersList() {
|
|
2317
|
+
var _a;
|
|
2318
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2319
|
+
if ((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isShowMaps) {
|
|
2320
|
+
this.filteredData = yield this.plotMarkers(this.customers);
|
|
2321
|
+
}
|
|
2322
|
+
else {
|
|
2323
|
+
this.filteredData = this.customers;
|
|
2324
|
+
}
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
ngAfterViewInit() {
|
|
2328
|
+
var _a, _b;
|
|
2329
|
+
this.maxLength = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.searchDateRange) !== null && _b !== void 0 ? _b : this.maxLength;
|
|
2330
|
+
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
2331
|
+
yield this.setUpMaps();
|
|
2332
|
+
yield this.setCustomersList();
|
|
2333
|
+
}), 1000);
|
|
2334
|
+
}
|
|
2335
|
+
ngOnChanges() {
|
|
2336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2337
|
+
yield this.setCustomersList();
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
handleOnClickNext(e) {
|
|
2341
|
+
this.nextStep.emit(e);
|
|
2342
|
+
}
|
|
2343
|
+
plotMarkers(customers) {
|
|
2344
|
+
var _a, _b;
|
|
2345
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2346
|
+
if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
|
|
2347
|
+
customers = customers.filter((customer) => {
|
|
2348
|
+
return this.agentService.canPlotMarkers(customer.session_status);
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
2351
|
+
if (((_b = this.config.dashboard) === null || _b === void 0 ? void 0 : _b.mapType) === "open-street") {
|
|
2352
|
+
customers =
|
|
2353
|
+
yield this.openStreetMapsService.plotDirectionsForAllTasks(customers);
|
|
2354
|
+
}
|
|
2355
|
+
else {
|
|
2356
|
+
customers =
|
|
2357
|
+
yield this.googleMapsService.plotDirectionsForAllTasks(customers);
|
|
2358
|
+
}
|
|
2359
|
+
return customers;
|
|
2360
|
+
});
|
|
2361
|
+
}
|
|
2362
|
+
handleOnChangeDateRange(event) {
|
|
2363
|
+
this.handleChangeDateRangeFormat(event);
|
|
2364
|
+
this.handleOnFilterTaskList({
|
|
2365
|
+
from_date: this.fromDate,
|
|
2366
|
+
to_date: this.toDate
|
|
2367
|
+
});
|
|
2368
|
+
}
|
|
2369
|
+
handleOnClickChangeSortOrder() {
|
|
2370
|
+
this.sortInAscendingOrder = !this.sortInAscendingOrder;
|
|
2371
|
+
this.handleOnChangeSortFilter(false);
|
|
2372
|
+
}
|
|
2373
|
+
handleOnChangeSortFilter(event) {
|
|
2374
|
+
if (event && isNotEmptyValue(event.value)) {
|
|
2375
|
+
this.sortFilterKey = event.value;
|
|
2376
|
+
this.handleOnSortTaskItems(this.sortFilterKey, this.sortInAscendingOrder);
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
handleOnSortTaskItems(key, order) {
|
|
2380
|
+
const sortedTaskItems = sortItems(this.filteredData, key, order);
|
|
2381
|
+
this.filteredData = getObjectDeepCopy(sortedTaskItems);
|
|
2382
|
+
}
|
|
2383
|
+
handleChangeDateRangeFormat(event) {
|
|
2384
|
+
var _a, _b;
|
|
2385
|
+
if (((_a = event.value) === null || _a === void 0 ? void 0 : _a.from) && ((_b = event.value) === null || _b === void 0 ? void 0 : _b.to)) {
|
|
2386
|
+
this.fromDate = convertKwikUIDateToStringFormat(event.value.from);
|
|
2387
|
+
this.toDate = convertKwikUIDateToStringFormat(event.value.to);
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
handleOnChangeSearchText(event) {
|
|
2391
|
+
this.searchText = event.value;
|
|
2392
|
+
}
|
|
2393
|
+
handleOnClickRemoveTask(task) {
|
|
2394
|
+
this.removeTask.emit(task);
|
|
2395
|
+
}
|
|
2396
|
+
handleOnFilterTaskList(filter) {
|
|
2397
|
+
this.filterTaskList.emit(filter);
|
|
2398
|
+
}
|
|
2399
|
+
handleOnClickPerformAction(event) {
|
|
2400
|
+
this.onClickPerformAction.emit(event);
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
/** @nocollapse */ CustomerListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, deps: [{ token: GoogleMapsService }, { token: OpenStreetMapsService }, { token: AgentService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2404
|
+
/** @nocollapse */ CustomerListComponent.ɵcmp = i0.ɵɵ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", onClickPerformAction: "onClickPerformAction" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"customer-list-wrapper\">\n <div\n class=\"customer-list-filter\"\n [formGroup]=\"formGroup\"\n >\n <div class=\"task-list-search-icons\">\n <kwikui-button\n appearance=\"mono\"\n icon=\"tuiIconSearchLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('search-text')\"\n ></kwikui-button>\n <kwikui-button\n appearance=\"mono\"\n icon=\"tuiIconCalendarLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('search-date')\"\n ></kwikui-button>\n <kwikui-button\n appearance=\"mono\"\n icon=\"tuiIconFilterLarge\"\n size=\"s\"\n type=\"button\"\n (onClick)=\"handleOnClickSearchType('sort-filter')\"\n ></kwikui-button>\n </div>\n\n <div\n class=\"task-list-search-action\"\n *ngIf=\"activeSearchAction\"\n >\n <kwikui-input-date-range\n *ngIf=\"activeSearchAction == 'search-date'\"\n class=\"task-list-date-box\"\n label=\"Search by Date Range\"\n id=\"dateRange\"\n size=\"m\"\n [max]=\"max\"\n [maxLength]=\"maxLength\"\n formControlName=\"search-date\"\n [formControl]=\"searchDateFormControl\"\n (getKeyValue)=\"handleOnChangeDateRange($event)\"\n ></kwikui-input-date-range>\n\n <kwikui-input\n *ngIf=\"activeSearchAction == 'search-text'\"\n label=\"Search\"\n id=\"search\"\n icon=\"tuiIconSearch\"\n placeholder=\"Search any task from here\"\n size=\"m\"\n [formControl]=\"searchTextFormControl\"\n formControlName=\"search-text\"\n (getKeyValue)=\"handleOnChangeSearchText($event)\"\n ></kwikui-input>\n\n <div\n *ngIf=\"activeSearchAction == 'sort-filter'\"\n class=\"task-list-sort-action\"\n >\n <kwikui-button\n appearance=\"outline\"\n [icon]=\"\n sortInAscendingOrder\n ? 'tuiIconChevronsUpLarge'\n : 'tuiIconChevronsDownLarge'\n \"\n size=\"m\"\n type=\"button\"\n (onClick)=\"handleOnClickChangeSortOrder()\"\n ></kwikui-button>\n <kwikui-input-select\n class=\"task-list-sort-key\"\n formControlName=\"sort-filter\"\n label=\"Sort By Key\"\n size=\"m\"\n [formControl]=\"sortFilterKeyFormControl\"\n [options]=\"sortFilterOptions\"\n [searchable]=\"false\"\n (getKeyValue)=\"handleOnChangeSortFilter($event)\"\n ></kwikui-input-select>\n </div>\n </div>\n </div>\n\n <div class=\"customer-task-list\">\n <cdk-virtual-scroll-viewport\n itemSize=\"1\"\n class=\"customer-task-list-scroll\"\n >\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 (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></customer-tile>\n </div>\n </cdk-virtual-scroll-viewport>\n </div>\n\n <div\n class=\"customer-list-empty\"\n *ngIf=\"filteredData.length === 0\"\n >\n {{\n config?.dashboard?.emptyTaskListMessage ?? \"0 Tasks for the given Date.\"\n }}\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-filter .task-list-search-icons{display:flex;justify-content:flex-end;align-items:center;flex-direction:row;grid-gap:.5rem;gap:.5rem}.customer-list-filter .task-list-search-action{margin-top:.5rem}.customer-list-filter .task-list-search-action .task-list-sort-action{display:flex;flex-direction:row;grid-gap:.5rem;gap:.5rem}.customer-list-filter .task-list-search-action .task-list-sort-action .task-list-sort-key{flex:1}.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: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i1.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: i1.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: i1.KwikUIInputSelectComponent, selector: "kwikui-input-select", inputs: ["disabled", "focus", "formControl", "formControlName", "hintContent", "icon", "id", "invalid", "label", "options", "placeholder", "properties", "searchable", "size", "validators"], outputs: ["getKeyValue"] }, { type: i5.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { type: CustomerTileComponent, selector: "customer-tile", inputs: ["customer", "index", "config"], outputs: ["onClickPerformAction", "nextStep", "removeTask"] }], directives: [{ type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["disabled", "formControlName", "ngModel"], outputs: ["ngModelChange"] }, { type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["disabled", "formControl", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i5.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { type: i5.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }], pipes: { "filter": Ng2SearchPipe$1 } });
|
|
2405
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: CustomerListComponent, decorators: [{
|
|
2406
|
+
type: Component,
|
|
2407
|
+
args: [{
|
|
2408
|
+
selector: "customer-list",
|
|
2409
|
+
templateUrl: "./customer-list.component.html",
|
|
2410
|
+
styleUrls: ["./customer-list.component.scss"]
|
|
2411
|
+
}]
|
|
2412
|
+
}], ctorParameters: function () { return [{ type: GoogleMapsService }, { type: OpenStreetMapsService }, { type: AgentService }]; }, propDecorators: { customers: [{
|
|
2413
|
+
type: Input
|
|
2414
|
+
}], config: [{
|
|
2415
|
+
type: Input
|
|
2416
|
+
}], nextStep: [{
|
|
2417
|
+
type: Output
|
|
2418
|
+
}], removeTask: [{
|
|
2419
|
+
type: Output
|
|
2420
|
+
}], filterTaskList: [{
|
|
2421
|
+
type: Output
|
|
2422
|
+
}], onClickPerformAction: [{
|
|
2423
|
+
type: Output
|
|
2424
|
+
}] } });
|
|
2425
|
+
|
|
2426
|
+
class KwikIDAgentDashboardComponentV1 {
|
|
2427
|
+
constructor(googleMapsService, agentService, httpClient, hostElement, dialogService) {
|
|
2428
|
+
this.googleMapsService = googleMapsService;
|
|
2429
|
+
this.agentService = agentService;
|
|
2430
|
+
this.httpClient = httpClient;
|
|
2431
|
+
this.hostElement = hostElement;
|
|
2432
|
+
this.dialogService = dialogService;
|
|
2433
|
+
this.config = {};
|
|
2434
|
+
this.taskList = [];
|
|
2435
|
+
this.nextStep = new EventEmitter();
|
|
2436
|
+
this.addTask = new EventEmitter();
|
|
2437
|
+
this.removeTask = new EventEmitter();
|
|
2438
|
+
this.filterTaskList = new EventEmitter();
|
|
2439
|
+
this.onClickPerformAction = new EventEmitter();
|
|
2440
|
+
this.loading = true;
|
|
2441
|
+
this.console = console;
|
|
2442
|
+
this.open = false;
|
|
2443
|
+
this.allFormsData = {};
|
|
2444
|
+
this.String = String;
|
|
2445
|
+
}
|
|
2446
|
+
windowResizeWatcher() {
|
|
2447
|
+
if (this.hostElement.nativeElement.offsetWidth < 600) {
|
|
2448
|
+
this.isMobileView = true;
|
|
2449
|
+
this.agentService.isMobileView = true;
|
|
2450
|
+
}
|
|
2451
|
+
else {
|
|
2452
|
+
this.isMobileView = false;
|
|
2453
|
+
this.agentService.isMobileView = false;
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
2456
|
+
ngOnInit() {
|
|
2457
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
2458
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2459
|
+
this.agentService.config = this.config;
|
|
2460
|
+
this.agentService.showMapview = (_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;
|
|
2461
|
+
this.agentService.addTaskForm =
|
|
2462
|
+
(_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;
|
|
2463
|
+
if (((_h = (_g = this.config) === null || _g === void 0 ? void 0 : _g.dashboard) === null || _h === void 0 ? void 0 : _h.mapType) === "google-maps" &&
|
|
2464
|
+
isNotEmptyValue((_k = (_j = this.config) === null || _j === void 0 ? void 0 : _j.dashboard) === null || _k === void 0 ? void 0 : _k.googleMapsAPIKey)) {
|
|
2465
|
+
this.loadMaps((_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.dashboard) === null || _m === void 0 ? void 0 : _m.googleMapsAPIKey).subscribe((loaded) => {
|
|
2466
|
+
this.mapsLoaded = loaded;
|
|
2467
|
+
if (loaded) {
|
|
2468
|
+
console.log("Google Maps JavaScript API loaded successfully.");
|
|
2469
|
+
this.loading = false;
|
|
2470
|
+
// Initialize and render Google Map here
|
|
2471
|
+
}
|
|
2472
|
+
else {
|
|
2473
|
+
console.error("Google Maps JavaScript API failed to load.");
|
|
2474
|
+
this.loading = false;
|
|
2475
|
+
}
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
else {
|
|
2479
|
+
this.mapsLoaded = true;
|
|
2480
|
+
this.loading = false;
|
|
2481
|
+
}
|
|
2482
|
+
setTimeout(() => {
|
|
2483
|
+
this.windowResizeWatcher();
|
|
2484
|
+
}, 1000);
|
|
2485
|
+
});
|
|
2486
|
+
}
|
|
2487
|
+
// Load Google Maps
|
|
2488
|
+
loadMaps(apiKey) {
|
|
2489
|
+
const url = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&v=3.exp&libraries=geometry,drawing,places`;
|
|
2490
|
+
this.googleMapsService.apiKey = apiKey;
|
|
2491
|
+
return this.httpClient.jsonp(url, "callback").pipe(map(() => true), catchError(() => {
|
|
2492
|
+
console.error("Error loading Google Maps JavaScript API.");
|
|
2493
|
+
return of(false);
|
|
2494
|
+
}));
|
|
2495
|
+
}
|
|
2496
|
+
handleOnClickNext(e) {
|
|
2497
|
+
this.nextStep.emit(e);
|
|
2498
|
+
}
|
|
2499
|
+
handleOnClickAddTask(task) {
|
|
2500
|
+
this.addTask.emit(task);
|
|
2501
|
+
}
|
|
2502
|
+
handleOnClickRemoveTask(task) {
|
|
2503
|
+
this.removeTask.emit(task);
|
|
2504
|
+
}
|
|
2505
|
+
handleOnFilterTaskList(filter) {
|
|
2506
|
+
this.filterTaskList.emit(filter);
|
|
2507
|
+
}
|
|
2508
|
+
refresh() {
|
|
2509
|
+
this.handleOnFilterTaskList({});
|
|
2510
|
+
}
|
|
2511
|
+
onClick() {
|
|
2512
|
+
this.open = !this.open;
|
|
2513
|
+
}
|
|
2514
|
+
onObscured(obscured) {
|
|
2515
|
+
if (obscured) {
|
|
2516
|
+
this.open = false;
|
|
2517
|
+
}
|
|
2518
|
+
}
|
|
2519
|
+
onActiveZone(active) {
|
|
2520
|
+
this.open = active && this.open;
|
|
2521
|
+
}
|
|
2522
|
+
close() {
|
|
2523
|
+
this.open = false;
|
|
2524
|
+
if (this.dialogSubscription) {
|
|
2525
|
+
this.dialogSubscription.unsubscribe();
|
|
2526
|
+
}
|
|
2527
|
+
}
|
|
2528
|
+
showDialog(content) {
|
|
2529
|
+
this.dialogSubscription = this.dialogService
|
|
2530
|
+
.open(content, { closeable: false, dismissible: false })
|
|
2531
|
+
.subscribe();
|
|
2532
|
+
}
|
|
2533
|
+
openInfoWindow(marker) {
|
|
2534
|
+
this.infoWindow.open(marker);
|
|
2535
|
+
}
|
|
2536
|
+
handleOnClickSaveForm(e) {
|
|
2537
|
+
this.handleOnClickAddTask(e.data);
|
|
2538
|
+
this.close();
|
|
2539
|
+
}
|
|
2540
|
+
handleOnClickLogout() {
|
|
2541
|
+
this.handleOnClickPerformAction({ action: { type: "logout" } });
|
|
2542
|
+
}
|
|
2543
|
+
handleOnClickPerformAction(event) {
|
|
2544
|
+
this.onClickPerformAction.emit(event);
|
|
2545
|
+
}
|
|
2546
|
+
}
|
|
2547
|
+
/** @nocollapse */ KwikIDAgentDashboardComponentV1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponentV1, deps: [{ token: GoogleMapsService }, { token: AgentService }, { token: i3$2.HttpClient }, { token: i0.ElementRef }, { token: TuiDialogService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2548
|
+
/** @nocollapse */ KwikIDAgentDashboardComponentV1.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponentV1, selector: "kwikid-agent-dashboard-v1", inputs: { config: "config", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList", onClickPerformAction: "onClickPerformAction" }, host: { listeners: { "window:resize": "windowResizeWatcher($event)" } }, viewQueries: [{ propertyName: "infoWindow", first: true, predicate: MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, template: "<div\n class=\"kwikid-agent-dashboard\"\n *ngIf=\"!loading\"\n>\n <div class=\"wrapper\">\n <header>\n <span (tuiActiveZoneChange)=\"onActiveZone($event)\">\n <kwikui-button\n [icon]=\"'tuiIconMenuLarge'\"\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 <!-- <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 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=\"agentService.config?.dashboard?.isAllowAddTask\"\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n label=\"Refresh\"\n [icon]=\"'tuiIconRefreshCw'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\n <kwikui-button\n *ngIf=\"this.config.dashboard.isShowMaps\"\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n label=\"{{\n agentService.showMapview ? 'Hide Maps' : 'Show Maps'\n }}\"\n type=\"button\"\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 <hr />\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n label=\"Logout\"\n icon=\"tuiIconLogOut\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"handleOnClickLogout()\"\n ></kwikui-button>\n </div>\n </div>\n </ng-template>\n </span>\n <div class=\"actions\">\n <kwikui-button\n *ngIf=\"agentService.config?.dashboard?.isAllowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"primary\"\n [label]=\"\n agentService.config?.dashboard?.addTaskButtonLabel ?? 'Add User'\n \"\n icon=\"tuiIconPlus\"\n shape=\"rounded\"\n size=\"s\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n </div>\n </header>\n\n <div class=\"dashboard-body\">\n <div\n *ngIf=\"mapsLoaded\"\n [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\"\n >\n <google-map\n *ngIf=\"agentService.config?.dashboard?.mapType == 'google-maps'\"\n [options]=\"this.googleMapsService.map\"\n height=\"100%\"\n width=\"100%\"\n >\n <map-marker\n #marker=\"mapMarker\"\n *ngFor=\"\n let markerPosition of this.googleMapsService.allMarkers;\n let index = index\n \"\n [position]=\"markerPosition\"\n [label]=\"{ text: String(index) }\"\n ></map-marker>\n <map-directions-renderer\n *ngIf=\"\n this.googleMapsService.directionsResults$\n | async as directionsResults\n \"\n [directions]=\"directionsResults\"\n [options]=\"this.googleMapsService.directionsRenderOption\"\n ></map-directions-renderer>\n </google-map>\n\n <div\n *ngIf=\"agentService.config?.dashboard?.mapType == 'open-street'\"\n id=\"map\"\n style=\"height: 100%\"\n ></div>\n </div>\n\n <div\n class=\"task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.currentTaskDetails != undefined &&\n !agentService.showMapview\n \"\n >\n <customer-details\n [customer]=\"agentService.currentTaskDetails\"\n [config]=\"config\"\n (nextStep)=\"handleOnClickNext($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></customer-details>\n </div>\n\n <div\n class=\"no-task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.currentTaskDetails == undefined &&\n !agentService.showMapview\n \"\n >\n <img\n src=\"assets/No-Results.jpg\"\n class=\"no-task-img\"\n alt=\"No Task\"\n />\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 (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></customer-list>\n </div>\n </div>\n </div>\n</div>\n\n<div\n class=\"kwikid-agent-dashboard-loader\"\n *ngIf=\"loading\"\n>\n <span class=\"loader\"></span>\n</div>\n\n<ng-template\n #template\n let-observer\n>\n <div class=\"add-task-header\">\n <h2>{{ agentService?.addTaskForm?.title ?? \"Create User\" }}</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 (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:1rem;max-height:80px;border:1px solid #cdcdcd}.kwikid-agent-dashboard .wrapper header .actions{display:flex;flex-direction:row;align-items:center}.kwikid-agent-dashboard .wrapper header .actions>*{margin-right:.5rem}.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%;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:.75rem;max-height:80px;border:1px solid #cdcdcd}.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;overflow:auto}.kwikid-agent-dashboard .wrapper .dashboard-body .map{width:100%;height:100%;position:relative;overflow:hidden;border:1px solid #cdcdcd;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;border:1px solid #cdcdcd}.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:320px;width:100%;height:100%;overflow:hidden;border:1px solid #cdcdcd}}.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;margin:0 auto;font-weight:600}.menu-dropdown .menu-dropdown-header .menu-dropdown-header-agent-id{font-size:.8rem;margin:0 auto;font-weight:600}.menu-dropdown .menu-dropdown-buttons ::ng-deep .t-wrapper{padding:0!important}.client-logo{height:40px;width:-moz-fit-content;width:fit-content;margin:0 auto;padding-left:1rem}.client-name{display:flex;flex-direction:row;align-content:center;justify-content:space-between;align-items:center;font-size:1rem;margin:0 auto;font-weight:600}\n"], components: [{ type: i1.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i2$2.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", "config"], outputs: ["nextStep", "removeTask", "onClickPerformAction"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "config"], outputs: ["nextStep", "removeTask", "filterTaskList", "onClickPerformAction"] }, { type: i3$1.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "extraData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig", "stepConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickViewFile", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i3.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i3.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i3.TuiDropdownPositionDirective, selector: "[tuiDropdown]" }, { type: i3.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i3.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2$2.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: i2$2.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }], pipes: { "async": i7.AsyncPipe } });
|
|
2549
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponentV1, decorators: [{
|
|
2550
|
+
type: Component,
|
|
2551
|
+
args: [{
|
|
2552
|
+
selector: "kwikid-agent-dashboard-v1",
|
|
2553
|
+
templateUrl: "./kwikid-agent-dashboard.component.html",
|
|
2554
|
+
styleUrls: ["./kwikid-agent-dashboard.component.scss"]
|
|
2555
|
+
}]
|
|
2556
|
+
}], ctorParameters: function () { return [{ type: GoogleMapsService }, { type: AgentService }, { type: i3$2.HttpClient }, { type: i0.ElementRef }, { type: i3.TuiDialogService, decorators: [{
|
|
2557
|
+
type: Inject,
|
|
2558
|
+
args: [TuiDialogService]
|
|
2559
|
+
}] }]; }, propDecorators: { windowResizeWatcher: [{
|
|
2560
|
+
type: HostListener,
|
|
2561
|
+
args: ["window:resize", ["$event"]]
|
|
2562
|
+
}], config: [{
|
|
2563
|
+
type: Input
|
|
2564
|
+
}], taskList: [{
|
|
2565
|
+
type: Input
|
|
2566
|
+
}], nextStep: [{
|
|
2567
|
+
type: Output
|
|
2568
|
+
}], addTask: [{
|
|
2569
|
+
type: Output
|
|
2570
|
+
}], removeTask: [{
|
|
2571
|
+
type: Output
|
|
2572
|
+
}], filterTaskList: [{
|
|
2573
|
+
type: Output
|
|
2574
|
+
}], onClickPerformAction: [{
|
|
2575
|
+
type: Output
|
|
2576
|
+
}], infoWindow: [{
|
|
2577
|
+
type: ViewChild,
|
|
2578
|
+
args: [MapInfoWindow, { static: false }]
|
|
2579
|
+
}], mapElement: [{
|
|
2580
|
+
type: ViewChild,
|
|
2581
|
+
args: ["map", { static: true }]
|
|
2582
|
+
}] } });
|
|
2583
|
+
|
|
2584
|
+
/* eslint-disable no-empty-function */
|
|
2585
|
+
class KwikIDAgentDashboardComponent {
|
|
2586
|
+
// eslint-disable-next-line no-useless-constructor, @typescript-eslint/no-empty-function
|
|
2587
|
+
constructor() {
|
|
2588
|
+
this.agentInfo = {};
|
|
2589
|
+
this.config = {};
|
|
2590
|
+
this.userConfig = {};
|
|
2591
|
+
this.taskList = [];
|
|
2592
|
+
this.nextStep = new EventEmitter();
|
|
2593
|
+
this.addTask = new EventEmitter();
|
|
2594
|
+
this.removeTask = new EventEmitter();
|
|
2595
|
+
this.filterTaskList = new EventEmitter();
|
|
2596
|
+
this.onGetTaskList = new EventEmitter();
|
|
2597
|
+
this.onClickPerformAction = new EventEmitter();
|
|
2598
|
+
}
|
|
2599
|
+
// eslint-disable-next-line class-methods-use-this, @typescript-eslint/no-empty-function
|
|
2600
|
+
ngOnInit() { }
|
|
2601
|
+
ngOnChanges(changes) {
|
|
2602
|
+
const verifyChange = (key) => {
|
|
2603
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
2604
|
+
return changes.hasOwnProperty(key) && !changes[key].firstChange;
|
|
2605
|
+
};
|
|
2606
|
+
if (verifyChange("taskList")) {
|
|
2607
|
+
this.taskList = changes.taskList.currentValue;
|
|
2608
|
+
}
|
|
2609
|
+
}
|
|
2610
|
+
handleOnClickNext(e) {
|
|
2611
|
+
this.nextStep.emit(e);
|
|
2612
|
+
}
|
|
2613
|
+
handleOnClickAddTask(task) {
|
|
2614
|
+
this.addTask.emit(task);
|
|
2615
|
+
}
|
|
2616
|
+
handleOnClickRemoveTask(task) {
|
|
2617
|
+
this.removeTask.emit(task);
|
|
2618
|
+
}
|
|
2619
|
+
handleOnFilterTaskList(filter) {
|
|
2620
|
+
this.onGetTaskList.emit(filter);
|
|
2621
|
+
}
|
|
2622
|
+
handleOnGetTaskList(event) {
|
|
2623
|
+
this.onGetTaskList.emit(event);
|
|
2624
|
+
}
|
|
2625
|
+
handleOnClickPerformAction(event) {
|
|
2626
|
+
this.onClickPerformAction.emit(event);
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2630
|
+
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: KwikIDAgentDashboardComponent, selector: "kwikid-agent-dashboard", inputs: { agentInfo: "agentInfo", config: "config", userConfig: "userConfig", taskList: "taskList" }, outputs: { nextStep: "nextStep", addTask: "addTask", removeTask: "removeTask", filterTaskList: "filterTaskList", onGetTaskList: "onGetTaskList", onClickPerformAction: "onClickPerformAction" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"config?.version === 2\">\n <kwikid-agent-dashboard-v2\n [agentInfo]=\"agentInfo\"\n [config]=\"config\"\n [taskList]=\"taskList\"\n [userConfig]=\"userConfig\"\n (onGetTaskList)=\"handleOnGetTaskList($event)\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></kwikid-agent-dashboard-v2>\n</div>\n\n<div *ngIf=\"config?.version !== 2\">\n <kwikid-agent-dashboard-v1\n [config]=\"config\"\n [taskList]=\"taskList\"\n (nextStep)=\"handleOnClickNext($event)\"\n (addTask)=\"handleOnClickAddTask($event)\"\n (removeTask)=\"handleOnClickRemoveTask($event)\"\n (filterTaskList)=\"handleOnFilterTaskList($event)\"\n (onClickPerformAction)=\"handleOnClickPerformAction($event)\"\n ></kwikid-agent-dashboard-v1>\n</div>\n", styles: ["div{height:100%}\n"], components: [{ type: KwikIDAgentDashboardComponentV2, selector: "kwikid-agent-dashboard-v2", inputs: ["config", "userConfig", "agentInfo", "taskList"], outputs: ["onGetTaskList", "onClickPerformAction"] }, { type: KwikIDAgentDashboardComponentV1, selector: "kwikid-agent-dashboard-v1", inputs: ["config", "taskList"], outputs: ["nextStep", "addTask", "removeTask", "filterTaskList", "onClickPerformAction"] }], directives: [{ type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
2631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardComponent, decorators: [{
|
|
2632
|
+
type: Component,
|
|
2633
|
+
args: [{
|
|
2634
|
+
selector: "kwikid-agent-dashboard",
|
|
2635
|
+
templateUrl: "./kwikid-agent-dashboard.component.html",
|
|
2636
|
+
styleUrls: ["./kwikid-agent-dashboard.component.scss"]
|
|
2637
|
+
}]
|
|
2638
|
+
}], ctorParameters: function () { return []; }, propDecorators: { agentInfo: [{
|
|
2639
|
+
type: Input
|
|
2640
|
+
}], config: [{
|
|
2641
|
+
type: Input
|
|
2642
|
+
}], userConfig: [{
|
|
2643
|
+
type: Input
|
|
2644
|
+
}], taskList: [{
|
|
2645
|
+
type: Input
|
|
2646
|
+
}], nextStep: [{
|
|
2647
|
+
type: Output
|
|
2648
|
+
}], addTask: [{
|
|
2649
|
+
type: Output
|
|
2650
|
+
}], removeTask: [{
|
|
2651
|
+
type: Output
|
|
2652
|
+
}], filterTaskList: [{
|
|
2653
|
+
type: Output
|
|
2654
|
+
}], onGetTaskList: [{
|
|
2655
|
+
type: Output
|
|
2656
|
+
}], onClickPerformAction: [{
|
|
2657
|
+
type: Output
|
|
2658
|
+
}] } });
|
|
2659
|
+
|
|
2660
|
+
class KwikIDAgentDashboardModuleV1 {
|
|
2661
|
+
}
|
|
2662
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV1, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2663
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV1.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV1, declarations: [KwikIDAgentDashboardComponentV1,
|
|
2664
|
+
CustomerListComponent,
|
|
2665
|
+
CustomerTileComponent,
|
|
2666
|
+
Ng2SearchPipe$1,
|
|
2667
|
+
StatusPillComponent,
|
|
2668
|
+
CustomerDetailsComponent,
|
|
2669
|
+
ActionButtonComponent], imports: [CommonModule,
|
|
2670
|
+
HttpClientModule,
|
|
2671
|
+
FormsModule,
|
|
2672
|
+
ReactiveFormsModule,
|
|
2673
|
+
KwikUIButtonModule,
|
|
2674
|
+
KwikUIInputModule,
|
|
2675
|
+
KwikUIInputDateModule,
|
|
2676
|
+
KwikUIInputDateRangeModule,
|
|
2677
|
+
KwikUIInputSelectModule,
|
|
2678
|
+
KwikUILabelValuePairModule,
|
|
2679
|
+
KwikUITableModule,
|
|
2680
|
+
KwikUITablePaginationModule,
|
|
2681
|
+
KwikIDFormViewModule,
|
|
2682
|
+
TuiRootModule,
|
|
2683
|
+
TuiDialogModule,
|
|
2684
|
+
TuiDropdownModule,
|
|
2685
|
+
TuiSidebarModule,
|
|
2686
|
+
TuiActiveZoneModule,
|
|
2687
|
+
TuiGroupModule,
|
|
2688
|
+
TuiSvgModule,
|
|
2689
|
+
ScrollingModule,
|
|
2690
|
+
GoogleMapsModule,
|
|
2691
|
+
HttpClientModule,
|
|
2692
|
+
HttpClientJsonpModule], exports: [KwikIDAgentDashboardComponentV1] });
|
|
2693
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV1.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV1, imports: [[
|
|
2694
|
+
CommonModule,
|
|
2695
|
+
HttpClientModule,
|
|
2696
|
+
FormsModule,
|
|
2697
|
+
ReactiveFormsModule,
|
|
2698
|
+
KwikUIButtonModule,
|
|
2699
|
+
KwikUIInputModule,
|
|
2700
|
+
KwikUIInputDateModule,
|
|
2701
|
+
KwikUIInputDateRangeModule,
|
|
2702
|
+
KwikUIInputSelectModule,
|
|
2703
|
+
KwikUILabelValuePairModule,
|
|
2704
|
+
KwikUITableModule,
|
|
2705
|
+
KwikUITablePaginationModule,
|
|
2706
|
+
KwikIDFormViewModule,
|
|
2707
|
+
TuiRootModule,
|
|
2708
|
+
TuiDialogModule,
|
|
2709
|
+
TuiDropdownModule,
|
|
2710
|
+
TuiSidebarModule,
|
|
2711
|
+
TuiActiveZoneModule,
|
|
2712
|
+
TuiGroupModule,
|
|
2713
|
+
TuiSvgModule,
|
|
2714
|
+
ScrollingModule,
|
|
2715
|
+
GoogleMapsModule,
|
|
2716
|
+
HttpClientModule,
|
|
2717
|
+
HttpClientJsonpModule
|
|
2718
|
+
]] });
|
|
2719
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV1, decorators: [{
|
|
2720
|
+
type: NgModule,
|
|
2721
|
+
args: [{
|
|
2722
|
+
declarations: [
|
|
2723
|
+
KwikIDAgentDashboardComponentV1,
|
|
2724
|
+
CustomerListComponent,
|
|
2725
|
+
CustomerTileComponent,
|
|
2726
|
+
Ng2SearchPipe$1,
|
|
2727
|
+
StatusPillComponent,
|
|
2728
|
+
CustomerDetailsComponent,
|
|
2729
|
+
ActionButtonComponent
|
|
2730
|
+
],
|
|
2731
|
+
imports: [
|
|
2732
|
+
CommonModule,
|
|
2733
|
+
HttpClientModule,
|
|
2734
|
+
FormsModule,
|
|
2735
|
+
ReactiveFormsModule,
|
|
2736
|
+
KwikUIButtonModule,
|
|
2737
|
+
KwikUIInputModule,
|
|
2738
|
+
KwikUIInputDateModule,
|
|
2739
|
+
KwikUIInputDateRangeModule,
|
|
2740
|
+
KwikUIInputSelectModule,
|
|
2741
|
+
KwikUILabelValuePairModule,
|
|
2742
|
+
KwikUITableModule,
|
|
2743
|
+
KwikUITablePaginationModule,
|
|
2744
|
+
KwikIDFormViewModule,
|
|
2745
|
+
TuiRootModule,
|
|
2746
|
+
TuiDialogModule,
|
|
2747
|
+
TuiDropdownModule,
|
|
2748
|
+
TuiSidebarModule,
|
|
2749
|
+
TuiActiveZoneModule,
|
|
2750
|
+
TuiGroupModule,
|
|
2751
|
+
TuiSvgModule,
|
|
2752
|
+
ScrollingModule,
|
|
2753
|
+
GoogleMapsModule,
|
|
2754
|
+
HttpClientModule,
|
|
2755
|
+
HttpClientJsonpModule
|
|
2756
|
+
],
|
|
2757
|
+
exports: [KwikIDAgentDashboardComponentV1]
|
|
2758
|
+
}]
|
|
2759
|
+
}] });
|
|
2760
|
+
|
|
2761
|
+
class AgentInfoComponent {
|
|
2762
|
+
constructor() { }
|
|
2763
|
+
ngOnInit() {
|
|
2764
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
2765
|
+
}
|
|
2766
|
+
}
|
|
2767
|
+
/** @nocollapse */ AgentInfoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2768
|
+
/** @nocollapse */ AgentInfoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: AgentInfoComponent, selector: "agent-info", ngImport: i0, template: "Agent Info\n", styles: [""] });
|
|
2769
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoComponent, decorators: [{
|
|
2770
|
+
type: Component,
|
|
2771
|
+
args: [{
|
|
2772
|
+
selector: "agent-info",
|
|
2773
|
+
templateUrl: "./agent-info.component.html",
|
|
2774
|
+
styleUrls: ["./agent-info.component.scss"]
|
|
2775
|
+
}]
|
|
2776
|
+
}], ctorParameters: function () { return []; } });
|
|
2777
|
+
|
|
2778
|
+
class AgentInfoModule {
|
|
2779
|
+
}
|
|
2780
|
+
/** @nocollapse */ AgentInfoModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2781
|
+
/** @nocollapse */ AgentInfoModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoModule, declarations: [AgentInfoComponent], imports: [CommonModule,
|
|
2782
|
+
FormsModule,
|
|
2783
|
+
ReactiveFormsModule,
|
|
2784
|
+
KwikUIModule,
|
|
2785
|
+
KwikIDFormsModule], exports: [AgentInfoComponent] });
|
|
2786
|
+
/** @nocollapse */ AgentInfoModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoModule, imports: [[
|
|
2787
|
+
CommonModule,
|
|
2788
|
+
FormsModule,
|
|
2789
|
+
ReactiveFormsModule,
|
|
2790
|
+
KwikUIModule,
|
|
2791
|
+
KwikIDFormsModule
|
|
2792
|
+
]] });
|
|
2793
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: AgentInfoModule, decorators: [{
|
|
2794
|
+
type: NgModule,
|
|
2795
|
+
args: [{
|
|
2796
|
+
declarations: [AgentInfoComponent],
|
|
2797
|
+
imports: [
|
|
2798
|
+
CommonModule,
|
|
2799
|
+
FormsModule,
|
|
2800
|
+
ReactiveFormsModule,
|
|
2801
|
+
KwikUIModule,
|
|
2802
|
+
KwikIDFormsModule
|
|
2803
|
+
],
|
|
2804
|
+
exports: [AgentInfoComponent]
|
|
2805
|
+
}]
|
|
2806
|
+
}] });
|
|
2807
|
+
|
|
2808
|
+
class BottomSheetModule {
|
|
2809
|
+
}
|
|
2810
|
+
/** @nocollapse */ BottomSheetModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2811
|
+
/** @nocollapse */ BottomSheetModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetModule, declarations: [BottomSheetComponent], imports: [CommonModule,
|
|
2812
|
+
FormsModule,
|
|
2813
|
+
ReactiveFormsModule,
|
|
2814
|
+
TuiSvgModule,
|
|
2815
|
+
KwikUIModule,
|
|
2816
|
+
KwikIDFormsModule], exports: [BottomSheetComponent] });
|
|
2817
|
+
/** @nocollapse */ BottomSheetModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetModule, imports: [[
|
|
2818
|
+
CommonModule,
|
|
2819
|
+
FormsModule,
|
|
2820
|
+
ReactiveFormsModule,
|
|
2821
|
+
TuiSvgModule,
|
|
2822
|
+
KwikUIModule,
|
|
2823
|
+
KwikIDFormsModule
|
|
2824
|
+
]] });
|
|
2825
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: BottomSheetModule, decorators: [{
|
|
2826
|
+
type: NgModule,
|
|
2827
|
+
args: [{
|
|
2828
|
+
declarations: [BottomSheetComponent],
|
|
2829
|
+
imports: [
|
|
2830
|
+
CommonModule,
|
|
2831
|
+
FormsModule,
|
|
2832
|
+
ReactiveFormsModule,
|
|
2833
|
+
TuiSvgModule,
|
|
2834
|
+
KwikUIModule,
|
|
2835
|
+
KwikIDFormsModule
|
|
2836
|
+
],
|
|
2837
|
+
exports: [BottomSheetComponent]
|
|
2838
|
+
}]
|
|
2839
|
+
}] });
|
|
2840
|
+
|
|
2841
|
+
class MapViewModule {
|
|
2842
|
+
}
|
|
2843
|
+
/** @nocollapse */ MapViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2844
|
+
/** @nocollapse */ MapViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewModule, declarations: [MapViewComponent], imports: [CommonModule,
|
|
2845
|
+
FormsModule,
|
|
2846
|
+
ReactiveFormsModule,
|
|
2847
|
+
KwikUIModule,
|
|
2848
|
+
KwikIDFormsModule], exports: [MapViewComponent] });
|
|
2849
|
+
/** @nocollapse */ MapViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewModule, imports: [[
|
|
2850
|
+
CommonModule,
|
|
2851
|
+
FormsModule,
|
|
2852
|
+
ReactiveFormsModule,
|
|
2853
|
+
KwikUIModule,
|
|
2854
|
+
KwikIDFormsModule
|
|
2855
|
+
]] });
|
|
2856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: MapViewModule, decorators: [{
|
|
2857
|
+
type: NgModule,
|
|
2858
|
+
args: [{
|
|
2859
|
+
declarations: [MapViewComponent],
|
|
2860
|
+
imports: [
|
|
2861
|
+
CommonModule,
|
|
2862
|
+
FormsModule,
|
|
2863
|
+
ReactiveFormsModule,
|
|
2864
|
+
KwikUIModule,
|
|
2865
|
+
KwikIDFormsModule
|
|
2866
|
+
],
|
|
2867
|
+
exports: [MapViewComponent]
|
|
2868
|
+
}]
|
|
2869
|
+
}] });
|
|
2870
|
+
|
|
2871
|
+
class PrimaryActionsModule {
|
|
2872
|
+
}
|
|
2873
|
+
/** @nocollapse */ PrimaryActionsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2874
|
+
/** @nocollapse */ PrimaryActionsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsModule, declarations: [PrimaryActionsComponent], imports: [CommonModule,
|
|
2875
|
+
FormsModule,
|
|
2876
|
+
ReactiveFormsModule,
|
|
2877
|
+
TuiItemsWithMoreModule,
|
|
2878
|
+
TuiDropdownModule,
|
|
2879
|
+
TuiHostedDropdownModule,
|
|
2880
|
+
TuiDataListModule,
|
|
2881
|
+
TuiBadgeModule,
|
|
2882
|
+
KwikUIModule,
|
|
2883
|
+
KwikIDFormsModule], exports: [PrimaryActionsComponent] });
|
|
2884
|
+
/** @nocollapse */ PrimaryActionsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsModule, imports: [[
|
|
2885
|
+
CommonModule,
|
|
2886
|
+
FormsModule,
|
|
2887
|
+
ReactiveFormsModule,
|
|
2888
|
+
TuiItemsWithMoreModule,
|
|
2889
|
+
TuiDropdownModule,
|
|
2890
|
+
TuiHostedDropdownModule,
|
|
2891
|
+
TuiDataListModule,
|
|
2892
|
+
TuiBadgeModule,
|
|
2893
|
+
KwikUIModule,
|
|
2894
|
+
KwikIDFormsModule
|
|
2895
|
+
]] });
|
|
2896
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: PrimaryActionsModule, decorators: [{
|
|
2897
|
+
type: NgModule,
|
|
2898
|
+
args: [{
|
|
2899
|
+
declarations: [PrimaryActionsComponent],
|
|
2900
|
+
imports: [
|
|
2901
|
+
CommonModule,
|
|
2902
|
+
FormsModule,
|
|
2903
|
+
ReactiveFormsModule,
|
|
2904
|
+
TuiItemsWithMoreModule,
|
|
2905
|
+
TuiDropdownModule,
|
|
2906
|
+
TuiHostedDropdownModule,
|
|
2907
|
+
TuiDataListModule,
|
|
2908
|
+
TuiBadgeModule,
|
|
2909
|
+
KwikUIModule,
|
|
2910
|
+
KwikIDFormsModule
|
|
2911
|
+
],
|
|
2912
|
+
exports: [PrimaryActionsComponent]
|
|
2913
|
+
}]
|
|
2914
|
+
}] });
|
|
2915
|
+
|
|
2916
|
+
class TaskItemStatusModule {
|
|
2917
|
+
}
|
|
2918
|
+
/** @nocollapse */ TaskItemStatusModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2919
|
+
/** @nocollapse */ TaskItemStatusModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusModule, declarations: [TaskItemStatusComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule], exports: [TaskItemStatusComponent] });
|
|
2920
|
+
/** @nocollapse */ TaskItemStatusModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusModule, imports: [[CommonModule, FormsModule, ReactiveFormsModule]] });
|
|
2921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemStatusModule, decorators: [{
|
|
2922
|
+
type: NgModule,
|
|
2923
|
+
args: [{
|
|
2924
|
+
declarations: [TaskItemStatusComponent],
|
|
2925
|
+
imports: [CommonModule, FormsModule, ReactiveFormsModule],
|
|
2926
|
+
exports: [TaskItemStatusComponent]
|
|
2927
|
+
}]
|
|
2928
|
+
}] });
|
|
2929
|
+
|
|
2930
|
+
class TaskDetailModule {
|
|
2931
|
+
}
|
|
2932
|
+
/** @nocollapse */ TaskDetailModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2933
|
+
/** @nocollapse */ TaskDetailModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailModule, declarations: [TaskDetailComponent], imports: [CommonModule,
|
|
2934
|
+
FormsModule,
|
|
2935
|
+
ReactiveFormsModule,
|
|
2936
|
+
KwikUIModule,
|
|
2937
|
+
KwikIDFormsModule,
|
|
2938
|
+
TaskItemStatusModule], exports: [TaskDetailComponent] });
|
|
2939
|
+
/** @nocollapse */ TaskDetailModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailModule, imports: [[
|
|
2940
|
+
CommonModule,
|
|
2941
|
+
FormsModule,
|
|
2942
|
+
ReactiveFormsModule,
|
|
2943
|
+
KwikUIModule,
|
|
2944
|
+
KwikIDFormsModule,
|
|
2945
|
+
TaskItemStatusModule
|
|
2946
|
+
]] });
|
|
2947
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskDetailModule, decorators: [{
|
|
2948
|
+
type: NgModule,
|
|
2949
|
+
args: [{
|
|
2950
|
+
declarations: [TaskDetailComponent],
|
|
2951
|
+
imports: [
|
|
2952
|
+
CommonModule,
|
|
2953
|
+
FormsModule,
|
|
2954
|
+
ReactiveFormsModule,
|
|
2955
|
+
KwikUIModule,
|
|
2956
|
+
KwikIDFormsModule,
|
|
2957
|
+
TaskItemStatusModule
|
|
2958
|
+
],
|
|
2959
|
+
exports: [TaskDetailComponent]
|
|
2960
|
+
}]
|
|
2961
|
+
}] });
|
|
720
2962
|
|
|
721
|
-
class
|
|
722
|
-
constructor(agentService, googleMapsService, openStreetMapsService, cdr) {
|
|
723
|
-
this.agentService = agentService;
|
|
724
|
-
this.googleMapsService = googleMapsService;
|
|
725
|
-
this.openStreetMapsService = openStreetMapsService;
|
|
726
|
-
this.cdr = cdr;
|
|
727
|
-
this.customer = {};
|
|
728
|
-
this.viewTaskDetails = [];
|
|
729
|
-
this.nextStep = new EventEmitter();
|
|
730
|
-
this.removeTask = new EventEmitter();
|
|
731
|
-
}
|
|
732
|
-
ngOnChanges(changes) {
|
|
733
|
-
this.cdr.detectChanges();
|
|
734
|
-
}
|
|
735
|
-
ngOnInit() {
|
|
736
|
-
var _a, _b, _c;
|
|
737
|
-
this.viewTaskDetails =
|
|
738
|
-
(_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;
|
|
739
|
-
}
|
|
740
|
-
getTaskCreationTime(task) {
|
|
741
|
-
var _a;
|
|
742
|
-
if (checkObjectPathExists(this.agentService.config, 'dashboard.taskCreationTimePath')) {
|
|
743
|
-
const time = getObjectValueFromPath(task, this.agentService.config.dashboard.taskCreationTimePath);
|
|
744
|
-
return this.convertEpochToDate(time);
|
|
745
|
-
}
|
|
746
|
-
else {
|
|
747
|
-
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);
|
|
748
|
-
}
|
|
749
|
-
}
|
|
750
|
-
convertEpochToDate(epochTime) {
|
|
751
|
-
if (typeof epochTime == 'string')
|
|
752
|
-
epochTime = Number(epochTime);
|
|
753
|
-
const date = new Date(epochTime * 1000); // Convert to milliseconds
|
|
754
|
-
const day = date.getDate().toString().padStart(2, '0');
|
|
755
|
-
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are zero-based
|
|
756
|
-
const year = date.getFullYear().toString();
|
|
757
|
-
return `${day}-${month}-${year}`;
|
|
758
|
-
}
|
|
759
|
-
getTaskDetails(taskData) {
|
|
760
|
-
return getObjectValueFromPath(this.customer, taskData);
|
|
761
|
-
}
|
|
762
|
-
goToMaps(location) {
|
|
763
|
-
window.open(`${location}`, '_blank');
|
|
764
|
-
}
|
|
765
|
-
handleOnClickNext(e) {
|
|
766
|
-
this.nextStep.emit(e);
|
|
767
|
-
}
|
|
768
|
-
close() {
|
|
769
|
-
var _a, _b;
|
|
770
|
-
this.agentService.currentTaskDetails = undefined;
|
|
771
|
-
if (((_b = (_a = this.agentService.config) === null || _a === void 0 ? void 0 : _a.dashboard) === null || _b === void 0 ? void 0 : _b.mapType) == 'google-maps') {
|
|
772
|
-
this.googleMapsService.plotDirectionsForSelectedTask(null);
|
|
773
|
-
}
|
|
774
|
-
else {
|
|
775
|
-
this.openStreetMapsService.plotDirectionsForSelectedTask(null);
|
|
776
|
-
}
|
|
777
|
-
}
|
|
778
|
-
handleOnClickRemoveTask(task) {
|
|
779
|
-
this.removeTask.emit(task);
|
|
780
|
-
}
|
|
2963
|
+
class TaskItemModule {
|
|
781
2964
|
}
|
|
782
|
-
/** @nocollapse */
|
|
783
|
-
/** @nocollapse */
|
|
784
|
-
|
|
785
|
-
|
|
2965
|
+
/** @nocollapse */ TaskItemModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2966
|
+
/** @nocollapse */ TaskItemModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemModule, declarations: [TaskItemComponent], imports: [CommonModule,
|
|
2967
|
+
FormsModule,
|
|
2968
|
+
ReactiveFormsModule,
|
|
2969
|
+
TuiAccordionModule,
|
|
2970
|
+
TaskItemStatusModule,
|
|
2971
|
+
KwikUIModule,
|
|
2972
|
+
KwikIDFormsModule], exports: [TaskItemComponent] });
|
|
2973
|
+
/** @nocollapse */ TaskItemModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemModule, imports: [[
|
|
2974
|
+
CommonModule,
|
|
2975
|
+
FormsModule,
|
|
2976
|
+
ReactiveFormsModule,
|
|
2977
|
+
TuiAccordionModule,
|
|
2978
|
+
TaskItemStatusModule,
|
|
2979
|
+
KwikUIModule,
|
|
2980
|
+
KwikIDFormsModule
|
|
2981
|
+
]] });
|
|
2982
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskItemModule, decorators: [{
|
|
2983
|
+
type: NgModule,
|
|
786
2984
|
args: [{
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
2985
|
+
declarations: [TaskItemComponent],
|
|
2986
|
+
imports: [
|
|
2987
|
+
CommonModule,
|
|
2988
|
+
FormsModule,
|
|
2989
|
+
ReactiveFormsModule,
|
|
2990
|
+
TuiAccordionModule,
|
|
2991
|
+
TaskItemStatusModule,
|
|
2992
|
+
KwikUIModule,
|
|
2993
|
+
KwikIDFormsModule
|
|
2994
|
+
],
|
|
2995
|
+
exports: [TaskItemComponent]
|
|
791
2996
|
}]
|
|
792
|
-
}]
|
|
793
|
-
type: Input
|
|
794
|
-
}], config: [{
|
|
795
|
-
type: Input
|
|
796
|
-
}], nextStep: [{
|
|
797
|
-
type: Output
|
|
798
|
-
}], removeTask: [{
|
|
799
|
-
type: Output
|
|
800
|
-
}] } });
|
|
2997
|
+
}] });
|
|
801
2998
|
|
|
802
|
-
class
|
|
803
|
-
constructor(googleMapsService, openStreetMapsService, agentService, hostElement) {
|
|
804
|
-
this.googleMapsService = googleMapsService;
|
|
805
|
-
this.openStreetMapsService = openStreetMapsService;
|
|
806
|
-
this.agentService = agentService;
|
|
807
|
-
this.hostElement = hostElement;
|
|
808
|
-
this.customer = {};
|
|
809
|
-
this.index = undefined;
|
|
810
|
-
this.isMobileView = false;
|
|
811
|
-
this.viewTaskDetails = [];
|
|
812
|
-
this.nextStep = new EventEmitter();
|
|
813
|
-
this.removeTask = new EventEmitter();
|
|
814
|
-
}
|
|
815
|
-
windowResizeWatcher() {
|
|
816
|
-
if (this.hostElement.nativeElement.offsetWidth < 600) {
|
|
817
|
-
this.isMobileView = true;
|
|
818
|
-
}
|
|
819
|
-
else {
|
|
820
|
-
this.isMobileView = false;
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
ngOnInit() {
|
|
824
|
-
var _a, _b, _c;
|
|
825
|
-
this.viewTaskDetails =
|
|
826
|
-
(_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;
|
|
827
|
-
}
|
|
828
|
-
openDetails() {
|
|
829
|
-
var _a, _b, _c, _d;
|
|
830
|
-
const isDifferentTaskSelected = ((_a = this.agentService.currentTaskDetails) === null || _a === void 0 ? void 0 : _a.session_id) !==
|
|
831
|
-
((_b = this.customer) === null || _b === void 0 ? void 0 : _b.session_id);
|
|
832
|
-
if (isDifferentTaskSelected) {
|
|
833
|
-
this.agentService.currentTaskDetails = this.customer;
|
|
834
|
-
}
|
|
835
|
-
else {
|
|
836
|
-
this.agentService.currentTaskDetails = undefined;
|
|
837
|
-
}
|
|
838
|
-
if (this.agentService.showMapview) {
|
|
839
|
-
if (((_d = (_c = this.agentService.config) === null || _c === void 0 ? void 0 : _c.dashboard) === null || _d === void 0 ? void 0 : _d.mapType) == 'google-maps') {
|
|
840
|
-
this.googleMapsService.plotDirectionsForSelectedTask(this.agentService.currentTaskDetails);
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
this.openStreetMapsService.plotDirectionsForSelectedTask(this.agentService.currentTaskDetails);
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
goToMaps(location) {
|
|
848
|
-
window.open(`${location}`, '_blank');
|
|
849
|
-
}
|
|
850
|
-
handleOnClickNext(e) {
|
|
851
|
-
this.nextStep.emit(e);
|
|
852
|
-
}
|
|
853
|
-
handleOnClickRemoveTask(task) {
|
|
854
|
-
this.removeTask.emit(task);
|
|
855
|
-
}
|
|
2999
|
+
class TaskListSearchModule {
|
|
856
3000
|
}
|
|
857
|
-
/** @nocollapse */
|
|
858
|
-
/** @nocollapse */
|
|
859
|
-
|
|
860
|
-
|
|
3001
|
+
/** @nocollapse */ TaskListSearchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3002
|
+
/** @nocollapse */ TaskListSearchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchModule, declarations: [TaskListSearchComponent], imports: [CommonModule,
|
|
3003
|
+
ScrollingModule,
|
|
3004
|
+
FormsModule,
|
|
3005
|
+
ReactiveFormsModule,
|
|
3006
|
+
KwikUIModule,
|
|
3007
|
+
KwikIDFormsModule], exports: [TaskListSearchComponent] });
|
|
3008
|
+
/** @nocollapse */ TaskListSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchModule, imports: [[
|
|
3009
|
+
CommonModule,
|
|
3010
|
+
ScrollingModule,
|
|
3011
|
+
FormsModule,
|
|
3012
|
+
ReactiveFormsModule,
|
|
3013
|
+
KwikUIModule,
|
|
3014
|
+
KwikIDFormsModule
|
|
3015
|
+
]] });
|
|
3016
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListSearchModule, decorators: [{
|
|
3017
|
+
type: NgModule,
|
|
861
3018
|
args: [{
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
3019
|
+
declarations: [TaskListSearchComponent],
|
|
3020
|
+
imports: [
|
|
3021
|
+
CommonModule,
|
|
3022
|
+
ScrollingModule,
|
|
3023
|
+
FormsModule,
|
|
3024
|
+
ReactiveFormsModule,
|
|
3025
|
+
KwikUIModule,
|
|
3026
|
+
KwikIDFormsModule
|
|
3027
|
+
],
|
|
3028
|
+
exports: [TaskListSearchComponent]
|
|
865
3029
|
}]
|
|
866
|
-
}]
|
|
867
|
-
type: HostListener,
|
|
868
|
-
args: ['window:resize', ['$event']]
|
|
869
|
-
}], customer: [{
|
|
870
|
-
type: Input
|
|
871
|
-
}], index: [{
|
|
872
|
-
type: Input
|
|
873
|
-
}], config: [{
|
|
874
|
-
type: Input
|
|
875
|
-
}], nextStep: [{
|
|
876
|
-
type: Output
|
|
877
|
-
}], removeTask: [{
|
|
878
|
-
type: Output
|
|
879
|
-
}] } });
|
|
3030
|
+
}] });
|
|
880
3031
|
|
|
881
3032
|
class Ng2SearchPipe {
|
|
882
3033
|
/**
|
|
@@ -899,17 +3050,17 @@ class Ng2SearchPipe {
|
|
|
899
3050
|
static filter(items, term, excludes) {
|
|
900
3051
|
const toCompare = term.toLowerCase();
|
|
901
3052
|
function checkInside(item, term) {
|
|
902
|
-
if (typeof item ===
|
|
3053
|
+
if (typeof item === "string" &&
|
|
903
3054
|
item.toString().toLowerCase().includes(toCompare)) {
|
|
904
3055
|
return true;
|
|
905
3056
|
}
|
|
906
|
-
for (
|
|
3057
|
+
for (const property in item) {
|
|
907
3058
|
if (item[property] === null ||
|
|
908
3059
|
item[property] == undefined ||
|
|
909
3060
|
excludes.includes(property)) {
|
|
910
3061
|
continue;
|
|
911
3062
|
}
|
|
912
|
-
if (typeof item[property] ===
|
|
3063
|
+
if (typeof item[property] === "object") {
|
|
913
3064
|
if (checkInside(item[property], term)) {
|
|
914
3065
|
return true;
|
|
915
3066
|
}
|
|
@@ -920,7 +3071,7 @@ class Ng2SearchPipe {
|
|
|
920
3071
|
}
|
|
921
3072
|
return false;
|
|
922
3073
|
}
|
|
923
|
-
return items.filter(
|
|
3074
|
+
return items.filter((item) => {
|
|
924
3075
|
return checkInside(item, term);
|
|
925
3076
|
});
|
|
926
3077
|
}
|
|
@@ -930,317 +3081,322 @@ class Ng2SearchPipe {
|
|
|
930
3081
|
/** @nocollapse */ Ng2SearchPipe.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe });
|
|
931
3082
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: Ng2SearchPipe, decorators: [{
|
|
932
3083
|
type: Pipe,
|
|
933
|
-
args: [{
|
|
934
|
-
name:
|
|
935
|
-
pure: false
|
|
936
|
-
}]
|
|
937
|
-
}, {
|
|
938
|
-
type: Injectable
|
|
939
|
-
}] });
|
|
940
|
-
|
|
941
|
-
class
|
|
942
|
-
constructor(googleMapsService, openStreetMapsService, agentService) {
|
|
943
|
-
this.googleMapsService = googleMapsService;
|
|
944
|
-
this.openStreetMapsService = openStreetMapsService;
|
|
945
|
-
this.agentService = agentService;
|
|
946
|
-
this.nextStep = new EventEmitter();
|
|
947
|
-
this.removeTask = new EventEmitter();
|
|
948
|
-
this.filterTaskList = new EventEmitter();
|
|
949
|
-
this.filteredData = [];
|
|
950
|
-
this.formGroup = new FormGroup({});
|
|
951
|
-
this.max = new TuiDay(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
|
|
952
|
-
}
|
|
953
|
-
ngOnInit() {
|
|
954
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
955
|
-
this.setDateRange();
|
|
956
|
-
});
|
|
957
|
-
}
|
|
958
|
-
setDateRange() {
|
|
959
|
-
var _a, _b, _c, _d, _e;
|
|
960
|
-
const searchDateStart = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.searchDateStart) !== null && _b !== void 0 ? _b : {
|
|
961
|
-
day: 0,
|
|
962
|
-
month: 0,
|
|
963
|
-
year: 0
|
|
964
|
-
};
|
|
965
|
-
const currentDate = new Date();
|
|
966
|
-
const startDate = new Date((_c = currentDate.getFullYear() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.year)) !== null && _c !== void 0 ? _c : 0, (_d = currentDate.getMonth() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.month)) !== null && _d !== void 0 ? _d : 0, (_e = currentDate.getDate() - (searchDateStart === null || searchDateStart === void 0 ? void 0 : searchDateStart.day)) !== null && _e !== void 0 ? _e : 0);
|
|
967
|
-
this.fromDate = this.getDate(startDate);
|
|
968
|
-
this.toDate = this.getDate(null);
|
|
969
|
-
this.dateRangeFormControl = new FormControl({
|
|
970
|
-
value: new TuiDayRange(new TuiDay(startDate.getFullYear(), startDate.getMonth(), startDate.getDate()), this.max),
|
|
971
|
-
disabled: false
|
|
972
|
-
});
|
|
973
|
-
this.formGroup.addControl('dateRange', this.dateRangeFormControl);
|
|
974
|
-
this.searchFormControl = new FormControl('');
|
|
975
|
-
this.formGroup.addControl('search', this.searchFormControl);
|
|
976
|
-
}
|
|
977
|
-
setUpMaps() {
|
|
978
|
-
var _a;
|
|
979
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
980
|
-
if (this.config.dashboard.isShowMaps) {
|
|
981
|
-
if (((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.mapType) == 'open-street') {
|
|
982
|
-
yield this.openStreetMapsService.initializeMap();
|
|
983
|
-
}
|
|
984
|
-
else {
|
|
985
|
-
yield this.googleMapsService.initializeMap();
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
setCustomersList() {
|
|
991
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
992
|
-
if (this.config.dashboard.isShowMaps) {
|
|
993
|
-
this.filteredData = yield this.plotMarkers(this.customers);
|
|
994
|
-
}
|
|
995
|
-
else {
|
|
996
|
-
this.filteredData = this.customers;
|
|
997
|
-
}
|
|
998
|
-
});
|
|
999
|
-
}
|
|
1000
|
-
ngAfterViewInit() {
|
|
1001
|
-
var _a, _b;
|
|
1002
|
-
this.maxLength = (_b = (_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.searchDateRange) !== null && _b !== void 0 ? _b : this.maxLength;
|
|
1003
|
-
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
1004
|
-
yield this.setUpMaps();
|
|
1005
|
-
yield this.setCustomersList();
|
|
1006
|
-
}), 1000);
|
|
1007
|
-
}
|
|
1008
|
-
ngOnChanges() {
|
|
1009
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1010
|
-
yield this.setCustomersList();
|
|
1011
|
-
});
|
|
1012
|
-
}
|
|
1013
|
-
handleOnClickNext(e) {
|
|
1014
|
-
this.nextStep.emit(e);
|
|
1015
|
-
}
|
|
1016
|
-
getDate(d) {
|
|
1017
|
-
const date = d ? new Date(d) : new Date();
|
|
1018
|
-
const year = date.getFullYear();
|
|
1019
|
-
let month = date.getMonth() + 1;
|
|
1020
|
-
let day = date.getDate();
|
|
1021
|
-
if (month < 10)
|
|
1022
|
-
month = '0' + month;
|
|
1023
|
-
if (day < 10)
|
|
1024
|
-
day = '0' + day;
|
|
1025
|
-
const today = `${year}-${month}-${day}`;
|
|
1026
|
-
return today;
|
|
1027
|
-
}
|
|
1028
|
-
plotMarkers(customers) {
|
|
1029
|
-
var _a, _b;
|
|
1030
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1031
|
-
if (!((_a = this.config.dashboard) === null || _a === void 0 ? void 0 : _a.isPlotCompletedTaskMarkers)) {
|
|
1032
|
-
customers = customers.filter((customer) => {
|
|
1033
|
-
return this.agentService.canPlotMarkers(customer.session_status);
|
|
1034
|
-
});
|
|
1035
|
-
}
|
|
1036
|
-
if (((_b = this.config.dashboard) === null || _b === void 0 ? void 0 : _b.mapType) == 'open-street') {
|
|
1037
|
-
customers = yield this.openStreetMapsService.plotDirectionsForAllTasks(customers);
|
|
1038
|
-
}
|
|
1039
|
-
else {
|
|
1040
|
-
customers = yield this.googleMapsService.plotDirectionsForAllTasks(customers);
|
|
1041
|
-
}
|
|
1042
|
-
return customers;
|
|
1043
|
-
});
|
|
1044
|
-
}
|
|
1045
|
-
getTuiDate(event) {
|
|
1046
|
-
let year = event.year;
|
|
1047
|
-
let month = event.month + 1;
|
|
1048
|
-
let date = event.day;
|
|
1049
|
-
month = month < 10 ? '0' + month : month;
|
|
1050
|
-
date = date < 10 ? '0' + date : date;
|
|
1051
|
-
return `${year}-${month}-${date}`;
|
|
1052
|
-
}
|
|
1053
|
-
onDateRangeChange(event) {
|
|
1054
|
-
this.fromDate = this.getTuiDate(event.value.from);
|
|
1055
|
-
this.toDate = this.getTuiDate(event.value.to);
|
|
1056
|
-
this.handleOnFilterTaskList({
|
|
1057
|
-
from_date: this.fromDate,
|
|
1058
|
-
to_date: this.toDate
|
|
1059
|
-
});
|
|
1060
|
-
}
|
|
1061
|
-
onSearchFilter(event) {
|
|
1062
|
-
this.searchText = event.value;
|
|
1063
|
-
}
|
|
1064
|
-
handleOnClickRemoveTask(task) {
|
|
1065
|
-
this.removeTask.emit(task);
|
|
1066
|
-
}
|
|
1067
|
-
handleOnFilterTaskList(filter) {
|
|
1068
|
-
this.filterTaskList.emit(filter);
|
|
1069
|
-
}
|
|
3084
|
+
args: [{
|
|
3085
|
+
name: "filter",
|
|
3086
|
+
pure: false
|
|
3087
|
+
}]
|
|
3088
|
+
}, {
|
|
3089
|
+
type: Injectable
|
|
3090
|
+
}] });
|
|
3091
|
+
|
|
3092
|
+
class TaskListModule {
|
|
1070
3093
|
}
|
|
1071
|
-
/** @nocollapse */
|
|
1072
|
-
/** @nocollapse */
|
|
1073
|
-
|
|
1074
|
-
|
|
3094
|
+
/** @nocollapse */ TaskListModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3095
|
+
/** @nocollapse */ TaskListModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListModule, declarations: [TaskListComponent, Ng2SearchPipe], imports: [CommonModule,
|
|
3096
|
+
ScrollingModule,
|
|
3097
|
+
FormsModule,
|
|
3098
|
+
ReactiveFormsModule,
|
|
3099
|
+
KwikUIModule,
|
|
3100
|
+
KwikUILoaderModule,
|
|
3101
|
+
KwikIDFormsModule,
|
|
3102
|
+
TaskItemModule,
|
|
3103
|
+
TaskListSearchModule,
|
|
3104
|
+
TuiPaginationModule], exports: [TaskListComponent] });
|
|
3105
|
+
/** @nocollapse */ TaskListModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListModule, imports: [[
|
|
3106
|
+
CommonModule,
|
|
3107
|
+
ScrollingModule,
|
|
3108
|
+
FormsModule,
|
|
3109
|
+
ReactiveFormsModule,
|
|
3110
|
+
KwikUIModule,
|
|
3111
|
+
KwikUILoaderModule,
|
|
3112
|
+
KwikIDFormsModule,
|
|
3113
|
+
TaskItemModule,
|
|
3114
|
+
TaskListSearchModule,
|
|
3115
|
+
TuiPaginationModule
|
|
3116
|
+
]] });
|
|
3117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskListModule, decorators: [{
|
|
3118
|
+
type: NgModule,
|
|
1075
3119
|
args: [{
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
3120
|
+
declarations: [TaskListComponent, Ng2SearchPipe],
|
|
3121
|
+
imports: [
|
|
3122
|
+
CommonModule,
|
|
3123
|
+
ScrollingModule,
|
|
3124
|
+
FormsModule,
|
|
3125
|
+
ReactiveFormsModule,
|
|
3126
|
+
KwikUIModule,
|
|
3127
|
+
KwikUILoaderModule,
|
|
3128
|
+
KwikIDFormsModule,
|
|
3129
|
+
TaskItemModule,
|
|
3130
|
+
TaskListSearchModule,
|
|
3131
|
+
TuiPaginationModule
|
|
3132
|
+
],
|
|
3133
|
+
exports: [TaskListComponent]
|
|
1079
3134
|
}]
|
|
1080
|
-
}]
|
|
1081
|
-
type: Input
|
|
1082
|
-
}], config: [{
|
|
1083
|
-
type: Input
|
|
1084
|
-
}], nextStep: [{
|
|
1085
|
-
type: Output
|
|
1086
|
-
}], removeTask: [{
|
|
1087
|
-
type: Output
|
|
1088
|
-
}], filterTaskList: [{
|
|
1089
|
-
type: Output
|
|
1090
|
-
}] } });
|
|
3135
|
+
}] });
|
|
1091
3136
|
|
|
1092
|
-
class
|
|
1093
|
-
constructor(
|
|
1094
|
-
this.googleMapsService = googleMapsService;
|
|
1095
|
-
this.agentService = agentService;
|
|
1096
|
-
this.httpClient = httpClient;
|
|
1097
|
-
this.hostElement = hostElement;
|
|
1098
|
-
this.dialogService = dialogService;
|
|
3137
|
+
class TaskPreviewComponent {
|
|
3138
|
+
constructor() {
|
|
1099
3139
|
this.config = {};
|
|
1100
|
-
this.
|
|
1101
|
-
this.
|
|
1102
|
-
this.addTask = new EventEmitter();
|
|
1103
|
-
this.removeTask = new EventEmitter();
|
|
1104
|
-
this.filterTaskList = new EventEmitter();
|
|
1105
|
-
this.loading = true;
|
|
1106
|
-
this.console = console;
|
|
1107
|
-
this.open = false;
|
|
1108
|
-
this.allFormsData = {};
|
|
1109
|
-
this.String = String;
|
|
1110
|
-
}
|
|
1111
|
-
windowResizeWatcher() {
|
|
1112
|
-
if (this.hostElement.nativeElement.offsetWidth < 600) {
|
|
1113
|
-
this.isMobileView = true;
|
|
1114
|
-
this.agentService.isMobileView = true;
|
|
1115
|
-
}
|
|
1116
|
-
else {
|
|
1117
|
-
this.isMobileView = false;
|
|
1118
|
-
this.agentService.isMobileView = false;
|
|
1119
|
-
}
|
|
3140
|
+
this.data = {};
|
|
3141
|
+
this.onClickTaskItemAction = new EventEmitter();
|
|
1120
3142
|
}
|
|
1121
3143
|
ngOnInit() {
|
|
1122
|
-
|
|
1123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1124
|
-
this.agentService.config = this.config;
|
|
1125
|
-
this.agentService.showMapview = (_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;
|
|
1126
|
-
this.agentService.addTaskForm =
|
|
1127
|
-
(_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;
|
|
1128
|
-
if (((_h = (_g = this.config) === null || _g === void 0 ? void 0 : _g.dashboard) === null || _h === void 0 ? void 0 : _h.mapType) == 'google-maps' &&
|
|
1129
|
-
isNotEmptyValue((_k = (_j = this.config) === null || _j === void 0 ? void 0 : _j.dashboard) === null || _k === void 0 ? void 0 : _k.googleMapsAPIKey)) {
|
|
1130
|
-
this.loadMaps((_m = (_l = this.config) === null || _l === void 0 ? void 0 : _l.dashboard) === null || _m === void 0 ? void 0 : _m.googleMapsAPIKey).subscribe((loaded) => {
|
|
1131
|
-
this.mapsLoaded = loaded;
|
|
1132
|
-
if (loaded) {
|
|
1133
|
-
console.log('Google Maps JavaScript API loaded successfully.');
|
|
1134
|
-
this.loading = false;
|
|
1135
|
-
// Initialize and render Google Map here
|
|
1136
|
-
}
|
|
1137
|
-
else {
|
|
1138
|
-
console.error('Google Maps JavaScript API failed to load.');
|
|
1139
|
-
this.loading = false;
|
|
1140
|
-
}
|
|
1141
|
-
});
|
|
1142
|
-
}
|
|
1143
|
-
else {
|
|
1144
|
-
this.mapsLoaded = true;
|
|
1145
|
-
this.loading = false;
|
|
1146
|
-
}
|
|
1147
|
-
setTimeout(() => {
|
|
1148
|
-
this.windowResizeWatcher();
|
|
1149
|
-
}, 1000);
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
|
-
// Load Google Maps
|
|
1153
|
-
loadMaps(apiKey) {
|
|
1154
|
-
const url = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&v=3.exp&libraries=geometry,drawing,places`;
|
|
1155
|
-
this.googleMapsService.apiKey = apiKey;
|
|
1156
|
-
return this.httpClient.jsonp(url, 'callback').pipe(map(() => true), catchError(() => {
|
|
1157
|
-
console.error('Error loading Google Maps JavaScript API.');
|
|
1158
|
-
return of(false);
|
|
1159
|
-
}));
|
|
1160
|
-
}
|
|
1161
|
-
handleOnClickNext(e) {
|
|
1162
|
-
this.nextStep.emit(e);
|
|
1163
|
-
}
|
|
1164
|
-
handleOnClickAddTask(task) {
|
|
1165
|
-
this.addTask.emit(task);
|
|
1166
|
-
}
|
|
1167
|
-
handleOnClickRemoveTask(task) {
|
|
1168
|
-
this.removeTask.emit(task);
|
|
1169
|
-
}
|
|
1170
|
-
handleOnFilterTaskList(filter) {
|
|
1171
|
-
this.filterTaskList.emit(filter);
|
|
1172
|
-
}
|
|
1173
|
-
refresh() {
|
|
1174
|
-
window.location.reload();
|
|
1175
|
-
}
|
|
1176
|
-
onClick() {
|
|
1177
|
-
this.open = !this.open;
|
|
1178
|
-
}
|
|
1179
|
-
onObscured(obscured) {
|
|
1180
|
-
if (obscured) {
|
|
1181
|
-
this.open = false;
|
|
1182
|
-
}
|
|
1183
|
-
}
|
|
1184
|
-
onActiveZone(active) {
|
|
1185
|
-
this.open = active && this.open;
|
|
1186
|
-
}
|
|
1187
|
-
showDialog(content) {
|
|
1188
|
-
this.dialogService
|
|
1189
|
-
.open(content, { closeable: false, dismissible: false })
|
|
1190
|
-
.subscribe();
|
|
1191
|
-
}
|
|
1192
|
-
openInfoWindow(marker) {
|
|
1193
|
-
this.infoWindow.open(marker);
|
|
1194
|
-
}
|
|
1195
|
-
handleOnClickSaveForm(e) {
|
|
1196
|
-
this.handleOnClickAddTask(e.data);
|
|
3144
|
+
return __awaiter(this, void 0, void 0, function* () { });
|
|
1197
3145
|
}
|
|
1198
|
-
handleOnClickViewForms(e) { }
|
|
1199
3146
|
}
|
|
1200
|
-
/** @nocollapse */
|
|
1201
|
-
/** @nocollapse */ KwikIDAgentDashboardComponent.ɵcmp = i0.ɵɵ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: MapInfoWindow, descendants: true }, { propertyName: "mapElement", first: true, predicate: ["map"], descendants: true, static: true }], ngImport: i0, 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 class=\"actions\">\n <kwikui-button\n *ngIf=\"agentService.config?.dashboard?.isAllowAddTask\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"primary\"\n [label]=\"agentService.config?.dashboard?.addTaskButtonLabel ?? 'Add User'\"\n [icon]=\"'tuiIconPlus'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"s\"\n (onClick)=\"showDialog(template)\"\n ></kwikui-button>\n\n <kwikui-button\n *ngIf=\"!agentService.config?.dashboard?.isAllowAddTask\"\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=\"s\"\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=\"agentService.config?.dashboard?.isAllowAddTask\"\n appearance=\"mono\"\n class=\"menu-dropdown-buttons\"\n label=\"Refresh\"\n [icon]=\"'tuiIconRefreshCw'\"\n size=\"m\"\n type=\"button\"\n (onClick)=\"refresh()\"\n ></kwikui-button>\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 <hr />\n <div class=\"menu-dropdown-footer\">\n <kwikui-button\n id=\"\"\n label=\"Logout\"\n styles=\"\"\n class=\"menu-dropdown-buttons\"\n type=\"button\"\n appearance=\"mono\"\n [icon]=\"'tuiIconLogOut'\"\n iconRight=\"\"\n [shape]=\"null\"\n size=\"m\"\n (onClick)=\"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\n *ngIf=\"mapsLoaded\"\n [class]=\"agentService.showMapview ? 'map' : 'map-hidden'\"\n >\n <google-map\n *ngIf=\"agentService.config?.dashboard?.mapType == 'google-maps'\"\n [options]=\"this.googleMapsService.map\"\n height=\"100%\"\n width=\"100%\"\n >\n <map-marker\n #marker=\"mapMarker\"\n *ngFor=\"\n let markerPosition of this.googleMapsService.allMarkers;\n let index = index\n \"\n [position]=\"markerPosition\"\n [label]=\"{ text: String(index) }\"\n ></map-marker>\n <map-directions-renderer\n *ngIf=\"\n this.googleMapsService.directionsResults$\n | async as directionsResults\n \"\n [directions]=\"directionsResults\"\n [options]=\"this.googleMapsService.directionsRenderOption\"\n ></map-directions-renderer>\n </google-map>\n\n <div\n *ngIf=\"agentService.config?.dashboard?.mapType == 'open-street'\"\n id=\"map\"\n style=\"height: 100%\"\n ></div>\n </div>\n\n <div\n class=\"task-details\"\n *ngIf=\"\n !agentService.isMobileView &&\n agentService.currentTaskDetails != undefined &&\n !agentService.showMapview\n \"\n >\n <customer-details\n [customer]=\"agentService.currentTaskDetails\"\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.currentTaskDetails == 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>{{agentService?.addTaskForm?.title ?? \"Create User\"}}</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 header .actions{display:flex;flex-direction:row;align-items:center}.kwikid-agent-dashboard .wrapper header .actions>*{margin-right:.5rem}.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: i4.KwikUIButtonComponent, selector: "kwikui-button", inputs: ["appearance", "class", "disabled", "icon", "iconRight", "id", "label", "shape", "showLoader", "size", "styles", "type", "pseudoHover"], outputs: ["onClick"] }, { type: i2.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", "config"], outputs: ["nextStep", "removeTask"] }, { type: CustomerListComponent, selector: "customer-list", inputs: ["customers", "config"], outputs: ["nextStep", "removeTask", "filterTaskList"] }, { type: i8.KwikIDFormViewComponent, selector: "kwikid-form-view", inputs: ["allFormsData", "apiCallResponse", "buttonClickResponse", "formConfig", "formData", "isMobileView", "popupFormCallback", "userConfig", "stepConfig"], outputs: ["getLogs", "getUnsavedDataState", "onActionShowPopupForm", "onClickApiCall", "onClickViewFile", "onClickFormFieldButton", "onClickGoBack", "onClickSaveForm", "onClickViewForms"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i10.TuiActiveZoneDirective, selector: "[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)", inputs: ["tuiActiveZoneParent"], outputs: ["tuiActiveZoneChange"], exportAs: ["tuiActiveZone"] }, { type: i11.TuiDropdownDirective, selector: "[tuiDropdown]:not(ng-container)", inputs: ["tuiDropdown"], exportAs: ["tuiDropdown"] }, { type: i11.TuiDropdownDriverDirective, selector: "[tuiDropdown]" }, { type: i11.TuiDropdownPositionDirective, selector: "[tuiDropdown]" }, { type: i11.TuiDropdownManualDirective, selector: "[tuiDropdown][tuiDropdownManual]", inputs: ["tuiDropdownManual"] }, { type: i11.TuiGroupDirective, selector: "[tuiGroup]:not(ng-container)", inputs: ["orientation", "adaptive", "collapsed", "rounded", "size"] }, { type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.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: i2.MapDirectionsRenderer, selector: "map-directions-renderer", inputs: ["directions", "options"], outputs: ["directionsChanged"], exportAs: ["mapDirectionsRenderer"] }], pipes: { "async": i6.AsyncPipe } });
|
|
1202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type:
|
|
3147
|
+
/** @nocollapse */ TaskPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3148
|
+
/** @nocollapse */ TaskPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: TaskPreviewComponent, selector: "task-preview", inputs: { config: "config", data: "data" }, outputs: { onClickTaskItemAction: "onClickTaskItemAction" }, ngImport: i0, template: "<div></div>\n", styles: [""] });
|
|
3149
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewComponent, decorators: [{
|
|
1203
3150
|
type: Component,
|
|
1204
3151
|
args: [{
|
|
1205
|
-
selector:
|
|
1206
|
-
templateUrl:
|
|
1207
|
-
styleUrls: [
|
|
3152
|
+
selector: "task-preview",
|
|
3153
|
+
templateUrl: "./task-preview.component.html",
|
|
3154
|
+
styleUrls: ["./task-preview.component.scss"]
|
|
1208
3155
|
}]
|
|
1209
|
-
}], ctorParameters: function () { return [
|
|
1210
|
-
type: Inject,
|
|
1211
|
-
args: [TuiDialogService]
|
|
1212
|
-
}] }]; }, propDecorators: { windowResizeWatcher: [{
|
|
1213
|
-
type: HostListener,
|
|
1214
|
-
args: ['window:resize', ['$event']]
|
|
1215
|
-
}], config: [{
|
|
3156
|
+
}], ctorParameters: function () { return []; }, propDecorators: { config: [{
|
|
1216
3157
|
type: Input
|
|
1217
|
-
}],
|
|
3158
|
+
}], data: [{
|
|
1218
3159
|
type: Input
|
|
1219
|
-
}],
|
|
1220
|
-
type: Output
|
|
1221
|
-
}], addTask: [{
|
|
1222
|
-
type: Output
|
|
1223
|
-
}], removeTask: [{
|
|
1224
|
-
type: Output
|
|
1225
|
-
}], filterTaskList: [{
|
|
3160
|
+
}], onClickTaskItemAction: [{
|
|
1226
3161
|
type: Output
|
|
1227
|
-
}], infoWindow: [{
|
|
1228
|
-
type: ViewChild,
|
|
1229
|
-
args: [MapInfoWindow, { static: false }]
|
|
1230
|
-
}], mapElement: [{
|
|
1231
|
-
type: ViewChild,
|
|
1232
|
-
args: ['map', { static: true }]
|
|
1233
3162
|
}] } });
|
|
1234
3163
|
|
|
3164
|
+
class TaskPreviewModule {
|
|
3165
|
+
}
|
|
3166
|
+
/** @nocollapse */ TaskPreviewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3167
|
+
/** @nocollapse */ TaskPreviewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewModule, declarations: [TaskPreviewComponent], imports: [CommonModule,
|
|
3168
|
+
FormsModule,
|
|
3169
|
+
ReactiveFormsModule,
|
|
3170
|
+
KwikUIModule,
|
|
3171
|
+
KwikIDFormsModule], exports: [TaskPreviewComponent] });
|
|
3172
|
+
/** @nocollapse */ TaskPreviewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewModule, imports: [[
|
|
3173
|
+
CommonModule,
|
|
3174
|
+
FormsModule,
|
|
3175
|
+
ReactiveFormsModule,
|
|
3176
|
+
KwikUIModule,
|
|
3177
|
+
KwikIDFormsModule
|
|
3178
|
+
]] });
|
|
3179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: TaskPreviewModule, decorators: [{
|
|
3180
|
+
type: NgModule,
|
|
3181
|
+
args: [{
|
|
3182
|
+
declarations: [TaskPreviewComponent],
|
|
3183
|
+
imports: [
|
|
3184
|
+
CommonModule,
|
|
3185
|
+
FormsModule,
|
|
3186
|
+
ReactiveFormsModule,
|
|
3187
|
+
KwikUIModule,
|
|
3188
|
+
KwikIDFormsModule
|
|
3189
|
+
],
|
|
3190
|
+
exports: [TaskPreviewComponent]
|
|
3191
|
+
}]
|
|
3192
|
+
}] });
|
|
3193
|
+
|
|
3194
|
+
class ComponentModule {
|
|
3195
|
+
}
|
|
3196
|
+
/** @nocollapse */ ComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3197
|
+
/** @nocollapse */ ComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ComponentModule, imports: [AgentInfoModule,
|
|
3198
|
+
BottomSheetModule,
|
|
3199
|
+
MapViewModule,
|
|
3200
|
+
PrimaryActionsModule,
|
|
3201
|
+
TaskDetailModule,
|
|
3202
|
+
TaskItemModule,
|
|
3203
|
+
TaskListModule,
|
|
3204
|
+
TaskListSearchModule,
|
|
3205
|
+
TaskPreviewModule], exports: [AgentInfoModule,
|
|
3206
|
+
BottomSheetModule,
|
|
3207
|
+
MapViewModule,
|
|
3208
|
+
PrimaryActionsModule,
|
|
3209
|
+
TaskDetailModule,
|
|
3210
|
+
TaskItemModule,
|
|
3211
|
+
TaskListModule,
|
|
3212
|
+
TaskListSearchModule,
|
|
3213
|
+
TaskPreviewModule] });
|
|
3214
|
+
/** @nocollapse */ ComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ComponentModule, imports: [[
|
|
3215
|
+
AgentInfoModule,
|
|
3216
|
+
BottomSheetModule,
|
|
3217
|
+
MapViewModule,
|
|
3218
|
+
PrimaryActionsModule,
|
|
3219
|
+
TaskDetailModule,
|
|
3220
|
+
TaskItemModule,
|
|
3221
|
+
TaskListModule,
|
|
3222
|
+
TaskListSearchModule,
|
|
3223
|
+
TaskPreviewModule
|
|
3224
|
+
], AgentInfoModule,
|
|
3225
|
+
BottomSheetModule,
|
|
3226
|
+
MapViewModule,
|
|
3227
|
+
PrimaryActionsModule,
|
|
3228
|
+
TaskDetailModule,
|
|
3229
|
+
TaskItemModule,
|
|
3230
|
+
TaskListModule,
|
|
3231
|
+
TaskListSearchModule,
|
|
3232
|
+
TaskPreviewModule] });
|
|
3233
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: ComponentModule, decorators: [{
|
|
3234
|
+
type: NgModule,
|
|
3235
|
+
args: [{
|
|
3236
|
+
declarations: [],
|
|
3237
|
+
imports: [
|
|
3238
|
+
AgentInfoModule,
|
|
3239
|
+
BottomSheetModule,
|
|
3240
|
+
MapViewModule,
|
|
3241
|
+
PrimaryActionsModule,
|
|
3242
|
+
TaskDetailModule,
|
|
3243
|
+
TaskItemModule,
|
|
3244
|
+
TaskListModule,
|
|
3245
|
+
TaskListSearchModule,
|
|
3246
|
+
TaskPreviewModule
|
|
3247
|
+
],
|
|
3248
|
+
exports: [
|
|
3249
|
+
AgentInfoModule,
|
|
3250
|
+
BottomSheetModule,
|
|
3251
|
+
MapViewModule,
|
|
3252
|
+
PrimaryActionsModule,
|
|
3253
|
+
TaskDetailModule,
|
|
3254
|
+
TaskItemModule,
|
|
3255
|
+
TaskListModule,
|
|
3256
|
+
TaskListSearchModule,
|
|
3257
|
+
TaskPreviewModule
|
|
3258
|
+
]
|
|
3259
|
+
}]
|
|
3260
|
+
}] });
|
|
3261
|
+
|
|
3262
|
+
class LayoutBodyModule {
|
|
3263
|
+
}
|
|
3264
|
+
/** @nocollapse */ LayoutBodyModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3265
|
+
/** @nocollapse */ LayoutBodyModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyModule, declarations: [LayoutBodyComponent], imports: [CommonModule,
|
|
3266
|
+
FormsModule,
|
|
3267
|
+
ReactiveFormsModule,
|
|
3268
|
+
KwikUIModule,
|
|
3269
|
+
KwikIDFormViewModule,
|
|
3270
|
+
ComponentModule,
|
|
3271
|
+
TuiSvgModule,
|
|
3272
|
+
TuiPreviewActionModule,
|
|
3273
|
+
TuiPreviewModule,
|
|
3274
|
+
TuiButtonModule], exports: [LayoutBodyComponent] });
|
|
3275
|
+
/** @nocollapse */ LayoutBodyModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyModule, imports: [[
|
|
3276
|
+
CommonModule,
|
|
3277
|
+
FormsModule,
|
|
3278
|
+
ReactiveFormsModule,
|
|
3279
|
+
KwikUIModule,
|
|
3280
|
+
KwikIDFormViewModule,
|
|
3281
|
+
ComponentModule,
|
|
3282
|
+
TuiSvgModule,
|
|
3283
|
+
TuiPreviewActionModule,
|
|
3284
|
+
TuiPreviewModule,
|
|
3285
|
+
TuiButtonModule
|
|
3286
|
+
]] });
|
|
3287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutBodyModule, decorators: [{
|
|
3288
|
+
type: NgModule,
|
|
3289
|
+
args: [{
|
|
3290
|
+
declarations: [LayoutBodyComponent],
|
|
3291
|
+
imports: [
|
|
3292
|
+
CommonModule,
|
|
3293
|
+
FormsModule,
|
|
3294
|
+
ReactiveFormsModule,
|
|
3295
|
+
KwikUIModule,
|
|
3296
|
+
KwikIDFormViewModule,
|
|
3297
|
+
ComponentModule,
|
|
3298
|
+
TuiSvgModule,
|
|
3299
|
+
TuiPreviewActionModule,
|
|
3300
|
+
TuiPreviewModule,
|
|
3301
|
+
TuiButtonModule
|
|
3302
|
+
],
|
|
3303
|
+
exports: [LayoutBodyComponent]
|
|
3304
|
+
}]
|
|
3305
|
+
}] });
|
|
3306
|
+
|
|
3307
|
+
class LayoutHeaderModule {
|
|
3308
|
+
}
|
|
3309
|
+
/** @nocollapse */ LayoutHeaderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3310
|
+
/** @nocollapse */ LayoutHeaderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderModule, declarations: [LayoutHeaderComponent], imports: [CommonModule,
|
|
3311
|
+
FormsModule,
|
|
3312
|
+
ReactiveFormsModule,
|
|
3313
|
+
KwikUIModule,
|
|
3314
|
+
KwikIDFormsModule,
|
|
3315
|
+
TuiActiveZoneModule,
|
|
3316
|
+
TuiGroupModule,
|
|
3317
|
+
TuiDropdownModule], exports: [LayoutHeaderComponent] });
|
|
3318
|
+
/** @nocollapse */ LayoutHeaderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderModule, imports: [[
|
|
3319
|
+
CommonModule,
|
|
3320
|
+
FormsModule,
|
|
3321
|
+
ReactiveFormsModule,
|
|
3322
|
+
KwikUIModule,
|
|
3323
|
+
KwikIDFormsModule,
|
|
3324
|
+
TuiActiveZoneModule,
|
|
3325
|
+
TuiGroupModule,
|
|
3326
|
+
TuiDropdownModule
|
|
3327
|
+
]] });
|
|
3328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutHeaderModule, decorators: [{
|
|
3329
|
+
type: NgModule,
|
|
3330
|
+
args: [{
|
|
3331
|
+
declarations: [LayoutHeaderComponent],
|
|
3332
|
+
imports: [
|
|
3333
|
+
CommonModule,
|
|
3334
|
+
FormsModule,
|
|
3335
|
+
ReactiveFormsModule,
|
|
3336
|
+
KwikUIModule,
|
|
3337
|
+
KwikIDFormsModule,
|
|
3338
|
+
TuiActiveZoneModule,
|
|
3339
|
+
TuiGroupModule,
|
|
3340
|
+
TuiDropdownModule
|
|
3341
|
+
],
|
|
3342
|
+
exports: [LayoutHeaderComponent]
|
|
3343
|
+
}]
|
|
3344
|
+
}] });
|
|
3345
|
+
|
|
3346
|
+
class LayoutModule {
|
|
3347
|
+
}
|
|
3348
|
+
/** @nocollapse */ LayoutModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3349
|
+
/** @nocollapse */ LayoutModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutModule, imports: [LayoutHeaderModule, LayoutBodyModule], exports: [LayoutHeaderModule, LayoutBodyModule] });
|
|
3350
|
+
/** @nocollapse */ LayoutModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutModule, imports: [[LayoutHeaderModule, LayoutBodyModule], LayoutHeaderModule, LayoutBodyModule] });
|
|
3351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: LayoutModule, decorators: [{
|
|
3352
|
+
type: NgModule,
|
|
3353
|
+
args: [{
|
|
3354
|
+
declarations: [],
|
|
3355
|
+
imports: [LayoutHeaderModule, LayoutBodyModule],
|
|
3356
|
+
exports: [LayoutHeaderModule, LayoutBodyModule]
|
|
3357
|
+
}]
|
|
3358
|
+
}] });
|
|
3359
|
+
|
|
3360
|
+
class KwikIDAgentDashboardModuleV2 {
|
|
3361
|
+
}
|
|
3362
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV2.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV2, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
3363
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV2.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV2, declarations: [KwikIDAgentDashboardComponentV2], imports: [CommonModule,
|
|
3364
|
+
FormsModule,
|
|
3365
|
+
ReactiveFormsModule,
|
|
3366
|
+
KwikUIModule,
|
|
3367
|
+
KwikIDFormsModule,
|
|
3368
|
+
LayoutModule,
|
|
3369
|
+
ComponentModule], exports: [KwikIDAgentDashboardComponentV2] });
|
|
3370
|
+
/** @nocollapse */ KwikIDAgentDashboardModuleV2.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV2, imports: [[
|
|
3371
|
+
CommonModule,
|
|
3372
|
+
FormsModule,
|
|
3373
|
+
ReactiveFormsModule,
|
|
3374
|
+
KwikUIModule,
|
|
3375
|
+
KwikIDFormsModule,
|
|
3376
|
+
LayoutModule,
|
|
3377
|
+
ComponentModule
|
|
3378
|
+
]] });
|
|
3379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModuleV2, decorators: [{
|
|
3380
|
+
type: NgModule,
|
|
3381
|
+
args: [{
|
|
3382
|
+
declarations: [KwikIDAgentDashboardComponentV2],
|
|
3383
|
+
imports: [
|
|
3384
|
+
CommonModule,
|
|
3385
|
+
FormsModule,
|
|
3386
|
+
ReactiveFormsModule,
|
|
3387
|
+
KwikUIModule,
|
|
3388
|
+
KwikIDFormsModule,
|
|
3389
|
+
LayoutModule,
|
|
3390
|
+
ComponentModule
|
|
3391
|
+
],
|
|
3392
|
+
exports: [KwikIDAgentDashboardComponentV2]
|
|
3393
|
+
}]
|
|
3394
|
+
}] });
|
|
3395
|
+
|
|
1235
3396
|
class KwikIDAgentDashboardModule {
|
|
1236
3397
|
}
|
|
1237
3398
|
/** @nocollapse */ KwikIDAgentDashboardModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1238
|
-
/** @nocollapse */ KwikIDAgentDashboardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, declarations: [KwikIDAgentDashboardComponent,
|
|
1239
|
-
CustomerListComponent,
|
|
1240
|
-
CustomerTileComponent,
|
|
1241
|
-
Ng2SearchPipe,
|
|
1242
|
-
StatusPillComponent,
|
|
1243
|
-
CustomerDetailsComponent], imports: [CommonModule,
|
|
3399
|
+
/** @nocollapse */ KwikIDAgentDashboardModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, declarations: [KwikIDAgentDashboardComponent], imports: [CommonModule,
|
|
1244
3400
|
HttpClientModule,
|
|
1245
3401
|
FormsModule,
|
|
1246
3402
|
ReactiveFormsModule,
|
|
@@ -1263,7 +3419,9 @@ class KwikIDAgentDashboardModule {
|
|
|
1263
3419
|
ScrollingModule,
|
|
1264
3420
|
GoogleMapsModule,
|
|
1265
3421
|
HttpClientModule,
|
|
1266
|
-
HttpClientJsonpModule
|
|
3422
|
+
HttpClientJsonpModule,
|
|
3423
|
+
KwikIDAgentDashboardModuleV1,
|
|
3424
|
+
KwikIDAgentDashboardModuleV2], exports: [KwikIDAgentDashboardComponent] });
|
|
1267
3425
|
/** @nocollapse */ KwikIDAgentDashboardModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, imports: [[
|
|
1268
3426
|
CommonModule,
|
|
1269
3427
|
HttpClientModule,
|
|
@@ -1288,19 +3446,14 @@ class KwikIDAgentDashboardModule {
|
|
|
1288
3446
|
ScrollingModule,
|
|
1289
3447
|
GoogleMapsModule,
|
|
1290
3448
|
HttpClientModule,
|
|
1291
|
-
HttpClientJsonpModule
|
|
3449
|
+
HttpClientJsonpModule,
|
|
3450
|
+
KwikIDAgentDashboardModuleV1,
|
|
3451
|
+
KwikIDAgentDashboardModuleV2
|
|
1292
3452
|
]] });
|
|
1293
3453
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: KwikIDAgentDashboardModule, decorators: [{
|
|
1294
3454
|
type: NgModule,
|
|
1295
3455
|
args: [{
|
|
1296
|
-
declarations: [
|
|
1297
|
-
KwikIDAgentDashboardComponent,
|
|
1298
|
-
CustomerListComponent,
|
|
1299
|
-
CustomerTileComponent,
|
|
1300
|
-
Ng2SearchPipe,
|
|
1301
|
-
StatusPillComponent,
|
|
1302
|
-
CustomerDetailsComponent
|
|
1303
|
-
],
|
|
3456
|
+
declarations: [KwikIDAgentDashboardComponent],
|
|
1304
3457
|
imports: [
|
|
1305
3458
|
CommonModule,
|
|
1306
3459
|
HttpClientModule,
|
|
@@ -1325,7 +3478,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImpo
|
|
|
1325
3478
|
ScrollingModule,
|
|
1326
3479
|
GoogleMapsModule,
|
|
1327
3480
|
HttpClientModule,
|
|
1328
|
-
HttpClientJsonpModule
|
|
3481
|
+
HttpClientJsonpModule,
|
|
3482
|
+
KwikIDAgentDashboardModuleV1,
|
|
3483
|
+
KwikIDAgentDashboardModuleV2
|
|
1329
3484
|
],
|
|
1330
3485
|
exports: [KwikIDAgentDashboardComponent]
|
|
1331
3486
|
}]
|