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}
|
checked={attributes.labelWithinInput}
|
||||||
onChange={(labelWithinInput) => (setAttributes({ labelWithinInput }))}
|
onChange={(labelWithinInput) => (setAttributes({ labelWithinInput }))}
|
||||||
/>
|
/>
|
||||||
|
<ToggleControl
|
||||||
|
label={MailPoet.I18n.t('blockMandatory')}
|
||||||
|
checked={attributes.mandatory}
|
||||||
|
onChange={(mandatory) => (setAttributes({ mandatory }))}
|
||||||
|
/>
|
||||||
</PanelBody>
|
</PanelBody>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
|
||||||
@@ -61,6 +66,7 @@ FirstNameEdit.propTypes = {
|
|||||||
attributes: PropTypes.shape({
|
attributes: PropTypes.shape({
|
||||||
label: PropTypes.string.isRequired,
|
label: PropTypes.string.isRequired,
|
||||||
labelWithinInput: PropTypes.bool.isRequired,
|
labelWithinInput: PropTypes.bool.isRequired,
|
||||||
|
mandatory: PropTypes.bool.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
setAttributes: PropTypes.func.isRequired,
|
setAttributes: PropTypes.func.isRequired,
|
||||||
};
|
};
|
||||||
|
@@ -20,7 +20,7 @@ export const settings = {
|
|||||||
},
|
},
|
||||||
mandatory: {
|
mandatory: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: true,
|
default: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
supports: {
|
supports: {
|
||||||
|
@@ -41,6 +41,7 @@
|
|||||||
'settingsGoToPage': __('Go to Page'),
|
'settingsGoToPage': __('Go to Page'),
|
||||||
'settingsPleaseSelectList': __('Please select a list'),
|
'settingsPleaseSelectList': __('Please select a list'),
|
||||||
'fieldsBlocksCategory': __('Fields'),
|
'fieldsBlocksCategory': __('Fields'),
|
||||||
|
'blockMandatory': __('Mandatory field'),
|
||||||
'blockFirstName': __('First name'),
|
'blockFirstName': __('First name'),
|
||||||
'blockFirstNameDescription': __('Input field used to catch subscribers’ first names.'),
|
'blockFirstNameDescription': __('Input field used to catch subscribers’ first names.'),
|
||||||
'blockEmail': __('Email'),
|
'blockEmail': __('Email'),
|
||||||
|
Reference in New Issue
Block a user