Skip to content

Commit 0811707

Browse files
fix: apply block image placeholder url
1 parent 4e03da5 commit 0811707

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

frontend/express/public/javascripts/countly/vue/components/content.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,8 @@
774774
template: CV.T('/javascripts/countly/vue/templates/content/UI/content-sidebar-input.html')
775775
}));
776776

777+
const DEFAULT_LIST_BLOCK_IMAGE_PLACEHOLDER_URL = '/content/images/fullscreenPlaceholderImage.png';
778+
777779
Vue.component('cly-content-block-list-input', countlyVue.components.create({
778780
props: {
779781
blockInputs: {
@@ -788,6 +790,19 @@
788790
'input'
789791
],
790792

793+
computed: {
794+
mappedBlockInputs() {
795+
return this.blockInputs.map(block => {
796+
return block.map(blockInput => ({
797+
...blockInput,
798+
...(blockInput.id.includes('image') && !blockInput.value) && {
799+
value: DEFAULT_LIST_BLOCK_IMAGE_PLACEHOLDER_URL
800+
}
801+
}));
802+
});
803+
}
804+
},
805+
791806
methods: {
792807
onAddAsset(payload) {
793808
this.$emit('add-asset', payload);

frontend/express/public/javascripts/countly/vue/templates/content/UI/content-block-list-input.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<div class="cly-content-block-list-input">
2-
<!-- v-tooltip.right="step.componentTooltip" -->
32
<el-collapse
4-
v-for="(block, blockIndex) in blockInputs"
3+
v-for="(block, blockIndex) in mappedBlockInputs"
54
:key="`list-block-${blockIndex}`"
65
class="cly-content-block-list-input__list-block"
76
>
@@ -12,7 +11,7 @@
1211
<img
1312
class="cly-content-block-list-input__list-block-header-display-icon"
1413
:data-test-id="'fullscreen-blocks-icon-block-' + blockIndex"
15-
:src="block[0].value || '/content/images/fullscreenPlaceholderImage.png'"
14+
:src="block[0].value"
1615
>
1716
<p
1817
class="cly-content-block-list-input__list-block-header-display-title"

0 commit comments

Comments
 (0)