cat-qw-lib 2.5.22 → 2.5.24
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/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -2625,6 +2625,9 @@ class QueueFilterDropdownService extends BaseService {
|
|
|
2625
2625
|
if (hasUnassigned) {
|
|
2626
2626
|
filterParams['unassigned'] = 'true';
|
|
2627
2627
|
}
|
|
2628
|
+
else {
|
|
2629
|
+
filterParams['unassigned'] = 'false';
|
|
2630
|
+
}
|
|
2628
2631
|
// Set underwriterId parameter only if there are real IDs (excluding "unassigned")
|
|
2629
2632
|
if (realUnderwriterIds.length > 0) {
|
|
2630
2633
|
filterParams['underwriterId'] = realUnderwriterIds.join(',');
|
|
@@ -7280,9 +7283,14 @@ class QueueFilterDropdownComponent {
|
|
|
7280
7283
|
this.searchSubscription = this.searchSubject.pipe(debounceTime$1(300), distinctUntilChanged$1(), switchMap((searchKey) => {
|
|
7281
7284
|
return this.filterService.getUnderwritersList(searchKey || SHARED.EMPTY);
|
|
7282
7285
|
})).subscribe((underwriters) => {
|
|
7283
|
-
//
|
|
7284
|
-
const unassignedOption =
|
|
7285
|
-
|
|
7286
|
+
// Update options for search/filter - preserve "Unassigned" option if it exists
|
|
7287
|
+
const unassignedOption = this.underwriterOptions.find(opt => opt.id === UNASSIGNED_UNDERWRITER_ID);
|
|
7288
|
+
if (unassignedOption) {
|
|
7289
|
+
this.underwriterOptions = [unassignedOption, ...underwriters];
|
|
7290
|
+
}
|
|
7291
|
+
else {
|
|
7292
|
+
this.underwriterOptions = underwriters;
|
|
7293
|
+
}
|
|
7286
7294
|
this.loadingUnderwriters = false;
|
|
7287
7295
|
});
|
|
7288
7296
|
}
|
|
@@ -7298,16 +7306,26 @@ class QueueFilterDropdownComponent {
|
|
|
7298
7306
|
if (!this.showDropdown) {
|
|
7299
7307
|
// Store current state when opening dropdown (this will be the applied filters)
|
|
7300
7308
|
this.originalFilters = this.filterService.getFilters();
|
|
7301
|
-
//
|
|
7302
|
-
this.
|
|
7309
|
+
// Reset loading state and reload underwriter list every time dropdown opens
|
|
7310
|
+
this.loadingUnderwriters = false;
|
|
7311
|
+
this.loadUnderwriterOptions();
|
|
7312
|
+
}
|
|
7313
|
+
else {
|
|
7314
|
+
// Reset loading state when closing dropdown
|
|
7315
|
+
this.loadingUnderwriters = false;
|
|
7303
7316
|
}
|
|
7304
7317
|
this.showDropdown = !this.showDropdown;
|
|
7305
7318
|
this.skipNextDocumentClick = true;
|
|
7306
7319
|
this.filters = this.filterService.getFilters();
|
|
7307
7320
|
}
|
|
7308
|
-
|
|
7321
|
+
loadUnderwriterOptions() {
|
|
7309
7322
|
this.loadingUnderwriters = true;
|
|
7310
|
-
this.
|
|
7323
|
+
this.filterService.getUnderwritersList(SHARED.EMPTY).subscribe((underwriters) => {
|
|
7324
|
+
// Add "Unassigned" option at the beginning of the list
|
|
7325
|
+
const unassignedOption = { id: UNASSIGNED_UNDERWRITER_ID, name: 'Unassigned' };
|
|
7326
|
+
this.underwriterOptions = [unassignedOption, ...underwriters];
|
|
7327
|
+
this.loadingUnderwriters = false;
|
|
7328
|
+
});
|
|
7311
7329
|
}
|
|
7312
7330
|
setRiskRating(rating) {
|
|
7313
7331
|
this.filterService.setRiskRating(rating);
|
|
@@ -7359,11 +7377,12 @@ class QueueFilterDropdownComponent {
|
|
|
7359
7377
|
}
|
|
7360
7378
|
applyFilters() {
|
|
7361
7379
|
const filterData = this.filterService.getFilters();
|
|
7362
|
-
if
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7380
|
+
// Always emit filterApplied event to trigger API call, even if no filters
|
|
7381
|
+
// This ensures the list API is called every time Apply Filters is clicked
|
|
7382
|
+
this.filterApplied.emit(filterData);
|
|
7383
|
+
this.filtersApplied = true; // Mark that filters have been applied
|
|
7366
7384
|
this.showDropdown = false;
|
|
7385
|
+
this.loadingUnderwriters = false; // Reset loading state when closing
|
|
7367
7386
|
this.originalFilters = null; // Clear stored state after applying
|
|
7368
7387
|
this.filters = this.filterService.getFilters();
|
|
7369
7388
|
}
|
|
@@ -7374,7 +7393,7 @@ class QueueFilterDropdownComponent {
|
|
|
7374
7393
|
this.originalFilters = null; // Clear originalFilters to prevent restoring old filters
|
|
7375
7394
|
this.filters = this.filterService.getFilters();
|
|
7376
7395
|
// Reload underwriter options when clearing
|
|
7377
|
-
this.
|
|
7396
|
+
this.loadUnderwriterOptions();
|
|
7378
7397
|
}
|
|
7379
7398
|
// Method to sync with container's applied filters
|
|
7380
7399
|
syncWithAppliedFilters(appliedFilters) {
|
|
@@ -7407,6 +7426,7 @@ class QueueFilterDropdownComponent {
|
|
|
7407
7426
|
// Only restore original filters if no filters have been applied yet
|
|
7408
7427
|
this.filterService.setAllFilters(this.originalFilters);
|
|
7409
7428
|
}
|
|
7429
|
+
this.loadingUnderwriters = false; // Reset loading state when closing without applying
|
|
7410
7430
|
this.originalFilters = null;
|
|
7411
7431
|
}
|
|
7412
7432
|
onDocumentClick(event) {
|