Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Enable field localization #24

Merged
merged 2 commits into from
Jan 23, 2023
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
6 changes: 6 additions & 0 deletions src/collections/Forms/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const label: Field = {
name: 'label',
label: 'Label',
type: 'text',
localized: true,
};

const required: Field = {
Expand Down Expand Up @@ -64,6 +65,7 @@ const Select: Block = {
{
name: 'defaultValue',
label: 'Default Value',
localized: true,
type: 'text',
admin: {
width: '50%',
Expand All @@ -88,6 +90,7 @@ const Select: Block = {
label: 'Label',
type: 'text',
required: true,
localized: true,
admin: {
width: '50%',
},
Expand Down Expand Up @@ -146,6 +149,7 @@ const Text: Block = {
name: 'defaultValue',
label: 'Default Value',
type: 'text',
localized: true,
admin: {
width: '50%',
},
Expand Down Expand Up @@ -192,6 +196,7 @@ const TextArea: Block = {
{
name: 'defaultValue',
label: 'Default Value',
localized: true,
type: 'text',
admin: {
width: '50%',
Expand Down Expand Up @@ -560,6 +565,7 @@ const Message: Block = {
{
name: 'message',
type: 'richText',
localized: true,
},
],
};
Expand Down
4 changes: 4 additions & 0 deletions src/collections/Forms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf
{
name: 'submitButtonLabel',
type: 'text',
localized: true,
},
{
name: 'confirmationType',
Expand All @@ -133,6 +134,7 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf
{
name: 'confirmationMessage',
type: 'richText',
localized: true,
required: true,
admin: {
condition: (_, siblingData) => siblingData?.confirmationType === 'message',
Expand Down Expand Up @@ -206,11 +208,13 @@ export const generateFormCollection = (formConfig: PluginConfig): CollectionConf
label: 'Subject',
defaultValue: 'You\'ve received a new message.',
required: true,
localized: true,
},
{
type: 'richText',
name: 'message',
label: 'Message',
localized: true,
admin: {
description: 'Enter the message that should be sent in this email.',
},
Expand Down