Admin panel in English and Polish, reworded per docs/dev/admin-ux.md
- admin-i18n module: AdminText { en, pl }, component texts under the ipal
namespace (project translations win), en + pl admin languages when the
project sets none (project's supportedLanguages wins)
- every plugin label, description, option, tab and group as { en, pl };
explicit labels instead of auto-labels; sentence case; glossary terms
- visible renames (slugs, names, data unchanged): Cookie banner, Form
messages, Privacy group, Search engines, Maintenance, Spam protection,
E-mail sending, stats nav link Overview (hidden without access)
- Polish visitor defaults by page locale: cookie banner, form messages,
validators, lightbox, accessibility widget; {field} uses the label
- fixes: e-mail status banner used Turnstile wording; developer words and
env var names out of editor messages; stats numbers/dates in the admin
language; test e-mail no longer says ipal-kit
- test/adminUx.test.ts: length limits, en + pl present, no developer words
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
eeac33ed2f
commit
6b46bc0c14
@@ -122,7 +122,7 @@ export function buildCookieCrawlEndpoints({
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err)
|
||||
req.payload.logger.error(`[ipal] cookie crawl: could not start — ${message}`)
|
||||
await write(req, { error: `Could not reach the scanner service: ${message}`, finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
await write(req, { error: 'The checking service could not be reached. Please try again later.', finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
return Response.json({ error: 'service_unreachable', ok: false }, { status: 502 })
|
||||
}
|
||||
return Response.json({ ok: true, status: 'running' }, { status: 202 })
|
||||
@@ -155,7 +155,7 @@ export function buildCookieCrawlEndpoints({
|
||||
} catch (err) {
|
||||
const message = err instanceof Error ? err.message : String(err)
|
||||
req.payload.logger.error(`[ipal] cookie crawl: saving the result failed — ${message}`)
|
||||
await write(req, { error: `Saving the result failed: ${message}`, finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
await write(req, { error: 'The result could not be saved. Please run the check again.', finishedAt: new Date().toISOString(), jobId: null, status: 'failed' })
|
||||
return Response.json({ ok: false }, { status: 500 })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -3,7 +3,7 @@ import type { GlobalConfig } from 'payload'
|
||||
import type { CookieScanLabels } from '../labels.js'
|
||||
|
||||
import { userMeetsRole } from '../../../access/predicates.js'
|
||||
import { labelRecord } from '../labels.js'
|
||||
import { labelFor, labelRecord } from '../labels.js'
|
||||
import { COOKIE_CRAWL_SLUG } from './config.js'
|
||||
|
||||
/**
|
||||
@@ -20,16 +20,16 @@ export function buildCookieCrawlGlobal(labels: Record<string, CookieScanLabels>)
|
||||
read: ({ req }) => userMeetsRole(req, 'editor'),
|
||||
update: ({ req }) => userMeetsRole(req, 'admin'),
|
||||
},
|
||||
admin: { description: L('crawlGlobalDescription'), group: 'Settings' },
|
||||
admin: { description: L('crawlGlobalDescription'), group: { en: 'Privacy', pl: 'Prywatność' } },
|
||||
fields: [
|
||||
{
|
||||
name: 'notifyEmails',
|
||||
type: 'text',
|
||||
admin: { description: L('notifyEmailsDescription') },
|
||||
label: L('notifyEmails'),
|
||||
validate: (value: null | string | undefined) => {
|
||||
validate: (value: null | string | undefined, { req }: { req: { i18n?: { language?: string } } }) => {
|
||||
const list = (value ?? '').split(',').map((v) => v.trim()).filter(Boolean)
|
||||
return list.every((v) => /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(v)) || 'Comma-separated e-mail addresses.'
|
||||
return list.every((v) => /^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(v)) || labelFor(labels, req?.i18n?.language, 'notifyEmailsInvalid')
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -56,9 +56,9 @@ export function buildCookieCrawlGlobal(labels: Record<string, CookieScanLabels>)
|
||||
fields: [
|
||||
{ name: 'pages', type: 'number', admin: ro, label: L('crawlPages') },
|
||||
{ name: 'violations', type: 'number', admin: ro, label: L('crawlViolations') },
|
||||
{ name: 'newUnknown', type: 'number', admin: ro, label: L('unknown') },
|
||||
{ name: 'created', type: 'number', admin: ro },
|
||||
{ name: 'updated', type: 'number', admin: ro },
|
||||
{ name: 'newUnknown', type: 'number', admin: ro, label: L('crawlNewUnknown') },
|
||||
{ name: 'created', type: 'number', admin: ro, label: L('crawlCreated') },
|
||||
{ name: 'updated', type: 'number', admin: ro, label: L('crawlUpdated') },
|
||||
],
|
||||
label: false,
|
||||
},
|
||||
|
||||
@@ -132,7 +132,7 @@ export async function finishCrawl({
|
||||
...common,
|
||||
data: {
|
||||
// Not a failure, but the "after accept" half saw no consent — say so where the editor looks.
|
||||
error: result.accepted ? null : 'The "Accept all" button was not found (acceptSelector), so the second run had no consent.',
|
||||
error: result.accepted ? null : 'The "Accept all" button was not found, so the site could not be checked after consent.',
|
||||
finishedAt: now,
|
||||
jobId: null,
|
||||
pages: result.pages,
|
||||
|
||||
Reference in New Issue
Block a user