tango-app-ui-manage-tickets 3.7.0-beta.60 → 3.7.0-beta.62
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.
- package/esm2022/lib/components/add-csm-modal/add-csm-modal.component.mjs +98 -0
- package/esm2022/lib/components/audit-log/audit-log.component.mjs +11 -0
- package/esm2022/lib/components/audit-mapping-list/audit-mapping-list.component.mjs +486 -0
- package/esm2022/lib/components/audit-metrics/audit-metrics.component.mjs +298 -0
- package/esm2022/lib/components/audit-report-popup/audit-report-popup.component.mjs +389 -0
- package/esm2022/lib/components/audit-retag/audit-retag.component.mjs +472 -0
- package/esm2022/lib/components/comment-model/comment-model.component.mjs +58 -0
- package/esm2022/lib/components/count/count.component.mjs +89 -0
- package/esm2022/lib/components/custom-select/custom-select.component.mjs +187 -0
- package/esm2022/lib/components/filter-options/filter-options.component.mjs +41 -0
- package/esm2022/lib/components/footfall-dic/footfall-dic.component.mjs +1061 -0
- package/esm2022/lib/components/footfall-dicview/footfall-dicview.component.mjs +1014 -0
- package/esm2022/lib/components/footfall-popup/footfall-popup.component.mjs +15 -0
- package/esm2022/lib/components/group-select/group-select.component.mjs +155 -0
- package/esm2022/lib/components/re-trigger/re-trigger.component.mjs +96 -0
- package/esm2022/lib/components/reactive-select/reactive-select.component.mjs +108 -0
- package/esm2022/lib/components/remove-audit/remove-audit.component.mjs +81 -0
- package/esm2022/lib/components/start-audit/start-audit.component.mjs +761 -0
- package/esm2022/lib/components/tango-manage-tickets/tango-manage-tickets.component.mjs +131 -0
- package/esm2022/lib/components/ticket-filter-panel/ticket-filter-panel.component.mjs +435 -0
- package/esm2022/lib/components/ticket-footfall-new/ticket-footfall-new.component.mjs +2748 -0
- package/esm2022/lib/components/ticketclosepopup/ticketclosepopup.component.mjs +43 -0
- package/esm2022/lib/components/tickets/tickets.component.mjs +847 -0
- package/esm2022/lib/components/viewcategory/viewcategory.component.mjs +89 -0
- package/esm2022/lib/services/audit.service.mjs +88 -0
- package/esm2022/lib/services/excel.service.mjs +45 -0
- package/esm2022/lib/services/ticket.service.mjs +319 -0
- package/esm2022/lib/services/timer.service.mjs +84 -0
- package/esm2022/lib/tango-manage-tickets-routing.module.mjs +44 -0
- package/esm2022/lib/tango-manage-tickets.module.mjs +109 -0
- package/esm2022/public-api.mjs +6 -0
- package/esm2022/tango-app-ui-manage-tickets.mjs +5 -0
- package/fesm2022/tango-app-ui-manage-tickets.mjs +10165 -0
- package/fesm2022/tango-app-ui-manage-tickets.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/add-csm-modal/add-csm-modal.component.d.ts +30 -0
- package/lib/components/audit-log/audit-log.component.d.ts +5 -0
- package/lib/components/audit-mapping-list/audit-mapping-list.component.d.ts +73 -0
- package/lib/components/audit-metrics/audit-metrics.component.d.ts +59 -0
- package/lib/components/audit-report-popup/audit-report-popup.component.d.ts +52 -0
- package/lib/components/audit-retag/audit-retag.component.d.ts +59 -0
- package/lib/components/comment-model/comment-model.component.d.ts +17 -0
- package/lib/components/count/count.component.d.ts +23 -0
- package/lib/components/custom-select/custom-select.component.d.ts +35 -0
- package/lib/components/filter-options/filter-options.component.d.ts +15 -0
- package/lib/components/footfall-dic/footfall-dic.component.d.ts +143 -0
- package/lib/components/footfall-dicview/footfall-dicview.component.d.ts +132 -0
- package/lib/components/footfall-popup/footfall-popup.component.d.ts +8 -0
- package/lib/components/group-select/group-select.component.d.ts +33 -0
- package/lib/components/re-trigger/re-trigger.component.d.ts +32 -0
- package/lib/components/reactive-select/reactive-select.component.d.ts +32 -0
- package/lib/components/remove-audit/remove-audit.component.d.ts +16 -0
- package/lib/components/start-audit/start-audit.component.d.ts +86 -0
- package/lib/components/tango-manage-tickets/tango-manage-tickets.component.d.ts +28 -0
- package/lib/components/ticket-filter-panel/ticket-filter-panel.component.d.ts +79 -0
- package/lib/components/ticket-footfall-new/ticket-footfall-new.component.d.ts +287 -0
- package/lib/components/ticketclosepopup/ticketclosepopup.component.d.ts +15 -0
- package/lib/components/tickets/tickets.component.d.ts +88 -0
- package/lib/components/viewcategory/viewcategory.component.d.ts +16 -0
- package/lib/services/audit.service.d.ts +36 -0
- package/lib/services/excel.service.d.ts +10 -0
- package/lib/services/ticket.service.d.ts +87 -0
- package/lib/services/timer.service.d.ts +22 -0
- package/lib/tango-manage-tickets-routing.module.d.ts +7 -0
- package/lib/tango-manage-tickets.module.d.ts +38 -0
- package/package.json +25 -12
- package/{src/public-api.ts → public-api.d.ts} +2 -8
- package/.eslintrc.json +0 -37
- package/ng-package.json +0 -7
- package/src/lib/components/add-csm-modal/add-csm-modal.component.html +0 -32
- package/src/lib/components/add-csm-modal/add-csm-modal.component.scss +0 -14
- package/src/lib/components/add-csm-modal/add-csm-modal.component.spec.ts +0 -23
- package/src/lib/components/add-csm-modal/add-csm-modal.component.ts +0 -94
- package/src/lib/components/audit-log/audit-log.component.html +0 -1
- package/src/lib/components/audit-log/audit-log.component.scss +0 -0
- package/src/lib/components/audit-log/audit-log.component.spec.ts +0 -23
- package/src/lib/components/audit-log/audit-log.component.ts +0 -10
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.html +0 -234
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.scss +0 -186
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.spec.ts +0 -23
- package/src/lib/components/audit-mapping-list/audit-mapping-list.component.ts +0 -520
- package/src/lib/components/audit-metrics/audit-metrics.component.html +0 -345
- package/src/lib/components/audit-metrics/audit-metrics.component.scss +0 -34
- package/src/lib/components/audit-metrics/audit-metrics.component.spec.ts +0 -23
- package/src/lib/components/audit-metrics/audit-metrics.component.ts +0 -292
- package/src/lib/components/audit-report-popup/audit-report-popup.component.html +0 -111
- package/src/lib/components/audit-report-popup/audit-report-popup.component.scss +0 -101
- package/src/lib/components/audit-report-popup/audit-report-popup.component.spec.ts +0 -23
- package/src/lib/components/audit-report-popup/audit-report-popup.component.ts +0 -397
- package/src/lib/components/audit-retag/audit-retag.component.html +0 -129
- package/src/lib/components/audit-retag/audit-retag.component.scss +0 -146
- package/src/lib/components/audit-retag/audit-retag.component.spec.ts +0 -23
- package/src/lib/components/audit-retag/audit-retag.component.ts +0 -489
- package/src/lib/components/comment-model/comment-model.component.html +0 -24
- package/src/lib/components/comment-model/comment-model.component.scss +0 -20
- package/src/lib/components/comment-model/comment-model.component.spec.ts +0 -23
- package/src/lib/components/comment-model/comment-model.component.ts +0 -53
- package/src/lib/components/count/count.component.html +0 -54
- package/src/lib/components/count/count.component.scss +0 -14
- package/src/lib/components/count/count.component.spec.ts +0 -23
- package/src/lib/components/count/count.component.ts +0 -82
- package/src/lib/components/custom-select/custom-select.component.html +0 -134
- package/src/lib/components/custom-select/custom-select.component.scss +0 -204
- package/src/lib/components/custom-select/custom-select.component.spec.ts +0 -23
- package/src/lib/components/custom-select/custom-select.component.ts +0 -189
- package/src/lib/components/filter-options/filter-options.component.html +0 -51
- package/src/lib/components/filter-options/filter-options.component.scss +0 -102
- package/src/lib/components/filter-options/filter-options.component.spec.ts +0 -23
- package/src/lib/components/filter-options/filter-options.component.ts +0 -38
- package/src/lib/components/footfall-dic/footfall-dic.component.html +0 -1275
- package/src/lib/components/footfall-dic/footfall-dic.component.scss +0 -273
- package/src/lib/components/footfall-dic/footfall-dic.component.spec.ts +0 -23
- package/src/lib/components/footfall-dic/footfall-dic.component.ts +0 -1206
- package/src/lib/components/footfall-dicview/footfall-dicview.component.html +0 -1136
- package/src/lib/components/footfall-dicview/footfall-dicview.component.scss +0 -416
- package/src/lib/components/footfall-dicview/footfall-dicview.component.spec.ts +0 -23
- package/src/lib/components/footfall-dicview/footfall-dicview.component.ts +0 -1168
- package/src/lib/components/footfall-popup/footfall-popup.component.html +0 -61
- package/src/lib/components/footfall-popup/footfall-popup.component.scss +0 -20
- package/src/lib/components/footfall-popup/footfall-popup.component.spec.ts +0 -23
- package/src/lib/components/footfall-popup/footfall-popup.component.ts +0 -12
- package/src/lib/components/group-select/group-select.component.html +0 -44
- package/src/lib/components/group-select/group-select.component.scss +0 -144
- package/src/lib/components/group-select/group-select.component.spec.ts +0 -23
- package/src/lib/components/group-select/group-select.component.ts +0 -145
- package/src/lib/components/re-trigger/re-trigger.component.html +0 -53
- package/src/lib/components/re-trigger/re-trigger.component.scss +0 -16
- package/src/lib/components/re-trigger/re-trigger.component.spec.ts +0 -23
- package/src/lib/components/re-trigger/re-trigger.component.ts +0 -96
- package/src/lib/components/reactive-select/reactive-select.component.html +0 -18
- package/src/lib/components/reactive-select/reactive-select.component.scss +0 -52
- package/src/lib/components/reactive-select/reactive-select.component.spec.ts +0 -23
- package/src/lib/components/reactive-select/reactive-select.component.ts +0 -104
- package/src/lib/components/remove-audit/remove-audit.component.html +0 -38
- package/src/lib/components/remove-audit/remove-audit.component.scss +0 -27
- package/src/lib/components/remove-audit/remove-audit.component.spec.ts +0 -23
- package/src/lib/components/remove-audit/remove-audit.component.ts +0 -81
- package/src/lib/components/start-audit/start-audit.component.html +0 -174
- package/src/lib/components/start-audit/start-audit.component.scss +0 -185
- package/src/lib/components/start-audit/start-audit.component.spec.ts +0 -23
- package/src/lib/components/start-audit/start-audit.component.ts +0 -761
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.html +0 -43
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.scss +0 -35
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.spec.ts +0 -23
- package/src/lib/components/tango-manage-tickets/tango-manage-tickets.component.ts +0 -118
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.html +0 -386
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.scss +0 -87
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.spec.ts +0 -23
- package/src/lib/components/ticket-filter-panel/ticket-filter-panel.component.ts +0 -494
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.html +0 -4743
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.scss +0 -1208
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.spec.ts +0 -23
- package/src/lib/components/ticket-footfall-new/ticket-footfall-new.component.ts +0 -3351
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.html +0 -100
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.scss +0 -34
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.spec.ts +0 -23
- package/src/lib/components/ticketclosepopup/ticketclosepopup.component.ts +0 -48
- package/src/lib/components/tickets/tickets.component.html +0 -451
- package/src/lib/components/tickets/tickets.component.scss +0 -131
- package/src/lib/components/tickets/tickets.component.spec.ts +0 -23
- package/src/lib/components/tickets/tickets.component.ts +0 -809
- package/src/lib/components/viewcategory/viewcategory.component.html +0 -38
- package/src/lib/components/viewcategory/viewcategory.component.scss +0 -29
- package/src/lib/components/viewcategory/viewcategory.component.spec.ts +0 -23
- package/src/lib/components/viewcategory/viewcategory.component.ts +0 -79
- package/src/lib/services/audit.service.spec.ts +0 -16
- package/src/lib/services/audit.service.ts +0 -98
- package/src/lib/services/excel.service.ts +0 -48
- package/src/lib/services/ticket.service.spec.ts +0 -16
- package/src/lib/services/ticket.service.ts +0 -501
- package/src/lib/services/timer.service.spec.ts +0 -16
- package/src/lib/services/timer.service.ts +0 -92
- package/src/lib/tango-manage-tickets-routing.module.ts +0 -37
- package/src/lib/tango-manage-tickets.module.ts +0 -68
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { TicketFilterPanelComponent } from './ticket-filter-panel.component';
|
|
4
|
-
|
|
5
|
-
describe('TicketFilterPanelComponent', () => {
|
|
6
|
-
let component: TicketFilterPanelComponent;
|
|
7
|
-
let fixture: ComponentFixture<TicketFilterPanelComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [TicketFilterPanelComponent]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
|
|
15
|
-
fixture = TestBed.createComponent(TicketFilterPanelComponent);
|
|
16
|
-
component = fixture.componentInstance;
|
|
17
|
-
fixture.detectChanges();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should create', () => {
|
|
21
|
-
expect(component).toBeTruthy();
|
|
22
|
-
});
|
|
23
|
-
});
|
|
@@ -1,494 +0,0 @@
|
|
|
1
|
-
import { Component, ElementRef, EventEmitter, HostListener, Input, OnChanges, Output, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
|
3
|
-
import { TicketService } from '../../services/ticket.service';
|
|
4
|
-
|
|
5
|
-
type Condition = 'gt' | 'lt' | 'gte' | 'lte' | 'between';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'lib-ticket-filter-panel',
|
|
9
|
-
templateUrl: './ticket-filter-panel.component.html',
|
|
10
|
-
styleUrl: './ticket-filter-panel.component.scss'
|
|
11
|
-
})
|
|
12
|
-
export class TicketFilterPanelComponent implements OnChanges {
|
|
13
|
-
@Output() apply = new EventEmitter<any>();
|
|
14
|
-
@Output() panelClosed = new EventEmitter<void>(); // ✅ not `close`
|
|
15
|
-
@Input() permissionType: string | null = null;
|
|
16
|
-
@Input() userType: string | null = null; // e.g. 'tango' or others
|
|
17
|
-
@Input() client :any;
|
|
18
|
-
@HostListener('document:click', ['$event'])
|
|
19
|
-
onDocumentClick(event: MouseEvent): void {
|
|
20
|
-
|
|
21
|
-
// 1️⃣ Always close dropdowns first
|
|
22
|
-
this.dropdownState.status = false;
|
|
23
|
-
this.dropdownState.reviewer = false;
|
|
24
|
-
this.dropdownState.approver = false;
|
|
25
|
-
|
|
26
|
-
// 2️⃣ If filter is not open → nothing to close
|
|
27
|
-
if (!this.isOpen) return;
|
|
28
|
-
|
|
29
|
-
// 3️⃣ Check if clicked inside filter card
|
|
30
|
-
const clickedInside = this.eRef.nativeElement.contains(event.target);
|
|
31
|
-
|
|
32
|
-
// 4️⃣ If clicked OUTSIDE → close entire filter panel
|
|
33
|
-
if (!clickedInside) {
|
|
34
|
-
this.isOpen = false;
|
|
35
|
-
this.panelClosed.emit();
|
|
36
|
-
this.filterForm.reset({
|
|
37
|
-
status: [],
|
|
38
|
-
reviewerCondition: null,
|
|
39
|
-
reviewerFrom: null,
|
|
40
|
-
reviewerTo: null,
|
|
41
|
-
|
|
42
|
-
approverCondition: null,
|
|
43
|
-
approverFrom: null,
|
|
44
|
-
approverTo: null,
|
|
45
|
-
|
|
46
|
-
tangoCondition: null,
|
|
47
|
-
tangoFrom: null,
|
|
48
|
-
tangoTo: null,
|
|
49
|
-
|
|
50
|
-
reviewedBy: [],
|
|
51
|
-
approvedBy: []
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
isOpen = false; // controls visibility
|
|
57
|
-
|
|
58
|
-
// called from parent via #filterPanel.open()
|
|
59
|
-
open() {
|
|
60
|
-
this.isOpen = true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// called from close button inside the panel
|
|
64
|
-
close() {
|
|
65
|
-
this.isOpen = false;
|
|
66
|
-
this.panelClosed.emit();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
showPanel = false; // you can also control this from parent
|
|
70
|
-
|
|
71
|
-
statusOptions: any[] = [
|
|
72
|
-
'Open',
|
|
73
|
-
'In-Progress',
|
|
74
|
-
'Closed',
|
|
75
|
-
'Under Tango Review',
|
|
76
|
-
'Tango Review Done',
|
|
77
|
-
'Expired',
|
|
78
|
-
'Tango Expired',
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
conditionOptions = [
|
|
83
|
-
{ value: 'gt', label: '> Greater than' },
|
|
84
|
-
{ value: 'lt', label: '< Lesser than' },
|
|
85
|
-
{ value: 'gte', label: '>= Greater than or equal to' },
|
|
86
|
-
{ value: 'lte', label: '<= Lesser than or equal to' },
|
|
87
|
-
{ value: 'between', label: 'Between' },
|
|
88
|
-
];
|
|
89
|
-
|
|
90
|
-
filterForm: FormGroup;
|
|
91
|
-
|
|
92
|
-
constructor(private fb: FormBuilder,private eRef: ElementRef,private service:TicketService) {
|
|
93
|
-
this.filterForm = this.fb.group({
|
|
94
|
-
status: [[]],
|
|
95
|
-
|
|
96
|
-
reviewerCondition: [null as Condition | null],
|
|
97
|
-
reviewerFrom: [null,[Validators.min(0), Validators.max(100)]],
|
|
98
|
-
reviewerTo: [null,[Validators.min(0), Validators.max(100)]],
|
|
99
|
-
|
|
100
|
-
approverCondition: [null as Condition | null],
|
|
101
|
-
approverFrom: [null,[Validators.min(0), Validators.max(100)]],
|
|
102
|
-
approverTo: [null,[Validators.min(0), Validators.max(100)]],
|
|
103
|
-
|
|
104
|
-
tangoCondition: [null as Condition | null],
|
|
105
|
-
tangoFrom: [null,[Validators.min(0), Validators.max(100)]],
|
|
106
|
-
tangoTo: [null,[Validators.min(0), Validators.max(100)]],
|
|
107
|
-
|
|
108
|
-
reviewedBy: [[]],
|
|
109
|
-
approvedBy: [[]],
|
|
110
|
-
});
|
|
111
|
-
this.onReset();
|
|
112
|
-
}
|
|
113
|
-
limitValue(event: any, controlName: string) {
|
|
114
|
-
let value = Number(event.target.value);
|
|
115
|
-
|
|
116
|
-
if (value < 0) value = 0;
|
|
117
|
-
if (value > 100) value = 100;
|
|
118
|
-
|
|
119
|
-
event.target.value = value;
|
|
120
|
-
this.filterForm.get(controlName)?.setValue(value, { emitEvent: false });
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
get isTango(): boolean {
|
|
124
|
-
return this.userType === 'tango';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// SHOW / HIDE RULES
|
|
128
|
-
|
|
129
|
-
// Reviewer accuracy and "Reviewed by" visible for tango + reviewer
|
|
130
|
-
get showReviewerAccuracy(): boolean {
|
|
131
|
-
return this.isTango || this.permissionType === 'review';
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
get showReviewedBy(): boolean {
|
|
135
|
-
return this.permissionType === 'review';
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Approver accuracy and "Approved by" visible for tango + approver
|
|
139
|
-
get showApproverAccuracy(): boolean {
|
|
140
|
-
return this.isTango || this.permissionType === 'approve';
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
get showApprovedBy(): boolean {
|
|
144
|
-
return this.permissionType === 'approve';
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// Tango accuracy only for tango users
|
|
148
|
-
get showTangoAccuracy(): boolean {
|
|
149
|
-
return this.isTango;
|
|
150
|
-
}
|
|
151
|
-
statusDropdownOpen = false;
|
|
152
|
-
isStatusSelected(status: string): boolean {
|
|
153
|
-
const selected: string[] = this.filterForm.value.status || [];
|
|
154
|
-
return selected.includes(status);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
onStatusChange(event: Event, status: string) {
|
|
158
|
-
const checkbox = event.target as HTMLInputElement;
|
|
159
|
-
const selected: string[] = this.filterForm.value.status || [];
|
|
160
|
-
let next: string[];
|
|
161
|
-
|
|
162
|
-
if (checkbox.checked) {
|
|
163
|
-
next = selected.includes(status) ? selected : [...selected, status];
|
|
164
|
-
} else {
|
|
165
|
-
next = selected.filter(s => s !== status);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
this.filterForm.patchValue({ status: next });
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
toggleStatusDropdown(event?: MouseEvent) {
|
|
172
|
-
if (event) {
|
|
173
|
-
event.stopPropagation(); // avoid document click closing it
|
|
174
|
-
}
|
|
175
|
-
this.statusDropdownOpen = !this.statusDropdownOpen;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// Are all statuses currently selected?
|
|
179
|
-
areAllStatusesSelected(): boolean {
|
|
180
|
-
const selected: string[] = this.filterForm.value.status || [];
|
|
181
|
-
return selected.length > 0 && selected.length === this.statusOptions.length;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// Handle "Select All" checkbox change
|
|
185
|
-
onStatusSelectAllChange(event: Event) {
|
|
186
|
-
const checkbox = event.target as HTMLInputElement;
|
|
187
|
-
|
|
188
|
-
if (checkbox.checked) {
|
|
189
|
-
// Select every status
|
|
190
|
-
this.filterForm.patchValue({ status: [...this.statusOptions] });
|
|
191
|
-
} else {
|
|
192
|
-
// Clear all
|
|
193
|
-
this.filterForm.patchValue({ status: [] });
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
get selectedStatuses(): string[] {
|
|
197
|
-
return this.filterForm.value.status || [];
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
isBetween(controlName: string): boolean {
|
|
201
|
-
return this.filterForm.get(controlName)?.value === 'between';
|
|
202
|
-
}
|
|
203
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
204
|
-
if (changes['client'] || changes['permissionType'] || changes['userType']) {
|
|
205
|
-
this.loadReviewerList();
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// full user list you already have
|
|
209
|
-
userList: any[] = [];
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
reviewerSearchTerm: string = '';
|
|
213
|
-
|
|
214
|
-
// ✅ simple computed list for *ngFor
|
|
215
|
-
get filteredReviewerList(): { email: string; name?: string }[] {
|
|
216
|
-
const term = (this.reviewerSearchTerm || '').trim().toLowerCase();
|
|
217
|
-
|
|
218
|
-
if (!term) {
|
|
219
|
-
return this.userList;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return this.userList.filter(u => {
|
|
223
|
-
const email = (u.email || '').toLowerCase();
|
|
224
|
-
const name = (u.name || '').toLowerCase();
|
|
225
|
-
return email.includes(term) || name.includes(term);
|
|
226
|
-
});
|
|
227
|
-
}
|
|
228
|
-
approverSearchTerm:any;
|
|
229
|
-
get filteredApproverList(): any[] {
|
|
230
|
-
const term = (this.approverSearchTerm || '').trim().toLowerCase();
|
|
231
|
-
if (!term) {
|
|
232
|
-
return this.userList;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
return this.userList.filter((u: any) => {
|
|
236
|
-
const email = (u.email || '').toLowerCase();
|
|
237
|
-
const name = (u.name || '').toLowerCase();
|
|
238
|
-
return email.includes(term) || name.includes(term);
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
onApproverSearch(value: string) {
|
|
243
|
-
this.approverSearchTerm = value;
|
|
244
|
-
}
|
|
245
|
-
private loadReviewerList(): void {
|
|
246
|
-
if (!this.client) {
|
|
247
|
-
this.userList = [];
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
let type: string;
|
|
252
|
-
|
|
253
|
-
if (this.userType === 'tango') {
|
|
254
|
-
type = 'tango'; // or 'all'
|
|
255
|
-
} else if (this.permissionType === 'review') {
|
|
256
|
-
type = 'review';
|
|
257
|
-
} else if (this.permissionType === 'approve') {
|
|
258
|
-
type = 'approve';
|
|
259
|
-
} else {
|
|
260
|
-
this.userList = [];
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
this.service.getReviewerApi(this.client, type,'').subscribe({
|
|
265
|
-
next: (res: any) => {
|
|
266
|
-
if (res && res.code === 200) {
|
|
267
|
-
this.userList = res.data;
|
|
268
|
-
} else {
|
|
269
|
-
this.userList = [];
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
|
-
error: () => {
|
|
273
|
-
this.userList = [];
|
|
274
|
-
}
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
// open flags
|
|
279
|
-
reviewerDropdownOpen = false;
|
|
280
|
-
approverDropdownOpen = false;
|
|
281
|
-
|
|
282
|
-
// convenience getters
|
|
283
|
-
get selectedReviewedBy(): string[] {
|
|
284
|
-
return this.filterForm.value.reviewedBy || [];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
get selectedApprovedBy(): string[] {
|
|
288
|
-
return this.filterForm.value.approvedBy || [];
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
// --- Reviewed By helpers ---
|
|
292
|
-
|
|
293
|
-
toggleReviewerDropdown(event?: MouseEvent) {
|
|
294
|
-
if (event) event.stopPropagation();
|
|
295
|
-
this.reviewerDropdownOpen = !this.reviewerDropdownOpen;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
isReviewerSelected(email: string): boolean {
|
|
299
|
-
return this.selectedReviewedBy.includes(email);
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
onReviewerChange(event: Event, email: string) {
|
|
303
|
-
const checkbox = event.target as HTMLInputElement;
|
|
304
|
-
const selected = [...this.selectedReviewedBy];
|
|
305
|
-
|
|
306
|
-
if (checkbox.checked) {
|
|
307
|
-
if (!selected.includes(email)) selected.push(email);
|
|
308
|
-
} else {
|
|
309
|
-
const i = selected.indexOf(email);
|
|
310
|
-
if (i >= 0) selected.splice(i, 1);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
this.filterForm.patchValue({ reviewedBy: selected });
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
areAllReviewersSelected(): boolean {
|
|
317
|
-
return (
|
|
318
|
-
this.userList.length > 0 &&
|
|
319
|
-
this.selectedReviewedBy.length === this.userList.length
|
|
320
|
-
);
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
onReviewerSelectAll(event: Event) {
|
|
324
|
-
const checkbox = event.target as HTMLInputElement;
|
|
325
|
-
|
|
326
|
-
if (checkbox.checked) {
|
|
327
|
-
this.filterForm.patchValue({
|
|
328
|
-
reviewedBy: this.userList.map((u:any) => u.email),
|
|
329
|
-
});
|
|
330
|
-
} else {
|
|
331
|
-
this.filterForm.patchValue({ reviewedBy: [] });
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
// --- Approved By helpers ---
|
|
336
|
-
|
|
337
|
-
toggleApproverDropdown(event?: MouseEvent) {
|
|
338
|
-
if (event) event.stopPropagation();
|
|
339
|
-
this.approverDropdownOpen = !this.approverDropdownOpen;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
isApproverSelected(email: string): boolean {
|
|
343
|
-
return this.selectedApprovedBy.includes(email);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
onApproverChange(event: Event, email: string) {
|
|
347
|
-
const checkbox = event.target as HTMLInputElement;
|
|
348
|
-
const selected = [...this.selectedApprovedBy];
|
|
349
|
-
|
|
350
|
-
if (checkbox.checked) {
|
|
351
|
-
if (!selected.includes(email)) selected.push(email);
|
|
352
|
-
} else {
|
|
353
|
-
const i = selected.indexOf(email);
|
|
354
|
-
if (i >= 0) selected.splice(i, 1);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
this.filterForm.patchValue({ approvedBy: selected });
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
areAllApproversSelected(): boolean {
|
|
361
|
-
return (
|
|
362
|
-
this.userList.length > 0 &&
|
|
363
|
-
this.selectedApprovedBy.length === this.userList.length
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
onApproverSelectAll(event: Event) {
|
|
368
|
-
const checkbox = event.target as HTMLInputElement;
|
|
369
|
-
|
|
370
|
-
if (checkbox.checked) {
|
|
371
|
-
this.filterForm.patchValue({
|
|
372
|
-
approvedBy: this.userList.map((u:any) => u.email),
|
|
373
|
-
});
|
|
374
|
-
} else {
|
|
375
|
-
this.filterForm.patchValue({ approvedBy: [] });
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
onReset(): void {
|
|
380
|
-
this.filterForm.reset({
|
|
381
|
-
status: [],
|
|
382
|
-
reviewerCondition: null,
|
|
383
|
-
reviewerFrom: null,
|
|
384
|
-
reviewerTo: null,
|
|
385
|
-
|
|
386
|
-
approverCondition: null,
|
|
387
|
-
approverFrom: null,
|
|
388
|
-
approverTo: null,
|
|
389
|
-
|
|
390
|
-
tangoCondition: null,
|
|
391
|
-
tangoFrom: null,
|
|
392
|
-
tangoTo: null,
|
|
393
|
-
|
|
394
|
-
reviewedBy: [],
|
|
395
|
-
approvedBy: []
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
// 2️⃣ Reset search terms
|
|
399
|
-
this.reviewerSearchTerm = '';
|
|
400
|
-
this.approverSearchTerm = '';
|
|
401
|
-
|
|
402
|
-
// 3️⃣ Build empty payload to send back
|
|
403
|
-
const payload = {
|
|
404
|
-
filterByStatus: [],
|
|
405
|
-
filterByReviewer: null,
|
|
406
|
-
filterByApprover: null,
|
|
407
|
-
filterByTango: null,
|
|
408
|
-
filterByReviewedBy: [],
|
|
409
|
-
fileterByApprovedBy: []
|
|
410
|
-
};
|
|
411
|
-
|
|
412
|
-
// 4️⃣ Emit the now-empty filter result
|
|
413
|
-
this.apply.emit(payload);
|
|
414
|
-
|
|
415
|
-
// 5️⃣ Close the filter panel
|
|
416
|
-
this.close();
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
private mapAccuracy(
|
|
420
|
-
condition: Condition | null,
|
|
421
|
-
from: number | null,
|
|
422
|
-
to: number | null
|
|
423
|
-
): string | null {
|
|
424
|
-
|
|
425
|
-
// nothing selected
|
|
426
|
-
if (!condition || from == null) return null;
|
|
427
|
-
|
|
428
|
-
// "between" → "90 to 100"
|
|
429
|
-
if (condition === 'between') {
|
|
430
|
-
if (to == null) return null;
|
|
431
|
-
return `${from} to ${to}`;
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
// other conditions (gt, lt, gte, lte)
|
|
435
|
-
const opMap: Record<Condition, string> = {
|
|
436
|
-
gt: '>',
|
|
437
|
-
lt: '<',
|
|
438
|
-
gte: '>=',
|
|
439
|
-
lte: '<=',
|
|
440
|
-
between: '', // already handled above
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
return `${opMap[condition]} ${from}`; // e.g. ">= 90"
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
onApply(): void {
|
|
447
|
-
|
|
448
|
-
const raw = this.filterForm.value;
|
|
449
|
-
|
|
450
|
-
const reviewerStr = this.mapAccuracy(raw.reviewerCondition, raw.reviewerFrom, raw.reviewerTo);
|
|
451
|
-
const approverStr = this.mapAccuracy(raw.approverCondition, raw.approverFrom, raw.approverTo);
|
|
452
|
-
const tangoStr = this.mapAccuracy(raw.tangoCondition, raw.tangoFrom, raw.tangoTo);
|
|
453
|
-
|
|
454
|
-
const payload = {
|
|
455
|
-
filterByStatus: raw.status || [],
|
|
456
|
-
|
|
457
|
-
filterByReviewer: reviewerStr,
|
|
458
|
-
filterByApprover: approverStr,
|
|
459
|
-
filterByTango: tangoStr,
|
|
460
|
-
|
|
461
|
-
filterByReviewedBy: raw.reviewedBy || [],
|
|
462
|
-
fileterByApprovedBy: raw.approvedBy || [],
|
|
463
|
-
};
|
|
464
|
-
this.apply.emit(payload);
|
|
465
|
-
this.close();
|
|
466
|
-
this.showPanel = false;
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
dropdownState = {
|
|
470
|
-
status: false,
|
|
471
|
-
reviewer: false,
|
|
472
|
-
approver: false
|
|
473
|
-
};
|
|
474
|
-
// @HostListener('document:click')
|
|
475
|
-
closeAll() {
|
|
476
|
-
this.dropdownState.status = false;
|
|
477
|
-
this.dropdownState.reviewer = false;
|
|
478
|
-
this.dropdownState.approver = false;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
toggleDropdown(type: 'status' | 'reviewer' | 'approver', event: MouseEvent) {
|
|
482
|
-
event.stopPropagation();
|
|
483
|
-
|
|
484
|
-
// Close all before opening a new one
|
|
485
|
-
this.closeAll();
|
|
486
|
-
|
|
487
|
-
// Toggle only the selected one
|
|
488
|
-
this.dropdownState[type] = !this.dropdownState[type];
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
isDropdownOpen(type: 'status' | 'reviewer' | 'approver') {
|
|
492
|
-
return this.dropdownState[type];
|
|
493
|
-
}
|
|
494
|
-
}
|