Skip to content

Commit

Permalink
Merge branch 'main' into slots2024
Browse files Browse the repository at this point in the history
  • Loading branch information
sneridagh authored Feb 22, 2024
2 parents ac09167 + 6eea1ed commit 33b96c9
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 14 deletions.
6 changes: 6 additions & 0 deletions docs/source/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ myst:

<!-- towncrier release notes start -->

## 18.0.0-alpha.13 (2024-02-22)

### Bugfix

- Fix sidebar form update. @robgietema [#5779](https://github.com/plone/volto/issues/5779)

## 18.0.0-alpha.12 (2024-02-21)

### Feature
Expand Down
6 changes: 6 additions & 0 deletions packages/volto-slate/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

<!-- towncrier release notes start -->

## 18.0.0-alpha.7 (2024-02-22)

### Bugfix

- Fix sidebar form update. @robgietema [#5779](https://github.com/plone/volto/issues/5779)

## 18.0.0-alpha.6 (2024-01-25)

### Bugfix
Expand Down
2 changes: 1 addition & 1 deletion packages/volto-slate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@plone/volto-slate",
"version": "18.0.0-alpha.6",
"version": "18.0.0-alpha.7",
"description": "Slate.js integration with Volto",
"main": "src/index.js",
"author": "European Environment Agency: IDM2 A-Team",
Expand Down
16 changes: 5 additions & 11 deletions packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { map, remove } from 'lodash';
import { isEmpty, map, remove } from 'lodash';
import { Button, Table } from 'semantic-ui-react';
import cx from 'classnames';
import { defineMessages, injectIntl } from 'react-intl';
Expand Down Expand Up @@ -227,7 +227,7 @@ class Edit extends Component {
* @returns {undefined}
*/
componentDidMount() {
if (!this.props.data.table) {
if (!this.props.data.table || isEmpty(this.props.data.table)) {
this.props.onChangeBlock(this.props.block, {
...this.props.data,
table: initialTable,
Expand All @@ -243,7 +243,7 @@ class Edit extends Component {
* @returns {undefined}
*/
UNSAFE_componentWillReceiveProps(nextProps) {
if (!nextProps.data.table) {
if (!nextProps.data.table || isEmpty(nextProps.data.table)) {
this.props.onChangeBlock(nextProps.block, {
...nextProps.data,
table: initialTable,
Expand Down Expand Up @@ -528,10 +528,7 @@ class Edit extends Component {
icon
basic
onClick={this.onDeleteRow}
disabled={
this.props.data.table &&
this.props.data.table.rows.length === 1
}
disabled={this.props.data.table?.rows?.length === 1}
title={this.props.intl.formatMessage(messages.deleteRow)}
aria-label={this.props.intl.formatMessage(messages.deleteRow)}
>
Expand Down Expand Up @@ -569,10 +566,7 @@ class Edit extends Component {
icon
basic
onClick={this.onDeleteCol}
disabled={
this.props.data.table &&
this.props.data.table.rows[0].cells.length === 1
}
disabled={this.props.data.table?.rows?.[0].cells.length === 1}
title={this.props.intl.formatMessage(messages.deleteCol)}
aria-label={this.props.intl.formatMessage(messages.deleteCol)}
>
Expand Down
6 changes: 6 additions & 0 deletions packages/volto/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ myst:

<!-- towncrier release notes start -->

## 18.0.0-alpha.13 (2024-02-22)

### Bugfix

- Fix sidebar form update. @robgietema [#5779](https://github.com/plone/volto/issues/5779)

## 18.0.0-alpha.12 (2024-02-21)

### Feature
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}
],
"license": "MIT",
"version": "18.0.0-alpha.12",
"version": "18.0.0-alpha.13",
"repository": {
"type": "git",
"url": "[email protected]:plone/volto.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/volto/src/components/manage/Form/Form.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class Form extends Component {
}
if (
this.props.global &&
!isEqual(this.props.globalData, this.state.formData)
!isEqual(this.props.globalData, prevProps.globalData)
) {
this.setState({
formData: this.props.globalData,
Expand Down

0 comments on commit 33b96c9

Please sign in to comment.