refactor: hide doc locale from admin editing UI

This commit is contained in:
Codex
2026-04-23 10:41:19 +08:00
parent ed7eb2e7e9
commit 1506867c90
9 changed files with 51 additions and 24 deletions
+35
View File
@@ -291,6 +291,33 @@ html[data-theme] .row .field-type {
max-width: none; max-width: none;
} }
html[data-theme] .field-type.row,
html[data-theme] .field-type.tabs-field,
html[data-theme] .field-type.group,
html[data-theme] .field-type.collapsible-field,
html[data-theme] .field-type.row:has(input[type='checkbox']),
html[data-theme] .field-type.row:has(select),
html[data-theme] .field-type.row:has(input[type='date']),
html[data-theme] .field-type.row:has(input[type='datetime-local']),
html[data-theme] .field-type.row:has(input[type='number']),
html[data-theme] .field-type.row:has(input[type='email']),
html[data-theme] .field-type.row:has(input[type='text']),
html[data-theme] .field-type.group:has(.render-fields),
html[data-theme] .field-type.group:has(.array-field),
html[data-theme] .field-type.group:has(.blocks-field),
html[data-theme] .field-type.group:has(.relationship-field),
html[data-theme] .field-type.group:has(.upload-field),
html[data-theme] .field-type.collapsible-field:has(.render-fields),
html[data-theme] .field-type.tabs-field:has(input[type='checkbox']),
html[data-theme] .field-type.tabs-field:has(select),
html[data-theme] .field-type.tabs-field:has(input[type='date']),
html[data-theme] .field-type.tabs-field:has(input[type='datetime-local']),
html[data-theme] .field-type.tabs-field:has(input[type='number']),
html[data-theme] .field-type.tabs-field:has(input[type='email']),
html[data-theme] .field-type.tabs-field:has(input[type='text']) {
max-width: none;
}
html[data-theme] .tabs-field__content-wrap, html[data-theme] .tabs-field__content-wrap,
html[data-theme] .tabs-field__content-wrap .render-fields, html[data-theme] .tabs-field__content-wrap .render-fields,
html[data-theme] .tabs-field__content-wrap .field-type, html[data-theme] .tabs-field__content-wrap .field-type,
@@ -310,6 +337,14 @@ html[data-theme] .tabs-field__content-wrap .field-type:has(.upload-field) {
max-width: none; max-width: none;
} }
html[data-theme] .field-type.group > .field-type__wrap,
html[data-theme] .field-type.collapsible-field > .field-type__wrap,
html[data-theme] .field-type.group .render-fields,
html[data-theme] .field-type.collapsible-field .render-fields {
max-width: none;
width: 100%;
}
html[data-theme] .row { html[data-theme] .row {
gap: 10px; gap: 10px;
} }
+2 -3
View File
@@ -10,7 +10,7 @@ export const Dealers: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('name'), baseFilter: independentDocListFilter('name'),
defaultColumns: ['name', 'docLocale', 'region', 'country', 'city', 'updatedAt'], defaultColumns: ['name', 'region', 'country', 'city', 'updatedAt'],
description: description:
'Dealer and distributor records surfaced in the dealer finder and product pages. English and Chinese dealer entries are maintained as separate documents.', 'Dealer and distributor records surfaced in the dealer finder and product pages. English and Chinese dealer entries are maintained as separate documents.',
group: { en: 'Sales', zh: '销售' }, group: { en: 'Sales', zh: '销售' },
@@ -39,8 +39,7 @@ export const Dealers: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this dealer record.',
}, },
}, },
{ name: 'name', label: { en: 'Name', zh: '名称' }, type: 'text', required: true, localized: true }, { name: 'name', label: { en: 'Name', zh: '名称' }, type: 'text', required: true, localized: true },
+2 -3
View File
@@ -25,7 +25,7 @@ export const Downloads: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('title'), baseFilter: independentDocListFilter('title'),
defaultColumns: ['title', 'docLocale', 'product', 'type', 'version', 'status', 'updatedAt'], defaultColumns: ['title', 'product', 'type', 'version', 'status', 'updatedAt'],
description: description:
'Firmware packages, manuals, software installers, and release notes tied to products. English and Chinese download entries are maintained as separate documents.', 'Firmware packages, manuals, software installers, and release notes tied to products. English and Chinese download entries are maintained as separate documents.',
group: { en: 'Catalog', zh: '产品' }, group: { en: 'Catalog', zh: '产品' },
@@ -54,8 +54,7 @@ export const Downloads: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this download entry.',
}, },
}, },
{ name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', required: true, localized: true }, { name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', required: true, localized: true },
+2 -3
View File
@@ -10,7 +10,7 @@ export const FAQs: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('question'), baseFilter: independentDocListFilter('question'),
defaultColumns: ['question', 'docLocale', 'group', 'order', 'updatedAt'], defaultColumns: ['question', 'group', 'order', 'updatedAt'],
description: description:
'Support knowledge base entries powering the FAQ center and product help flows. English and Chinese FAQ entries are maintained as separate documents.', 'Support knowledge base entries powering the FAQ center and product help flows. English and Chinese FAQ entries are maintained as separate documents.',
group: { en: 'Support', zh: '支持' }, group: { en: 'Support', zh: '支持' },
@@ -39,8 +39,7 @@ export const FAQs: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this FAQ entry.',
}, },
}, },
{ {
+2 -4
View File
@@ -10,7 +10,7 @@ export const News: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('title'), baseFilter: independentDocListFilter('title'),
defaultColumns: ['title', 'docLocale', 'category', 'publishedAt', 'updatedAt'], defaultColumns: ['title', 'category', 'publishedAt', 'updatedAt'],
description: description:
'Editorial news stories used for the news hub and homepage highlights. English and Chinese are maintained as separate documents.', 'Editorial news stories used for the news hub and homepage highlights. English and Chinese are maintained as separate documents.',
group: { en: 'Publishing', zh: '内容' }, group: { en: 'Publishing', zh: '内容' },
@@ -45,9 +45,7 @@ export const News: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description:
'Independent document language. Create one record for EN and one record for ZH, then keep this aligned with the admin locale while editing.',
}, },
}, },
{ name: 'slug', label: { en: 'Slug', zh: '链接标识' }, type: 'text', required: true, localized: true }, { name: 'slug', label: { en: 'Slug', zh: '链接标识' }, type: 'text', required: true, localized: true },
+2 -3
View File
@@ -10,7 +10,7 @@ export const ProductCategories: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('name'), baseFilter: independentDocListFilter('name'),
defaultColumns: ['slug', 'docLocale', 'name', 'order', 'updatedAt'], defaultColumns: ['slug', 'name', 'order', 'updatedAt'],
description: description:
'Navigation and merchandising categories for the product catalog. English and Chinese categories are maintained as separate documents.', 'Navigation and merchandising categories for the product catalog. English and Chinese categories are maintained as separate documents.',
group: { en: 'Catalog', zh: '产品' }, group: { en: 'Catalog', zh: '产品' },
@@ -38,8 +38,7 @@ export const ProductCategories: CollectionConfig = {
{ label: '中文 Doc', value: 'zh' }, { label: '中文 Doc', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this category record.',
}, },
}, },
{ name: 'slug', type: 'text', required: true }, { name: 'slug', type: 'text', required: true },
+2 -3
View File
@@ -25,7 +25,7 @@ export const ProductReviews: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('title'), baseFilter: independentDocListFilter('title'),
defaultColumns: ['title', 'docLocale', 'product', 'sourceName', 'sortOrder', 'status', 'updatedAt'], defaultColumns: ['title', 'product', 'sourceName', 'sortOrder', 'status', 'updatedAt'],
description: description:
'Editorial reviews, quotes, thumbnails, and outbound links associated with products. Homepage review quotes are also sourced from this collection, and English/Chinese entries are maintained as separate documents.', 'Editorial reviews, quotes, thumbnails, and outbound links associated with products. Homepage review quotes are also sourced from this collection, and English/Chinese entries are maintained as separate documents.',
group: { en: 'Catalog', zh: '产品' }, group: { en: 'Catalog', zh: '产品' },
@@ -54,8 +54,7 @@ export const ProductReviews: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this review entry.',
}, },
}, },
{ name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', localized: true, required: true }, { name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', localized: true, required: true },
+2 -3
View File
@@ -25,7 +25,7 @@ export const ProductVideos: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('title'), baseFilter: independentDocListFilter('title'),
defaultColumns: ['title', 'docLocale', 'product', 'provider', 'sortOrder', 'status', 'updatedAt'], defaultColumns: ['title', 'product', 'provider', 'sortOrder', 'status', 'updatedAt'],
description: description:
'Product-linked video entries shown on detail pages and reused in marketing blocks. English and Chinese video records are maintained as separate documents.', 'Product-linked video entries shown on detail pages and reused in marketing blocks. English and Chinese video records are maintained as separate documents.',
group: { en: 'Catalog', zh: '产品' }, group: { en: 'Catalog', zh: '产品' },
@@ -54,8 +54,7 @@ export const ProductVideos: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
position: 'sidebar', condition: () => false,
description: 'Independent document language for this video entry.',
}, },
}, },
{ name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', localized: true, required: true }, { name: 'title', label: { en: 'Title', zh: '标题' }, type: 'text', localized: true, required: true },
+2 -2
View File
@@ -34,7 +34,7 @@ export const Products: CollectionConfig = {
}, },
admin: { admin: {
baseFilter: independentDocListFilter('name'), baseFilter: independentDocListFilter('name'),
defaultColumns: ['model', 'docLocale', 'category', 'template', 'status', 'updatedAt'], defaultColumns: ['model', 'category', 'template', 'status', 'updatedAt'],
description: description:
'Product master records power templates, editor-driven pages, awards, downloads, and SEO. English and Chinese products are maintained as separate documents.', 'Product master records power templates, editor-driven pages, awards, downloads, and SEO. English and Chinese products are maintained as separate documents.',
group: { en: 'Catalog', zh: '产品' }, group: { en: 'Catalog', zh: '产品' },
@@ -66,7 +66,7 @@ export const Products: CollectionConfig = {
{ label: '简体中文', value: 'zh' }, { label: '简体中文', value: 'zh' },
], ],
admin: { admin: {
description: 'Independent document language for this product record.', condition: () => false,
}, },
}, },
{ name: 'model', label: { en: 'Model', zh: '产品型号' }, type: 'text', required: true }, { name: 'model', label: { en: 'Model', zh: '产品型号' }, type: 'text', required: true },