feat: pagination in the SPA for the Sites and Authors lists

This commit is contained in:
Florian Sylvain committed 2026-10-19 04:00:47 +02:00
1 parent 500ad59458
commit 340a0ad461
34 files changed
+2833 -896

No files matched your search

+26 -1
View File
@@ -31,8 +31,27 @@ const VISUAL_REFERENCE =
const officeBoard = 'RenewCMS Screens Back-office.dc.html'
const PAGINATION_STATES = [
'First page',
'Middle page',
'Last page',
'Single page',
'Page size menu',
'Loading a page',
'Error loading a page',
'Empty after search',
'Search resets to page 1',
'Long labels on mobile',
]
const extraSources: Record<string, Source[]> = {
sites: [
{
board: officeBoard,
group: 'Sites: pagination',
states: PAGINATION_STATES,
alias: {},
},
{
board: officeBoard,
group: 'Sites: form',
@@ -67,6 +86,12 @@ const extraSources: Record<string, Source[]> = {
},
],
authors: [
{
board: officeBoard,
group: 'Authors: pagination',
states: PAGINATION_STATES,
alias: {},
},
{
board: officeBoard,
group: 'Authors: form',
@@ -842,7 +867,7 @@ function fulfilment(mock: ApiMock, url: URL, call: number) {
const text = typeof body === 'string'
return {
status: mock.status,
headers: mock.headers,
headers: { ...mock.headers, ...mock.headersFor?.(url, call) },
contentType: text ? 'text/plain; charset=utf-8' : 'application/json',
body: body === undefined ? '' : text ? (body as string) : JSON.stringify(body),
}