anpassungen nach rebase

This commit is contained in:
Daniel Egger 2018-09-19 17:40:53 +02:00
parent a441f3b515
commit 48e724f4e4
5 changed files with 14 additions and 9 deletions

View File

@ -174,7 +174,9 @@
case 'image_url_block':
el = {
...el,
value: {
url: ''
}
};
break;
}

View File

@ -1,7 +1,7 @@
<template>
<div class="image-form">
<div v-if="!url" ref="uploadcare-panel"></div>
<div v-if="url">
<div v-if="!value.url" ref="uploadcare-panel"></div>
<div v-if="value.url">
<img :src="previewUrl">
</div>
</div>
@ -12,7 +12,7 @@
export default {
props: ['url', 'index'],
props: ['value', 'index'],
mounted() {
let uploadcarePanel = openImagePanel(this.$refs['uploadcare-panel']);
@ -37,14 +37,15 @@
function openImagePanel(panelElement) {
return uploadcare.openPanel(panelElement, null, {
tabs: ['file'],
publicKey: 'ad89e9f42d4f5532d176',
publicKey: '78212ff39934a59775ac',
});
}
},
computed: {
previewUrl: function() {
if (this.url) {
return this.url + '-/preview/200x200/';
console.log(this.value);
if (this.value && this.value.url) {
return this.value.url + '-/preview/200x200/';
}
return null;
}

Binary file not shown.

View File

@ -29,7 +29,7 @@ def handle_content_blocks(content_data):
new_contents.append({
'type': 'image_url_block',
'value': {
'url': bleach.clean(content['url'])
'url': bleach.clean(content['value']['url'])
}})
elif content['type'] == 'link_block':
new_contents.append({

View File

@ -62,8 +62,10 @@ class NewContentBlockMutationTest(TestCase):
"contents": [
{
"type": "image_url_block",
'value': {
"url": "/test.png"
}
}
]
},
"after": self.sibling_id