Adds verirication for empty metadatum on sorting.

This commit is contained in:
Mateus Machado Luna 2018-07-23 13:50:31 -03:00
parent 8c0c244e16
commit 62085cb309
1 changed files with 5 additions and 3 deletions

View File

@ -191,9 +191,11 @@
<b-icon icon="menu-down"/>
</button>
<b-dropdown-item
:class="{ 'is-active': orderBy == metadatum.slug }"
v-for="metadatum in sortingMetadata"
:class="{ 'is-active': metadatum != undefined && orderBy == metadatum.slug }"
v-for="metadatum of sortingMetadata"
v-if="
totalItems > 0 &&
metadatum != undefined &&
metadatum.slug === 'creation_date' || (
metadatum.metadata_type_object &&
metadatum.metadata_type_object.related_mapped_prop == 'title'
@ -205,7 +207,7 @@
<!-- Once we have sorting by metadata we can use this -->
<!-- <b-dropdown-item
:class="{ 'is-active': orderBy == metadatum.slug }"
v-for="metadatum in sortingMetadata"
v-for="metadatum of sortingMetadata"
v-if="
metadatum.slug === 'creation_date' ||
metadatum.slug === 'author_name' || (