Adds Title and Description by default to Repository level Items List and Term Items List.

This commit is contained in:
Mateus Machado Luna 2018-08-17 12:50:27 -03:00
parent 48fc6684a4
commit 286cc95047
6 changed files with 206 additions and 22 deletions

View File

@ -90,7 +90,7 @@
.is-secondary-content {
padding: 0px !important;
margin: 106px auto 0 auto;
margin: 94px auto 0 auto;
position: relative;
overflow-y: hidden;
height: calc(100% - 94px);

View File

@ -300,9 +300,21 @@
}"
v-for="(column, index) in tableMetadata"
:key="index"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-if="collectionId != undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
@click="goToItemPage(item)"
v-html="item.metadata != undefined ? renderMetadata(item.metadata, column) : ''" />
v-html="item.metadata != undefined ? renderMetadata(item.metadata, column) : ''" />
<p
v-tooltip="{
content: item.title != undefined ? item.title : '',
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-for="(column, index) in tableMetadata"
:key="index"
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
@click="goToItemPage(item)"
v-html="item.title != undefined ? item.title : ''" />
</div>
<!-- Actions -->
<div
@ -337,6 +349,28 @@
:src="item['thumbnail'].medium_large ? item['thumbnail'].medium_large : thumbPlaceholderPath">
<div class="list-metadata media-body">
<span
v-for="(column, index) in tableMetadata"
:key="index"
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'description')">
<h3
v-tooltip="{
content: $i18n.get('label_description'),
html: false,
autoHide: false,
placement: 'auto-start'
}"
class="metadata-label">{{ $i18n.get('label_description') }}</h3>
<p
v-tooltip="{
content: item.description != undefined ? item.description : '',
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-html="item.description != undefined ? item.description : ''"
class="metadata-value"/>
</span>
<span
v-for="(column, index) in tableMetadata"
:key="index"
@ -437,11 +471,28 @@
}"
@click="goToItemPage(item)">
<!-- <data-and-tooltip
v-if="column.metadatum !== 'row_thumbnail' &&
column.metadatum !== 'row_actions' &&
column.metadatum !== 'row_creation'"
:data="renderMetadata(item.metadata, column)"/> -->
<p
v-tooltip="{
content: item.title,
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'title'"
v-html="item.title != undefined ? item.title : ''"/>
<p
v-tooltip="{
content: item.description,
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'description'"
v-html="item.description != undefined ? item.description : ''"/>
<p
v-tooltip="{
content: renderMetadata(item.metadata, column),
@ -525,7 +576,7 @@ export default {
items: Array,
isLoading: false,
isOnTrash: false,
viewMode: 'table'
viewMode: 'card'
},
mounted() {
this.selectedItems = [];

View File

@ -832,13 +832,17 @@
let thumbnailMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'thumbnail');
let creationDateMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'creation_date');
let authorNameMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'author_name');
let descriptionMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.metadata_type_object != undefined ? metadatum.metadata_type_object.related_mapped_prop == 'description' : false);
// Updates Search
this.$eventBusSearch.addFetchOnly({
'0': thumbnailMetadatum.display ? 'thumbnail' : null,
'meta': fetchOnlyMetadatumIds,
'1': creationDateMetadatum.display ? 'creation_date' : null,
'2': authorNameMetadatum.display ? 'author_name': null
'2': authorNameMetadatum.display ? 'author_name': null,
'3': (this.isRepositoryLevel ? 'title' : null),
'4': (this.isRepositoryLevel && descriptionMetadatum.display ? 'description' : null),
});
// Closes dropdown
@ -895,6 +899,28 @@
display: thumbnailMetadatumDisplay
});
// Repository Level always shows core metadata
if (this.isRepositoryLevel) {
metadata.push({
name: this.$i18n.get('label_title'),
metadatum: 'row_title',
metadata_type_object: {core: true, related_mapped_prop: 'title'},
metadata_type: undefined,
slug: 'title',
id: undefined,
display: true
});
metadata.push({
name: this.$i18n.get('label_description'),
metadatum: 'row_description',
metadata_type_object: {core: true, related_mapped_prop: 'description'},
metadata_type: undefined,
slug: 'description',
id: undefined,
display: true
});
}
let fetchOnlyMetadatumIds = [];
for (let metadatum of this.metadata) {
@ -938,6 +964,7 @@
let creationDateMetadatumDisplay = prefsFetchOnlyObject != undefined ? (prefsFetchOnlyObject['1'] != null) : true;
let authorNameMetadatumDisplay = prefsFetchOnlyObject != undefined ? (prefsFetchOnlyObject['2'] != null) : true;
// Creation date and author name should appear only on admin.
if (!this.isOnTheme) {
metadata.push({
@ -962,9 +989,23 @@
'0': (thumbnailMetadatumDisplay ? 'thumbnail' : null),
'meta': fetchOnlyMetadatumIds,
'1': (creationDateMetadatumDisplay ? 'creation_date' : null),
'2': (authorNameMetadatumDisplay ? 'author_name' : null)
'2': (authorNameMetadatumDisplay ? 'author_name' : null),
'3': (this.isRepositoryLevel ? 'title' : null),
'4': (this.isRepositoryLevel ? 'description' : null),
});
// Sorting metadata
if (this.isRepositoryLevel) {
this.sortingMetadata.push({
name: this.$i18n.get('label_title'),
metadatum: 'row_title',
metadata_type_object: {core: true, related_mapped_prop: 'title'},
metadata_type: undefined,
slug: 'title',
id: undefined,
display: true
});
}
this.sortingMetadata.push({
name: this.$i18n.get('label_creation_date'),
metadatum: 'row_creation',

View File

@ -834,13 +834,17 @@
let thumbnailMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'thumbnail');
let creationDateMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'creation_date');
let authorNameMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.slug == 'author_name');
let descriptionMetadatum = this.localDisplayedMetadata.find(metadatum => metadatum.metadata_type_object != undefined ? metadatum.metadata_type_object.related_mapped_prop == 'description' : false);
// Updates Search
this.$eventBusSearch.addFetchOnly({
'0': thumbnailMetadatum.display ? 'thumbnail' : null,
'meta': fetchOnlyMetadatumIds,
'1': creationDateMetadatum.display ? 'creation_date' : null,
'2': authorNameMetadatum.display ? 'author_name': null
'2': authorNameMetadatum.display ? 'author_name': null,
'3': (this.isRepositoryLevel ? 'title' : null),
'4': (this.isRepositoryLevel && descriptionMetadatum.display ? 'description' : null),
});
// Closes dropdown
@ -897,6 +901,28 @@
display: thumbnailMetadatumDisplay
});
// Repository Level always shows core metadata
if (this.isRepositoryLevel) {
metadata.push({
name: this.$i18n.get('label_title'),
metadatum: 'row_title',
metadata_type_object: {core: true, related_mapped_prop: 'title'},
metadata_type: undefined,
slug: 'title',
id: undefined,
display: true
});
metadata.push({
name: this.$i18n.get('label_description'),
metadatum: 'row_description',
metadata_type_object: {core: true, related_mapped_prop: 'description'},
metadata_type: undefined,
slug: 'description',
id: undefined,
display: true
});
}
let fetchOnlyMetadatumIds = [];
for (let metadatum of this.metadata) {
@ -964,9 +990,24 @@
'0': (thumbnailMetadatumDisplay ? 'thumbnail' : null),
'meta': fetchOnlyMetadatumIds,
'1': (creationDateMetadatumDisplay ? 'creation_date' : null),
'2': (authorNameMetadatumDisplay ? 'author_name' : null)
'2': (authorNameMetadatumDisplay ? 'author_name' : null),
'3': (this.isRepositoryLevel ? 'title' : null),
'4': (this.isRepositoryLevel ? 'description' : null),
});
// Sorting metadata
if (this.isRepositoryLevel) {
this.sortingMetadata.push({
name: this.$i18n.get('label_title'),
metadatum: 'row_title',
metadata_type_object: {core: true, related_mapped_prop: 'title'},
metadata_type: undefined,
slug: 'title',
id: undefined,
display: true
});
}
this.sortingMetadata.push({
name: this.$i18n.get('label_creation_date'),
metadatum: 'row_creation',

View File

@ -32,10 +32,22 @@
v-for="(column, index) in displayedMetadata"
:key="index"
class="metadata-title"
v-if="column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
v-if="collectionId != undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
@click="goToItemPage(item)"
v-html="item.metadata != undefined ? renderMetadata(item.metadata, column) : ''" />
<p
v-tooltip="{
content: item.title != undefined ? item.title : '',
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-for="(column, index) in tableMetadata"
:key="index"
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'title')"
@click="goToItemPage(item)"
v-html="item.title != undefined ? item.title : ''" />
<!-- Remaining metadata -->
<div
class="media"
@ -47,6 +59,28 @@
</a>
<div class="list-metadata media-body">
<span
v-for="(column, index) in tableMetadata"
:key="index"
v-if="collectionId == undefined && column.display && column.metadata_type_object != undefined && (column.metadata_type_object.related_mapped_prop == 'description')">
<h3
v-tooltip="{
content: $i18n.get('label_description'),
html: false,
autoHide: false,
placement: 'auto-start'
}"
class="metadata-label">{{ $i18n.get('label_description') }}</h3>
<p
v-tooltip="{
content: item.description != undefined ? item.description : '',
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-html="item.description != undefined ? item.description : ''"
class="metadata-value"/>
</span>
<span
v-for="(column, index) in displayedMetadata"
:key="index"

View File

@ -67,11 +67,28 @@
}"
@click="goToItemPage(item)">
<!-- <data-and-tooltip
v-if="column.metadatum !== 'row_thumbnail' &&
column.metadatum !== 'row_actions' &&
column.metadatum !== 'row_creation'"
:data="renderMetadata( item.metadata[column.slug] )"/> -->
<p
v-tooltip="{
content: item.title,
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'title'"
v-html="item.title != undefined ? item.title : ''"/>
<p
v-tooltip="{
content: item.description,
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="collectionId == undefined &&
column.metadata_type_object != undefined &&
column.metadata_type_object.related_mapped_prop == 'description'"
v-html="item.description != undefined ? item.description : ''"/>
<p
v-tooltip="{
content: renderMetadata( item.metadata[column.slug] ),