Add mandatory option to First Name field
[MAILPOET-2452]
This commit is contained in:
committed by
Rostislav Wolný
parent
612f436dba
commit
0c1ca572ed
@@ -25,6 +25,11 @@ const FirstNameEdit = ({ attributes, setAttributes }) => {
|
||||
checked={attributes.labelWithinInput}
|
||||
onChange={(labelWithinInput) => (setAttributes({ labelWithinInput }))}
|
||||
/>
|
||||
<ToggleControl
|
||||
label={MailPoet.I18n.t('blockMandatory')}
|
||||
checked={attributes.mandatory}
|
||||
onChange={(mandatory) => (setAttributes({ mandatory }))}
|
||||
/>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
|
||||
@@ -61,6 +66,7 @@ FirstNameEdit.propTypes = {
|
||||
attributes: PropTypes.shape({
|
||||
label: PropTypes.string.isRequired,
|
||||
labelWithinInput: PropTypes.bool.isRequired,
|
||||
mandatory: PropTypes.bool.isRequired,
|
||||
}).isRequired,
|
||||
setAttributes: PropTypes.func.isRequired,
|
||||
};
|
||||
|
@@ -20,7 +20,7 @@ export const settings = {
|
||||
},
|
||||
mandatory: {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
supports: {
|
||||
|
@@ -41,6 +41,7 @@
|
||||
'settingsGoToPage': __('Go to Page'),
|
||||
'settingsPleaseSelectList': __('Please select a list'),
|
||||
'fieldsBlocksCategory': __('Fields'),
|
||||
'blockMandatory': __('Mandatory field'),
|
||||
'blockFirstName': __('First name'),
|
||||
'blockFirstNameDescription': __('Input field used to catch subscribers’ first names.'),
|
||||
'blockEmail': __('Email'),
|
||||
|
Reference in New Issue
Block a user