Removes the use of value_as_string from table item view for textarea values.

This commit is contained in:
Mateus Machado Luna 2019-08-15 09:37:33 -03:00
parent 04cfd8cc28
commit 7b4425485b
3 changed files with 7 additions and 13 deletions

View File

@ -804,7 +804,7 @@
column.metadatum !== 'row_author' &&
column.metadatum !== 'row_title' &&
column.metadatum !== 'row_description'"
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column, column.metadata_type_object.component) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
<span v-if="column.metadatum == 'row_thumbnail'">
<img
@ -1246,17 +1246,14 @@ export default {
goToItemEditPage(item) {
this.$router.push(this.$routerHelper.getItemEditPath(item.collection_id, item.id));
},
renderMetadata(itemMetadata, column, component) {
renderMetadata(itemMetadata, column) {
let metadata = (itemMetadata != undefined && itemMetadata[column.slug] != undefined) ? itemMetadata[column.slug] : false;
if (!metadata || itemMetadata == undefined) {
return '';
} else {
if ((component != undefined && component == 'tainacan-textarea') || this.$route.query.iframemode)
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_string) : metadata.value_as_string;
else
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html) : metadata.value_as_html;
return this.viewMode == 'table' ? ('<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html) : metadata.value_as_html;
}
},
getLimitedDescription(description) {

View File

@ -193,7 +193,7 @@
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-height: 1.25rem;
max-height: 1.125rem;
}
a:hover {
text-decoration: none !important;

View File

@ -156,7 +156,7 @@
column.metadatum !== 'row_author' &&
column.metadatum !== 'row_title' &&
column.metadatum !== 'row_description'"
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column, column.metadata_type_object.component) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
v-html="renderMetadata(item.metadata, column) != '' ? renderMetadata(item.metadata, column) : `<span class='has-text-gray3 is-italic'>` + $i18n.get('label_value_not_informed') + `</span>`"/>
<span v-if="column.metadatum == 'row_thumbnail'">
<img
@ -190,17 +190,14 @@ export default {
}
},
methods: {
renderMetadata(itemMetadata, column, component) {
renderMetadata(itemMetadata, column) {
let metadata = (itemMetadata != undefined && itemMetadata[column.slug] != undefined) ? itemMetadata[column.slug] : false;
if (!metadata) {
return '';
} else {
if (component != undefined && component == 'tainacan-textarea')
return '<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_string;
else
return '<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html;
return '<span class="sr-only">' + column.name + ': </span>' + metadata.value_as_html;
}
}
}