anpassungen nach rebase
This commit is contained in:
parent
a441f3b515
commit
48e724f4e4
|
|
@ -174,7 +174,9 @@
|
|||
case 'image_url_block':
|
||||
el = {
|
||||
...el,
|
||||
value: {
|
||||
url: ''
|
||||
}
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -62,8 +62,10 @@ class NewContentBlockMutationTest(TestCase):
|
|||
"contents": [
|
||||
{
|
||||
"type": "image_url_block",
|
||||
'value': {
|
||||
"url": "/test.png"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"after": self.sibling_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue