Skip to content

Commit

Permalink
sort group fields alphabetically
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Sep 13, 2022
1 parent 0fd5511 commit 8609aef
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ export const ExplainLogRateSpikesAnalysis: FC<ExplainLogRateSpikesAnalysisProps>
}, {} as Record<string, Record<string, number>>);

const tableItems = mockData.map(({ group, docCount }, index) => {
const sortedGroup = group.sort((a, b) => (a.field > b.field) ? 1 : ((b.field > a.field) ? -1 : 0));
const dedupedGroup = {};
const repeatedValues = {};

group.forEach((pair) => {
sortedGroup.forEach((pair) => {
const fieldName = pair.field;
const fieldValue = pair.value;
if (groupFieldValuesCountMap[fieldName][fieldValue] <= 2) {
Expand Down

0 comments on commit 8609aef

Please sign in to comment.