Skip to content

Commit

Permalink
fix: fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliaghisini committed Oct 16, 2023
1 parent e2140a1 commit a5aa27a
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EditBlock extends SubblockEdit {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Accordion Edit
*/
constructor(props) {
super(props);
Expand Down
1 change: 1 addition & 0 deletions src/components/ItaliaTheme/Blocks/Accordion/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Edit extends SubblocksEdit {
<EditBlock
{...this.props}
{...this.subblockProps}
onChangeFocus={this.onSubblockChangeFocus}
data={subblock}
index={subindex}
selected={
Expand Down
2 changes: 2 additions & 0 deletions src/components/ItaliaTheme/Blocks/Callout/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ const Edit = ({
focusNextField={() => {
setSelectedField('text');
}}
onSelectBlock={onSelectBlock}
/>
</CalloutTitle>
<CalloutText>
Expand All @@ -87,6 +88,7 @@ const Edit = ({
data={data}
fieldName="text"
block={block}
onSelectBlock={onSelectBlock}
selected={selectedField === 'text'}
placeholder={intl.formatMessage(messages.text)}
onChangeBlock={onChangeBlock}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class EditBlock extends SubblockEdit {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Contacts Blocks edit
*/
constructor(props) {
super(props);
Expand Down
4 changes: 3 additions & 1 deletion src/components/ItaliaTheme/Blocks/ContactsBlock/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Edit extends SubblocksEdit {
fieldName="title"
selected={this.state.selectedField === 'title'}
placeholder={this.props.intl.formatMessage(messages.title)}
onSelectBlock={() => {}}
setSelected={() => {
this.setState({ selectedField: 'title' });
}}
Expand All @@ -100,7 +101,7 @@ class Edit extends SubblocksEdit {
placeholder={this.props.intl.formatMessage(
messages.description,
)}
onSelectBlock={null}
onSelectBlock={() => {}}
setSelected={() => {
this.setState({ selectedField: 'description' });
}}
Expand Down Expand Up @@ -132,6 +133,7 @@ class Edit extends SubblocksEdit {
{...this.subblockProps}
openObjectBrowser={this.props.openObjectBrowser}
onSubblockChangeFocus={this.onSubblockChangeFocus}
onChangeFocus={this.onSubblockChangeFocus}
isLast={this.state.subblocks.length - 1 === subindex}
isFirst={subindex === 0}
onFocusPreviousBlock={() => {
Expand Down
10 changes: 7 additions & 3 deletions src/components/ItaliaTheme/Blocks/IconBlocks/Block/EditBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class EditBlock extends SubblockEdit {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Icons Blocks edit
*/
constructor(props) {
super(props);
Expand Down Expand Up @@ -108,7 +108,9 @@ class EditBlock extends SubblockEdit {
selected={
this.props.selected && this.state.focusOn === 'title'
}
setSelected={() => this.setState({ focusOn: 'title' })}
setSelected={() => {
this.setState({ focusOn: 'title' });
}}
block={this.props.block}
onChangeBlock={(block, _data) => {
this.props.onChangeBlock(this.props.index, _data);
Expand Down Expand Up @@ -145,7 +147,9 @@ class EditBlock extends SubblockEdit {
key="text"
fieldName="text"
selected={this.props.selected && this.state.focusOn === 'text'}
setSelected={() => this.setState({ focusOn: 'text' })}
setSelected={() => {
this.setState({ focusOn: 'text' });
}}
onChangeBlock={(block, _data) => {
this.props.onChangeBlock(this.props.index, _data);
}}
Expand Down
1 change: 1 addition & 0 deletions src/components/ItaliaTheme/Blocks/IconBlocks/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class Edit extends SubblocksEdit {
index={subindex}
selected={this.isSubblockSelected(subindex)}
{...this.subblockProps}
onChangeFocus={this.onSubblockChangeFocus}
isFirst={subindex === 0}
isLast={subindex === this.state.subblocks?.length - 1}
openObjectBrowser={this.props.openObjectBrowser}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class EditBlock extends SubblockEdit {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Numbers Block edit
*/
constructor(props) {
super(props);
Expand Down Expand Up @@ -77,7 +77,9 @@ class EditBlock extends SubblockEdit {
data={this.props.data}
fieldName="title"
selected={this.props.selected && this.state.focusOn === 'title'}
setSelected={() => this.setState({ focusOn: 'title' })}
setSelected={() => {
this.setState({ focusOn: 'title' });
}}
block={this.props.block}
onChangeBlock={(block, _data) => {
this.props.onChangeBlock(this.props.index, _data);
Expand Down Expand Up @@ -113,6 +115,9 @@ class EditBlock extends SubblockEdit {
key="text"
fieldName="text"
selected={this.props.selected && this.state.focusOn === 'text'}
setSelected={() => {
this.setState({ focusOn: 'text' });
}}
block={this.props.block}
onChangeBlock={(block, _data) => {
this.props.onChangeBlock(this.props.index, _data);
Expand Down
1 change: 1 addition & 0 deletions src/components/ItaliaTheme/Blocks/NumbersBlock/Edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class Edit extends SubblocksEdit {
index={subindex}
selected={this.isSubblockSelected(subindex)}
{...this.subblockProps}
onChangeFocus={this.onSubblockChangeFocus}
isFirst={subindex === 0}
isLast={subindex === this.state.subblocks?.length - 1}
openObjectBrowser={this.props.openObjectBrowser}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const Edit = ({
fieldName="simple_card_title"
selected={selectedField === 'title'}
onChangeBlock={onChangeBlock}
onSelectBlock={onSelectBlock}
placeholder={intl.formatMessage(messages.simple_card_title)}
setSelected={() => {
setSelectedField('title');
Expand All @@ -94,8 +95,12 @@ const Edit = ({
data={data}
fieldName="simple_card_content"
selected={selectedField === 'content'}
setSelected={() => {
setSelectedField('content');
}}
block={block}
onChangeBlock={onChangeBlock}
onSelectBlock={onSelectBlock}
placeholder={intl.formatMessage(
messages.simple_card_content,
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ SimpleTextEditorWidget.propTypes = {
onSelectBlock: PropTypes.func.isRequired,
onChangeBlock: PropTypes.func.isRequired,
block: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
value: PropTypes.string,
selected: PropTypes.bool.isRequired,
placeholder: PropTypes.string.isRequired,
focusPrevField: PropTypes.func,
focusNextField: PropTypes.func,
//from block props:
properties: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusPreviousBlock: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusNextBlock: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusPreviousBlock: PropTypes.func.isRequired,
onFocusNextBlock: PropTypes.func.isRequired,
};

export default SimpleTextEditorWidget;
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const TextEditorWidget = (props) => {

TextEditorWidget.propTypes = {
data: PropTypes.objectOf(PropTypes.any).isRequired,
setSelected: PropTypes.func.isRequired,
setSelected: PropTypes.func,
onChangeBlock: PropTypes.func.isRequired,
block: PropTypes.string.isRequired,
selected: PropTypes.bool.isRequired,
Expand All @@ -140,8 +140,8 @@ TextEditorWidget.propTypes = {
focusNextField: PropTypes.func,
//from block props:
properties: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusPreviousBlock: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusNextBlock: PropTypes.objectOf(PropTypes.any).isRequired,
onFocusPreviousBlock: PropTypes.func.isRequired,
onFocusNextBlock: PropTypes.func.isRequired,
onSelectBlock: PropTypes.func.isRequired,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class EditComponent extends Component {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Hero Image left edit
*/
constructor(props) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class Edit extends Component {
* Constructor
* @method constructor
* @param {Object} props Component properties
* @constructs WysiwygEditor
* @constructs Video block edit
*/
constructor(props) {
super(props);
Expand Down

0 comments on commit a5aa27a

Please sign in to comment.