tango-app-ui-manage-tickets 3.7.0-beta.14 → 3.7.0-beta.16

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 (91) 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-metrics/audit-metrics.component.html +345 -0
  13. package/src/lib/components/audit-metrics/audit-metrics.component.scss +34 -0
  14. package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +23 -0
  15. package/src/lib/components/audit-metrics/audit-metrics.component.ts +292 -0
  16. package/src/lib/components/comment-model/comment-model.component.html +24 -0
  17. package/src/lib/components/comment-model/comment-model.component.scss +20 -0
  18. package/src/lib/components/comment-model/comment-model.component.spec.ts +23 -0
  19. package/src/lib/components/comment-model/comment-model.component.ts +53 -0
  20. package/src/lib/components/count/count.component.html +54 -0
  21. package/src/lib/components/count/count.component.scss +14 -0
  22. package/src/lib/components/count/count.component.spec.ts +23 -0
  23. package/src/lib/components/count/count.component.ts +82 -0
  24. package/src/lib/components/footfall-dic/footfall-dic.component.html +1242 -0
  25. package/src/lib/components/footfall-dic/footfall-dic.component.scss +273 -0
  26. package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +23 -0
  27. package/src/lib/components/footfall-dic/footfall-dic.component.ts +1106 -0
  28. package/src/lib/components/group-select/group-select.component.html +44 -0
  29. package/src/lib/components/group-select/group-select.component.scss +144 -0
  30. package/src/lib/components/group-select/group-select.component.spec.ts +23 -0
  31. package/src/lib/components/group-select/group-select.component.ts +145 -0
  32. package/src/lib/components/re-trigger/re-trigger.component.html +53 -0
  33. package/src/lib/components/re-trigger/re-trigger.component.scss +16 -0
  34. package/src/lib/components/re-trigger/re-trigger.component.spec.ts +23 -0
  35. package/src/lib/components/re-trigger/re-trigger.component.ts +96 -0
  36. package/src/lib/components/reactive-select/reactive-select.component.html +18 -0
  37. package/src/lib/components/reactive-select/reactive-select.component.scss +52 -0
  38. package/src/lib/components/reactive-select/reactive-select.component.spec.ts +23 -0
  39. package/src/lib/components/reactive-select/reactive-select.component.ts +104 -0
  40. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +38 -0
  41. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +35 -0
  42. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +23 -0
  43. package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +116 -0
  44. package/src/lib/components/tickets/tickets.component.html +439 -0
  45. package/src/lib/components/tickets/tickets.component.scss +131 -0
  46. package/src/lib/components/tickets/tickets.component.spec.ts +23 -0
  47. package/src/lib/components/tickets/tickets.component.ts +748 -0
  48. package/src/lib/services/excel.service.ts +48 -0
  49. package/src/lib/services/ticket.service.spec.ts +16 -0
  50. package/src/lib/services/ticket.service.ts +175 -0
  51. package/src/lib/tango-manage-tickets-routing.module.ts +16 -0
  52. package/src/lib/tango-manage-tickets.module.ts +34 -0
  53. package/{public-api.d.ts → src/public-api.ts} +8 -2
  54. package/tsconfig.lib.json +14 -0
  55. package/tsconfig.lib.prod.json +10 -0
  56. package/tsconfig.spec.json +14 -0
  57. package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +0 -98
  58. package/esm2022/lib/components/audit-log/audit-log.component.mjs +0 -11
  59. package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +0 -298
  60. package/esm2022/lib/components/comment-model/comment-model.component.mjs +0 -58
  61. package/esm2022/lib/components/count/count.component.mjs +0 -89
  62. package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +0 -983
  63. package/esm2022/lib/components/group-select/group-select.component.mjs +0 -155
  64. package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +0 -96
  65. package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +0 -108
  66. package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +0 -127
  67. package/esm2022/lib/components/tickets/tickets.component.mjs +0 -793
  68. package/esm2022/lib/services/excel.service.mjs +0 -45
  69. package/esm2022/lib/services/ticket.service.mjs +0 -161
  70. package/esm2022/lib/tango-manage-tickets-routing.module.mjs +0 -24
  71. package/esm2022/lib/tango-manage-tickets.module.mjs +0 -54
  72. package/esm2022/public-api.mjs +0 -6
  73. package/esm2022/tango-app-ui-manage-tickets.mjs +0 -5
  74. package/fesm2022/tango-app-ui-manage-tickets.mjs +0 -3006
  75. package/fesm2022/tango-app-ui-manage-tickets.mjs.map +0 -1
  76. package/index.d.ts +0 -5
  77. package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +0 -30
  78. package/lib/components/audit-log/audit-log.component.d.ts +0 -5
  79. package/lib/components/audit-metrics/audit-metrics.component.d.ts +0 -59
  80. package/lib/components/comment-model/comment-model.component.d.ts +0 -17
  81. package/lib/components/count/count.component.d.ts +0 -23
  82. package/lib/components/footfall-dic/footfall-dic.component.d.ts +0 -139
  83. package/lib/components/group-select/group-select.component.d.ts +0 -33
  84. package/lib/components/re-trigger/re-trigger.component.d.ts +0 -32
  85. package/lib/components/reactive-select/reactive-select.component.d.ts +0 -32
  86. package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +0 -27
  87. package/lib/components/tickets/tickets.component.d.ts +0 -84
  88. package/lib/services/excel.service.d.ts +0 -10
  89. package/lib/services/ticket.service.d.ts +0 -49
  90. package/lib/tango-manage-tickets-routing.module.d.ts +0 -7
  91. package/lib/tango-manage-tickets.module.d.ts +0 -21
@@ -0,0 +1,44 @@
1
+ <div class="outer-container">
2
+ <div [ngClass]="disabled ? 'disable-input':''" (click)="openDropdown($event)" class="form-select">
3
+ <ng-container *ngIf="multi" >
4
+ <span *ngIf="selectedValues?.length" class="select-value mx-2"> <img class="me-2" alt="Pic" src="./assets/tango/Image/users-teams.svg">{{selectedValues?.[0]?.[searchField]}}</span>
5
+ <!-- <span *ngIf="selectedValues?.length > 1" class="select-value mx-2"><img class="me-2" alt="Pic" src="./assets/tango/Image/users-teams.svg">{{selectedValues?.[1]?.[searchField]}}</span> -->
6
+ <span class="select-value mx-2" *ngIf="selectedValues?.length > 1">+{{selectedValues?.length -1}}</span> {{label}}
7
+ </ng-container>
8
+ <ng-container *ngIf="!multi" >
9
+ {{selectedValues?.[0]?.[searchField]}}
10
+ </ng-container>
11
+ </div>
12
+ <div [ngClass]="showDropdown ? '' : 'd-none'" class="input-container dropdown" >
13
+ <div class="w-100 input-wrapper">
14
+ <input [(ngModel)]="searchValue" placeholder="Search" (input)="onInput($event)" type="text">
15
+ <svg class="search-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="17" viewBox="0 0 16 17" fill="none">
16
+ <path d="M14 14.5L11.1 11.6M12.6667 7.83333C12.6667 10.7789 10.2789 13.1667 7.33333 13.1667C4.38781 13.1667 2 10.7789 2 7.83333C2 4.88781 4.38781 2.5 7.33333 2.5C10.2789 2.5 12.6667 4.88781 12.6667 7.83333Z" stroke="#667085" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>
17
+ </svg>
18
+ </div>
19
+ <ul>
20
+ <li *ngIf="multi && filteredValues?.length">
21
+ <label class="form-check" [for]="instanceId" >
22
+ <input (change)="onSelectAll($event)" [checked]="checkIfAllSelected()" class="form-check-input me-3" type="checkbox"
23
+ [id]="instanceId">
24
+ <span class="form-check-label" >
25
+ Select All
26
+ </span>
27
+ </label>
28
+ </li>
29
+ <li *ngFor="let item of filteredValues" [ngClass]="item.isSelected && !multi ? 'selected' : ''" >
30
+ <label [for]="item[idField] + instanceId" [ngClass]="multi ? '': 'ps-0'" class="form-check">
31
+ <input [ngClass]="multi ? '': 'd-none'" (change)="onSelect($event, item)" [(ngModel)]="item.isSelected" class="form-check-input me-3" type="checkbox" value=""
32
+ [id]="item[idField] + instanceId">
33
+ <span class="form-check-label" >
34
+ {{item[searchField]}}
35
+ </span>
36
+ </label>
37
+ </li>
38
+ <li *ngIf="!filteredValues?.length" >
39
+ <span class="d-flex align-items-center justify-content-center" >No data found</span>
40
+ </li>
41
+ </ul>
42
+ </div>
43
+
44
+ </div>
@@ -0,0 +1,144 @@
1
+ :host {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
5
+
6
+
7
+ .outer-container {
8
+ // z-index: 1;
9
+ position: relative;
10
+ background-color: white;
11
+
12
+
13
+ .form-select {
14
+ font-size: 1.1rem;
15
+ font-weight: 600;
16
+ border-radius: 8px !important;
17
+ color: var(--Gray-500, #344054);
18
+ border: 1px solid var(--Gray-300, #D0D5DD) !important;
19
+ height: 42.5px;
20
+ }
21
+
22
+ .disable-input{
23
+ pointer-events: none;
24
+ background-color: #F9FAFB !important;
25
+ }
26
+
27
+ .input-container {
28
+ position: absolute;
29
+ width: 100%;
30
+ z-index: 1;
31
+
32
+ .input-wrapper {
33
+ padding: 8px 10px;
34
+ background-color: white;
35
+ border-top-right-radius: 8px;
36
+ border-top-left-radius: 8px;
37
+ border-top: 1px solid rgba(16, 24, 40, 0.08);
38
+ border-right: 1px solid rgba(16, 24, 40, 0.08);
39
+ border-left: 1px solid rgba(16, 24, 40, 0.08);
40
+
41
+
42
+ input {
43
+ width: 100%;
44
+ border-radius: 8px;
45
+ border: 1px solid var(--Gray-300, #D0D5DD);
46
+ background: var(--White, #FFF);
47
+ box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
48
+ padding: 10px 14px 10px 30px;
49
+ outline: none;
50
+
51
+ ::placeholder {
52
+ color: var(--Gray-500, #667085);
53
+ font-family: Inter;
54
+ font-size: 14px;
55
+ font-weight: 500;
56
+ line-height: 20px;
57
+ }
58
+ }
59
+
60
+ .search-icon {
61
+ position: absolute;
62
+ left: 20px;
63
+ top: 20px;
64
+ }
65
+ }
66
+
67
+ ul {
68
+ position: relative;
69
+ background-color: white;
70
+ margin: 0;
71
+ padding: 0;
72
+ max-height: 200px;
73
+ min-height: auto;
74
+ overflow-y: auto;
75
+ border-bottom-right-radius: 8px;
76
+ border-bottom-left-radius: 8px;
77
+ border-bottom: 1px solid rgba(16, 24, 40, 0.08);
78
+ border-right: 1px solid rgba(16, 24, 40, 0.08);
79
+ border-left: 1px solid rgba(16, 24, 40, 0.08);
80
+
81
+ .selected{
82
+ background: #F9FAFB;
83
+ }
84
+
85
+ li {
86
+ list-style: none;
87
+ padding: 10px 16px;
88
+ cursor: pointer;
89
+
90
+ label{
91
+ cursor: pointer;
92
+ }
93
+
94
+ }
95
+
96
+ li:hover{
97
+ background: #F9FAFB;
98
+ }
99
+
100
+ }
101
+
102
+ }
103
+
104
+ }
105
+
106
+ .form-check {
107
+ display: flex;
108
+ align-items: center;
109
+ }
110
+
111
+ .form-check-input {
112
+ height: 16px;
113
+ width: 16px;
114
+ border-radius: 4px;
115
+ border: 1px solid var(--Primary-600, #00A3FF);
116
+ }
117
+
118
+ .form-check-input:checked {
119
+ --bs-form-check-bg-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAICAYAAADA+m62AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAB4SURBVHgBhY7NDUBQEIRnqcJNKXTg6qYTStCB+Isy6IQSNMDa9SLh5eWZZPcw+81kCX/quABhD73QyKXsGoyIvNCJSto2hEhNtY4N9cwYeMXEsVqB1GaSauRQOpty2tSmO3FgloAmF5nEhgyoesMO6CuFW66fn2xdFyA3ZzcRLrMAAAAASUVORK5CYII=');
120
+ background-color: #EAF8FF;
121
+ border-color: #00A3FF;
122
+ }
123
+
124
+ .form-check-label {
125
+ color: var(--Gray-700, #344054);
126
+ font-family: Inter;
127
+ font-size: 14px;
128
+ font-style: normal;
129
+ font-weight: 500;
130
+ line-height: 20px;
131
+ }
132
+
133
+ .select-value{
134
+ border-radius: 16px !important;
135
+ background: var(--Gray-100, #F2F4F7) !important;
136
+ mix-blend-mode: multiply;
137
+ color: var(--Gray-700, #344054) !important;
138
+ text-align: center;
139
+ font-size: 14px;
140
+ font-style: normal;
141
+ font-weight: 500;
142
+ line-height: 20px;
143
+ padding: 4px 12px 4px 6px;
144
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { GroupSelectComponent } from './group-select.component';
4
+
5
+ describe('GroupSelectComponent', () => {
6
+ let component: GroupSelectComponent;
7
+ let fixture: ComponentFixture<GroupSelectComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [GroupSelectComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(GroupSelectComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,145 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostListener, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
2
+ import { TicketService } from '../../services/ticket.service';
3
+ @Component({
4
+ selector: 'lib-group-select',
5
+ templateUrl: './group-select.component.html',
6
+ styleUrl: './group-select.component.scss'
7
+ })
8
+ export class GroupSelectComponent implements OnInit, OnChanges {
9
+ @HostListener('document:click', ['$event'])
10
+ onClick(event: MouseEvent) {
11
+ const target = event.target as HTMLElement;
12
+ if (!target.closest('.dropdown')) {
13
+ this.showDropdown = false;
14
+ }
15
+ }
16
+
17
+ @Input() items: any
18
+ @Input() searchField: string
19
+ @Input() multi: boolean
20
+ @Input() idField: string
21
+ @Input() selectedValues: any = []
22
+ @Input() disabled: boolean | undefined
23
+ @Input() label: string
24
+ @Output() selected = new EventEmitter<any>()
25
+ filteredValues: any = []
26
+ showDropdown: boolean
27
+ searchValue: string
28
+ instanceId: any;
29
+
30
+
31
+ constructor(private cd: ChangeDetectorRef, private authService:TicketService) { }
32
+ ngOnInit(): void {
33
+ this.instanceId = crypto.randomUUID();
34
+ this.authService.dropDownTrigger.subscribe((e)=>{
35
+ if(e !== this.instanceId){
36
+ this.showDropdown = false
37
+ this.cd.detectChanges()
38
+ }
39
+ })
40
+ }
41
+
42
+ ngOnChanges(changes: SimpleChanges): void {
43
+
44
+ if (changes['items'] && this.items?.length) {
45
+ this.initializeItems();
46
+ }
47
+ if (changes['selectedValues'] && Array.isArray(changes['selectedValues']?.currentValue) && changes['selectedValues']?.currentValue?.length > 0 && changes['selectedValues']?.currentValue[0]) {
48
+ this.updateSelectedValues();
49
+ }
50
+ }
51
+
52
+ initializeItems() {
53
+ this.filteredValues = this.items.map((item: any) => ({ ...item }));
54
+ this.updateSelectedValues()
55
+ }
56
+
57
+ updateSelectedValues() {
58
+ this.selectedValues?.forEach((selectedItem: any) => {
59
+ const item = this.filteredValues?.find((filteredItem: any) => filteredItem?.[this.idField] === selectedItem?.[this.idField]);
60
+ if (item) {
61
+ item.isSelected = true;
62
+ }
63
+ });
64
+
65
+ }
66
+
67
+ openDropdown(event: any) {
68
+ this.authService.dropDownTrigger.next(this.instanceId)
69
+ event.stopPropagation();
70
+ this.showDropdown = !this.showDropdown;
71
+ }
72
+
73
+ onInput(event: any) {
74
+ if (!event.target.value) {
75
+ this.filteredValues = [...this.items];
76
+ } else {
77
+ const searchTerm = event.target.value.toLowerCase();
78
+ this.filteredValues = this.items.filter((item: any) =>
79
+ item[this.searchField].toLowerCase().includes(searchTerm)
80
+ );
81
+ }
82
+ this.updateSelectedValues();
83
+ this.cd.detectChanges();
84
+ }
85
+
86
+ onSelect(event: any, item: any) {
87
+ if (this.multi) {
88
+ if (event.currentTarget.checked) {
89
+ this.selectedValues.push(item );
90
+ } else {
91
+ this.selectedValues = this.selectedValues.filter((elem: any) => elem[this.idField] !== item[this.idField]);
92
+ }
93
+ } else {
94
+ this.selectedValues = [{ ...item }];
95
+ this.filteredValues.forEach((element:any) => {
96
+ if(element[this.idField] !== item[this.idField]){
97
+ element.isSelected = false
98
+ }
99
+ });
100
+ this.showDropdown = false;
101
+ }
102
+
103
+ const valuesToEmit = this.selectedValues.map((value: any) => {
104
+ const selectedItem = { ...value };
105
+ delete selectedItem.isSelected;
106
+ return selectedItem;
107
+ });
108
+
109
+ this.cd.detectChanges();
110
+ this.emitSelectedValues(valuesToEmit);
111
+
112
+ }
113
+
114
+ onSelectAll(event: any) {
115
+ const selectAll = event.currentTarget.checked;
116
+ this.filteredValues.forEach((item: any) => item.isSelected = selectAll);
117
+
118
+ if (selectAll) {
119
+ this.selectedValues = [...this.filteredValues];
120
+ } else {
121
+ this.selectedValues = [];
122
+ }
123
+
124
+ const valuesToEmit = this.selectedValues.map((value: any) => {
125
+ const { isSelected, ...selectedItem } = value;
126
+ return selectedItem;
127
+ });
128
+
129
+ this.cd.detectChanges();
130
+ this.emitSelectedValues(valuesToEmit);
131
+ }
132
+
133
+
134
+ emitSelectedValues(values: any[]) {
135
+ if (this.multi) {
136
+ this.selected.emit(values);
137
+ } else {
138
+ this.selected.emit(values[0]);
139
+ }
140
+ }
141
+
142
+ checkIfAllSelected() {
143
+ return this.filteredValues.every((item: any) => item.isSelected);
144
+ }
145
+ }
@@ -0,0 +1,53 @@
1
+ <div class="card">
2
+
3
+ <div class="card-header border-0">
4
+ <div class="card-title d-grid">
5
+ <div class="card-title">Re-trigger File</div>
6
+ <div class="text-sub">Re-trigger the file to a queue or other users</div>
7
+ </div>
8
+ </div>
9
+ <div class="card-body">
10
+ <div class="">
11
+ <label class="label">Push Form</label>
12
+ <div class="position-relative w-100 mt-3 mb-5">
13
+ <button type="button" (click)="openDropdown($event)"
14
+ class="btn btn-default w-100 btn-outline btn-outline-default rounded-3 text-nowrap border-val d-flex justify-content-between">
15
+ {{selectedItem}}
16
+ <span><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"
17
+ viewBox="0 0 20 20" fill="none">
18
+ <path d="M5 7.5L10 12.5L15 7.5" stroke="#667085" stroke-width="1.66667"
19
+ stroke-linecap="round" stroke-linejoin="round" />
20
+ </svg></span>
21
+ </button>
22
+ <div *ngIf="dropDown" class="card py-1 w-100 position-absolute top-50px end-0">
23
+ <ul *ngFor="let item of dropdownItems" class="list-unstyled">
24
+ <li [ngClass]="selectedItem === item ? 'active' : ''"
25
+ class="camera px-5 items fw-semibold cursor-pointer py-2"
26
+ (click)="selectItem(item)">{{item}}
27
+ </li>
28
+ </ul>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <div class="mt-5 cursor-pointer d-flex mb-5">
33
+ <div *ngFor="let data of standardData" (click)="selectRadio(data)" class="d-flex align-items-center me-20">
34
+ <input [checked]="selectedData === data" type="radio" class="radio">
35
+ <span class="ms-3 standard">{{data}}</span>
36
+ </div>
37
+ </div>
38
+ <div *ngIf="selectedData === 'To User'" class="w-100 mb-5">
39
+ <label for="infraDownTime" class="label mb-3">Select User<span class="alert-required"></span></label>
40
+ <lib-select [items]="userList" [multi]="false" [searchField]="'userName'" [idField]="'userId'"
41
+ (selected)="onReportSelect($event)" [selectedValues]="[userId]"></lib-select>
42
+ </div>
43
+ <div>
44
+ <label class="label mb-3">Comments</label>
45
+ <textarea class="form-control" [(ngModel)]="Comment"></textarea>
46
+ </div>
47
+ <div class="d-flex mt-5">
48
+ <button class="btn btn-outline w-100 me-2" (click)="activeModal.dismiss()">Cancel</button>
49
+ <button *ngIf="selectedData === 'To User'" class="btn btn-primary w-100 ms-2" [disabled]="!userId || !Comment" (click)="closeModal()">Submit</button>
50
+ <button *ngIf="selectedData === 'To Queue'" class="btn btn-primary w-100 ms-2" [disabled]="!Comment" (click)="closeModal()">Submit</button>
51
+ </div>
52
+ </div>
53
+ </div>
@@ -0,0 +1,16 @@
1
+ .label{
2
+ color: var(--Gray-700, #344054);
3
+ font-size: 14px;
4
+ font-weight: 500;
5
+ line-height: 20px;
6
+ }
7
+ .standard{
8
+ color: var(--Gray-700, #344054);
9
+ font-size: 16px;
10
+ font-weight: 500;
11
+ line-height: 24px;
12
+ }
13
+ .radio{
14
+ width:16px !important;
15
+ height:16px !important;
16
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ReTriggerComponent } from './re-trigger.component';
4
+
5
+ describe('ReTriggerComponent', () => {
6
+ let component: ReTriggerComponent;
7
+ let fixture: ComponentFixture<ReTriggerComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ReTriggerComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ReTriggerComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });
@@ -0,0 +1,96 @@
1
+ import { Component,HostListener, OnDestroy, OnInit,Input } from '@angular/core';
2
+ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
3
+ import { TicketService } from '../../services/ticket.service';
4
+ import { takeUntil, Subject } from 'rxjs';
5
+
6
+ @Component({
7
+ selector: 'lib-retrigger',
8
+ templateUrl: './re-trigger.component.html',
9
+ styleUrl: './re-trigger.component.scss'
10
+ })
11
+ export class ReTriggerComponent implements OnInit,OnDestroy {
12
+
13
+ dropDown: boolean = false;
14
+ loading:boolean = true;
15
+ noData:boolean = false;
16
+ dropdownItems:any[] = [];
17
+ selectedItem: any = 'Audit';
18
+ selectedData:any = 'To Queue';
19
+ standardData:any = ['To Queue','To User']
20
+ Comment:any = '';
21
+ userId:any = '';
22
+ private readonly destroy$ = new Subject();
23
+ @Input() reTrigerData:any;
24
+ userList: any = [];
25
+
26
+ constructor(public activeModal:NgbActiveModal,private service:TicketService){
27
+
28
+ }
29
+
30
+ @HostListener('document:click', ['$event'])
31
+ onClick(event: MouseEvent) {
32
+ const
33
+ target = event.target as HTMLElement;
34
+ if (!target.closest('.dropDown')) {
35
+ this.dropDown = false;
36
+ }
37
+ }
38
+
39
+ ngOnInit(){
40
+ if(this.reTrigerData?.data?.auditType ==='ReAudit'){
41
+ this.dropdownItems = ['Audit','ReAudit']
42
+ }else if(this.reTrigerData?.data?.auditType ==='Audit'){
43
+ this.dropdownItems = ['Audit']
44
+ }
45
+ this.getuserList();
46
+ }
47
+
48
+ getuserList(){
49
+ this.service.getuserList().subscribe({
50
+ next:(res:any)=>{
51
+ if(res && res.code === 200) {
52
+ this.userList = res?.data?.result;
53
+ }
54
+ },
55
+ })
56
+ }
57
+
58
+ ngOnDestroy(): void {
59
+ this.destroy$.next(true);
60
+ this.destroy$.complete();
61
+ }
62
+
63
+ selectRadio(value:any){
64
+ this.selectedData = value;
65
+ }
66
+
67
+ openDropdown(event: MouseEvent) {
68
+ event.stopPropagation();
69
+ this.dropDown = !this.dropDown;
70
+ }
71
+
72
+ selectItem(value: any) {
73
+ this.selectedItem = value;
74
+ this.dropDown = false;
75
+ }
76
+
77
+ onReportSelect(event:any){
78
+ this.userId = event;
79
+ }
80
+
81
+ closeModal(){
82
+ let data:any = {
83
+ fileDate: this.reTrigerData?.data?.fileDate,
84
+ storeId: this.reTrigerData?.data?.storeId,
85
+ auditType: this.selectedItem,
86
+ zoneName : this.reTrigerData?.data?.zoneName,
87
+ triggerType: this.selectedData === 'To Queue' ? 'queue' : 'user',
88
+ totalCount: this.selectedItem ==='Audit' ? this.reTrigerData?.data?.beforeCount : this.reTrigerData?.data?.afterCount,
89
+ comments: this.Comment,
90
+ moduleType : this.reTrigerData?.data?.moduleType
91
+ }
92
+ this.selectedData === 'To User' ? data.userId = this.userId.userId : ''
93
+ this.activeModal.close(data);
94
+ }
95
+
96
+ }
@@ -0,0 +1,18 @@
1
+ <div class="custom-select">
2
+ <div class="form-group">
3
+ <label *ngIf="label" class="form-label">{{label}}</label>
4
+ <div class="position-relative">
5
+ <div (click)="openDropdown()" [ngClass]="isDisabled ? 'disable' : ''" class="form-select dropselect ellipse1">
6
+ {{selected?.[nameField]}}</div>
7
+ <div *ngIf="isOpened" class="card py-2 w-100 position-absolute end-0 z-1 drop-list">
8
+ <ul class="list-unstyled mb-2">
9
+ <li *ngFor="let item of data" (click)="onSelect(item)"
10
+ [ngClass]="item?.[idField] === selected?.[idField] ? 'active' : ''"
11
+ class="text px-5 items cursor-pointer py-4 ">
12
+ {{item?.[nameField]}}
13
+ </li>
14
+ </ul>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </div>
@@ -0,0 +1,52 @@
1
+ .custom-select {
2
+ min-width: 200px;
3
+ .items:hover,
4
+ .tems.focus,
5
+ .items.active,
6
+ .camera.focus-visible {
7
+ background: var(--Gray-50, #F9FAFB);
8
+ }
9
+
10
+ .drop-list{
11
+ max-height: 300px;
12
+ overflow-y: scroll;
13
+ }
14
+
15
+ .dropselect {
16
+ color: var(--Gray-500, #667085);
17
+ font-family: 'Inter';
18
+ font-size: 16px;
19
+ font-style: normal;
20
+ font-weight: 400;
21
+ line-height: 24px;
22
+ /* 150% */
23
+ height: 45px !important;
24
+ cursor: default;
25
+ white-space: nowrap;
26
+ overflow: hidden;
27
+ }
28
+
29
+ .text {
30
+ color: var(--Gray-700, #344054);
31
+ font-size: 14px;
32
+ font-weight: 500;
33
+ line-height: 20px;
34
+ }
35
+
36
+ .disable{
37
+ pointer-events: none;
38
+ background-color: #F9FAFB !important;
39
+ }
40
+ }
41
+
42
+ .ellipse1{
43
+ min-width:auto;
44
+ max-width:100%;
45
+ white-space: nowrap;
46
+ overflow: hidden;
47
+ text-overflow: ellipsis;
48
+ }
49
+
50
+ .z-1 {
51
+ z-index: 9 !important;
52
+ }
@@ -0,0 +1,23 @@
1
+ import { ComponentFixture, TestBed } from '@angular/core/testing';
2
+
3
+ import { ReactiveSelectComponent } from './reactive-select.component';
4
+
5
+ describe('ReactiveSelectComponent', () => {
6
+ let component: ReactiveSelectComponent;
7
+ let fixture: ComponentFixture<ReactiveSelectComponent>;
8
+
9
+ beforeEach(async () => {
10
+ await TestBed.configureTestingModule({
11
+ declarations: [ReactiveSelectComponent]
12
+ })
13
+ .compileComponents();
14
+
15
+ fixture = TestBed.createComponent(ReactiveSelectComponent);
16
+ component = fixture.componentInstance;
17
+ fixture.detectChanges();
18
+ });
19
+
20
+ it('should create', () => {
21
+ expect(component).toBeTruthy();
22
+ });
23
+ });