Skip to content

Commit

Permalink
πŸ› FIx affects string columns ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Valen committed Dec 12, 2024
1 parent 1718a6d commit 29c0821
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/FlawAffects/useFilterSortAffects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,18 @@ export function useFilterSortAffects() {
} else if (sortKey.value === 'cvss_scores') {
return affect[sortKey.value].length;
}
if (affect[sortKey.value] === '') {
return sortOrder.value === ascend ? '_' : 'Z';
}
return affect[sortKey.value] || 0;
};

const comparators = standard
? [ascend<ZodAffectType>(prop('ps_module')), ascend<ZodAffectType>(prop('ps_component'))]
: [order<ZodAffectType>(customSortFn),
order<ZodAffectType>(sortKey.value === 'ps_module' ? prop('ps_component') : prop('ps_module'))];
: [
order<ZodAffectType>(customSortFn),
order<ZodAffectType>(sortKey.value === 'ps_module' ? prop('ps_component') : prop('ps_module')),
];

return sortWith([
ascend((affect: ZodAffectType) => !affect.uuid ? 0 : 1),
Expand Down

0 comments on commit 29c0821

Please sign in to comment.