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
@@ -3,8 +3,8 @@ import type { Field } from 'payload'
|
||||
const whenEnabled = (_: unknown, siblingData: { enabled?: boolean } | undefined) => Boolean(siblingData?.enabled)
|
||||
|
||||
/**
|
||||
* Site Settings → "Under construction" tab: a developer tool for a site that
|
||||
* isn't finished. When enabled, only the homepage and the chosen pages are
|
||||
* Site settings → "Maintenance" tab (maintenance mode) for a site that isn't
|
||||
* finished. When enabled, only the homepage and the chosen pages are
|
||||
* reachable — any other address redirects to the homepage with a notice, and a
|
||||
* link to another page shows the notice instead of navigating. One rule for
|
||||
* every visitor (pages stay static, there is no per-user check).
|
||||
@@ -20,23 +20,53 @@ export function buildConstructionFields(pagesSlug: string): Field[] {
|
||||
name: 'enabled',
|
||||
type: 'checkbox',
|
||||
admin: {
|
||||
description:
|
||||
'Only the homepage and the pages below can be opened. Other addresses redirect to the homepage with the notice; links to other pages show it instead of navigating.',
|
||||
description: {
|
||||
en: 'Visitors can open only the homepage and the pages below; other links show a notice.',
|
||||
pl: 'Odwiedzający mogą otworzyć tylko stronę główną i strony poniżej; inne linki pokazują komunikat.',
|
||||
},
|
||||
},
|
||||
defaultValue: false,
|
||||
label: 'Site under construction',
|
||||
label: { en: 'Maintenance mode', pl: 'Tryb prac technicznych' },
|
||||
},
|
||||
{
|
||||
name: 'allowedPages',
|
||||
type: 'relationship',
|
||||
admin: { condition: whenEnabled, description: 'The homepage is always available.' },
|
||||
admin: {
|
||||
condition: whenEnabled,
|
||||
description: { en: 'The homepage is always available.', pl: 'Strona główna jest zawsze dostępna.' },
|
||||
},
|
||||
hasMany: true,
|
||||
label: 'Pages still available',
|
||||
label: { en: 'Available pages', pl: 'Dostępne strony' },
|
||||
relationTo: pagesSlug as never,
|
||||
},
|
||||
{ name: 'title', type: 'text', admin: { condition: whenEnabled }, label: 'Notice title', localized: true },
|
||||
{ name: 'message', type: 'textarea', admin: { condition: whenEnabled }, label: 'Notice text', localized: true },
|
||||
{ name: 'buttonLabel', type: 'text', admin: { condition: whenEnabled }, label: 'Close button label', localized: true },
|
||||
{
|
||||
name: 'title',
|
||||
type: 'text',
|
||||
admin: { condition: whenEnabled },
|
||||
label: { en: 'Notice title', pl: 'Tytuł komunikatu' },
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'message',
|
||||
type: 'textarea',
|
||||
admin: { condition: whenEnabled },
|
||||
label: { en: 'Notice text', pl: 'Treść komunikatu' },
|
||||
localized: true,
|
||||
},
|
||||
{
|
||||
name: 'buttonLabel',
|
||||
type: 'text',
|
||||
admin: {
|
||||
condition: whenEnabled,
|
||||
description: {
|
||||
en: 'Leave empty to show a × sign.',
|
||||
pl: 'Zostaw puste, aby pokazać znak ×.',
|
||||
},
|
||||
placeholder: { en: 'Close', pl: 'Zamknij' },
|
||||
},
|
||||
label: { en: 'Close button label', pl: 'Etykieta przycisku zamknięcia' },
|
||||
localized: true,
|
||||
},
|
||||
],
|
||||
label: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user