Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove localized property from RowField and CollapsibleField #9672

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/payload/src/fields/config/sanitize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { baseIDField } from '../baseFields/baseIDField.js'
import { setDefaultBeforeDuplicate } from '../setDefaultBeforeDuplicate.js'
import { validations } from '../validations.js'
import { sanitizeJoinField } from './sanitizeJoinField.js'
import { fieldAffectsData, tabHasName } from './types.js'
import { fieldAffectsData, fieldIsLocalized, tabHasName } from './types.js'

type Args = {
collectionConfig?: CollectionConfig
Expand Down Expand Up @@ -249,7 +249,7 @@ export const sanitizeFields = async ({
? `${joinPath ? joinPath + '.' : ''}${field.name}`
: joinPath,
joins,
parentIsLocalized: parentIsLocalized || field.localized,
parentIsLocalized: parentIsLocalized || fieldIsLocalized(field),
requireFieldLevelRichTextEditor,
richTextSanitizationPromises,
validRelationships,
Expand Down
4 changes: 2 additions & 2 deletions packages/payload/src/fields/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ export type RowField = {
admin?: Omit<Admin, 'description'>
fields: Field[]
type: 'row'
} & Omit<FieldBase, 'admin' | 'label' | 'name' | 'validate' | 'virtual'>
} & Omit<FieldBase, 'admin' | 'label' | 'localized' | 'name' | 'validate' | 'virtual'>

export type RowFieldClient = {
admin?: Omit<AdminClient, 'description'>
Expand Down Expand Up @@ -686,7 +686,7 @@ export type CollapsibleField = {
label: Required<FieldBase['label']>
}
) &
Omit<FieldBase, 'label' | 'name' | 'validate' | 'virtual'>
Omit<FieldBase, 'label' | 'localized' | 'name' | 'validate' | 'virtual'>

export type CollapsibleFieldClient = {
admin?: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
fieldHasSubFields,
fieldIsHiddenOrDisabled,
fieldIsID,
fieldIsLocalized,
fieldIsSidebar,
getFieldPaths,
tabHasName,
Expand Down Expand Up @@ -626,7 +627,7 @@ export const addFieldStatePromise = async (args: AddFieldStatePromiseArgs): Prom
id,
// passthrough parent functionality
addErrorPathToParent: addErrorPathToParentArg,
anyParentLocalized: field.localized || anyParentLocalized,
anyParentLocalized: fieldIsLocalized(field) || anyParentLocalized,
clientFieldSchemaMap,
collectionSlug,
data,
Expand Down