Skip to content

Commit df05a17

Browse files
committed
chore: 🚨 fix new rules
1 parent d4fec2d commit df05a17

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

‎src/components/DsfrTable/DsfrTable.spec.ts‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {fireEvent, render, waitFor} from '@testing-library/vue'
1+
import { fireEvent, render, waitFor } from '@testing-library/vue'
22

33
import DsfrTag from '../DsfrTag/DsfrTag.vue'
44

@@ -105,12 +105,12 @@ describe('DsfrTable', () => {
105105
const title = 'Utilisateurs'
106106

107107
const headers = ['Nom', 'Prénom']
108-
const rows = generateRowsWithTwoColumns(5);
108+
const rows = generateRowsWithTwoColumns(5)
109109
const props = {
110110
title,
111111
headers,
112112
rows,
113-
pagination: true
113+
pagination: true,
114114
}
115115

116116
const component = render(DsfrTable, {
@@ -124,7 +124,7 @@ describe('DsfrTable', () => {
124124
})
125125

126126
// When
127-
const newRows = generateRowsWithTwoColumns(25);
127+
const newRows = generateRowsWithTwoColumns(25)
128128

129129
component.rerender({
130130
...props,
@@ -142,12 +142,12 @@ describe('DsfrTable', () => {
142142
const title = 'Utilisateurs'
143143

144144
const headers = ['Nom', 'Prénom']
145-
const rows = generateRowsWithTwoColumns(50);
145+
const rows = generateRowsWithTwoColumns(50)
146146
const props = {
147147
title,
148148
headers,
149149
rows,
150-
pagination: true
150+
pagination: true,
151151
}
152152

153153
const component = render(DsfrTable, {
@@ -170,7 +170,7 @@ describe('DsfrTable', () => {
170170
})
171171
})
172172

173-
function generateRowsWithTwoColumns(numberOfRows: number): string[][] {
173+
function generateRowsWithTwoColumns (numberOfRows: number): string[][] {
174174
const rows: string[][] = []
175175

176176
for (let i = 0; i < numberOfRows; i++) {

‎src/components/DsfrTable/DsfrTable.stories.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -279,18 +279,18 @@ export const TableauEntier = (args) => ({
279279
rows: args.rows.map((rowData) =>
280280
Array.isArray(rowData)
281281
? rowData.map((field) =>
282-
field.cellAttrs?.onClick
283-
? {
284-
...field,
285-
cellAttrs: {
286-
...field.cellAttrs,
287-
onClick () {
288-
args.onClickCell(field)
282+
field.cellAttrs?.onClick
283+
? {
284+
...field,
285+
cellAttrs: {
286+
...field.cellAttrs,
287+
onClick () {
288+
args.onClickCell(field)
289+
},
289290
},
290-
},
291-
}
292-
: field,
293-
)
291+
}
292+
: field,
293+
)
294294
: {
295295
...rowData,
296296
rowAttrs: {

‎src/components/DsfrTable/DsfrTable.vue‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<script lang="ts" setup>
2-
import { computed, ref, watch } from 'vue'
2+
import { computed, ref } from 'vue'
33
44
import DsfrTableHeaders from './DsfrTableHeaders.vue'
55
import DsfrTableRow, { type DsfrTableRowProps } from './DsfrTableRow.vue'
66
import type { DsfrTableProps } from './DsfrTable.types'
7-
import {getRandomId} from "@/utils/random-utils";
87
98
import { getRandomId } from '@/utils/random-utils'
109
@@ -26,12 +25,12 @@ const getRowData = (row: DsfrTableProps['rows']) => {
2625
}
2726
2827
const currentPage = ref(props.currentPage)
29-
const selectId = getRandomId()
28+
const selectId = getRandomId('resultPerPage')
3029
const optionSelected = ref(props.resultsDisplayed)
3130
const pageCount = computed(() =>
3231
props.rows.length > optionSelected.value
3332
? Math.ceil(props.rows.length / optionSelected.value)
34-
: 1
33+
: 1,
3534
)
3635
const paginationOptions = [5, 10, 25, 50, 100]
3736
const returnLowestLimit = () => currentPage.value * optionSelected.value - optionSelected.value
@@ -65,8 +64,6 @@ const goLastPage = () => {
6564
currentPage.value = pageCount.value
6665
emit('update:currentPage')
6766
}
68-
69-
const selectId = getRandomId('resultPerPage')
7067
</script>
7168

7269
<template>
@@ -124,11 +121,14 @@ const selectId = getRandomId('resultPerPage')
124121
</option>
125122
</select>
126123
</div>
127-
<div class="flex ml-1"
128-
aria-live="polite"
129-
aria-atomic="true"
124+
<div
125+
class="flex ml-1"
126+
aria-live="polite"
127+
aria-atomic="true"
130128
>
131-
<p class="self-center fr-m-0">Page {{ currentPage }} sur {{ pageCount }}</p>
129+
<p class="self-center fr-m-0">
130+
Page {{ currentPage }} sur {{ pageCount }}
131+
</p>
132132
</div>
133133
<div class="flex ml-1">
134134
<button

0 commit comments

Comments
 (0)