cat-qw-lib 1.0.88 → 1.0.89
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
|
@@ -6576,25 +6576,7 @@ class QueueContainerComponent extends BaseContainerComponent {
|
|
|
6576
6576
|
next: (res) => {
|
|
6577
6577
|
const apiData = res?.data || res?.paginatedResults || res || [];
|
|
6578
6578
|
if (apiData && apiData.length > 0) {
|
|
6579
|
-
|
|
6580
|
-
const sortedApiData = [...apiData].sort((a, b) => {
|
|
6581
|
-
const aPercent = Number(a.taskCompletionPercent) || 0;
|
|
6582
|
-
const bPercent = Number(b.taskCompletionPercent) || 0;
|
|
6583
|
-
// 100% first
|
|
6584
|
-
if (aPercent === 100 && bPercent !== 100)
|
|
6585
|
-
return -1;
|
|
6586
|
-
if (bPercent === 100 && aPercent !== 100)
|
|
6587
|
-
return 1;
|
|
6588
|
-
// 0% last
|
|
6589
|
-
if (aPercent === 0 && bPercent !== 0)
|
|
6590
|
-
return 1;
|
|
6591
|
-
if (bPercent === 0 && aPercent !== 0)
|
|
6592
|
-
return -1;
|
|
6593
|
-
// Otherwise, sort descending (optional: or keep original order)
|
|
6594
|
-
return bPercent - aPercent;
|
|
6595
|
-
});
|
|
6596
|
-
// Build table with sorted data
|
|
6597
|
-
this.table = this.tableBuilder.buildSecondaryTable(sortedApiData);
|
|
6579
|
+
this.table = this.tableBuilder.buildSecondaryTable(apiData);
|
|
6598
6580
|
}
|
|
6599
6581
|
else if (this.table) {
|
|
6600
6582
|
this.table = { ...this.table, records: [] };
|