Disable edit of images and embeds in Draftail - not cooked enough

This commit is contained in:
Thibaud Colas 2018-01-17 16:59:17 +02:00
parent 4054fb2f18
commit 19a6189d57
4 changed files with 2 additions and 25 deletions

View file

@ -15,7 +15,7 @@ const propTypes = {
* Editor block to display media and edit content.
*/
const EmbedBlock = props => {
const { entity, onEditEntity, onRemoveEntity } = props.blockProps;
const { entity, onRemoveEntity } = props.blockProps;
const { url, title, thumbnail } = entity.getData();
return (
@ -30,10 +30,6 @@ const EmbedBlock = props => {
{title}
</a>
<button className="button Tooltip__button" onClick={onEditEntity}>
{STRINGS.EDIT}
</button>
<button className="button button-secondary no Tooltip__button" onClick={onRemoveEntity}>
{STRINGS.DELETE}
</button>

View file

@ -38,7 +38,7 @@ class ImageBlock extends Component {
render() {
const { blockProps } = this.props;
const { entity, onEditEntity, onRemoveEntity } = blockProps;
const { entity, onRemoveEntity } = blockProps;
const { src, alt } = entity.getData();
return (
@ -48,10 +48,6 @@ class ImageBlock extends Component {
<input className="ImageBlock__field__input" type="text" value={alt || ''} onChange={this.changeAlt} />
</label>
<button className="button Tooltip__button" onClick={onEditEntity}>
{STRINGS.EDIT}
</button>
<button className="button button-secondary no Tooltip__button" onClick={onRemoveEntity}>
{STRINGS.DELETE}
</button>

View file

@ -22,11 +22,6 @@ exports[`EmbedBlock renders 1`] = `
>
Test title
</a>
<button
className="button Tooltip__button"
>
Edit
</button>
<button
className="button button-secondary no Tooltip__button"
>

View file

@ -29,11 +29,6 @@ exports[`ImageBlock alt 1`] = `
value="Test"
/>
</label>
<button
className="button Tooltip__button"
>
Edit
</button>
<button
className="button button-secondary no Tooltip__button"
>
@ -71,11 +66,6 @@ exports[`ImageBlock renders 1`] = `
value=""
/>
</label>
<button
className="button Tooltip__button"
>
Edit
</button>
<button
className="button button-secondary no Tooltip__button"
>