• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

inclusion-numerique / coop-mediation-numerique / 0c817526-57bf-41ab-ac48-8c68e9f9592f

24 Mar 2026 05:48PM UTC coverage: 6.896% (-3.7%) from 10.556%
0c817526-57bf-41ab-ac48-8c68e9f9592f

push

circleci

web-flow
Merge pull request #462 from inclusion-numerique/feat/fuzzy-search-doublons

feat(beneficiaires): add fuzzy matching for duplicate detection

470 of 10483 branches covered (4.48%)

Branch coverage included in aggregate %.

0 of 4 new or added lines in 2 files covered. (0.0%)

1360 existing lines in 150 files now uncovered.

1355 of 15981 relevant lines covered (8.48%)

37.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/apps/web/src/libs/data-table/getDataTableOrderBy.ts
1
import {
2
  DataTableConfiguration,
3
  DataTableRow,
4
  DataTableSearchParams,
5
} from './DataTableConfiguration'
6

UNCOV
7
export const getDataTableOrderBy = <
×
8
  OrderBy extends Record<string, unknown> = Record<string, unknown>,
9
  Configuration extends DataTableConfiguration<
10
    DataTableRow,
11
    Record<string, unknown>,
12
    OrderBy
13
  > = DataTableConfiguration<DataTableRow, Record<string, unknown>, OrderBy>,
14
>(
15
  searchParams: DataTableSearchParams<Configuration>,
16
  configuration: Configuration,
17
): OrderBy[] => {
UNCOV
18
  const direction = searchParams.ordre ?? 'asc'
×
19

20
  // Applying default order by
UNCOV
21
  if (!searchParams.tri) {
×
UNCOV
22
    const defaultOrderByColumn = configuration.columns.find(
×
UNCOV
23
      (column) => column.defaultSortable && column.orderBy,
×
24
    )
UNCOV
25
    if (!defaultOrderByColumn || !defaultOrderByColumn.orderBy) {
×
26
      return []
×
27
    }
28

UNCOV
29
    return defaultOrderByColumn.orderBy(
×
30
      defaultOrderByColumn.defaultSortableDirection ?? direction,
×
31
    )
32
  }
33
  const column = configuration.columns.find(
×
34
    (item) => item.name === searchParams.tri,
×
35
  )
36

37
  return column?.orderBy ? column.orderBy(direction) : []
×
38
}
39

UNCOV
40
export const getDataTableRawOrderBy = <
×
41
  OrderBy extends Record<string, unknown> = Record<string, unknown>,
42
  Configuration extends DataTableConfiguration<
43
    DataTableRow,
44
    Record<string, unknown>,
45
    OrderBy
46
  > = DataTableConfiguration<DataTableRow, Record<string, unknown>, OrderBy>,
47
>(
48
  searchParams: DataTableSearchParams<Configuration>,
49
  configuration: Configuration,
50
): OrderBy[] => {
51
  const direction = searchParams.ordre ?? 'asc'
×
52

53
  // Applying default order by
54
  if (!searchParams.tri) {
×
55
    const defaultOrderByColumn = configuration.columns.find(
×
56
      (column) => column.defaultSortable && column.orderBy,
×
57
    )?.orderBy
58
    if (!defaultOrderByColumn) {
×
59
      return []
×
60
    }
61

62
    return defaultOrderByColumn(direction)
×
63
  }
64
  const column = configuration.columns.find(
×
65
    (item) => item.name === searchParams.tri,
×
66
  )
67

68
  return column?.orderBy ? column.orderBy(direction) : []
×
69
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc