tango-app-ui-manage-tickets 3.7.0-beta.60 → 3.7.0-beta.62
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/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +98 -0
- package/esm2022/lib/components/audit-log/audit-log.component.mjs +11 -0
- package/esm2022/lib/components/audit-mapping-list/audit-mapping-list.component.mjs +486 -0
- package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +298 -0
- package/esm2022/lib/components/audit-report-popup/audit-report-popup.component.mjs +389 -0
- package/esm2022/lib/components/audit-retag/audit-retag.component.mjs +472 -0
- package/esm2022/lib/components/comment-model/comment-model.component.mjs +58 -0
- package/esm2022/lib/components/count/count.component.mjs +89 -0
- package/esm2022/lib/components/custom-select/custom-select.component.mjs +187 -0
- package/esm2022/lib/components/filter-options/filter-options.component.mjs +41 -0
- package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +1061 -0
- package/esm2022/lib/components/footfall-dicview/footfall-dicview.component.mjs +1014 -0
- package/esm2022/lib/components/footfall-popup/footfall-popup.component.mjs +15 -0
- package/esm2022/lib/components/group-select/group-select.component.mjs +155 -0
- package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +96 -0
- package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +108 -0
- package/esm2022/lib/components/remove-audit/remove-audit.component.mjs +81 -0
- package/esm2022/lib/components/start-audit/start-audit.component.mjs +761 -0
- package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +131 -0
- package/esm2022/lib/components/ticket-filter-panel/ticket-filter-panel.component.mjs +435 -0
- package/esm2022/lib/components/ticket-footfall-new/ticket-footfall-new.component.mjs +2748 -0
- package/esm2022/lib/components/ticketclosepopup/ticketclosepopup.component.mjs +43 -0
- package/esm2022/lib/components/tickets/tickets.component.mjs +847 -0
- package/esm2022/lib/components/viewcategory/viewcategory.component.mjs +89 -0
- package/esm2022/lib/services/audit.service.mjs +88 -0
- package/esm2022/lib/services/excel.service.mjs +45 -0
- package/esm2022/lib/services/ticket.service.mjs +319 -0
- package/esm2022/lib/services/timer.service.mjs +84 -0
- package/esm2022/lib/tango-manage-tickets-routing.module.mjs +44 -0
- package/esm2022/lib/tango-manage-tickets.module.mjs +109 -0
- package/esm2022/public-api.mjs +6 -0
- package/esm2022/tango-app-ui-manage-tickets.mjs +5 -0
- package/fesm2022/tango-app-ui-manage-tickets.mjs +10165 -0
- package/fesm2022/tango-app-ui-manage-tickets.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +30 -0
- package/lib/components/audit-log/audit-log.component.d.ts +5 -0
- package/lib/components/audit-mapping-list/audit-mapping-list.component.d.ts +73 -0
- package/lib/components/audit-metrics/audit-metrics.component.d.ts +59 -0
- package/lib/components/audit-report-popup/audit-report-popup.component.d.ts +52 -0
- package/lib/components/audit-retag/audit-retag.component.d.ts +59 -0
- package/lib/components/comment-model/comment-model.component.d.ts +17 -0
- package/lib/components/count/count.component.d.ts +23 -0
- package/lib/components/custom-select/custom-select.component.d.ts +35 -0
- package/lib/components/filter-options/filter-options.component.d.ts +15 -0
- package/lib/components/footfall-dic/footfall-dic.component.d.ts +143 -0
- package/lib/components/footfall-dicview/footfall-dicview.component.d.ts +132 -0
- package/lib/components/footfall-popup/footfall-popup.component.d.ts +8 -0
- package/lib/components/group-select/group-select.component.d.ts +33 -0
- package/lib/components/re-trigger/re-trigger.component.d.ts +32 -0
- package/lib/components/reactive-select/reactive-select.component.d.ts +32 -0
- package/lib/components/remove-audit/remove-audit.component.d.ts +16 -0
- package/lib/components/start-audit/start-audit.component.d.ts +86 -0
- package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +28 -0
- package/lib/components/ticket-filter-panel/ticket-filter-panel.component.d.ts +79 -0
- package/lib/components/ticket-footfall-new/ticket-footfall-new.component.d.ts +287 -0
- package/lib/components/ticketclosepopup/ticketclosepopup.component.d.ts +15 -0
- package/lib/components/tickets/tickets.component.d.ts +88 -0
- package/lib/components/viewcategory/viewcategory.component.d.ts +16 -0
- package/lib/services/audit.service.d.ts +36 -0
- package/lib/services/excel.service.d.ts +10 -0
- package/lib/services/ticket.service.d.ts +87 -0
- package/lib/services/timer.service.d.ts +22 -0
- package/lib/tango-manage-tickets-routing.module.d.ts +7 -0
- package/lib/tango-manage-tickets.module.d.ts +38 -0
- package/package.json +25 -12
- package/{src/public-api.ts → public-api.d.ts} +2 -8
- package/.eslintrc.json +0 -37
- package/ng-package.json +0 -7
- package/src/lib/components/add-csm-modal/add-csm-modal.component.html +0 -32
- package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +0 -14
- package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +0 -23
- package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +0 -94
- package/src/lib/components/audit-log/audit-log.component.html +0 -1
- package/src/lib/components/audit-log/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log/audit-log.component.spec.ts +0 -23
- package/src/lib/components/audit-log/audit-log.component.ts +0 -10
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +0 -234
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +0 -186
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +0 -23
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +0 -520
- package/src/lib/components/audit-metrics/audit-metrics.component.html +0 -345
- package/src/lib/components/audit-metrics/audit-metrics.component.scss +0 -34
- package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +0 -23
- package/src/lib/components/audit-metrics/audit-metrics.component.ts +0 -292
- package/src/lib/components/audit-report-popup/audit-report-popup.component.html +0 -111
- package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +0 -101
- package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +0 -23
- package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +0 -397
- package/src/lib/components/audit-retag/audit-retag.component.html +0 -129
- package/src/lib/components/audit-retag/audit-retag.component.scss +0 -146
- package/src/lib/components/audit-retag/audit-retag.component.spec.ts +0 -23
- package/src/lib/components/audit-retag/audit-retag.component.ts +0 -489
- package/src/lib/components/comment-model/comment-model.component.html +0 -24
- package/src/lib/components/comment-model/comment-model.component.scss +0 -20
- package/src/lib/components/comment-model/comment-model.component.spec.ts +0 -23
- package/src/lib/components/comment-model/comment-model.component.ts +0 -53
- package/src/lib/components/count/count.component.html +0 -54
- package/src/lib/components/count/count.component.scss +0 -14
- package/src/lib/components/count/count.component.spec.ts +0 -23
- package/src/lib/components/count/count.component.ts +0 -82
- package/src/lib/components/custom-select/custom-select.component.html +0 -134
- package/src/lib/components/custom-select/custom-select.component.scss +0 -204
- package/src/lib/components/custom-select/custom-select.component.spec.ts +0 -23
- package/src/lib/components/custom-select/custom-select.component.ts +0 -189
- package/src/lib/components/filter-options/filter-options.component.html +0 -51
- package/src/lib/components/filter-options/filter-options.component.scss +0 -102
- package/src/lib/components/filter-options/filter-options.component.spec.ts +0 -23
- package/src/lib/components/filter-options/filter-options.component.ts +0 -38
- package/src/lib/components/footfall-dic/footfall-dic.component.html +0 -1275
- package/src/lib/components/footfall-dic/footfall-dic.component.scss +0 -273
- package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +0 -23
- package/src/lib/components/footfall-dic/footfall-dic.component.ts +0 -1206
- package/src/lib/components/footfall-dicview/footfall-dicview.component.html +0 -1136
- package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +0 -416
- package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +0 -23
- package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +0 -1168
- package/src/lib/components/footfall-popup/footfall-popup.component.html +0 -61
- package/src/lib/components/footfall-popup/footfall-popup.component.scss +0 -20
- package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +0 -23
- package/src/lib/components/footfall-popup/footfall-popup.component.ts +0 -12
- package/src/lib/components/group-select/group-select.component.html +0 -44
- package/src/lib/components/group-select/group-select.component.scss +0 -144
- package/src/lib/components/group-select/group-select.component.spec.ts +0 -23
- package/src/lib/components/group-select/group-select.component.ts +0 -145
- package/src/lib/components/re-trigger/re-trigger.component.html +0 -53
- package/src/lib/components/re-trigger/re-trigger.component.scss +0 -16
- package/src/lib/components/re-trigger/re-trigger.component.spec.ts +0 -23
- package/src/lib/components/re-trigger/re-trigger.component.ts +0 -96
- package/src/lib/components/reactive-select/reactive-select.component.html +0 -18
- package/src/lib/components/reactive-select/reactive-select.component.scss +0 -52
- package/src/lib/components/reactive-select/reactive-select.component.spec.ts +0 -23
- package/src/lib/components/reactive-select/reactive-select.component.ts +0 -104
- package/src/lib/components/remove-audit/remove-audit.component.html +0 -38
- package/src/lib/components/remove-audit/remove-audit.component.scss +0 -27
- package/src/lib/components/remove-audit/remove-audit.component.spec.ts +0 -23
- package/src/lib/components/remove-audit/remove-audit.component.ts +0 -81
- package/src/lib/components/start-audit/start-audit.component.html +0 -174
- package/src/lib/components/start-audit/start-audit.component.scss +0 -185
- package/src/lib/components/start-audit/start-audit.component.spec.ts +0 -23
- package/src/lib/components/start-audit/start-audit.component.ts +0 -761
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +0 -43
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +0 -35
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +0 -23
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +0 -118
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +0 -386
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +0 -87
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +0 -23
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +0 -494
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +0 -4743
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +0 -1208
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +0 -23
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +0 -3351
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +0 -100
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +0 -34
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +0 -23
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +0 -48
- package/src/lib/components/tickets/tickets.component.html +0 -451
- package/src/lib/components/tickets/tickets.component.scss +0 -131
- package/src/lib/components/tickets/tickets.component.spec.ts +0 -23
- package/src/lib/components/tickets/tickets.component.ts +0 -809
- package/src/lib/components/viewcategory/viewcategory.component.html +0 -38
- package/src/lib/components/viewcategory/viewcategory.component.scss +0 -29
- package/src/lib/components/viewcategory/viewcategory.component.spec.ts +0 -23
- package/src/lib/components/viewcategory/viewcategory.component.ts +0 -79
- package/src/lib/services/audit.service.spec.ts +0 -16
- package/src/lib/services/audit.service.ts +0 -98
- package/src/lib/services/excel.service.ts +0 -48
- package/src/lib/services/ticket.service.spec.ts +0 -16
- package/src/lib/services/ticket.service.ts +0 -501
- package/src/lib/services/timer.service.spec.ts +0 -16
- package/src/lib/services/timer.service.ts +0 -92
- package/src/lib/tango-manage-tickets-routing.module.ts +0 -37
- package/src/lib/tango-manage-tickets.module.ts +0 -68
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -1,520 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, OnChanges, SimpleChanges, OnDestroy, ChangeDetectorRef, ViewChild } from '@angular/core';
|
|
2
|
-
import { ActivatedRoute, Router } from '@angular/router';
|
|
3
|
-
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
|
4
|
-
import { ToastService } from 'tango-app-ui-shared';
|
|
5
|
-
import { AuditService } from '../../services/audit.service';
|
|
6
|
-
import * as LZString from 'lz-string';
|
|
7
|
-
// import { AuditReportPopupComponent } from '../audit-report-popup/audit-report-popup.component';
|
|
8
|
-
import { Subject, takeUntil, Subscription } from 'rxjs';
|
|
9
|
-
import { TimerService } from '../../services/timer.service';
|
|
10
|
-
import { AuditReportPopupComponent } from '../audit-report-popup/audit-report-popup.component';
|
|
11
|
-
|
|
12
|
-
@Component({
|
|
13
|
-
selector: 'lib-audit-mapping-list',
|
|
14
|
-
templateUrl: './audit-mapping-list.component.html',
|
|
15
|
-
styleUrl: './audit-mapping-list.component.scss'
|
|
16
|
-
})
|
|
17
|
-
export class AuditMappingListComponent {
|
|
18
|
-
|
|
19
|
-
totalfile = 0;
|
|
20
|
-
customer = 0;
|
|
21
|
-
junk = 0;
|
|
22
|
-
employee = 0;
|
|
23
|
-
currentValue: any = 0;
|
|
24
|
-
showvalue: boolean = false;
|
|
25
|
-
retggingpage: boolean = false;
|
|
26
|
-
showvalue1: boolean = false;
|
|
27
|
-
junkimage: any = []
|
|
28
|
-
retagimage: any = []
|
|
29
|
-
submitvalue: boolean = true;
|
|
30
|
-
auditmappingdata: any;
|
|
31
|
-
customercount: any;
|
|
32
|
-
auditLoading = true;
|
|
33
|
-
selectedType: any;
|
|
34
|
-
|
|
35
|
-
junkcount: any = 0;
|
|
36
|
-
employeecount: any = 0;
|
|
37
|
-
employeimage: any = [];
|
|
38
|
-
filedetails: any;
|
|
39
|
-
demographic: any;
|
|
40
|
-
submitted: boolean = false;
|
|
41
|
-
dummymapping: any;
|
|
42
|
-
private readonly destroy$ = new Subject();
|
|
43
|
-
timePassed: number = 0;
|
|
44
|
-
subscription: Subscription | null = null;
|
|
45
|
-
formattedTime: string = '00:00:00';
|
|
46
|
-
count: any;
|
|
47
|
-
category: any = []
|
|
48
|
-
@ViewChild('confirmDraft') confirmDraft: any;
|
|
49
|
-
|
|
50
|
-
constructor(public modalService: NgbModal, private router: Router, private auditService: AuditService, private toastr: ToastService, private route: ActivatedRoute,
|
|
51
|
-
private cd: ChangeDetectorRef, private timerService: TimerService) {
|
|
52
|
-
this.selectedType = this.route.snapshot.paramMap.get('type')
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
ngOnInit(): void {
|
|
56
|
-
this.getAuditConfig()
|
|
57
|
-
// this.initial_data_loading();
|
|
58
|
-
if (this.retagimage.length > 0) {
|
|
59
|
-
this.showvalue = true
|
|
60
|
-
}
|
|
61
|
-
this.setTimer();
|
|
62
|
-
}
|
|
63
|
-
getAuditConfig() {
|
|
64
|
-
|
|
65
|
-
let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
|
|
66
|
-
this.auditService.getAuditconfig(filedata?.filedetails?.clientId).pipe(takeUntil(this.destroy$)).subscribe({
|
|
67
|
-
next: (res: any) => {
|
|
68
|
-
if (res && res?.code == 200) {
|
|
69
|
-
this.category = res.data.footfallDirectoryConfigs.taggingLimitation
|
|
70
|
-
// this.initial_data_loading()
|
|
71
|
-
// this.saveDraftimg();
|
|
72
|
-
this.getmappingdata()
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
}
|
|
78
|
-
setTimer() {
|
|
79
|
-
this.subscription = this.timerService.getTimePassed().subscribe(time => {
|
|
80
|
-
this.timePassed = time;
|
|
81
|
-
this.formattedTime = this.timerService.formatTime(time);
|
|
82
|
-
this.cd.detectChanges();
|
|
83
|
-
});
|
|
84
|
-
this.timerService.startTimer();
|
|
85
|
-
document.addEventListener('mousemove', this.handleGlobalMouseEvent);
|
|
86
|
-
document.addEventListener('click', this.handleGlobalMouseEvent);
|
|
87
|
-
document.addEventListener('mouseenter', this.handleGlobalMouseEvent);
|
|
88
|
-
document.addEventListener('scroll', this.handleGlobalMouseEvent);
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
ngOnDestroy(): void {
|
|
93
|
-
this.destroy$.next(true);
|
|
94
|
-
this.destroy$.complete();
|
|
95
|
-
document.removeEventListener('mousemove', this.handleGlobalMouseEvent);
|
|
96
|
-
document.removeEventListener('click', this.handleGlobalMouseEvent);
|
|
97
|
-
document.removeEventListener('mouseenter', this.handleGlobalMouseEvent);
|
|
98
|
-
document.removeEventListener('scroll', this.handleGlobalMouseEvent);
|
|
99
|
-
this.timerService.clearTimer()
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
handleGlobalMouseEvent = (): void => {
|
|
103
|
-
this.timerService.startTimer();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
initial_data_loading() {
|
|
107
|
-
if ('audit' in sessionStorage) {
|
|
108
|
-
let stringifydata = sessionStorage.getItem('audit') || '{}'
|
|
109
|
-
const decompressedData = LZString.decompress(stringifydata);
|
|
110
|
-
var auditdata = JSON.parse(decompressedData || '{}')
|
|
111
|
-
if (auditdata.length > 0) {
|
|
112
|
-
this.auditmappingdata = auditdata;
|
|
113
|
-
this.customercount = this.auditmappingdata.length
|
|
114
|
-
} else {
|
|
115
|
-
this.auditmappingdata = []
|
|
116
|
-
this.customercount = 0
|
|
117
|
-
}
|
|
118
|
-
this.demographic = this.auditmappingdata.filter((data: any) => data.demographic === 'd').length;
|
|
119
|
-
}
|
|
120
|
-
this.category.map((data: any) => {
|
|
121
|
-
var count = JSON.parse(sessionStorage.getItem(data?.type) || '{}')
|
|
122
|
-
data.count = count?.length
|
|
123
|
-
})
|
|
124
|
-
if ('retag' in sessionStorage) {
|
|
125
|
-
var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
126
|
-
if (retagdata.length > 0) {
|
|
127
|
-
this.retagimage = retagdata;
|
|
128
|
-
} else {
|
|
129
|
-
this.retagimage = [];
|
|
130
|
-
if (this.retagimage.length == 0) {
|
|
131
|
-
this.showvalue = false
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if ('totalfiles' in sessionStorage) {
|
|
136
|
-
var files = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
|
|
137
|
-
this.totalfile = files?.totalfiles
|
|
138
|
-
this.filedetails = files?.filedetails
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
getmappingdata() {
|
|
144
|
-
var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
|
|
145
|
-
this.filedetails = totalfile?.filedetails
|
|
146
|
-
|
|
147
|
-
var payload: any = {
|
|
148
|
-
storeId: totalfile?.filedetails?.storeId,
|
|
149
|
-
fileDate: totalfile?.filedetails?.Date,
|
|
150
|
-
auditId: totalfile?.auditId,
|
|
151
|
-
count: totalfile?.totalfiles
|
|
152
|
-
}
|
|
153
|
-
this.auditService.getAuditmappinglist(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
154
|
-
next: (res: any) => {
|
|
155
|
-
if (res && res?.code == 200) {
|
|
156
|
-
this.auditLoading = false;
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
this.category.map((data: any) => {
|
|
162
|
-
let filterData = res?.data?.result?.draftedData?.filter((x: any) => x.type === data.type)
|
|
163
|
-
data.value = filterData[0]?.value && filterData[0]?.value.length > 0 ? filterData[0]?.value : []
|
|
164
|
-
data.count = data?.value?.length
|
|
165
|
-
sessionStorage.setItem(data?.type, JSON.stringify(data?.value && data?.value.length > 0 ? data?.value : []))
|
|
166
|
-
|
|
167
|
-
})
|
|
168
|
-
let customerData = res?.data?.result?.draftedData?.filter((x: any) => x.type === 'customer')
|
|
169
|
-
|
|
170
|
-
this.auditmappingdata = customerData[0]?.value
|
|
171
|
-
const jsonString = JSON.stringify(customerData[0]?.value);
|
|
172
|
-
const compressedData = LZString.compress(jsonString);
|
|
173
|
-
sessionStorage.setItem('audit', compressedData)
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var retagiamge = JSON.parse(sessionStorage.getItem('retag') || '[]')
|
|
178
|
-
if (retagiamge.length > 0) {
|
|
179
|
-
let stringifydata = sessionStorage.getItem('audit') || '{}'
|
|
180
|
-
const decompressedData = LZString.decompress(stringifydata);
|
|
181
|
-
var customer = JSON.parse(decompressedData || '{}')
|
|
182
|
-
customer = [...customer, ...retagiamge]
|
|
183
|
-
const jsonString = JSON.stringify(customer);
|
|
184
|
-
const compressedData = LZString.compress(jsonString);
|
|
185
|
-
sessionStorage.setItem('audit', compressedData)
|
|
186
|
-
}
|
|
187
|
-
sessionStorage.removeItem('retag')
|
|
188
|
-
this.retagimage = []
|
|
189
|
-
this.initial_data_loading()
|
|
190
|
-
if (this.retagimage.length == 0) {
|
|
191
|
-
this.showvalue = false
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
error: (err: any) => {
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
})
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
redireact: boolean = false;
|
|
202
|
-
|
|
203
|
-
backToTagging() {
|
|
204
|
-
this.redireact = true;
|
|
205
|
-
this.saveDraftimg();
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
changesdata() {
|
|
209
|
-
var user = JSON.parse(localStorage.getItem('user-info') || '{}')
|
|
210
|
-
var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
|
|
211
|
-
var payload: any = {
|
|
212
|
-
storeId: totalfile?.filedetails?.storeId,
|
|
213
|
-
fileDate: totalfile?.filedetails?.Date,
|
|
214
|
-
auditId: totalfile?.auditId,
|
|
215
|
-
count: totalfile?.totalfiles
|
|
216
|
-
}
|
|
217
|
-
this.auditService.getAuditmappinglist(payload).pipe(takeUntil(this.destroy$)).subscribe({
|
|
218
|
-
next: (res: any) => {
|
|
219
|
-
if (res && res?.code == 200) {
|
|
220
|
-
this.auditLoading = false;
|
|
221
|
-
sessionStorage.removeItem('retag')
|
|
222
|
-
this.retagimage = []
|
|
223
|
-
this.category.map((data: any) => {
|
|
224
|
-
let filterData = res?.data?.result?.draftedData?.filter((x: any) => x.type === data.type)
|
|
225
|
-
data.value = filterData[0]?.value && filterData[0]?.value.length > 0 ? filterData[0]?.value : []
|
|
226
|
-
data.count = data?.value?.length
|
|
227
|
-
sessionStorage.setItem(data?.type, JSON.stringify(data?.value && data?.value.length > 0 ? data?.value : []))
|
|
228
|
-
|
|
229
|
-
})
|
|
230
|
-
let customerData = res?.data?.result?.draftedData?.filter((x: any) => x.type === 'customer')
|
|
231
|
-
|
|
232
|
-
this.auditmappingdata = customerData[0]?.value
|
|
233
|
-
const jsonString = JSON.stringify(customerData[0]?.value);
|
|
234
|
-
const compressedData = LZString.compress(jsonString);
|
|
235
|
-
sessionStorage.setItem('audit', compressedData)
|
|
236
|
-
if (this.retagimage.length == 0) {
|
|
237
|
-
this.showvalue = false
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
this.router.navigate(["/manage/tickets/audit"])
|
|
241
|
-
}
|
|
242
|
-
},
|
|
243
|
-
error: (err: any) => {
|
|
244
|
-
|
|
245
|
-
}
|
|
246
|
-
})
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
251
|
-
if (changes['auditmappingdata']) {
|
|
252
|
-
this.dummymapping = JSON.parse(JSON.stringify(changes['auditmappingdata'].currentValue));
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
allowDrop(ev: any) {
|
|
257
|
-
ev.preventDefault();
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
drag(ev: any) {
|
|
261
|
-
ev.dataTransfer.setData("text/plain", ev.target.id);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
dropforretag(ev: any) {
|
|
265
|
-
ev.preventDefault();
|
|
266
|
-
const draggedImageId = ev.dataTransfer.getData('text/plain');
|
|
267
|
-
const draggedImage = document.getElementById(draggedImageId);
|
|
268
|
-
this.showvalue = true;
|
|
269
|
-
const htmltag = ev.dataTransfer.getData('text/html');
|
|
270
|
-
var Name = getTagNameFromHTML(htmltag);
|
|
271
|
-
if (Name != null && this.category.filter((data: any) => data?.type === Name)?.length > 0) {
|
|
272
|
-
|
|
273
|
-
let imageData = JSON.parse(sessionStorage.getItem(Name) || '{}')
|
|
274
|
-
var splicedvalue = imageData.splice(imageData.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId), 1);
|
|
275
|
-
|
|
276
|
-
this.category.map((data: any) => {
|
|
277
|
-
if (data?.type == Name) {
|
|
278
|
-
data.value = imageData
|
|
279
|
-
data.count = imageData.length
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
})
|
|
283
|
-
sessionStorage.setItem(Name, JSON.stringify(imageData))
|
|
284
|
-
var oldretag = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
285
|
-
var newtag: any = []
|
|
286
|
-
if (Number(oldretag.length) > 0) {
|
|
287
|
-
newtag = [...oldretag, ...splicedvalue]
|
|
288
|
-
} else {
|
|
289
|
-
newtag = splicedvalue
|
|
290
|
-
}
|
|
291
|
-
this.retagimage = newtag
|
|
292
|
-
sessionStorage.setItem('retag', JSON.stringify(this.retagimage))
|
|
293
|
-
|
|
294
|
-
} else if (Name != null) {
|
|
295
|
-
var insertIndex = this.auditmappingdata.findIndex(({ img_id }: { img_id: string }) => img_id == Name)
|
|
296
|
-
var mainarray = this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_id }: { img_id: string }) => img_id == Name), 1);
|
|
297
|
-
this.customercount = this.auditmappingdata?.length;
|
|
298
|
-
if (mainarray?.length > 0 && mainarray[0].mappedid.length > 1) {
|
|
299
|
-
var checkindex = mainarray[0].mappedid.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId)
|
|
300
|
-
|
|
301
|
-
var subarray = mainarray[0].mappedid.splice(mainarray[0].mappedid.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId), 1);
|
|
302
|
-
if (checkindex == 0) {
|
|
303
|
-
mainarray[0].img_name = mainarray[0].mappedid[0].img_name
|
|
304
|
-
mainarray[0].img_id = mainarray[0].mappedid[0].img_id
|
|
305
|
-
mainarray[0].img_path = mainarray[0].mappedid[0].img_path
|
|
306
|
-
}
|
|
307
|
-
mainarray[0].count = mainarray[0].count - 1
|
|
308
|
-
subarray[0].mappedid = []
|
|
309
|
-
let obj = {
|
|
310
|
-
img_name: subarray[0].img_name,
|
|
311
|
-
img_id: subarray[0].img_id,
|
|
312
|
-
img_path: subarray[0].img_path
|
|
313
|
-
}
|
|
314
|
-
subarray[0].mappedid.push(obj)
|
|
315
|
-
subarray[0].selected = false
|
|
316
|
-
subarray[0].dropped = false
|
|
317
|
-
subarray[0].demographic = ''
|
|
318
|
-
subarray[0].count = 1;
|
|
319
|
-
var oldretag = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
320
|
-
var newtag: any = []
|
|
321
|
-
if (Number(oldretag.length) > 0) {
|
|
322
|
-
newtag = [...oldretag, ...subarray]
|
|
323
|
-
} else {
|
|
324
|
-
newtag = subarray
|
|
325
|
-
}
|
|
326
|
-
this.retagimage = newtag
|
|
327
|
-
sessionStorage.setItem('retag', JSON.stringify(this.retagimage))
|
|
328
|
-
this.auditmappingdata.splice(insertIndex, 0, ...mainarray);
|
|
329
|
-
const jsonString = JSON.stringify(this.auditmappingdata);
|
|
330
|
-
const compressedData = LZString.compress(jsonString);
|
|
331
|
-
sessionStorage.setItem('audit', compressedData)
|
|
332
|
-
} else {
|
|
333
|
-
|
|
334
|
-
var oldretag = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
335
|
-
var newtag: any = []
|
|
336
|
-
if (Number(oldretag.length) > 0) {
|
|
337
|
-
newtag = [...oldretag, ...mainarray]
|
|
338
|
-
} else {
|
|
339
|
-
newtag = mainarray
|
|
340
|
-
}
|
|
341
|
-
this.retagimage = newtag
|
|
342
|
-
sessionStorage.setItem('retag', JSON.stringify(this.retagimage))
|
|
343
|
-
const jsonString = JSON.stringify(this.auditmappingdata);
|
|
344
|
-
const compressedData = LZString.compress(jsonString);
|
|
345
|
-
sessionStorage.setItem('audit', compressedData)
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
function getTagNameFromHTML(html: any) {
|
|
350
|
-
var tempElement = document.createElement('div');
|
|
351
|
-
tempElement.innerHTML = html;
|
|
352
|
-
var firstChild: any = tempElement.firstChild;
|
|
353
|
-
if (firstChild.hasAttribute('name')) {
|
|
354
|
-
var namePropertyValue = firstChild.getAttribute('name');
|
|
355
|
-
return namePropertyValue;
|
|
356
|
-
}
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
sessionStorage.setItem('retag', JSON.stringify(this.retagimage))
|
|
360
|
-
|
|
361
|
-
if ('retag' in sessionStorage) {
|
|
362
|
-
var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
363
|
-
this.retagimage = retagdata;
|
|
364
|
-
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
removeimage(data: any) {
|
|
369
|
-
var removed_img = this.retagimage.filter((ev: any) => ev.img_id == data.img_id)
|
|
370
|
-
this.retagimage.splice(this.retagimage.findIndex(({ img_id }: { img_id: string }) => img_id == data.img_id), 1);
|
|
371
|
-
this.auditmappingdata = [...this.auditmappingdata, ...removed_img]
|
|
372
|
-
this.customercount = this.auditmappingdata?.length;
|
|
373
|
-
if (!this.retagimage.length) { this.showvalue = false }
|
|
374
|
-
let stringifydata = sessionStorage.getItem('audit') || '{}'
|
|
375
|
-
const decompressedData = LZString.decompress(stringifydata);
|
|
376
|
-
const completeDate = JSON.parse(decompressedData || '{}')
|
|
377
|
-
const jsonString = JSON.stringify(this.auditmappingdata);
|
|
378
|
-
const compressedData = LZString.compress(jsonString);
|
|
379
|
-
sessionStorage.setItem('audit', compressedData)
|
|
380
|
-
sessionStorage.setItem('retag', JSON.stringify(this.retagimage))
|
|
381
|
-
this.cd.detectChanges();
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
saveDraftimg() {
|
|
385
|
-
this.submitted = true;
|
|
386
|
-
|
|
387
|
-
var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
|
|
388
|
-
this.timePassed = JSON.parse(sessionStorage.getItem('timeSpent') || '{}')
|
|
389
|
-
if ('retag' in sessionStorage) {
|
|
390
|
-
var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
391
|
-
this.retagimage = retagdata;
|
|
392
|
-
}
|
|
393
|
-
let storedData = [
|
|
394
|
-
{
|
|
395
|
-
type: "customer",
|
|
396
|
-
value: this.auditmappingdata ? this.auditmappingdata : [],
|
|
397
|
-
}
|
|
398
|
-
]
|
|
399
|
-
|
|
400
|
-
this.category.map((data: any) => {
|
|
401
|
-
let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '{}');
|
|
402
|
-
storedData.push({
|
|
403
|
-
type: data.type,
|
|
404
|
-
value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
|
|
405
|
-
})
|
|
406
|
-
})
|
|
407
|
-
var inserobj: any = {
|
|
408
|
-
storeId: totalfile?.filedetails?.storeId,
|
|
409
|
-
fileDate: totalfile?.filedetails?.Date,
|
|
410
|
-
auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails?.auditId,
|
|
411
|
-
totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
|
|
412
|
-
retagCount: this.retagimage.length,
|
|
413
|
-
timeSpent: this.timePassed,
|
|
414
|
-
retagImage: this.retagimage ? this.retagimage : []
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
this.auditService.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
418
|
-
if (!this.redireact) {
|
|
419
|
-
this.submitted = false;
|
|
420
|
-
this.getmappingdata()
|
|
421
|
-
} else {
|
|
422
|
-
this.changesdata()
|
|
423
|
-
}
|
|
424
|
-
})
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
taggingview() {
|
|
429
|
-
this.submitted = true;
|
|
430
|
-
var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
|
|
431
|
-
this.showvalue = false;
|
|
432
|
-
this.showvalue1 = true;
|
|
433
|
-
this.retggingpage = true;
|
|
434
|
-
let stringifydata = sessionStorage.getItem('audit') || '{}'
|
|
435
|
-
const decompressedData = LZString.decompress(stringifydata);
|
|
436
|
-
var customer = JSON.parse(decompressedData || '{}')
|
|
437
|
-
let storedData = [
|
|
438
|
-
{
|
|
439
|
-
type: "customer",
|
|
440
|
-
value: customer ? customer : [],
|
|
441
|
-
}
|
|
442
|
-
]
|
|
443
|
-
|
|
444
|
-
this.category.map((data: any) => {
|
|
445
|
-
let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '{}');
|
|
446
|
-
storedData.push({
|
|
447
|
-
type: data.type,
|
|
448
|
-
value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
|
|
449
|
-
})
|
|
450
|
-
})
|
|
451
|
-
var inserobj: any = {
|
|
452
|
-
storeId: totalfile?.filedetails?.store_id,
|
|
453
|
-
fileDate: totalfile?.filedetails?.file_date,
|
|
454
|
-
auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
|
|
455
|
-
totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
|
|
456
|
-
retagCount: this.retagimage.length,
|
|
457
|
-
timeSpent: this.timePassed,
|
|
458
|
-
retagImage: this.retagimage ? this.retagimage : []
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
this.auditService.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe(() => { this.submitted = false; })
|
|
462
|
-
if ('retag' in sessionStorage) {
|
|
463
|
-
var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
|
|
464
|
-
this.retagimage = retagdata;
|
|
465
|
-
|
|
466
|
-
}
|
|
467
|
-
this.router.navigate(["/manage/tickets/retag-mapping"])
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
submitaudit() {
|
|
471
|
-
const modalRef = this.modalService.open(AuditReportPopupComponent, {
|
|
472
|
-
size: 'lg',
|
|
473
|
-
centered: true
|
|
474
|
-
})
|
|
475
|
-
modalRef.componentInstance.selectedType = this.selectedType;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
setValue(i: any) {
|
|
481
|
-
let index = 0;
|
|
482
|
-
if (i > index) {
|
|
483
|
-
return this.currentValue = this.currentValue + 1;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
currentGroupNumber: any = 0;
|
|
488
|
-
|
|
489
|
-
getGroupNumber(obj: any): number | null {
|
|
490
|
-
if (obj.count > 1) {
|
|
491
|
-
return ++this.currentGroupNumber;
|
|
492
|
-
}
|
|
493
|
-
return null;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
resetGroupNumber() {
|
|
497
|
-
this.currentGroupNumber = 0;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
getFilteredData(count: number) {
|
|
501
|
-
return this.auditmappingdata.filter((obj: any) => obj.count === count);
|
|
502
|
-
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
toggleImage(img_name: any) {
|
|
506
|
-
this.auditmappingdata.map((data: any) => {
|
|
507
|
-
if (data.img_name == img_name) {
|
|
508
|
-
if (data.mappedid.length > 0) {
|
|
509
|
-
data.demographic !== 'd' ? data.demographic = 'd' : data.demographic = ''
|
|
510
|
-
} else {
|
|
511
|
-
data.dropped = !data.dropped
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
})
|
|
515
|
-
this.demographic = this.auditmappingdata.filter((data: any) => data.demographic === 'd').length;
|
|
516
|
-
const jsonString = JSON.stringify(this.auditmappingdata);
|
|
517
|
-
const compressedData = LZString.compress(jsonString);
|
|
518
|
-
sessionStorage.setItem('audit', compressedData)
|
|
519
|
-
}
|
|
520
|
-
}
|