tango-app-ui-manage-tickets 3.7.0-beta.58 → 3.7.0-beta.60

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/.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 +520 -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 +489 -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 +761 -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 +494 -0
  84. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +4743 -0
  85. package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +1208 -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 +3351 -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-mapping-list/audit-mapping-list.component.mjs +0 -486
  116. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +0 -298
  117. package/esm2022/lib/components/audit-report-popup/audit-report-popup.component.mjs +0 -389
  118. package/esm2022/lib/components/audit-retag/audit-retag.component.mjs +0 -470
  119. package/esm2022/lib/components/comment-model/comment-model.component.mjs +0 -58
  120. package/esm2022/lib/components/count/count.component.mjs +0 -89
  121. package/esm2022/lib/components/custom-select/custom-select.component.mjs +0 -187
  122. package/esm2022/lib/components/filter-options/filter-options.component.mjs +0 -41
  123. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +0 -1061
  124. package/esm2022/lib/components/footfall-dicview/footfall-dicview.component.mjs +0 -1014
  125. package/esm2022/lib/components/footfall-popup/footfall-popup.component.mjs +0 -15
  126. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  127. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +0 -96
  128. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  129. package/esm2022/lib/components/remove-audit/remove-audit.component.mjs +0 -81
  130. package/esm2022/lib/components/start-audit/start-audit.component.mjs +0 -761
  131. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +0 -131
  132. package/esm2022/lib/components/ticket-filter-panel/ticket-filter-panel.component.mjs +0 -435
  133. package/esm2022/lib/components/ticket-footfall-new/ticket-footfall-new.component.mjs +0 -2673
  134. package/esm2022/lib/components/ticketclosepopup/ticketclosepopup.component.mjs +0 -43
  135. package/esm2022/lib/components/tickets/tickets.component.mjs +0 -847
  136. package/esm2022/lib/components/viewcategory/viewcategory.component.mjs +0 -89
  137. package/esm2022/lib/services/audit.service.mjs +0 -88
  138. package/esm2022/lib/services/excel.service.mjs +0 -45
  139. package/esm2022/lib/services/ticket.service.mjs +0 -314
  140. package/esm2022/lib/services/timer.service.mjs +0 -84
  141. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +0 -44
  142. package/esm2022/lib/tango-manage-tickets.module.mjs +0 -109
  143. package/esm2022/public-api.mjs +0 -6
  144. package/esm2022/tango-app-ui-manage-tickets.mjs +0 -5
  145. package/fesm2022/tango-app-ui-manage-tickets.mjs +0 -10083
  146. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +0 -1
  147. package/index.d.ts +0 -5
  148. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +0 -30
  149. package/lib/components/audit-log/audit-log.component.d.ts +0 -5
  150. package/lib/components/audit-mapping-list/audit-mapping-list.component.d.ts +0 -73
  151. package/lib/components/audit-metrics/audit-metrics.component.d.ts +0 -59
  152. package/lib/components/audit-report-popup/audit-report-popup.component.d.ts +0 -52
  153. package/lib/components/audit-retag/audit-retag.component.d.ts +0 -59
  154. package/lib/components/comment-model/comment-model.component.d.ts +0 -17
  155. package/lib/components/count/count.component.d.ts +0 -23
  156. package/lib/components/custom-select/custom-select.component.d.ts +0 -35
  157. package/lib/components/filter-options/filter-options.component.d.ts +0 -15
  158. package/lib/components/footfall-dic/footfall-dic.component.d.ts +0 -143
  159. package/lib/components/footfall-dicview/footfall-dicview.component.d.ts +0 -132
  160. package/lib/components/footfall-popup/footfall-popup.component.d.ts +0 -8
  161. package/lib/components/group-select/group-select.component.d.ts +0 -33
  162. package/lib/components/re-trigger/re-trigger.component.d.ts +0 -32
  163. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  164. package/lib/components/remove-audit/remove-audit.component.d.ts +0 -16
  165. package/lib/components/start-audit/start-audit.component.d.ts +0 -86
  166. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +0 -28
  167. package/lib/components/ticket-filter-panel/ticket-filter-panel.component.d.ts +0 -79
  168. package/lib/components/ticket-footfall-new/ticket-footfall-new.component.d.ts +0 -286
  169. package/lib/components/ticketclosepopup/ticketclosepopup.component.d.ts +0 -15
  170. package/lib/components/tickets/tickets.component.d.ts +0 -88
  171. package/lib/components/viewcategory/viewcategory.component.d.ts +0 -16
  172. package/lib/services/audit.service.d.ts +0 -36
  173. package/lib/services/excel.service.d.ts +0 -10
  174. package/lib/services/ticket.service.d.ts +0 -85
  175. package/lib/services/timer.service.d.ts +0 -22
  176. package/lib/tango-manage-tickets-routing.module.d.ts +0 -7
  177. package/lib/tango-manage-tickets.module.d.ts +0 -38
@@ -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,489 @@
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
+ this.getAuditConfig()
114
+ if (this.retagimage.length == 0) {
115
+ this.submitvalue = false;
116
+ }
117
+ this.auditLoading = false
118
+ this.setTimer();
119
+ }
120
+ getAuditConfig() {
121
+
122
+ let filedata = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
123
+ this.$api.getAuditconfig(filedata?.filedetails?.clientId).pipe(takeUntil(this.destroy$)).subscribe({
124
+ next: (res: any) => {
125
+ if (res && res?.code == 200) {
126
+ console.log(res.data.footfallDirectoryConfigs.taggingLimitation)
127
+ this.category = res.data.footfallDirectoryConfigs.taggingLimitation
128
+ this.initial_data_loading()
129
+
130
+ }
131
+ }
132
+ })
133
+ }
134
+ setTimer() {
135
+ this.subscription = this.timerService.getTimePassed().subscribe(time => {
136
+ this.timePassed = time;
137
+ this.formattedTime = this.timerService.formatTime(time);
138
+ this.cd.detectChanges();
139
+ });
140
+ this.timerService.startTimer();
141
+ document.addEventListener('mousemove', this.handleGlobalMouseEvent);
142
+ document.addEventListener('click', this.handleGlobalMouseEvent);
143
+ document.addEventListener('mouseenter', this.handleGlobalMouseEvent);
144
+ document.addEventListener('scroll', this.handleGlobalMouseEvent);
145
+ }
146
+
147
+ handleGlobalMouseEvent = (): void => {
148
+ this.timerService.startTimer();
149
+ }
150
+
151
+ ngOnDestroy(): void {
152
+ this.destroy$.next(true);
153
+ this.destroy$.complete();
154
+ document.removeEventListener('mousemove', this.handleGlobalMouseEvent);
155
+ document.removeEventListener('click', this.handleGlobalMouseEvent);
156
+ document.removeEventListener('mouseenter', this.handleGlobalMouseEvent);
157
+ document.removeEventListener('scroll', this.handleGlobalMouseEvent);
158
+ this.timerService.clearTimer()
159
+
160
+ }
161
+
162
+ initial_data_loading() {
163
+ if ('audit' in sessionStorage) {
164
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
165
+ const decompressedData = LZString.decompress(stringifydata);
166
+ var auditdata = JSON.parse(decompressedData || '{}')
167
+ if (auditdata.length > 0) {
168
+ this.auditmappingdata = auditdata;
169
+ this.customercount = this.auditmappingdata.length
170
+ } else {
171
+ this.auditmappingdata = []
172
+ this.customercount = 0
173
+ }
174
+ }
175
+
176
+ this.category.map((data: any) => {
177
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
178
+ data.count = count?.length
179
+ })
180
+ if ('retag' in sessionStorage) {
181
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
182
+ if (retagdata.length > 0) {
183
+ this.retagimage = retagdata;
184
+ this.submitvalue = true;
185
+ } else {
186
+ this.retagimage = [];
187
+ }
188
+
189
+ }
190
+
191
+ if ('totalfiles' in sessionStorage) {
192
+ var files = JSON.parse(sessionStorage.getItem('totalfiles') || '{}')
193
+ this.totalfile = files?.totalfiles
194
+ this.filedetails = files?.filedetails
195
+
196
+ }
197
+ }
198
+ getmappingdata() {
199
+ this.auditLoading = false
200
+ var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
201
+ this.filedetails = totalfile?.filedetails
202
+
203
+ var payload: any = {
204
+ storeId: totalfile?.filedetails?.storeId,
205
+ fileDate: totalfile?.filedetails?.Date,
206
+ auditId: totalfile?.auditId,
207
+ count: totalfile?.totalfiles
208
+ }
209
+ this.$api.getAuditmappinglist(payload).pipe(takeUntil(this.destroy$)).subscribe({
210
+ next: (res: any) => {
211
+ if (res && res?.code == 200) {
212
+ this.auditLoading = false
213
+ sessionStorage.removeItem('retag')
214
+ this.retagimage = []
215
+ this.category.map((data: any) => {
216
+ let filterData = res?.data?.result?.draftedData?.filter((x: any) => x.type === data.type)
217
+ data.value = filterData[0]?.value && filterData[0]?.value.length > 0 ? filterData[0]?.value : []
218
+ data.count = data?.value?.length
219
+ sessionStorage.setItem(data?.type, JSON.stringify(data?.value && data?.value.length > 0 ? data?.value : []))
220
+
221
+ })
222
+ let customerData = res?.data?.result?.draftedData?.filter((x: any) => x.type === 'customer')
223
+
224
+ this.auditmappingdata = customerData[0]?.value
225
+ const jsonString = JSON.stringify(customerData[0]?.value);
226
+ const compressedData = LZString.compress(jsonString);
227
+ sessionStorage.setItem('audit', compressedData)
228
+ this.initial_data_loading()
229
+ }
230
+ },
231
+ error: (err: any) => {
232
+
233
+ },
234
+ })
235
+ }
236
+
237
+ reviewdata() {
238
+ this.submitvalue = false;
239
+ var totalfile: any = JSON.parse(sessionStorage.getItem('totalfiles') || '{}');
240
+ if ('audit' in sessionStorage) {
241
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
242
+ const decompressedData = LZString.decompress(stringifydata);
243
+ var auditdata = JSON.parse(decompressedData || '{}')
244
+ if (auditdata.length > 0) {
245
+ this.auditmappingdata = auditdata;
246
+ this.customercount = this.auditmappingdata.length;
247
+ }
248
+ }
249
+ if ('retag' in sessionStorage) {
250
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
251
+ this.retagimage = retagdata;
252
+ this.auditmappingdata = [...this.auditmappingdata, ...this.retagimage]
253
+ const jsonString = JSON.stringify(this.auditmappingdata);
254
+ const compressedData = LZString.compress(jsonString);
255
+ sessionStorage.setItem('audit', compressedData)
256
+ sessionStorage.removeItem('retag')
257
+ this.retagimage = [];
258
+ }
259
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
260
+ const decompressedData = LZString.decompress(stringifydata);
261
+ var customer = JSON.parse(decompressedData || '{}')
262
+ let storedData = [
263
+ {
264
+ type: "customer",
265
+ value: customer ? customer : [],
266
+ }
267
+ ]
268
+
269
+ this.category.map((data: any) => {
270
+ let sessionvalue = JSON.parse(sessionStorage.getItem(data.type) || '{}');
271
+ storedData.push({
272
+ type: data.type,
273
+ value: sessionvalue && sessionvalue.length > 0 ? sessionvalue : []
274
+ })
275
+ })
276
+ console.log("🚀 ~ StartAuditComponent ~ Reviewdata ~ storedData:", storedData)
277
+ var inserobj: any = {
278
+
279
+ storeId: totalfile?.filedetails?.storeId,
280
+ auditId: totalfile?.auditId ? totalfile?.auditId : totalfile?.filedetails.auditId,
281
+ fileDate: totalfile?.filedetails?.Date,
282
+ totalCount: totalfile?.totalfiles ? totalfile.totalfiles : 0,
283
+ retagCount: 0,
284
+ timeSpent: this.timePassed,
285
+ retagImage: [],
286
+ draftedData: storedData
287
+ }
288
+ this.$api.saveDraft(inserobj).pipe(takeUntil(this.destroy$)).subscribe({
289
+ next: (res: any) => {
290
+ if (res && res.code == 200) {
291
+ this.getmappingdata();
292
+ this.router.navigate(["/manage/tickets/mapping-list",])
293
+ }
294
+ },
295
+ error: (err: any) => {
296
+ this.toastr.getErrorToast(err?.error)
297
+ },
298
+ })
299
+ }
300
+
301
+ retagallowDrop(event: any) {
302
+ event.preventDefault();
303
+ }
304
+ dragStart(event: any) {
305
+ event.dataTransfer.setData("text/plain", event.target.id);
306
+ }
307
+
308
+ dropretag(event: any) {
309
+ event.preventDefault();
310
+ const dropretagimage = event.dataTransfer.getData('text/plain');
311
+ event.target.appendChild(document.getElementById(dropretagimage));
312
+ const dropzone: any = dropretagimage;
313
+ this.auditmappingdata.map((data: any) => {
314
+
315
+ if (data.img_id == dropzone.id) {
316
+ if (data.mappedid.length > 0) {
317
+ var findone = this.auditmappingdata.filter((data: any) => data.img_name == dropretagimage)
318
+ if (findone.length > 0) {
319
+ data.count = data.count + findone[0].count
320
+ data.mappedid = [...data.mappedid, ...findone[0].mappedid]
321
+ }
322
+ if ('duplicate' in sessionStorage) {
323
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
324
+ filedata = [...filedata, ...findone]
325
+ sessionStorage.setItem('duplicate', JSON.stringify(filedata))
326
+ } else {
327
+ sessionStorage.setItem('duplicate', JSON.stringify(findone))
328
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
329
+ console.log("🚀 ~ StartAuditComponent ~ dropImage ~ filedata:", filedata)
330
+
331
+ }
332
+ this.category.map((data: any) => {
333
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
334
+ data.count = count?.length
335
+ })
336
+ console.log("🚀 ~ AuditRetagComponent ~ dropretag ~ this.category:", this.category)
337
+ } else {
338
+ data.count = data.count + 1,
339
+ data.mappedid.push(dropretagimage)
340
+ }
341
+ }
342
+ })
343
+ }
344
+
345
+ selectretagimage(res: any) {
346
+ this.retagimage.map((data: any) => {
347
+ if (data.img_id == res) {
348
+ if (data.mappedid.length == 1) {
349
+ data.selected = !data.selected
350
+ }
351
+ }
352
+ })
353
+ }
354
+
355
+ selectgroupimage(res: any) {
356
+ this.auditmappingdata.map((data: any) => {
357
+ if (data.img_id == res) {
358
+ if (data.mappedid.length == 1) {
359
+ data.selected = !data.selected
360
+ }
361
+ }
362
+ })
363
+ }
364
+
365
+ removeaudit(data: any) {
366
+ const modalRef = this.modalService.open(RemoveAuditComponent, {
367
+ size: 'lg',
368
+ centered: true,
369
+ backdrop: 'static',
370
+ keyboard: false
371
+ })
372
+ modalRef.componentInstance.data = data;
373
+ modalRef.closed.subscribe((res: any) => {
374
+ if (res && res?.reload) {
375
+ this.initial_data_loading()
376
+ }
377
+ })
378
+
379
+ }
380
+ submitaudit() {
381
+ const modalRef = this.modalService.open(AuditReportPopupComponent, {
382
+ size: 'lg',
383
+ centered: true,
384
+ backdrop: 'static',
385
+ keyboard: false
386
+ })
387
+ modalRef.componentInstance.selectedType = this.selectedType;
388
+ modalRef.closed;
389
+ }
390
+
391
+
392
+ viewcategory(data: any) {
393
+ const modalRef = this.modalService.open(ViewcategoryComponent, {
394
+ size: 'lg',
395
+ centered: true,
396
+ backdrop: 'static',
397
+ keyboard: false
398
+ })
399
+ modalRef.componentInstance.data = data
400
+ modalRef.componentInstance.imageList = data,
401
+ modalRef.closed.subscribe((res: any) => {
402
+ if (res && res?.reload) {
403
+ this.initial_data_loading()
404
+ }
405
+ })
406
+ }
407
+
408
+ dropImage(event: any) {
409
+ const htmltag = event.dataTransfer.getData('text/html');
410
+ var Name = getTagNameFromHTML(htmltag);
411
+ const dropZone = event.target;
412
+ console.log(Name)
413
+ debugger
414
+ if (Name == 'customer' || Name == 'retag') {
415
+ event.preventDefault();
416
+ const draggedImageId = event.dataTransfer.getData('text/plain');
417
+ const draggedImage = document.getElementById(draggedImageId);
418
+ event.target.appendChild(draggedImage);
419
+ this.auditmappingdata.map((data: any, index: number) => {
420
+
421
+ if (data.img_id === dropZone.id) {
422
+ let findone = [];
423
+ const retagdata = JSON.parse(sessionStorage.getItem('retag') || '[]');
424
+ this.retagimage = retagdata;
425
+ findone = this.retagimage.filter((imgData: any) => imgData.img_id === draggedImageId);
426
+ if (findone.length === 0) {
427
+ findone = this.auditmappingdata.filter((imgData: any) => imgData.img_id === draggedImageId);
428
+ }
429
+
430
+ this.retagimage = this.retagimage.filter((imgData: any) => imgData.img_id !== draggedImageId);
431
+ sessionStorage.setItem('retag', JSON.stringify(this.retagimage));
432
+
433
+ console.log("🚀 ~ AuditRetagComponent ~ dropImage ~ findone:", findone)
434
+ if (findone.length > 0) {
435
+ data.count += findone[0].count;
436
+
437
+ data.mappedid = [...data.mappedid, ...findone[0]];
438
+ if ('duplicate' in sessionStorage) {
439
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
440
+ filedata = [...filedata, ...findone]
441
+ sessionStorage.setItem('duplicate', JSON.stringify(filedata))
442
+ } else {
443
+ sessionStorage.setItem('duplicate', JSON.stringify(findone))
444
+ let filedata = JSON.parse(sessionStorage.getItem('duplicate') || '{}')
445
+ console.log("🚀 ~ StartAuditComponent ~ dropImage ~ filedata:", filedata)
446
+
447
+ }
448
+ } else {
449
+ data.count += 1;
450
+ data.mappedid.push(draggedImageId);
451
+ }
452
+ }
453
+ })
454
+ if (Name == 'customer') {
455
+ this.auditmappingdata.splice(this.auditmappingdata.findIndex(({ img_id }: { img_id: string }) => img_id == draggedImageId), 1);
456
+ this.auditmappingdata.map((data: any) => data.selected = false)
457
+ }
458
+
459
+
460
+ this.customercount = this.auditmappingdata?.length;
461
+ const jsonString = JSON.stringify(this.auditmappingdata);
462
+ const compressedData = LZString.compress(jsonString);
463
+ sessionStorage.setItem('audit', compressedData)
464
+ var retagdata = JSON.parse(sessionStorage.getItem('retag') || '{}')
465
+ this.retagimage = retagdata;
466
+ if (this.retagimage.length == 0) {
467
+ this.submitvalue = false;
468
+ }
469
+ this.category.map((data: any) => {
470
+ var count = JSON.parse(sessionStorage.getItem(data.type) || '{}')
471
+ data.count = count?.length
472
+ })
473
+ }
474
+
475
+
476
+
477
+ function getTagNameFromHTML(html: any) {
478
+ var tempElement = document.createElement('div');
479
+ tempElement.innerHTML = html;
480
+ var firstChild: any = tempElement.firstChild;
481
+ if (firstChild.hasAttribute('name')) {
482
+ var namePropertyValue = firstChild.getAttribute('name');
483
+ return namePropertyValue;
484
+ }
485
+ return null;
486
+ }
487
+ }
488
+
489
+ }
@@ -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
+
@@ -0,0 +1,54 @@
1
+ <div class="card">
2
+ <div class="card-header">
3
+ <div class="card-title d-grid">
4
+ <div *ngIf="data?.type" class="card-label">{{data?.type | titlecase}} Count - {{data?.storeId}}</div>
5
+ <div class="text-sub">{{data?.fileDate | customDateFormat}}</div>
6
+ </div>
7
+ <div class="card-toolbar">
8
+ <button *ngIf="!noData" type="button" (click)="exportTable()"
9
+ class="btn btn-default mx-2 btn-outline btn-outline-default rounded-3 text-nowrap border-val"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
10
+ <path d="M17.5 12.5V15.8333C17.5 16.2754 17.3244 16.6993 17.0118 17.0118C16.6993 17.3244 16.2754 17.5 15.8333 17.5H4.16667C3.72464 17.5 3.30072 17.3244 2.98816 17.0118C2.67559 16.6993 2.5 16.2754 2.5 15.8333V12.5M14.1667 6.66667L10 2.5M10 2.5L5.83333 6.66667M10 2.5V12.5" stroke="#344054" stroke-width="1.67" stroke-linecap="round" stroke-linejoin="round"/>
11
+ </svg>
12
+ <span class="ms-2">Export</span> </button>
13
+ </div>
14
+ </div>
15
+ <div class="card-body">
16
+ <div class="row mx-3">
17
+ <div class="col-md-12 item scroll-y">
18
+ <div class="item" *ngFor="let images of auditImages;let i=index" style="padding: 10px;">
19
+ <img class="mx-3 my-3 img" [src]="images?.imgPath">
20
+ <div class="text-center m-0 fs-7 fw-bold">{{images?.imgName}}</div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+
26
+ <ng-container *ngIf="loading">
27
+ <div class="row loader d-flex justify-content-center align-items-center">
28
+ <div class="shimmer">
29
+ <div class="wrapper">
30
+ <div class="stroke animate title"></div>
31
+ <div class="stroke animate link"></div>
32
+ <div class="stroke animate description"></div>
33
+ </div>
34
+ </div>
35
+ <div class="shimmer">
36
+ <div class="wrapper">
37
+ <div class="stroke animate title"></div>
38
+ <div class="stroke animate link"></div>
39
+ <div class="stroke animate description"></div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </ng-container>
44
+ <ng-container *ngIf="noData">
45
+ <div class="row">
46
+ <div class="col-lg-12 mb-3">
47
+ <div class="card-body d-flex justify-content-center align-items-center flex-column">
48
+ <img class="img-src w-25" src="./assets/tango/Icons/Nodata.svg" alt="">
49
+ </div>
50
+ </div>
51
+ </div>
52
+ </ng-container>
53
+ </div>
54
+