tango-app-ui-manage-tickets 3.7.0-beta.6 → 3.7.0-beta.61

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 +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 +3344 -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,38 @@
1
+ <div class="modal-body mt-5">
2
+ <div class=" d-flex">
3
+ <div class="d-flex justify-content-between w-100">
4
+ <div class="d-flex flex-column">
5
+ <div class="d-flex align-items-center mb-2">
6
+ <div class="fs-2 text-dark fw-bolder my-3 mx-7"> <span class="card-label fw-bold text-dark">
7
+ {{maindata?.name ? maindata?.name : 'Customer' }} Files -
8
+ <span>{{maindata?.count}}</span></span></div>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ <div class="btn btn-sm btn-icon btn-active-color-primary me-5" (click)="closepopup()" data-bs-dismiss="modal">
13
+ <span class="svg-icon svg-icon-1">
14
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
15
+ <rect opacity="0.5" x="6" y="17.3137" width="16" height="2" rx="1" transform="rotate(-45 6 17.3137)"
16
+ fill="black"></rect>
17
+ <rect x="7.41422" y="6" width="16" height="2" rx="1" transform="rotate(45 7.41422 6)" fill="black">
18
+ </rect>
19
+ </svg>
20
+ </span>
21
+ </div>
22
+ </div>
23
+ <div class="card-body">
24
+ <div class="row mx-3">
25
+ <div class="col-md-12 item scroll-y">
26
+ <div class="item" *ngFor="let item of imagelist;let i=index" style="padding: 10px;">
27
+
28
+ <img class="mx-3 mb-3 img" [src]="item.img_path">
29
+ <div class="text-center m-0 fs-7 fw-bold">{{item.img_name}}</div>
30
+ <span class="notify-badge1 cursor-pointer" (click)="removeimage(item)"><i class="fa fa-close" aria-hidden="true"
31
+ style="font-size:15px;color:#00A3FF"></i>
32
+ </span>
33
+
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
@@ -0,0 +1,29 @@
1
+ .img {
2
+ width: 95px;
3
+ height: 200px;
4
+ }
5
+
6
+ .item {
7
+ position: relative;
8
+ padding-top: 20px;
9
+ display: inline-block;
10
+ max-height: 595px;
11
+ }
12
+
13
+ .scroll-y {
14
+ overflow-y: auto !important;
15
+ position: relative !important;
16
+ }
17
+
18
+ .notify-badge1 {
19
+ position: absolute;
20
+ right: 14px;
21
+ top: 5px;
22
+ background: var(--Primary-50, #EAF8FF);
23
+ text-align: center;
24
+ border-radius: 6px;
25
+ color: #00A3FF;
26
+ border: 2px solid var(--Primary-600, #00A3FF);
27
+ padding: 0px 8px;
28
+ font-size: 20px;
29
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ViewcategoryComponent } from './viewcategory.component';
4
+
5
+ describe('ViewcategoryComponent', () => {
6
+ let component: ViewcategoryComponent;
7
+ let fixture: ComponentFixture<ViewcategoryComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ViewcategoryComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ViewcategoryComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,79 @@
1
+ import { Component, OnInit, Input } from '@angular/core';
2
+ import { NgbModal, NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import * as LZString from 'lz-string';
4
+ @Component({
5
+ selector: 'lib-viewcategory',
6
+ templateUrl: './viewcategory.component.html',
7
+ styleUrl: './viewcategory.component.scss'
8
+ })
9
+ export class ViewcategoryComponent {
10
+ maindata: any = {}
11
+ imagelist: any = []
12
+ counter: any = 0;
13
+ @Input() data: any
14
+ constructor(public modalService: NgbModal, public activeModel: NgbActiveModal) { }
15
+
16
+ ngOnInit(): void {
17
+ if (this.data) {
18
+ this.maindata = this.data
19
+ }
20
+ var saveData = JSON.parse(sessionStorage.getItem(this.maindata?.type) || '{}')
21
+ if (saveData.length > 0) {
22
+ this.imagelist = saveData
23
+ }
24
+ }
25
+ removeimage(data: any) {
26
+
27
+ this.counter = 0;
28
+ let oldData = JSON.parse(sessionStorage.getItem(this.maindata?.type) || '{}')
29
+ let auditData = sessionStorage.getItem('audit') || '{}'
30
+ const decompressedData = LZString.decompress(auditData);
31
+ var customer = JSON.parse(decompressedData || '{}')
32
+ customer.map((cus: any) => {
33
+ if (cus.count > 0) {
34
+ cus.mappedid = cus.mappedid.filter((x: any) => x.img_name != data.img_name)
35
+ cus.count = cus.mappedid.length
36
+ }
37
+ })
38
+ console.log(customer)
39
+ const jsonString = JSON.stringify(customer);
40
+ const compressedData = LZString.compress(jsonString);
41
+ sessionStorage.setItem('audit', compressedData)
42
+ if (this.counter < oldData?.length) {
43
+ this.counter = this.counter + 1;
44
+ var wrongData = oldData.splice(oldData.findIndex(({ img_name }: { img_name: string }) => img_name == data?.img_name), 1);
45
+ let stringifydata = sessionStorage.getItem('audit') || '{}'
46
+ const decompressedData = LZString.decompress(stringifydata);
47
+ var customer = JSON.parse(decompressedData || '{}')
48
+ console.log(wrongData)
49
+ if (wrongData.length > 0) {
50
+ wrongData[0].selected = false
51
+ }
52
+ customer.push(wrongData[0])
53
+ const jsonString = JSON.stringify(customer);
54
+ const compressedData = LZString.compress(jsonString);
55
+ sessionStorage.setItem('audit', compressedData)
56
+ sessionStorage.setItem(this.maindata?.type, JSON.stringify(oldData))
57
+ var newdata = JSON.parse(sessionStorage.getItem(this.maindata?.type) || '{}')
58
+ if (newdata.length > 0) {
59
+ this.imagelist = newdata
60
+ } else if (newdata.length == 0) {
61
+ this.activeModel.close({ reload: true });
62
+ } else {
63
+ this.imagelist = []
64
+
65
+ }
66
+ } else {
67
+
68
+ }
69
+
70
+
71
+ }
72
+
73
+ closepopup() {
74
+ console.log(this.counter)
75
+ if (this.counter > 0) {
76
+ this.activeModel.close({ reload: true });
77
+ } else { this.activeModel.close({ reload: false }); }
78
+ }
79
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { AuditService } from './audit.service';
4
+
5
+ describe('AuditService', () => {
6
+ let service: AuditService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(AuditService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });
@@ -0,0 +1,98 @@
1
+ import { Injectable, Optional } from '@angular/core';
2
+ import { HttpClient, HttpErrorResponse } from '@angular/common/http';
3
+ import { Observable, catchError, map, throwError,BehaviorSubject } from 'rxjs';
4
+ import { GlobalStateService } from 'tango-app-ui-global';
5
+
6
+ @Injectable({
7
+ providedIn: 'root'
8
+ })
9
+ export class AuditService {
10
+
11
+
12
+ ticketApiUrl: any;
13
+ storeApiUrl: any;
14
+ data: any;
15
+ userUrl: any;
16
+ tokenStorage: any;
17
+ zoneauditApiUrl:any;
18
+ edgeAppApiUrl: any;
19
+ clientApiUrl:string
20
+
21
+ clientId = new BehaviorSubject<string>('')
22
+ clientData = new BehaviorSubject<any>(null)
23
+ auditApiUrl: any;
24
+ traxauditApiUrl: any;
25
+ vmsAuditUrl: any;
26
+ footfallDirapiUrl: any;
27
+
28
+ dropDownTrigger = new BehaviorSubject<any>(null)
29
+ constructor(private http: HttpClient, private gs: GlobalStateService) {
30
+ this.gs.environment.subscribe((env) => {
31
+ if (env) {
32
+ this.ticketApiUrl = env.ticketsApiUrl
33
+ this.storeApiUrl = env.storeApiUrl;
34
+ this.userUrl = env.userUrl;
35
+ this.edgeAppApiUrl = env.edgeAppApiUrl;
36
+ this.auditApiUrl = env.auditApiUrl;
37
+ this.clientApiUrl = env.clientApiUrl
38
+ this.vmsAuditUrl = env.vmsAuditUrl
39
+ this.footfallDirapiUrl = env.footfallDirapiUrl
40
+ }
41
+ this.gs.dataRangeValue.subscribe((e:any)=>{
42
+ if(e){
43
+ this.clientId.next(e.client)
44
+ }
45
+ })
46
+ });
47
+
48
+ }
49
+
50
+ // audit code
51
+
52
+ getAuditMapping(payload:any) {
53
+ return this.http.get(`${this.vmsAuditUrl}/get-file?storeId=${payload?.storeId}&nextId=${payload?.nextId}&limit=${payload?.limit}&Date=${payload?.Date}&count=${payload?.count}`)
54
+ }
55
+ getAuditconfig(clientId:any) {
56
+ return this.http.get(`${this.clientApiUrl}/get-footfall-directory-config?clientId=${clientId}`)
57
+ }
58
+
59
+
60
+ export(data: any) {
61
+ return this.http.get(`${this.clientApiUrl}/audit/processing_info?export=${data.export}&userId=${data.userId}`, {responseType: 'arraybuffer'})
62
+ }
63
+
64
+ getauditCard(filter: any,user:any){
65
+ return this.http.get(`${this.clientApiUrl}/audit/userAuditSummary?range=${filter}&userId=${user}`)
66
+ }
67
+
68
+ getactivitylog(data: any) {
69
+ return this.http.post(`${this.clientApiUrl}/activitylog/list`, data)
70
+ }
71
+ saveDraft(data: any) {
72
+ return this.http.post(`${this.vmsAuditUrl}/save-draft`, data)
73
+ }
74
+ getAuditmappinglist(payload:any) {
75
+ return this.http.get(`${this.vmsAuditUrl}/get-drafted-data?fileDate=${payload?.fileDate}&storeId=${payload?.storeId}&auditId=${payload?.auditId}`)
76
+ }
77
+ saveaudit(data: any) {
78
+ return this.http.post(`${this.footfallDirapiUrl}/tango-review-ticket`, data)
79
+ }
80
+
81
+
82
+
83
+ userDetails() {
84
+ return this.http.get(`${this.auditApiUrl}/auth/me`, {
85
+ }).pipe(map((response: any) => {
86
+ localStorage.setItem('user-info', JSON.stringify(response.data));
87
+ return response
88
+ }),
89
+ catchError(this.handleError));
90
+ }
91
+
92
+ private handleError(error: HttpErrorResponse): Observable<never> {
93
+ return throwError(
94
+ () => new Error("Something bad happened; please try again later")
95
+ );
96
+ }
97
+
98
+ }
@@ -0,0 +1,48 @@
1
+ import { Injectable } from '@angular/core';
2
+ import * as FileSaver from 'file-saver';
3
+ import * as XLSX from 'xlsx';
4
+
5
+ const EXCEL_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8';
6
+ const EXCEL_EXTENSION = '.xlsx';
7
+ const ZIP_TYPE = 'application/zip'
8
+ const ZIP_EXTENSION = '.zip'
9
+
10
+ @Injectable({
11
+ providedIn: 'root'
12
+ })
13
+ export class ExcelService {
14
+
15
+
16
+ constructor() { }
17
+
18
+ public exportAsExcelFile(json: any[], excelFileName: string): void {
19
+ const worksheet: XLSX.WorkSheet = XLSX.utils.json_to_sheet(json);
20
+ const workbook: XLSX.WorkBook = { Sheets: { 'data': worksheet }, SheetNames: ['data'] };
21
+ const excelBuffer: any = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
22
+ this.saveAsExcelFile(excelBuffer, excelFileName);
23
+ }
24
+
25
+ public saveAsExcelFile(buffer: any, fileName: string): void {
26
+ console.log(buffer, fileName);
27
+
28
+ const data: Blob = new Blob([buffer], {
29
+ type: EXCEL_TYPE
30
+ });
31
+ FileSaver.saveAs(data, fileName + 'list'+ EXCEL_EXTENSION);
32
+ }
33
+
34
+ private saveAsTemplate(buffer: any, fileName: string): void {
35
+ const data: Blob = new Blob([buffer], {
36
+ type: EXCEL_TYPE
37
+ });
38
+ FileSaver.saveAs(data, fileName + EXCEL_EXTENSION);
39
+ }
40
+
41
+ public saveAsZipFile(buffer: any, fileName: string): void {
42
+ const data: Blob = new Blob([buffer], {
43
+ type: ZIP_TYPE
44
+ });
45
+ FileSaver.saveAs(data, fileName + 'Images'+ ZIP_EXTENSION);
46
+ }
47
+
48
+ }
@@ -0,0 +1,16 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+
3
+ import { TicketService } from './ticket.service';
4
+
5
+ describe('TicketService', () => {
6
+ let service: TicketService;
7
+
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({});
10
+ service = TestBed.inject(TicketService);
11
+ });
12
+
13
+ it('should be created', () => {
14
+ expect(service).toBeTruthy();
15
+ });
16
+ });