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': case 'image_url_block':
el = { el = {
...el, ...el,
url: '' value: {
url: ''
}
}; };
break; break;
} }

View File

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

Binary file not shown.

View File

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

View File

@ -62,7 +62,9 @@ class NewContentBlockMutationTest(TestCase):
"contents": [ "contents": [
{ {
"type": "image_url_block", "type": "image_url_block",
"url": "/test.png" 'value': {
"url": "/test.png"
}
} }
] ]
}, },