Skip to content

Commit

Permalink
FIX Applying the allowed elements fix to the other add element buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
ScopeyNZ committed Jan 29, 2019
1 parent adc3692 commit 289f6f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/src/components/ElementEditor/ElementEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ class ElementEditor extends PureComponent {
onDragOver={this.handleDragOver}
/>
<ListComponent
allowedElementTypes={allowedElementTypes}
elementTypes={elementTypes}
areaId={areaId}
onDragOver={this.handleDragOver}
Expand Down
4 changes: 3 additions & 1 deletion client/src/components/ElementEditor/ElementList.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ElementList extends Component {
HoverBarComponent,
DragIndicatorComponent,
blocks,
allowedElementTypes,
elementTypes,
areaId,
onDragEnd,
Expand Down Expand Up @@ -64,7 +65,7 @@ class ElementList extends Component {
{isDraggingOver || <HoverBarComponent
areaId={areaId}
elementId={element.ID}
elementTypes={elementTypes}
elementTypes={allowedElementTypes}
/>}
</div>
));
Expand Down Expand Up @@ -111,6 +112,7 @@ ElementList.propTypes = {
// @todo support either ElementList or Element children in an array (or both)
blocks: PropTypes.arrayOf(elementType),
elementTypes: PropTypes.arrayOf(elementTypeType).isRequired,
allowedElementTypes: PropTypes.arrayOf(elementTypeType).isRequired,
loading: PropTypes.bool,
areaId: PropTypes.number.isRequired,
dragTargetElementId: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
Expand Down
3 changes: 3 additions & 0 deletions client/src/components/ElementEditor/tests/ElementList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ describe('ElementList', () => {
<ElementList
key={'1'}
blocks={blocks}
allowedElementTypes={elementTypes}
elementTypes={elementTypes}
ElementComponent={Element}
LoadingComponent={Loading}
Expand All @@ -74,6 +75,7 @@ describe('ElementList', () => {
<ElementList
key={'2'}
blocks={[]}
allowedElementTypes={elementTypes}
elementTypes={elementTypes}
ElementComponent={Element}
LoadingComponent={Loading}
Expand All @@ -94,6 +96,7 @@ describe('ElementList', () => {
<ElementList
key={'3'}
blocks={[]}
allowedElementTypes={elementTypes}
elementTypes={elementTypes}
ElementComponent={Element}
LoadingComponent={Loading}
Expand Down

0 comments on commit 289f6f6

Please sign in to comment.