tango-app-ui-manage-tickets 3.7.0-beta.70 → 3.7.0-beta.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +98 -0
  2. package/esm2022/lib/components/audit-log/audit-log.component.mjs +11 -0
  3. package/esm2022/lib/components/audit-mapping-list/audit-mapping-list.component.mjs +498 -0
  4. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +298 -0
  5. package/esm2022/lib/components/audit-report-popup/audit-report-popup.component.mjs +389 -0
  6. package/esm2022/lib/components/audit-retag/audit-retag.component.mjs +480 -0
  7. package/esm2022/lib/components/comment-model/comment-model.component.mjs +58 -0
  8. package/esm2022/lib/components/count/count.component.mjs +89 -0
  9. package/esm2022/lib/components/custom-select/custom-select.component.mjs +187 -0
  10. package/esm2022/lib/components/filter-options/filter-options.component.mjs +41 -0
  11. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +1061 -0
  12. package/esm2022/lib/components/footfall-dicview/footfall-dicview.component.mjs +1014 -0
  13. package/esm2022/lib/components/footfall-popup/footfall-popup.component.mjs +15 -0
  14. package/esm2022/lib/components/group-select/group-select.component.mjs +155 -0
  15. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +96 -0
  16. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +108 -0
  17. package/esm2022/lib/components/remove-audit/remove-audit.component.mjs +81 -0
  18. package/esm2022/lib/components/start-audit/start-audit.component.mjs +758 -0
  19. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +131 -0
  20. package/esm2022/lib/components/ticket-filter-panel/ticket-filter-panel.component.mjs +435 -0
  21. package/esm2022/lib/components/ticket-footfall-new/ticket-footfall-new.component.mjs +2511 -0
  22. package/esm2022/lib/components/ticketclosepopup/ticketclosepopup.component.mjs +43 -0
  23. package/esm2022/lib/components/tickets/tickets.component.mjs +847 -0
  24. package/esm2022/lib/components/viewcategory/viewcategory.component.mjs +89 -0
  25. package/esm2022/lib/services/audit.service.mjs +88 -0
  26. package/esm2022/lib/services/excel.service.mjs +45 -0
  27. package/esm2022/lib/services/ticket.service.mjs +319 -0
  28. package/esm2022/lib/services/timer.service.mjs +84 -0
  29. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +44 -0
  30. package/esm2022/lib/tango-manage-tickets.module.mjs +109 -0
  31. package/esm2022/public-api.mjs +6 -0
  32. package/esm2022/tango-app-ui-manage-tickets.mjs +5 -0
  33. package/fesm2022/tango-app-ui-manage-tickets.mjs +9945 -0
  34. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +1 -0
  35. package/index.d.ts +5 -0
  36. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +30 -0
  37. package/lib/components/audit-log/audit-log.component.d.ts +5 -0
  38. package/lib/components/audit-mapping-list/audit-mapping-list.component.d.ts +73 -0
  39. package/lib/components/audit-metrics/audit-metrics.component.d.ts +59 -0
  40. package/lib/components/audit-report-popup/audit-report-popup.component.d.ts +52 -0
  41. package/lib/components/audit-retag/audit-retag.component.d.ts +59 -0
  42. package/lib/components/comment-model/comment-model.component.d.ts +17 -0
  43. package/lib/components/count/count.component.d.ts +23 -0
  44. package/lib/components/custom-select/custom-select.component.d.ts +35 -0
  45. package/lib/components/filter-options/filter-options.component.d.ts +15 -0
  46. package/lib/components/footfall-dic/footfall-dic.component.d.ts +143 -0
  47. package/lib/components/footfall-dicview/footfall-dicview.component.d.ts +132 -0
  48. package/lib/components/footfall-popup/footfall-popup.component.d.ts +8 -0
  49. package/lib/components/group-select/group-select.component.d.ts +33 -0
  50. package/lib/components/re-trigger/re-trigger.component.d.ts +32 -0
  51. package/lib/components/reactive-select/reactive-select.component.d.ts +32 -0
  52. package/lib/components/remove-audit/remove-audit.component.d.ts +16 -0
  53. package/lib/components/start-audit/start-audit.component.d.ts +86 -0
  54. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +28 -0
  55. package/lib/components/ticket-filter-panel/ticket-filter-panel.component.d.ts +79 -0
  56. package/lib/components/ticket-footfall-new/ticket-footfall-new.component.d.ts +293 -0
  57. package/lib/components/ticketclosepopup/ticketclosepopup.component.d.ts +15 -0
  58. package/lib/components/tickets/tickets.component.d.ts +88 -0
  59. package/lib/components/viewcategory/viewcategory.component.d.ts +16 -0
  60. package/lib/services/audit.service.d.ts +36 -0
  61. package/lib/services/excel.service.d.ts +10 -0
  62. package/lib/services/ticket.service.d.ts +87 -0
  63. package/lib/services/timer.service.d.ts +22 -0
  64. package/lib/tango-manage-tickets-routing.module.d.ts +7 -0
  65. package/lib/tango-manage-tickets.module.d.ts +38 -0
  66. package/package.json +25 -12
  67. package/{src/public-api.ts → public-api.d.ts} +2 -8
  68. package/.eslintrc.json +0 -37
  69. package/ng-package.json +0 -7
  70. package/src/lib/components/add-csm-modal/add-csm-modal.component.html +0 -32
  71. package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +0 -14
  72. package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +0 -23
  73. package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +0 -94
  74. package/src/lib/components/audit-log/audit-log.component.html +0 -1
  75. package/src/lib/components/audit-log/audit-log.component.scss +0 -0
  76. package/src/lib/components/audit-log/audit-log.component.spec.ts +0 -23
  77. package/src/lib/components/audit-log/audit-log.component.ts +0 -10
  78. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +0 -234
  79. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +0 -186
  80. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +0 -23
  81. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +0 -536
  82. package/src/lib/components/audit-metrics/audit-metrics.component.html +0 -345
  83. package/src/lib/components/audit-metrics/audit-metrics.component.scss +0 -34
  84. package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +0 -23
  85. package/src/lib/components/audit-metrics/audit-metrics.component.ts +0 -292
  86. package/src/lib/components/audit-report-popup/audit-report-popup.component.html +0 -111
  87. package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +0 -101
  88. package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +0 -23
  89. package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +0 -397
  90. package/src/lib/components/audit-retag/audit-retag.component.html +0 -129
  91. package/src/lib/components/audit-retag/audit-retag.component.scss +0 -146
  92. package/src/lib/components/audit-retag/audit-retag.component.spec.ts +0 -23
  93. package/src/lib/components/audit-retag/audit-retag.component.ts +0 -497
  94. package/src/lib/components/comment-model/comment-model.component.html +0 -24
  95. package/src/lib/components/comment-model/comment-model.component.scss +0 -20
  96. package/src/lib/components/comment-model/comment-model.component.spec.ts +0 -23
  97. package/src/lib/components/comment-model/comment-model.component.ts +0 -53
  98. package/src/lib/components/count/count.component.html +0 -54
  99. package/src/lib/components/count/count.component.scss +0 -14
  100. package/src/lib/components/count/count.component.spec.ts +0 -23
  101. package/src/lib/components/count/count.component.ts +0 -82
  102. package/src/lib/components/custom-select/custom-select.component.html +0 -134
  103. package/src/lib/components/custom-select/custom-select.component.scss +0 -204
  104. package/src/lib/components/custom-select/custom-select.component.spec.ts +0 -23
  105. package/src/lib/components/custom-select/custom-select.component.ts +0 -189
  106. package/src/lib/components/filter-options/filter-options.component.html +0 -51
  107. package/src/lib/components/filter-options/filter-options.component.scss +0 -102
  108. package/src/lib/components/filter-options/filter-options.component.spec.ts +0 -23
  109. package/src/lib/components/filter-options/filter-options.component.ts +0 -38
  110. package/src/lib/components/footfall-dic/footfall-dic.component.html +0 -1275
  111. package/src/lib/components/footfall-dic/footfall-dic.component.scss +0 -273
  112. package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +0 -23
  113. package/src/lib/components/footfall-dic/footfall-dic.component.ts +0 -1206
  114. package/src/lib/components/footfall-dicview/footfall-dicview.component.html +0 -1136
  115. package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +0 -416
  116. package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +0 -23
  117. package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +0 -1168
  118. package/src/lib/components/footfall-popup/footfall-popup.component.html +0 -61
  119. package/src/lib/components/footfall-popup/footfall-popup.component.scss +0 -20
  120. package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +0 -23
  121. package/src/lib/components/footfall-popup/footfall-popup.component.ts +0 -12
  122. package/src/lib/components/group-select/group-select.component.html +0 -44
  123. package/src/lib/components/group-select/group-select.component.scss +0 -144
  124. package/src/lib/components/group-select/group-select.component.spec.ts +0 -23
  125. package/src/lib/components/group-select/group-select.component.ts +0 -145
  126. package/src/lib/components/re-trigger/re-trigger.component.html +0 -53
  127. package/src/lib/components/re-trigger/re-trigger.component.scss +0 -16
  128. package/src/lib/components/re-trigger/re-trigger.component.spec.ts +0 -23
  129. package/src/lib/components/re-trigger/re-trigger.component.ts +0 -96
  130. package/src/lib/components/reactive-select/reactive-select.component.html +0 -18
  131. package/src/lib/components/reactive-select/reactive-select.component.scss +0 -52
  132. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +0 -23
  133. package/src/lib/components/reactive-select/reactive-select.component.ts +0 -104
  134. package/src/lib/components/remove-audit/remove-audit.component.html +0 -38
  135. package/src/lib/components/remove-audit/remove-audit.component.scss +0 -27
  136. package/src/lib/components/remove-audit/remove-audit.component.spec.ts +0 -23
  137. package/src/lib/components/remove-audit/remove-audit.component.ts +0 -81
  138. package/src/lib/components/start-audit/start-audit.component.html +0 -174
  139. package/src/lib/components/start-audit/start-audit.component.scss +0 -185
  140. package/src/lib/components/start-audit/start-audit.component.spec.ts +0 -23
  141. package/src/lib/components/start-audit/start-audit.component.ts +0 -772
  142. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +0 -43
  143. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +0 -35
  144. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +0 -23
  145. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +0 -118
  146. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +0 -386
  147. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +0 -87
  148. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +0 -23
  149. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +0 -493
  150. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +0 -3751
  151. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +0 -1240
  152. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +0 -23
  153. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +0 -2863
  154. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +0 -100
  155. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +0 -34
  156. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +0 -23
  157. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +0 -48
  158. package/src/lib/components/tickets/tickets.component.html +0 -451
  159. package/src/lib/components/tickets/tickets.component.scss +0 -131
  160. package/src/lib/components/tickets/tickets.component.spec.ts +0 -23
  161. package/src/lib/components/tickets/tickets.component.ts +0 -809
  162. package/src/lib/components/viewcategory/viewcategory.component.html +0 -38
  163. package/src/lib/components/viewcategory/viewcategory.component.scss +0 -29
  164. package/src/lib/components/viewcategory/viewcategory.component.spec.ts +0 -23
  165. package/src/lib/components/viewcategory/viewcategory.component.ts +0 -79
  166. package/src/lib/services/audit.service.spec.ts +0 -16
  167. package/src/lib/services/audit.service.ts +0 -98
  168. package/src/lib/services/excel.service.ts +0 -48
  169. package/src/lib/services/ticket.service.spec.ts +0 -16
  170. package/src/lib/services/ticket.service.ts +0 -501
  171. package/src/lib/services/timer.service.spec.ts +0 -16
  172. package/src/lib/services/timer.service.ts +0 -92
  173. package/src/lib/tango-manage-tickets-routing.module.ts +0 -37
  174. package/src/lib/tango-manage-tickets.module.ts +0 -68
  175. package/tsconfig.lib.json +0 -14
  176. package/tsconfig.lib.prod.json +0 -10
  177. package/tsconfig.spec.json +0 -14
@@ -1,772 +0,0 @@
1
- import { Component, OnInit, HostListener, ViewChild, viewChild, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
- import { ActivatedRoute, Route, Router } from '@angular/router';
3
- import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
4
- import { Observable, Subject, timer, Subscription } from 'rxjs';
5
- import { AuditService } from '../../services/audit.service';
6
- import { ToastService } from 'tango-app-ui-shared';
7
- import { NgxSpinnerService } from 'ngx-spinner';
8
- import { RemoveAuditComponent } from '../remove-audit/remove-audit.component';
9
- import * as LZString from 'lz-string';
10
- import { ExcelService } from '../../services/excel.service';
11
- import { takeUntil } from 'rxjs';
12
- import { TimerService } from '../../services/timer.service';
13
- import { ViewcategoryComponent } from '../viewcategory/viewcategory.component';
14
-
15
- @Component({
16
- selector: 'lib-start-audit',
17
- templateUrl: './start-audit.component.html',
18
- styleUrl: './start-audit.component.scss'
19
- })
20
- export class StartAuditComponent implements OnInit, OnDestroy {
21
- junkimage: any;
22
- employeimage: any;
23
- filedetails: any = {};
24
- datareason: any;
25
- limit: any = 500;
26
- nextId: any = ''
27
- spinnerstart = true
28
- submitted: boolean = false;
29
- auditId: any;
30
- customercount = 0;
31
- junkcount = 0;
32
- employeecount = 0;
33
- demographic: any;
34
- id: any = '';
35
- queueName: any = '';
36
- auditmappingdata: any;
37
- totalfile: any = 0;
38
- auditLoading = true;
39
- badge = false;
40
- imagelist: any = "./assets/tango/Images/loading-img.png"
41
- selected: any = [];
42
- selectedType: any;
43
- auditLoading1 = true;
44
- Nodata = false;
45
- counter: any = 1;
46
- clickedImages: boolean[] = [];
47
- @ViewChild('confirmDraft') confirmDraft: any;
48
- @ViewChild('confirmerror') confirmerror: any;
49
- Errormsg: any;
50
- storedetails: any;
51
- openmodel: boolean = false;
52
- private readonly destroy$ = new Subject();
53
- getBack: boolean = false;
54
- category: any = []
55
- @HostListener("window:scroll", [])
56
- onScroll(): void {
57
- if ('totalfiles' in sessionStorage) {
58
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
59
- if (filedata?.filedetails?.nextToken) {
60
- if (Math.ceil(window.innerHeight + window.scrollY) >= document.body.scrollHeight) {//this condition failed when the browser inspect screen open in horizontal
61
- if (this.spinnerstart) {
62
- this.spinnerService.show();
63
- this.getMapping('nextId')
64
- }
65
- }
66
- }
67
- } else {
68
- var result: any = window.confirm("Something Went Wrong. Please clear browser cache or Use incognito window")
69
- if (result) {
70
-
71
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
72
- } else {
73
-
74
- }
75
- }
76
- }
77
-
78
- @HostListener('window:keydown', ['$event'])
79
- handleKeyPress(event: KeyboardEvent) {
80
- if (this.openmodel) return;
81
- // if (event.key === 'g' || event.code === 'KeyG') {
82
- // var group = this.auditmappingdata.filter((data: any) => data.selected === true)
83
- // if (group.length > 0) {
84
- // if (group.length == 1) {
85
- // this.toastr.getErrorToast('Please Select multiple file then add to Group')
86
- // } else {
87
- // let dummyarray = group.shift()
88
- // var groupimages: any = []
89
- // group.forEach((data: any) => {
90
- // this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_name }: { img_name: string }) => img_name == data.img_name), 1);
91
- // groupimages.push(data.mappedid[0])
92
- // })
93
- // this.demographic = this.auditmappingdata.filter((data: any) => data.demographic === 'd').length;
94
- // dummyarray.count = dummyarray.count + groupimages.length
95
- // dummyarray.selected = false
96
- // dummyarray.demographic = ''
97
- // dummyarray.mappedid = [...dummyarray.mappedid, ...groupimages]
98
- // const jsonString = JSON.stringify(this.auditmappingdata);
99
- // const compressedData = LZString.compress(jsonString);
100
- // sessionStorage.setItem('audit', compressedData)
101
- // }
102
-
103
- // // this.initial_data_loading()
104
- // } else {
105
- // this.toastr.getErrorToast('Please Select file then add to Group')
106
- // }
107
- // }
108
- const pressed = (event.key || '').toLowerCase();
109
- const matched = this.category.find((m: any) => {
110
- if (!m.key) return false;
111
- const mapKey = m.key.toLowerCase();
112
- // match by event.key (preferred) OR by event.code like 'KeyJ'
113
- return pressed === mapKey || event.code === `Key${mapKey.toUpperCase()}`;
114
- });
115
-
116
- if (!matched) return
117
- if (matched) {
118
- var newData = this.auditmappingdata.filter((data: any) => data.selected === true)
119
- if (newData.length > 0) {
120
- var oldData = JSON.parse(sessionStorage.getItem(matched?.type) || '{}')
121
- if (Number(oldData.length) > 0) {
122
- newData = [...oldData, ...newData]
123
- } else {
124
- newData = newData
125
- }
126
- this.category.map((data: any) => {
127
- if (data.type === matched?.type) {
128
- data.count = newData.length
129
- }
130
- })
131
- sessionStorage.setItem(matched?.type, JSON.stringify(newData))
132
- this.auditmappingdata = this.auditmappingdata.filter((data: any) => data.selected === false)
133
- const jsonString = JSON.stringify(this.auditmappingdata);
134
- const compressedData = LZString.compress(jsonString);
135
- sessionStorage.setItem('audit', compressedData)
136
- this.toastr.getSuccessToast(`${matched?.type} Added Succesfully!`);
137
- } else {
138
- this.toastr.getErrorToast(`Please Select file then add to ${matched?.type} `)
139
- }
140
-
141
- }
142
-
143
- }
144
-
145
- constructor(
146
- private excel: ExcelService,
147
- private auditservice: AuditService,
148
- private toastr: ToastService,
149
- private router: Router, private cd: ChangeDetectorRef,
150
- private modalService: NgbModal, private timerService: TimerService,
151
- private spinnerService: NgxSpinnerService, private route: ActivatedRoute
152
- ) {
153
- this.selectedType = this.route.snapshot.paramMap.get('type')
154
- }
155
- destroy = new Subject();
156
- showDialog = false;
157
- timePassed: number = 0;
158
- subscription: Subscription | null = null;
159
- formattedTime: string = '00:00:00';
160
-
161
- notice = 'session expired';
162
- showNotice = false;
163
- rxjsTimer: Subscription[] = [];
164
-
165
- ngOnInit(): void {
166
-
167
- this.getAuditConfig()
168
- if ('user-info' in localStorage) {
169
- var user = JSON.parse(localStorage.getItem('user-info') || '{}')
170
- this.id = user._id
171
- }
172
- if ('audit' in sessionStorage) {
173
- let stringifydata = sessionStorage.getItem('audit') || '{}'
174
- const decompressedData = LZString.decompress(stringifydata);
175
- var auditdata = JSON.parse(decompressedData || '{}')
176
- if (auditdata.length > 0) {
177
- this.auditmappingdata = auditdata;
178
- this.customercount = this.auditmappingdata.length
179
- }
180
- this.auditLoading = false;
181
- this.setTimer();
182
- } else {
183
- var filedata
184
- if ('totalfiles' in sessionStorage) {
185
- filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
186
- this.getMapping()
187
- }
188
- }
189
- }
190
-
191
- setTimer() {
192
- this.subscription = this.timerService.getTimePassed().subscribe(time => {
193
- this.timePassed = time;
194
- this.formattedTime = this.timerService.formatTime(time);
195
- this.cd.detectChanges();
196
- });
197
- this.timerService.startTimer();
198
- document.addEventListener('mousemove', this.handleGlobalMouseEvent);
199
- document.addEventListener('click', this.handleGlobalMouseEvent);
200
- document.addEventListener('mouseenter', this.handleGlobalMouseEvent);
201
- document.addEventListener('scroll', this.handleGlobalMouseEvent);
202
- }
203
-
204
- handleGlobalMouseEvent = (): void => {
205
- this.timerService.startTimer();
206
- }
207
-
208
-
209
- ngOnDestroy(): void {
210
- this.destroy$.next(true);
211
- this.destroy$.complete();
212
- document.removeEventListener('mousemove', this.handleGlobalMouseEvent);
213
- document.removeEventListener('click', this.handleGlobalMouseEvent);
214
- document.removeEventListener('mouseenter', this.handleGlobalMouseEvent);
215
- document.removeEventListener('scroll', this.handleGlobalMouseEvent);
216
- this.timerService.clearTimer()
217
- }
218
-
219
- initial_data_loading() {
220
- if ('audit' in sessionStorage) {
221
- let stringifydata = sessionStorage.getItem('audit') || '{}'
222
- const decompressedData = LZString.decompress(stringifydata);
223
- var auditdata = JSON.parse(decompressedData || '{}')
224
- if (auditdata.length > 0) {
225
- this.auditmappingdata = auditdata;
226
- this.demographic = this.auditmappingdata.filter((data: any) => data.demographic === 'd').length;
227
- this.customercount = this.auditmappingdata.length
228
- this.auditLoading = false;
229
- } else {
230
- this.auditmappingdata = []
231
- this.customercount = 0
232
- }
233
- }
234
-
235
-
236
- this.category.map((data: any) => {
237
- var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
238
- data.count = count?.length
239
- })
240
- if ('retag' in sessionStorage) {
241
- var retagiamge = JSON.parse(sessionStorage.getItem('retag') || '[]')
242
- if (retagiamge.length > 0) {
243
- let stringifydata = sessionStorage.getItem('audit') || '{}'
244
- const decompressedData = LZString.decompress(stringifydata);
245
- var customer = JSON.parse(decompressedData || '{}')
246
- customer = [...customer, ...retagiamge]
247
- const jsonString = JSON.stringify(this.auditmappingdata);
248
- const compressedData = LZString.compress(jsonString);
249
- sessionStorage.setItem('audit', compressedData)
250
- sessionStorage.removeItem('retag')
251
- }
252
- }
253
- if ('totalfiles' in sessionStorage) {
254
- var files = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
255
- this.totalfile = files?.totalfiles
256
- this.filedetails = files?.filedetails
257
- this.storedetails = files?.storedetails
258
- }
259
- }
260
- toggleImage(img_name: any) {
261
- this.selected.push(img_name)
262
- this.auditmappingdata.map((data: any) => {
263
-
264
- if (data.img_name == img_name) {
265
- if (data.mappedid.length == 1) {
266
- data.selected = !data.selected
267
- } else {
268
- data.dropped = !data.dropped
269
- }
270
- }
271
- })
272
- }
273
- getAuditConfig() {
274
-
275
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
276
- this.auditservice.getAuditconfig(filedata?.filedetails?.clientId).pipe(takeUntil(this.destroy$)).subscribe({
277
- next: (res: any) => {
278
- if (res && res?.code == 200) {
279
-
280
- this.category = res.data.footfallDirectoryConfigs.taggingLimitation
281
- this.category.map((data: any) => {
282
- if (data?.type in sessionStorage) {
283
-
284
- } else {
285
- sessionStorage.setItem(data.type, JSON.stringify([]))
286
- }
287
- })
288
- this.initial_data_loading()
289
-
290
- }
291
- }
292
- })
293
- }
294
- getMapping(nextId?: any) {
295
- this.auditLoading = true;
296
- this.spinnerstart = false
297
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
298
- let tickettype = sessionStorage.getItem('ticketType')
299
- console.log("🚀 ~ StartAuditComponent ~ getMapping ~ tickettype:", tickettype)
300
- let payload = {
301
- storeId: filedata?.filedetails?.storeId,
302
- limit: this.limit,
303
- nextId: filedata?.filedetails?.nextToken ? filedata?.filedetails?.nextToken : '',
304
- Date: filedata?.filedetails?.Date,
305
- count: filedata?.totalfiles,
306
- tickettype:tickettype
307
- }
308
-
309
-
310
- this.auditservice.getAuditMapping(payload).pipe(takeUntil(this.destroy$)).subscribe({
311
- next: (res: any) => {
312
- if (res && res?.code == 200) {
313
- this.storedetails = res?.data;
314
- setTimeout(() => {
315
- if (res?.data?.file?.nextToken) {
316
- this.getMapping(res?.data?.file?.nextToken)
317
- }
318
- }, 100)
319
- if (res?.data?.isDraft) {
320
- sessionStorage.setItem('timeSpent', JSON.stringify(res?.data?.timeSpent));
321
- this.spinnerstart = false;
322
-
323
- this.category.map((data: any) => {
324
-
325
- let filterData = res?.data?.result.filter((x: any) => x.type === data.type)
326
-
327
- sessionStorage.setItem(data.type, JSON.stringify(filterData[0].value))
328
- })
329
- let customerData = res?.data?.result.filter((x: any) => x.type === 'customer')
330
-
331
- this.auditmappingdata = customerData[0].value
332
- const jsonString = JSON.stringify(customerData[0].value);
333
- const compressedData = LZString.compress(jsonString);
334
- sessionStorage.setItem('audit', compressedData)
335
-
336
-
337
- this.totalfile = res?.data?.count;
338
- this.filedetails = res?.data?.file;
339
-
340
-
341
- this.category.map((data: any) => {
342
-
343
- var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
344
- data.count = count?.length
345
- })
346
-
347
- if (res?.data?.result?.retag_image?.length > 0) {
348
- let stringifydata = sessionStorage.getItem('audit') || '{}'
349
- const decompressedData = LZString.decompress(stringifydata);
350
- var customer = JSON.parse(decompressedData || '{}')
351
- customer = [...customer, ...res.data.result.retag_image]
352
- this.auditmappingdata = customer;
353
- const jsonString = JSON.stringify(customer);
354
- const compressedData = LZString.compress(jsonString);
355
- sessionStorage.setItem('audit', compressedData)
356
- }
357
-
358
- var totalfiles = {
359
- "storedetails": {
360
- "storeName": res?.data?.storeName,
361
- "address": res?.data?.address
362
- },
363
- "totalfiles": this.storedetails?.count,
364
- "auditId": res?.data.file?.auditId,
365
- "filedetails": {
366
- "storeId": this.storedetails?.file?.storeId,
367
- "Date": res?.data?.file?.Date,
368
- "userId": res?.data?.file?.userId,
369
- "clientId": res?.data?.file?.clientId,
370
- }
371
- }
372
- sessionStorage.setItem('totalfiles', JSON.stringify(totalfiles))
373
- this.auditLoading = false;
374
- this.setTimer();
375
- } else {
376
- this.spinnerstart = false
377
- this.spinnerService.hide();
378
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
379
- if (filedata?.filedetails?.nextToken) {
380
- this.auditLoading = false;
381
- this.auditId = res.data.file?.auditId;
382
- this.totalfile = res?.data?.count;
383
- this.filedetails = res?.data?.file;
384
- this.filedetails.zoneName = res?.data?.file?.zoneName;
385
- if ('audit' in sessionStorage) {
386
- if (this.auditmappingdata?.length > 0) {
387
- this.auditmappingdata = [...this.auditmappingdata, ...res?.data?.result]
388
- this.customercount = this.auditmappingdata?.length
389
- }
390
- }
391
- } else {
392
- this.auditLoading = false;
393
- this.auditLoading1 = false;
394
- this.filedetails = res?.data?.file;
395
- this.auditId = res.data.file?.auditId;
396
- this.auditmappingdata = res?.data?.result;
397
- this.totalfile = res?.data?.count;
398
- this.filedetails.queueName = this.queueName;
399
- this.filedetails.zoneName = res?.data?.file?.zoneName;
400
- }
401
- const jsonString = JSON.stringify(this.auditmappingdata);
402
- const compressedData = LZString.compress(jsonString);
403
- sessionStorage.setItem('audit', compressedData)
404
- let obj = {
405
- totalfiles: this.totalfile,
406
- filedetails: this.filedetails,
407
- auditId: this.auditId,
408
-
409
- storedetails: {
410
- "storeName": res?.data?.storeName,
411
- "address": res?.data?.address
412
- },
413
- }
414
- sessionStorage.setItem('totalfiles', JSON.stringify(obj))
415
- this.spinnerstart = true
416
- this.setTimer();
417
- }
418
-
419
- } else if (!res || res.code == 204) {
420
- if (this.counter < 6) {
421
- this.counter = this.counter + 1;
422
- this.getMapping()
423
- this.showDialog = true;
424
- } else {
425
- this.auditLoading = false;
426
- if (!nextId) { this.Nodata = true } else { }
427
- this.submitted = true;
428
- this.destroy.next(true);
429
- this.destroy.complete();
430
- this.showNotice = true;
431
- }
432
- }
433
-
434
- },
435
- error: (err: any) => {
436
-
437
- if (err?.status == 404) {
438
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
439
- if (filedata.filedetails && filedata.filedetails.nextToken) {
440
- delete filedata.filedetails.nextToken;
441
- sessionStorage.setItem('totalfiles', JSON.stringify(filedata));
442
- this.getMapping('')
443
- }
444
- } else {
445
- this.toastr.getErrorToast(err?.error?.message)
446
- }
447
- }
448
- })
449
- }
450
-
451
- removeaudit(data: any) {
452
- const modalRef = this.modalService.open(RemoveAuditComponent, {
453
- size: 'lg',
454
- centered: true,
455
- backdrop: 'static',
456
- keyboard: false
457
- })
458
- modalRef.componentInstance.data = data,
459
- modalRef.closed.subscribe((res: any) => {
460
- if (res && res?.reload) {
461
- this.initial_data_loading()
462
- }
463
- })
464
- }
465
- allowDrop(event: any) {
466
- event.preventDefault();
467
- }
468
-
469
- dragImage(event: any) {
470
- event.dataTransfer.setData('text/plain', event.target.id);
471
- }
472
-
473
- dropImage(event: any) {
474
- event.preventDefault();
475
- const draggedImageId = event.dataTransfer.getData('text/plain');
476
- const draggedImage = document.getElementById(draggedImageId);
477
- event.target.appendChild(draggedImage);
478
- const dropZone = event.target;
479
- this.auditmappingdata.map((data: any, index: number) => {
480
- if (data.img_name == dropZone.id) {
481
- if (data.mappedid.length > 0) {
482
- var findone = this.auditmappingdata.filter((data: any) => data.img_name == draggedImageId)
483
-
484
- if (findone.length > 0) {
485
- data.count = data.count + findone[0].count
486
- data.mappedid = [...data.mappedid, ...findone[0].mappedid]
487
- }
488
- if ('duplicate' in sessionStorage) {
489
- let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
490
- let filteredData = findone[0].mappedid.filter((data: any) => data.img_id === findone[0].img_id)
491
- let insertObj: any = {}
492
- insertObj.img_id = filteredData[0]?.img_id
493
- insertObj.img_name = filteredData[0]?.img_name
494
- insertObj.img_path = filteredData[0]?.img_path
495
- insertObj.mappedid = [
496
- {
497
- img_id: filteredData[0]?.img_id,
498
- img_name: filteredData[0]?.img_name,
499
- img_path: filteredData[0]?.img_path
500
- }
501
- ]
502
-
503
-
504
- filedata = [...filedata, ...[insertObj]]
505
-
506
- sessionStorage.setItem('duplicate', JSON.stringify(filedata))
507
- }
508
- this.category.map((data: any) => {
509
- var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
510
- data.count = count?.length
511
- })
512
- } else {
513
- data.count = data.count + 1
514
- data.mappedid.push(draggedImageId)
515
- }
516
- }
517
- })
518
-
519
-
520
-
521
- this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_name }: { img_name: string }) => img_name == draggedImageId), 1);
522
- this.auditmappingdata.map((data: any) => data.selected = false)
523
- const jsonString = JSON.stringify(this.auditmappingdata);
524
- const compressedData = LZString.compress(jsonString);
525
- sessionStorage.setItem('audit', compressedData)
526
- }
527
-
528
- dragStart(event: DragEvent) {
529
- const target = event.target as HTMLImageElement;
530
- event.dataTransfer?.setData('text/plain', target.id);
531
- }
532
-
533
- Reviewdata() {
534
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
535
- if (filedata?.filedetails?.nextToken) {
536
- this.toastr.getErrorToast('Scroll Down to bottom load the files before Move to Next page!');
537
- } else {
538
- this.submitted = true;
539
- var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
540
- let stringifydata = sessionStorage.getItem('audit') || '{}'
541
- const decompressedData = LZString.decompress(stringifydata);
542
- var customer = JSON.parse(decompressedData || '{}')
543
- let storedData = [
544
- {
545
- type: "customer",
546
- value: customer ? customer : [],
547
- }
548
- ]
549
-
550
- this.category.map((data: any) => {
551
- let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '[]');
552
- storedData.push({
553
- type: data.type,
554
- value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
555
- })
556
- })
557
- var inserobj: any = {
558
- userCommands: this.datareason ? this.datareason : "",
559
- customerCount: customer ? customer?.length : 0,
560
- storeId: totalfile?.filedetails?.storeId,
561
- auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
562
- fileDate: totalfile?.filedetails?.Date,
563
- totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
564
- retagCount: 0,
565
- timeSpent: this.timePassed,
566
- retagImage: [],
567
- draftedData: storedData
568
- }
569
-
570
- this.auditservice.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe({
571
- next: (res: any) => {
572
- if (res && res?.code == 200) {
573
- this.submitted = false;
574
- this.router.navigate(["/manage/tickets/mapping-list"])
575
- } if (res && res.code == 203) {
576
- this.Errormsg = res.message
577
- const modalRef = this.modalService.open(this.confirmerror, { centered: true })
578
- modalRef.result.then((result) => {
579
- if (result.isConfirmed) {
580
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
581
- }
582
- })
583
- }
584
- },
585
- error: (err: any) => {
586
- if (err?.code == 400 || err?.code == 204 || err?.code == 404 || err?.code == 500) {
587
- this.Errormsg = err.message
588
- const modalRef = this.modalService.open(this.confirmerror, { centered: true })
589
- modalRef.result.then((result) => {
590
- if (result.isConfirmed) {
591
- this.submitted = true;
592
- }
593
- })
594
- }
595
- }
596
- })
597
- }
598
-
599
- }
600
-
601
- viewcategory(data: any) {
602
- const modalRef = this.modalService.open(ViewcategoryComponent, {
603
- size: 'lg',
604
- centered: true,
605
- backdrop: 'static',
606
- keyboard: false
607
- })
608
- modalRef.componentInstance.data = data
609
- modalRef.componentInstance.imageList = data,
610
- modalRef.closed.subscribe((res: any) => {
611
- if (res && res?.reload) {
612
- this.initial_data_loading()
613
- }
614
- })
615
- }
616
- async savedraft() {
617
- let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
618
- if (filedata?.filedetails?.nextToken) {
619
- this.toastr.getErrorToast('Scroll Down to bottom load the files before save!');
620
- } else {
621
- this.openmodel = true;
622
- const modalRef = this.modalService.open(this.confirmDraft, {
623
- centered: true, size: 'md'
624
- })
625
- modalRef.result.then((result) => {
626
-
627
-
628
- if (result === 'isDenied') {
629
- var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
630
- let stringifydata = sessionStorage.getItem('audit') || '{}'
631
- const decompressedData = LZString.decompress(stringifydata);
632
- var customer = JSON.parse(decompressedData || '{}')
633
- let storedData = [
634
- {
635
- type: "customer",
636
- value: customer ? customer : [],
637
- }
638
- ]
639
-
640
- this.category.map((data: any) => {
641
- let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '[]');
642
- storedData.push({
643
- type: data.type,
644
- value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
645
- })
646
- })
647
-
648
- var inserobj: any = {
649
- userCommands: this.datareason ? this.datareason : "",
650
- // userId: user?.user,
651
- storeId: totalfile?.filedetails?.storeId,
652
- fileDate: totalfile?.filedetails?.Date,
653
- auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
654
- totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
655
- customerCount: customer ? customer?.length : 0,
656
- retagCount: 0,
657
- timeSpent: this.timePassed,
658
- retagImage: [],
659
- draftedData: storedData
660
- }
661
- if (inserobj?.auditId && inserobj?.auditId != '') {
662
- this.auditservice.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe({
663
- next: (res: any) => {
664
- if (res && res.code == 200) {
665
- this.submitted = false;
666
- this.toastr.getSuccessToast(res?.data?.result)
667
- } else {
668
- if (res && res.code == 203) {
669
- this.Errormsg = res.error;
670
- const modalRef = this.modalService.open(this.confirmerror)
671
- modalRef.result.then((result) => {
672
- if (result.isConfirmed) {
673
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
674
- }
675
- })
676
- }
677
- }
678
- },
679
- error: (err: any) => {
680
- if (err?.code == 400 || err?.code == 204 || err?.code == 404 || err?.code == 500) {
681
- this.toastr.getErrorToast('File not saved!')
682
- }
683
- }
684
- })
685
- } else {
686
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
687
- }
688
-
689
- } else if (result === 'isConfirmed') {
690
- var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
691
-
692
- let stringifydata = sessionStorage.getItem('audit') || '{}'
693
- const decompressedData = LZString.decompress(stringifydata);
694
- var customer = JSON.parse(decompressedData || '{}')
695
- let storedData = [
696
- {
697
- type: "customer",
698
- value: this.auditmappingdata ? this.auditmappingdata : [],
699
- }
700
- ]
701
-
702
- this.category.map((data: any) => {
703
- let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '[]');
704
- storedData.push({
705
- type: data.type,
706
- value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
707
- })
708
- })
709
- var inserobj: any = {
710
- userCommands: this.datareason ? this.datareason : "",
711
- customerCount: customer ? customer?.length : 0,
712
- storeId: totalfile?.filedetails?.storeId,
713
- auditType: totalfile?.filedetails?.type,
714
- fileDate: totalfile?.filedetails?.Date,
715
- auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
716
- totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
717
- retagCount: 0,
718
- timeSpent: this.timePassed,
719
- retagImage: [],
720
- draftedData: storedData
721
- }
722
- if (inserobj?.auditId && inserobj.auditId !== '') {
723
-
724
- this.auditservice.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe({
725
- next: (res: any) => {
726
- if (res && res.code == 200) {
727
- this.submitted = false;
728
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
729
- } else {
730
- if (res && res.code == 203) {
731
- this.Errormsg = res.error;
732
- const modalRef = this.modalService.open(this.confirmerror)
733
- modalRef.result.then((result) => {
734
- if (result.isConfirmed) {
735
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
736
- }
737
- })
738
- }
739
-
740
- }
741
- },
742
- error: (err: any) => {
743
- if (err?.code == 400 || err?.code == 204 || err?.code == 404 || err?.code == 500) {
744
- this.toastr.getErrorToast('File not saved!')
745
- }
746
- }
747
- })
748
- } else {
749
- this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
750
- }
751
- } else {
752
-
753
- }
754
- })
755
- modalRef.result.finally(() => {
756
- this.openmodel = false;
757
- });
758
- }
759
- }
760
-
761
- backtotickets() {
762
- this.savedraft();
763
- // this.router.navigate(['/manage/tickets'], { queryParams: { type: 'footfall' } })
764
-
765
- }
766
- cameraPreview() {
767
- // const ModalRef = this.modalService.open(CameraPreviewComponent,{
768
- // centered: true,
769
- // size:'lg'
770
- // })
771
- }
772
- }