feat: articles pagination
This commit is contained in:
1 parent
a2d224240c
commit
73f4b539fe
45 files changed
+3528
-317
No files matched your search
@@ -285,6 +285,13 @@ export const messages = {
|
||||
"Couldn't copy the link": 'Impossible de copier le lien',
|
||||
'Articles, sorted by last updated, newest first':
|
||||
'Articles triés par dernière modification, du plus récent au plus ancien',
|
||||
'Articles, sorted by {0}, {1}': 'Articles triés par {0}, {1}',
|
||||
title: 'titre',
|
||||
status: 'statut',
|
||||
created: 'date de création',
|
||||
updated: 'dernière modification',
|
||||
ascending: 'croissant',
|
||||
descending: 'décroissant',
|
||||
'Loading articles': 'Chargement des articles',
|
||||
Loading: 'Chargement',
|
||||
"Couldn't load your articles": 'Impossible de charger vos articles',
|
||||
@@ -1062,6 +1069,17 @@ export const messages = {
|
||||
'Rows per page': 'Lignes par page',
|
||||
'Previous page': 'Page précédente',
|
||||
'Next page': 'Page suivante',
|
||||
'First page': 'Première page',
|
||||
'Last page': 'Dernière page',
|
||||
Pagination: 'Pagination',
|
||||
Previous: 'Précédent',
|
||||
Next: 'Suivant',
|
||||
'{0} per page': '{0} par page',
|
||||
'Loading page {0}…': 'Chargement de la page {0}…',
|
||||
"Couldn't load page {0}. Showing page {1}.":
|
||||
'Impossible de charger la page {0}. Affichage de la page {1}.',
|
||||
"That page doesn't exist. Showing the last page.":
|
||||
'Cette page n’existe pas. Affichage de la dernière page.',
|
||||
'Start date': 'Date de début',
|
||||
'End date': 'Date de fin',
|
||||
When: 'Quand',
|
||||
|
||||
+15
-11
@@ -13,6 +13,7 @@ import { initializeLocale, setLocale, t } from './index'
|
||||
import { messages } from './messages'
|
||||
import { formatAbsoluteDateFromIso } from '@/lib/relativeDate'
|
||||
import { formatSize, pluralArticles } from '@/lib/mediaFormat'
|
||||
import { articleEnvelope, articleListUrl } from '@/views/__tests__/articleEnvelope'
|
||||
|
||||
vi.mock('@/composables/useApi', async () => {
|
||||
const { ref } = await import('vue')
|
||||
@@ -349,16 +350,19 @@ describe('Hardener localization outcomes', () => {
|
||||
expect(document.activeElement).toBe(wrapper!.find('input[autocomplete="username"]').element)
|
||||
})
|
||||
it('focuses article search after clearing French no-results', async () => {
|
||||
request.mockResolvedValue([
|
||||
{
|
||||
id: 12,
|
||||
title: 'Data title',
|
||||
body: '',
|
||||
is_online: false,
|
||||
created_at: '2025-02-14T12:00:00Z',
|
||||
updated_at: '2025-02-14T12:00:00Z',
|
||||
},
|
||||
])
|
||||
const article = {
|
||||
id: 12,
|
||||
title: 'Data title',
|
||||
body: '',
|
||||
is_online: false,
|
||||
created_at: '2025-02-14T12:00:00Z',
|
||||
updated_at: '2025-02-14T12:00:00Z',
|
||||
}
|
||||
request.mockImplementation(async (url: string) =>
|
||||
articleEnvelope([article], {
|
||||
q: new URL(url, 'http://localhost').searchParams.get('q') ?? '',
|
||||
}),
|
||||
)
|
||||
setLocale('fr')
|
||||
await mountRoute('/article?q=absent')
|
||||
Array.from(document.body.querySelectorAll<HTMLButtonElement>('button'))
|
||||
@@ -414,7 +418,7 @@ describe('Hardener localization outcomes', () => {
|
||||
updated_at: '2025-02-14T12:00:00Z',
|
||||
}
|
||||
request.mockImplementation(async (url: string) =>
|
||||
url === '/v1/article/?format=html' ? [article] : article,
|
||||
url === articleListUrl() ? articleEnvelope([article]) : article,
|
||||
)
|
||||
await mountRoute(path)
|
||||
if (path === '/article') {
|
||||
|
||||
Reference in new issue
Block a user