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

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 (147) hide show
  1. package/.eslintrc.json +37 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +12 -25
  4. package/src/lib/components/add-csm-modal/add-csm-modal.component.html +32 -0
  5. package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +14 -0
  6. package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +23 -0
  7. package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +94 -0
  8. package/src/lib/components/audit-log/audit-log.component.html +1 -0
  9. package/src/lib/components/audit-log/audit-log.component.scss +0 -0
  10. package/src/lib/components/audit-log/audit-log.component.spec.ts +23 -0
  11. package/src/lib/components/audit-log/audit-log.component.ts +10 -0
  12. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +234 -0
  13. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +186 -0
  14. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +23 -0
  15. package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +536 -0
  16. package/src/lib/components/audit-metrics/audit-metrics.component.html +345 -0
  17. package/src/lib/components/audit-metrics/audit-metrics.component.scss +34 -0
  18. package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +23 -0
  19. package/src/lib/components/audit-metrics/audit-metrics.component.ts +292 -0
  20. package/src/lib/components/audit-report-popup/audit-report-popup.component.html +111 -0
  21. package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +101 -0
  22. package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +23 -0
  23. package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +397 -0
  24. package/src/lib/components/audit-retag/audit-retag.component.html +129 -0
  25. package/src/lib/components/audit-retag/audit-retag.component.scss +146 -0
  26. package/src/lib/components/audit-retag/audit-retag.component.spec.ts +23 -0
  27. package/src/lib/components/audit-retag/audit-retag.component.ts +497 -0
  28. package/src/lib/components/comment-model/comment-model.component.html +24 -0
  29. package/src/lib/components/comment-model/comment-model.component.scss +20 -0
  30. package/src/lib/components/comment-model/comment-model.component.spec.ts +23 -0
  31. package/src/lib/components/comment-model/comment-model.component.ts +53 -0
  32. package/src/lib/components/count/count.component.html +54 -0
  33. package/src/lib/components/count/count.component.scss +14 -0
  34. package/src/lib/components/count/count.component.spec.ts +23 -0
  35. package/src/lib/components/count/count.component.ts +82 -0
  36. package/src/lib/components/custom-select/custom-select.component.html +134 -0
  37. package/src/lib/components/custom-select/custom-select.component.scss +204 -0
  38. package/src/lib/components/custom-select/custom-select.component.spec.ts +23 -0
  39. package/src/lib/components/custom-select/custom-select.component.ts +189 -0
  40. package/src/lib/components/filter-options/filter-options.component.html +51 -0
  41. package/src/lib/components/filter-options/filter-options.component.scss +102 -0
  42. package/src/lib/components/filter-options/filter-options.component.spec.ts +23 -0
  43. package/src/lib/components/filter-options/filter-options.component.ts +38 -0
  44. package/src/lib/components/footfall-dic/footfall-dic.component.html +1275 -0
  45. package/src/lib/components/footfall-dic/footfall-dic.component.scss +273 -0
  46. package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +23 -0
  47. package/src/lib/components/footfall-dic/footfall-dic.component.ts +1206 -0
  48. package/src/lib/components/footfall-dicview/footfall-dicview.component.html +1136 -0
  49. package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +416 -0
  50. package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +23 -0
  51. package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +1168 -0
  52. package/src/lib/components/footfall-popup/footfall-popup.component.html +61 -0
  53. package/src/lib/components/footfall-popup/footfall-popup.component.scss +20 -0
  54. package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +23 -0
  55. package/src/lib/components/footfall-popup/footfall-popup.component.ts +12 -0
  56. package/src/lib/components/group-select/group-select.component.html +44 -0
  57. package/src/lib/components/group-select/group-select.component.scss +144 -0
  58. package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
  59. package/src/lib/components/group-select/group-select.component.ts +145 -0
  60. package/src/lib/components/re-trigger/re-trigger.component.html +53 -0
  61. package/src/lib/components/re-trigger/re-trigger.component.scss +16 -0
  62. package/src/lib/components/re-trigger/re-trigger.component.spec.ts +23 -0
  63. package/src/lib/components/re-trigger/re-trigger.component.ts +96 -0
  64. package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
  65. package/src/lib/components/reactive-select/reactive-select.component.scss +52 -0
  66. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
  67. package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
  68. package/src/lib/components/remove-audit/remove-audit.component.html +38 -0
  69. package/src/lib/components/remove-audit/remove-audit.component.scss +27 -0
  70. package/src/lib/components/remove-audit/remove-audit.component.spec.ts +23 -0
  71. package/src/lib/components/remove-audit/remove-audit.component.ts +81 -0
  72. package/src/lib/components/start-audit/start-audit.component.html +174 -0
  73. package/src/lib/components/start-audit/start-audit.component.scss +185 -0
  74. package/src/lib/components/start-audit/start-audit.component.spec.ts +23 -0
  75. package/src/lib/components/start-audit/start-audit.component.ts +772 -0
  76. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +43 -0
  77. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +35 -0
  78. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +23 -0
  79. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +118 -0
  80. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +386 -0
  81. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +87 -0
  82. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +23 -0
  83. package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +493 -0
  84. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +3751 -0
  85. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +1240 -0
  86. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +23 -0
  87. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +2863 -0
  88. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +100 -0
  89. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +34 -0
  90. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +23 -0
  91. package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +48 -0
  92. package/src/lib/components/tickets/tickets.component.html +451 -0
  93. package/src/lib/components/tickets/tickets.component.scss +131 -0
  94. package/src/lib/components/tickets/tickets.component.spec.ts +23 -0
  95. package/src/lib/components/tickets/tickets.component.ts +809 -0
  96. package/src/lib/components/viewcategory/viewcategory.component.html +38 -0
  97. package/src/lib/components/viewcategory/viewcategory.component.scss +29 -0
  98. package/src/lib/components/viewcategory/viewcategory.component.spec.ts +23 -0
  99. package/src/lib/components/viewcategory/viewcategory.component.ts +79 -0
  100. package/src/lib/services/audit.service.spec.ts +16 -0
  101. package/src/lib/services/audit.service.ts +98 -0
  102. package/src/lib/services/excel.service.ts +48 -0
  103. package/src/lib/services/ticket.service.spec.ts +16 -0
  104. package/src/lib/services/ticket.service.ts +501 -0
  105. package/src/lib/services/timer.service.spec.ts +16 -0
  106. package/src/lib/services/timer.service.ts +92 -0
  107. package/src/lib/tango-manage-tickets-routing.module.ts +37 -0
  108. package/src/lib/tango-manage-tickets.module.ts +68 -0
  109. package/{public-api.d.ts → src/public-api.ts} +8 -2
  110. package/tsconfig.lib.json +14 -0
  111. package/tsconfig.lib.prod.json +10 -0
  112. package/tsconfig.spec.json +14 -0
  113. package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +0 -98
  114. package/esm2022/lib/components/audit-log/audit-log.component.mjs +0 -11
  115. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +0 -298
  116. package/esm2022/lib/components/comment-model/comment-model.component.mjs +0 -58
  117. package/esm2022/lib/components/count/count.component.mjs +0 -89
  118. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +0 -894
  119. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  120. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +0 -96
  121. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  122. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +0 -127
  123. package/esm2022/lib/components/tickets/tickets.component.mjs +0 -793
  124. package/esm2022/lib/services/excel.service.mjs +0 -45
  125. package/esm2022/lib/services/ticket.service.mjs +0 -158
  126. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +0 -24
  127. package/esm2022/lib/tango-manage-tickets.module.mjs +0 -54
  128. package/esm2022/public-api.mjs +0 -6
  129. package/esm2022/tango-app-ui-manage-tickets.mjs +0 -5
  130. package/fesm2022/tango-app-ui-manage-tickets.mjs +0 -2914
  131. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +0 -1
  132. package/index.d.ts +0 -5
  133. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +0 -30
  134. package/lib/components/audit-log/audit-log.component.d.ts +0 -5
  135. package/lib/components/audit-metrics/audit-metrics.component.d.ts +0 -59
  136. package/lib/components/comment-model/comment-model.component.d.ts +0 -17
  137. package/lib/components/count/count.component.d.ts +0 -23
  138. package/lib/components/footfall-dic/footfall-dic.component.d.ts +0 -130
  139. package/lib/components/group-select/group-select.component.d.ts +0 -33
  140. package/lib/components/re-trigger/re-trigger.component.d.ts +0 -32
  141. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  142. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +0 -27
  143. package/lib/components/tickets/tickets.component.d.ts +0 -84
  144. package/lib/services/excel.service.d.ts +0 -10
  145. package/lib/services/ticket.service.d.ts +0 -49
  146. package/lib/tango-manage-tickets-routing.module.d.ts +0 -7
  147. package/lib/tango-manage-tickets.module.d.ts +0 -21
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { AuditRetagComponent } from './audit-retag.component';
4
+
5
+ describe('AuditRetagComponent', () => {
6
+ let component: AuditRetagComponent;
7
+ let fixture: ComponentFixture<AuditRetagComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [AuditRetagComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(AuditRetagComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,497 @@
1
+ import { Component, OnInit, HostListener, OnDestroy, ChangeDetectorRef } from '@angular/core';
2
+ import * as LZString from 'lz-string';
3
+ import { ToastService } from 'tango-app-ui-shared';
4
+ import { AuditService } from '../../services/audit.service';
5
+ import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
6
+ import { ActivatedRoute, Router } from '@angular/router';
7
+ import { RemoveAuditComponent } from '../remove-audit/remove-audit.component';
8
+ import { AuditReportPopupComponent } from '../audit-report-popup/audit-report-popup.component';
9
+ import { Subject, takeUntil, Subscription } from 'rxjs';
10
+ import { TimerService } from '../../services/timer.service';
11
+ import { ViewcategoryComponent } from '../viewcategory/viewcategory.component';
12
+
13
+ @Component({
14
+ selector: 'lib-audit-retag',
15
+ templateUrl: './audit-retag.component.html',
16
+ styleUrl: './audit-retag.component.scss'
17
+ })
18
+ export class AuditRetagComponent implements OnInit, OnDestroy {
19
+
20
+ totalfile = 0;
21
+ customer = 0;
22
+ junk = 0;
23
+ employee = 0;
24
+ junkimage: any = []
25
+ retagimage: any = []
26
+ submitvalue: boolean = true;
27
+ auditmappingdata: any = [];
28
+ customercount: any = 0;
29
+ junkcount: any = 0;
30
+ employeecount: any = 0;
31
+ employeimage: any = [];
32
+ filedetails: any = {};
33
+ auditLoading = false;
34
+ selectedType: any;
35
+ private readonly destroy$ = new Subject();
36
+ timePassed: number = 0;
37
+ subscription: Subscription | null = null;
38
+ formattedTime: string = '00:00:00';
39
+
40
+ openmodel: boolean = false;
41
+ category: any = []
42
+ @HostListener('window:keydown', ['$event'])
43
+ handleKeyPress(event: KeyboardEvent) {
44
+ if (this.openmodel) return;
45
+ // if (event.key === 'g' || event.code === 'KeyG') {
46
+ // var group = this.auditmappingdata.filter((data: any) => data.selected === true)
47
+ // if (group.length > 0) {
48
+ // if (group.length == 1) {
49
+ // this.toastr.getErrorToast('Please Select multiple file then add to Group')
50
+ // } else {
51
+ // let dummyarray = group.shift()
52
+ // var groupimages: any = []
53
+ // group.forEach((data: any) => {
54
+ // this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_name }: { img_name: string }) => img_name == data.img_name), 1);
55
+ // groupimages.push(data.mappedid[0])
56
+ // })
57
+ // dummyarray.count = dummyarray.count + groupimages.length
58
+ // dummyarray.selected = false
59
+
60
+ // dummyarray.mappedid = [...dummyarray.mappedid, ...groupimages]
61
+ // const jsonString = JSON.stringify(this.auditmappingdata);
62
+ // const compressedData = LZString.compress(jsonString);
63
+ // sessionStorage.setItem('audit', compressedData)
64
+ // }
65
+
66
+ // // this.initial_data_loading()
67
+ // } else {
68
+ // this.toastr.getErrorToast('Please Select file then add to Group')
69
+ // }
70
+ // }
71
+ const pressed = (event.key || '').toLowerCase();
72
+ const matched = this.category.find((m: any) => {
73
+ if (!m.key) return false;
74
+ const mapKey = m.key.toLowerCase();
75
+ // match by event.key (preferred) OR by event.code like 'KeyJ'
76
+ return pressed === mapKey || event.code === `Key${mapKey.toUpperCase()}`;
77
+ });
78
+ console.log(matched)
79
+ if (!matched) return
80
+ if (matched) {
81
+ var newData = this.auditmappingdata.filter((data: any) => data.selected === true)
82
+ if (newData.length > 0) {
83
+ var oldData = JSON.parse(sessionStorage.getItem(matched?.type) || '{}')
84
+ if (Number(oldData.length) > 0) {
85
+ newData = [...oldData, ...newData]
86
+ } else {
87
+ newData = newData
88
+ }
89
+ this.category.map((data: any) => {
90
+ if (data.type === matched?.type) {
91
+ data.count = newData.length
92
+ }
93
+ })
94
+ sessionStorage.setItem(matched?.type, JSON.stringify(newData))
95
+ this.auditmappingdata = this.auditmappingdata.filter((data: any) => data.selected === false)
96
+ const jsonString = JSON.stringify(this.auditmappingdata);
97
+ const compressedData = LZString.compress(jsonString);
98
+ sessionStorage.setItem('audit', compressedData)
99
+ this.toastr.getSuccessToast(`${matched?.type} Added Succesfully!`);
100
+ } else {
101
+ this.toastr.getErrorToast(`Please Select file then add to ${matched?.type} `)
102
+ }
103
+
104
+ }
105
+
106
+ }
107
+ constructor(public modalService: NgbModal, private router: Router, private $api: AuditService,
108
+ private toastr: ToastService, private route: ActivatedRoute, private timerService: TimerService, private cd: ChangeDetectorRef) {
109
+ this.selectedType = this.route.snapshot.paramMap.get('type')
110
+ }
111
+
112
+ ngOnInit(): void {
113
+ console.log("*************")
114
+ this.getAuditConfig()
115
+ if (this.retagimage.length == 0) {
116
+ this.submitvalue = false;
117
+ }
118
+ this.auditLoading = false
119
+ this.setTimer();
120
+ }
121
+ getAuditConfig() {
122
+
123
+ let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
124
+ this.$api.getAuditconfig(filedata?.filedetails?.clientId).pipe(takeUntil(this.destroy$)).subscribe({
125
+ next: (res: any) => {
126
+ if (res && res?.code == 200) {
127
+ console.log(res.data.footfallDirectoryConfigs.taggingLimitation)
128
+ this.category = res.data.footfallDirectoryConfigs.taggingLimitation
129
+ this.initial_data_loading()
130
+
131
+ }
132
+ }
133
+ })
134
+ }
135
+ setTimer() {
136
+ this.subscription = this.timerService.getTimePassed().subscribe(time => {
137
+ this.timePassed = time;
138
+ this.formattedTime = this.timerService.formatTime(time);
139
+ this.cd.detectChanges();
140
+ });
141
+ this.timerService.startTimer();
142
+ document.addEventListener('mousemove', this.handleGlobalMouseEvent);
143
+ document.addEventListener('click', this.handleGlobalMouseEvent);
144
+ document.addEventListener('mouseenter', this.handleGlobalMouseEvent);
145
+ document.addEventListener('scroll', this.handleGlobalMouseEvent);
146
+ }
147
+
148
+ handleGlobalMouseEvent = (): void => {
149
+ this.timerService.startTimer();
150
+ }
151
+
152
+ ngOnDestroy(): void {
153
+ this.destroy$.next(true);
154
+ this.destroy$.complete();
155
+ document.removeEventListener('mousemove', this.handleGlobalMouseEvent);
156
+ document.removeEventListener('click', this.handleGlobalMouseEvent);
157
+ document.removeEventListener('mouseenter', this.handleGlobalMouseEvent);
158
+ document.removeEventListener('scroll', this.handleGlobalMouseEvent);
159
+ this.timerService.clearTimer()
160
+
161
+ }
162
+
163
+ initial_data_loading() {
164
+ console.log("------------")
165
+ if ('audit' in sessionStorage) {
166
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
167
+ const decompressedData = LZString.decompress(stringifydata);
168
+ var auditdata = JSON.parse(decompressedData || '{}')
169
+ console.log("🚀 ~ AuditRetagComponent ~ initial_data_loading ~ auditdata:", auditdata)
170
+ if (auditdata.length > 0) {
171
+ this.auditmappingdata = auditdata;
172
+ this.customercount = this.auditmappingdata.length
173
+ } else {
174
+ this.auditmappingdata = []
175
+ this.customercount = 0
176
+ }
177
+ }
178
+
179
+ this.category.map((data: any) => {
180
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
181
+ console.log("🚀 ~ AuditRetagComponent ~ initial_data_loading ~ count:", count)
182
+ data.count = count?.length
183
+ })
184
+ if ('retag' in sessionStorage) {
185
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
186
+ if (retagdata.length > 0) {
187
+ this.retagimage = retagdata;
188
+ this.submitvalue = true;
189
+ } else {
190
+ this.retagimage = [];
191
+ }
192
+
193
+ }
194
+
195
+ if ('totalfiles' in sessionStorage) {
196
+ var files = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
197
+ this.totalfile = files?.totalfiles
198
+ this.filedetails = files?.filedetails
199
+
200
+ }
201
+ }
202
+ getmappingdata() {
203
+ this.auditLoading = false
204
+ var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
205
+ this.filedetails = totalfile?.filedetails
206
+
207
+ var payload: any = {
208
+ storeId: totalfile?.filedetails?.storeId,
209
+ fileDate: totalfile?.filedetails?.Date,
210
+ auditId: totalfile?.auditId,
211
+ count: totalfile?.totalfiles
212
+ }
213
+ this.$api.getAuditmappinglist(payload).pipe(takeUntil(this.destroy$)).subscribe({
214
+ next: (res: any) => {
215
+ if (res && res?.code == 200) {
216
+ this.auditLoading = false
217
+ sessionStorage.removeItem('retag')
218
+ this.retagimage = []
219
+ this.category.map((data: any) => {
220
+ let filterData = res?.data?.result?.draftedData?.filter((x: any) => x.type === data.type)
221
+ data.value = filterData[0]?.value && filterData[0]?.value.length > 0 ? filterData[0]?.value : []
222
+ data.count = data?.value?.length
223
+ sessionStorage.setItem(data?.type, JSON.stringify(data?.value && data?.value.length > 0 ? data?.value : []))
224
+
225
+ })
226
+ let customerData = res?.data?.result?.draftedData?.filter((x: any) => x.type === 'customer')
227
+ console.log("🚀 ~ AuditRetagComponent ~ getmappingdata ~ customerData:", customerData)
228
+
229
+ this.auditmappingdata = customerData[0]?.value
230
+ const jsonString = JSON.stringify(customerData[0]?.value);
231
+ const compressedData = LZString.compress(jsonString);
232
+ sessionStorage.setItem('audit', compressedData)
233
+ this.initial_data_loading()
234
+ }
235
+ },
236
+ error: (err: any) => {
237
+
238
+ },
239
+ })
240
+ }
241
+
242
+ reviewdata() {
243
+ this.submitvalue = false;
244
+ var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
245
+ if ('audit' in sessionStorage) {
246
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
247
+ const decompressedData = LZString.decompress(stringifydata);
248
+ var auditdata = JSON.parse(decompressedData || '{}')
249
+ if (auditdata.length > 0) {
250
+ this.auditmappingdata = auditdata;
251
+ this.customercount = this.auditmappingdata.length;
252
+ }
253
+ }
254
+ if ('retag' in sessionStorage) {
255
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
256
+ this.retagimage = retagdata;
257
+ this.auditmappingdata = [...this.auditmappingdata, ...this.retagimage]
258
+ const jsonString = JSON.stringify(this.auditmappingdata);
259
+ const compressedData = LZString.compress(jsonString);
260
+ sessionStorage.setItem('audit', compressedData)
261
+ sessionStorage.removeItem('retag')
262
+ this.retagimage = [];
263
+ }
264
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
265
+ const decompressedData = LZString.decompress(stringifydata);
266
+ var customer = JSON.parse(decompressedData || '{}')
267
+ let storedData = [
268
+ {
269
+ type: "customer",
270
+ value: customer ? customer : [],
271
+ }
272
+ ]
273
+
274
+ this.category.map((data: any) => {
275
+ let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '{}');
276
+ storedData.push({
277
+ type: data.type,
278
+ value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
279
+ })
280
+ })
281
+ console.log("🚀 ~ StartAuditComponent ~ Reviewdata ~ storedData:", storedData)
282
+ var inserobj: any = {
283
+
284
+ storeId: totalfile?.filedetails?.storeId,
285
+ auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
286
+ fileDate: totalfile?.filedetails?.Date,
287
+ totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
288
+ retagCount: 0,
289
+ timeSpent: this.timePassed,
290
+ retagImage: [],
291
+ draftedData: storedData
292
+ }
293
+ this.$api.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe({
294
+ next: (res: any) => {
295
+ if (res && res.code == 200) {
296
+ this.getmappingdata();
297
+ this.router.navigate(["/manage/tickets/mapping-list",])
298
+ }
299
+ },
300
+ error: (err: any) => {
301
+ this.toastr.getErrorToast(err?.error)
302
+ },
303
+ })
304
+ }
305
+
306
+ retagallowDrop(event: any) {
307
+ event.preventDefault();
308
+ }
309
+ dragStart(event: any) {
310
+ event.dataTransfer.setData("text/plain", event.target.id);
311
+ }
312
+
313
+ dropretag(event: any) {
314
+ event.preventDefault();
315
+ const dropretagimage = event.dataTransfer.getData('text/plain');
316
+ event.target.appendChild(document.getElementById(dropretagimage));
317
+ const dropzone: any = dropretagimage;
318
+ this.auditmappingdata.map((data: any) => {
319
+
320
+ if (data.img_id == dropzone.id) {
321
+ if (data.mappedid.length > 0) {
322
+ var findone = this.auditmappingdata.filter((data: any) => data.img_name == dropretagimage)
323
+ if (findone.length > 0) {
324
+ data.count = data.count + findone[0].count
325
+ data.mappedid = [...data.mappedid, ...findone[0].mappedid]
326
+ }
327
+ if ('duplicate' in sessionStorage) {
328
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
329
+ filedata = [...filedata, ...findone]
330
+ sessionStorage.setItem('duplicate', JSON.stringify(filedata))
331
+ } else {
332
+ sessionStorage.setItem('duplicate', JSON.stringify(findone))
333
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
334
+ console.log("🚀 ~ StartAuditComponent ~ dropImage ~ filedata:", filedata)
335
+
336
+ }
337
+ this.category.map((data: any) => {
338
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
339
+ data.count = count?.length
340
+ })
341
+ console.log("🚀 ~ AuditRetagComponent ~ dropretag ~ this.category:", this.category)
342
+ } else {
343
+ data.count = data.count + 1,
344
+ data.mappedid.push(dropretagimage)
345
+ }
346
+ }
347
+ })
348
+ }
349
+
350
+ selectretagimage(res: any) {
351
+ this.retagimage.map((data: any) => {
352
+ if (data.img_id == res) {
353
+ if (data.mappedid.length == 1) {
354
+ data.selected = !data.selected
355
+ }
356
+ }
357
+ })
358
+ }
359
+
360
+ selectgroupimage(res: any) {
361
+ this.auditmappingdata.map((data: any) => {
362
+ if (data.img_id == res) {
363
+ if (data.mappedid.length == 1) {
364
+ data.selected = !data.selected
365
+ }
366
+ }
367
+ })
368
+ }
369
+
370
+ removeaudit(data: any) {
371
+ const modalRef = this.modalService.open(RemoveAuditComponent, {
372
+ size: 'lg',
373
+ centered: true,
374
+ backdrop: 'static',
375
+ keyboard: false
376
+ })
377
+ modalRef.componentInstance.data = data;
378
+ modalRef.closed.subscribe((res: any) => {
379
+ if (res && res?.reload) {
380
+ this.initial_data_loading()
381
+ }
382
+ })
383
+
384
+ }
385
+ submitaudit() {
386
+ const modalRef = this.modalService.open(AuditReportPopupComponent, {
387
+ size: 'lg',
388
+ centered: true,
389
+ backdrop: 'static',
390
+ keyboard: false
391
+ })
392
+ modalRef.componentInstance.selectedType = this.selectedType;
393
+ modalRef.closed;
394
+ }
395
+
396
+
397
+ viewcategory(data: any) {
398
+ const modalRef = this.modalService.open(ViewcategoryComponent, {
399
+ size: 'lg',
400
+ centered: true,
401
+ backdrop: 'static',
402
+ keyboard: false
403
+ })
404
+ modalRef.componentInstance.data = data
405
+ modalRef.componentInstance.imageList = data,
406
+ modalRef.closed.subscribe((res: any) => {
407
+ if (res && res?.reload) {
408
+ this.initial_data_loading()
409
+ }
410
+ })
411
+ }
412
+
413
+ dropImage(event: any) {
414
+ const htmltag = event.dataTransfer.getData('text/html');
415
+ var Name = getTagNameFromHTML(htmltag);
416
+ const dropZone = event.target;
417
+ // console.log(Name)
418
+ // debugger
419
+ if (Name == 'customer' || Name == 'retag') {
420
+ event.preventDefault();
421
+ const draggedImageId = event.dataTransfer.getData('text/plain');
422
+ const draggedImage = document.getElementById(draggedImageId);
423
+ event.target.appendChild(draggedImage);
424
+ this.auditmappingdata.map((data: any, index: number) => {
425
+
426
+ if (data.img_id === dropZone.id) {
427
+ let findone = [];
428
+ const retagdata = JSON.parse(sessionStorage.getItem('retag') || '[]');
429
+ this.retagimage = retagdata;
430
+ findone = this.retagimage.filter((imgData: any) => imgData.img_id === draggedImageId);
431
+ if (findone.length === 0) {
432
+ findone = this.auditmappingdata.filter((imgData: any) => imgData.img_id === draggedImageId);
433
+ }
434
+
435
+ this.retagimage = this.retagimage.filter((imgData: any) => imgData.img_id !== draggedImageId);
436
+ sessionStorage.setItem('retag', JSON.stringify(this.retagimage));
437
+
438
+ console.log("🚀 ~ AuditRetagComponent ~ dropImage ~ findone:", findone)
439
+ if (findone.length > 0) {
440
+
441
+ data.mappedid = [...data.mappedid, ...findone[0].mappedid];
442
+ data.count = data.mappedid.length;
443
+ console.log("🚀 ~ AuditRetagComponent ~ dropImage ~ data.mappedid:", data.mappedid)
444
+ if ('duplicate' in sessionStorage) {
445
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
446
+ filedata = [...filedata, ...findone]
447
+ sessionStorage.setItem('duplicate', JSON.stringify(filedata))
448
+ } else {
449
+ sessionStorage.setItem('duplicate', JSON.stringify(findone))
450
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
451
+ console.log("🚀 ~ StartAuditComponent ~ dropImage ~ filedata:", filedata)
452
+
453
+ }
454
+ } else {
455
+ data.count += 1;
456
+ data.mappedid.push(draggedImageId);
457
+ }
458
+ }
459
+ })
460
+ if (Name == 'customer') {
461
+ console.log(this.auditmappingdata.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId))
462
+ this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId), 1);
463
+ this.auditmappingdata.map((data: any) => data.selected = false)
464
+ }
465
+
466
+
467
+ console.log("🚀 ~ AuditRetagComponent ~ dropImage ~ this.auditmappingdata:", this.auditmappingdata)
468
+ this.customercount = this.auditmappingdata?.length;
469
+ const jsonString = JSON.stringify(this.auditmappingdata);
470
+ const compressedData = LZString.compress(jsonString);
471
+ sessionStorage.setItem('audit', compressedData)
472
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
473
+ this.retagimage = retagdata;
474
+ if (this.retagimage.length == 0) {
475
+ this.submitvalue = false;
476
+ }
477
+ this.category.map((data: any) => {
478
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
479
+ data.count = count?.length
480
+ })
481
+ }
482
+
483
+
484
+
485
+ function getTagNameFromHTML(html: any) {
486
+ var tempElement = document.createElement('div');
487
+ tempElement.innerHTML = html;
488
+ var firstChild: any = tempElement.firstChild;
489
+ if (firstChild.hasAttribute('name')) {
490
+ var namePropertyValue = firstChild.getAttribute('name');
491
+ return namePropertyValue;
492
+ }
493
+ return null;
494
+ }
495
+ }
496
+
497
+ }
@@ -0,0 +1,24 @@
1
+ <div class="card py-0">
2
+ <div class="card-body py-0 d-flex flex-start flex-column p-9 ">
3
+ <div class="my-5">
4
+ <div class="symbol symbol-75px symbol-circle">
5
+ <svg width="56" height="56" viewBox="0 0 56 56" fill="none" xmlns="http://www.w3.org/2000/svg">
6
+ <rect x="4" y="4" width="48" height="48" rx="24" fill="#DAF1FF"/>
7
+ <rect x="4" y="4" width="48" height="48" rx="24" stroke="#EAF8FF" stroke-width="8"/>
8
+ <path d="M37 31C37 31.5304 36.7893 32.0391 36.4142 32.4142C36.0391 32.7893 35.5304 33 35 33H23L19 37V21C19 20.4696 19.2107 19.9609 19.5858 19.5858C19.9609 19.2107 20.4696 19 21 19H35C35.5304 19 36.0391 19.2107 36.4142 19.5858C36.7893 19.9609 37 20.4696 37 21V31Z" stroke="#00A3FF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
9
+ </svg>
10
+ </div>
11
+ </div>
12
+ <a class="fs-4 text-gray-800 text-hover-primary fw-bold mb-0 title cursor-pointer">Comment</a>
13
+ <p class="text-sub">Add comment for the ticket</p>
14
+ <div class="w-100">
15
+ <label class="label my-2">Comments</label>
16
+ <textarea class="form-control" [(ngModel)]="comment" rows="4" type="text"></textarea>
17
+
18
+ <div class="d-flex my-7" role="group">
19
+ <button class="btn btn-outline w-100 me-3" (click)="cancel()">Cancel</button>
20
+ <button class="btn btn-primary w-100 ms-3" (click)="commentSubmit()">Submit</button>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
@@ -0,0 +1,20 @@
1
+ ::ng-deep.modal-content {
2
+ border-radius: 12px !important;
3
+ overflow: unset !important;
4
+ }
5
+
6
+ ::ng-deep ngb-modal-window .component-host-scrollable {
7
+ overflow: unset !important;
8
+ }
9
+ .text-sub{
10
+ color: var(--Gray-500, #667085) !important;
11
+ font-size: 14px;
12
+ font-weight: 400;
13
+ line-height: 20px;
14
+ }
15
+ .label{
16
+ color: var(--Gray-700, #344054) !important;
17
+ font-size: 14px;
18
+ font-weight: 500;
19
+ line-height: 20px;
20
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { CommentModelComponent } from './comment-model.component';
4
+
5
+ describe('CommentModelComponent', () => {
6
+ let component: CommentModelComponent;
7
+ let fixture: ComponentFixture<CommentModelComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [CommentModelComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(CommentModelComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,53 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import { TicketService } from '../../services/ticket.service';
4
+ import { ToastService } from 'tango-app-ui-shared';
5
+ import { Subject, takeUntil } from 'rxjs';
6
+ @Component({
7
+ selector: 'lib-comment-model',
8
+ templateUrl: './comment-model.component.html',
9
+ styleUrl: './comment-model.component.scss'
10
+ })
11
+ export class CommentModelComponent {
12
+ @Input() ticketId: any;
13
+ comment:any= ""
14
+ private readonly destroy$ = new Subject();
15
+ constructor(private activeModal:NgbActiveModal, private service: TicketService,
16
+ private toast: ToastService){
17
+
18
+ }
19
+
20
+ cancel(){
21
+ this.activeModal.close();
22
+ }
23
+ commentSubmit(){
24
+ if(this.comment == ''){
25
+ return this.toast.getErrorToast("Please Enter Any comment")
26
+ }
27
+ let obj = {
28
+ "ticketId": this.ticketId,
29
+ "primary": "",
30
+ "secondary": [],
31
+ "comment": this.comment,
32
+
33
+ }
34
+ this.service
35
+ .updateTicketIssue(obj)
36
+ .pipe(takeUntil(this.destroy$))
37
+ .subscribe({
38
+ next: (res: any) => {
39
+ if (res && res.code === 200) {
40
+ this.toast.getSuccessToast(res.message);
41
+ this.activeModal.close("submit");
42
+ }
43
+ },
44
+ error: (err: any) => {
45
+ this.toast.getErrorToast(err.error.error ? err.error.error : err.error);
46
+ },
47
+ complete: () => {},
48
+ });
49
+ }
50
+
51
+ }
52
+
53
+