More adustments to collection header bar.

This commit is contained in:
Mateus Machado Luna 2020-01-15 17:08:59 -03:00
parent 8596a84be5
commit 298252f919
7 changed files with 64 additions and 81 deletions

View File

@ -1,20 +1,8 @@
<template>
<div class="filters-list-page">
<b-loading :active.sync="isLoadingMetadatumTypes"/>
<div
v-if="!isRepositoryLevel"
class="tainacan-page-title">
<h1>
{{ $i18n.get('title_collection_filters_edition') + ' ' }}
<span style="font-weight: 600;">{{ collection && collection.name ? collection.name : '' }}</span>
</h1>
<a
@click="$router.go(-1)"
class="back-link has-text-secondary">
{{ $i18n.get('back') }}
</a>
<hr>
</div>
<tainacan-title
:bread-crumb-items="[{ path: '', label: this.$i18n.get('filters') }]"/>
<p v-if="isRepositoryLevel">{{ $i18n.get('info_repository_filters_inheritance') }}</p>
<br>
<div

View File

@ -2,20 +2,8 @@
<div class="metadata-list-page">
<b-loading :active.sync="isLoadingMetadatumTypes"/>
<b-loading :active.sync="isLoadingMetadatumMappers"/>
<div
v-if="!isRepositoryLevel"
class="tainacan-page-title">
<h1>
{{ $i18n.get('title_collection_metadata_edition') + ' ' }}
<span style="font-weight: 600;">{{ collection && collection.name ? collection.name : '' }}</span>
</h1>
<a
@click="$router.go(-1)"
class="back-link has-text-secondary">
{{ $i18n.get('back') }}
</a>
<hr>
</div>
<tainacan-title
:bread-crumb-items="[{ path: '', label: this.$i18n.get('metadata') }]"/>
<p v-if="isRepositoryLevel">{{ $i18n.get('info_repository_metadata_inheritance') }}</p>
<br>
<b-tabs

View File

@ -23,32 +23,6 @@
</span>
</button>
</div>
<div class="level-item">
<nav class="breadcrumbs">
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }}</router-link>
&nbsp;>&nbsp;
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('collections') }}</router-link>
&nbsp;>&nbsp;
<router-link
tag="a"
:to="{ path: collectionBreadCrumbItem.url, query: { fromBreadcrumb: true }}">{{ collectionBreadCrumbItem.name }}</router-link>
<template v-for="(childBreadCrumbItem, index) of childrenBreadCrumbItems">
<span :key="index">&nbsp;>&nbsp;</span>
<router-link
:key="index"
v-if="childBreadCrumbItem.path != ''"
tag="a"
:to="childBreadCrumbItem.path">{{ childBreadCrumbItem.label }}</router-link>
<span
:key="index"
v-else>{{ childBreadCrumbItem.label }}</span>
</template>
</nav>
</div>
</div>
<ul class="menu-list level-right">
@ -232,18 +206,11 @@ export default {
activeRoute: 'ItemsList',
pageTitle: '',
activeRouteName: '',
childrenBreadCrumbItems: []
}
},
computed: {
collection() {
return this.getCollection();
},
collectionBreadCrumbItem() {
return {
url: this.collection && this.collection.id ? this.$routerHelper.getCollectionPath(this.collection.id) : '',
name: this.collection && this.collection.name ? this.collection.name : ''
};
}
},
watch: {
@ -257,20 +224,12 @@ export default {
created() {
this.activeRoute = this.$route.name;
this.pageTitle = this.$route.meta.title;
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
},
beforeDestroy() {
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
this.pageTitle = this.$route.meta.title;
},
methods: {
...mapGetters('collection', [
'getCollection'
]),
collectionBreadCrumbUpdate(breadCrumbItems) {
this.childrenBreadCrumbItems = breadCrumbItems;
}
])
}
}
</script>

View File

@ -1,7 +1,7 @@
<template>
<div class="tainacan-page-title">
<h1>{{ pageTitle }} <span class="is-italic has-text-weight-semibold">{{ isRepositoryLevel ? '' : entityName }}</span></h1>
<h1>{{ pageTitle }} <span class="is-italic has-text-weight-semibold">{{ !isRepositoryLevel && collection && collection.name ? collection.name : '' }}</span></h1>
<a
@click="$router.go(-1)"
class="back-link has-text-secondary">
@ -10,7 +10,7 @@
<hr>
<nav
v-show="isRepositoryLevel"
v-if="isRepositoryLevel"
class="breadcrumbs">
<router-link
tag="a"
@ -27,11 +27,39 @@
v-else>{{ breadCrumbItem.label }}</span>
</template>
</nav>
<nav
v-else
class="breadcrumbs">
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('repository') }}</router-link>
&nbsp;>&nbsp;
<router-link
tag="a"
:to="$routerHelper.getCollectionsPath()">{{ $i18n.get('collections') }}</router-link>
&nbsp;>&nbsp;
<router-link
tag="a"
:to="{ path: collectionBreadCrumbItem.url, query: { fromBreadcrumb: true }}">{{ collectionBreadCrumbItem.name }}</router-link>
<template v-for="(childBreadCrumbItem, index) of childrenBreadCrumbItems">
<span :key="index">&nbsp;>&nbsp;</span>
<router-link
:key="index"
v-if="childBreadCrumbItem.path != ''"
tag="a"
:to="childBreadCrumbItem.path">{{ childBreadCrumbItem.label }}</router-link>
<span
:key="index"
v-else>{{ childBreadCrumbItem.label }}</span>
</template>
</nav>
</div>
</template>
<script>
import { mapGetters } from 'vuex';
export default {
name: 'TainacanTitle',
props: {
@ -42,7 +70,19 @@ export default {
isRepositoryLevel: true,
pageTitle: '',
activeRouteName: '',
breadCrumbItem: {}
breadCrumbItem: {},
childrenBreadCrumbItems: []
}
},
computed: {
collection() {
return this.getCollection();
},
collectionBreadCrumbItem() {
return {
url: this.collection && this.collection.id ? this.$routerHelper.getCollectionPath(this.collection.id) : '',
name: this.collection && this.collection.name ? this.collection.name : ''
};
}
},
watch: {
@ -57,8 +97,22 @@ export default {
},
created() {
this.isRepositoryLevel = (this.$route.params.collectionId == undefined);
document.title = this.$route.meta.title;
this.pageTitle = document.title;
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
},
beforeDestroy() {
this.$root.$on('onCollectionBreadCrumbUpdate', this.collectionBreadCrumbUpdate);
},
methods: {
...mapGetters('collection', [
'getCollection'
]),
collectionBreadCrumbUpdate(breadCrumbItems) {
this.childrenBreadCrumbItems = breadCrumbItems;
}
}
}
</script>

View File

@ -1,8 +1,5 @@
<template>
<div class="repository-level-page page-container">
<tainacan-title
:bread-crumb-items="[{ path: '', label: this.$i18n.get('filters') }]"/>
<filters-list/>
</div>
</template>

View File

@ -1,8 +1,5 @@
<template>
<div class="repository-level-page page-container">
<tainacan-title
:bread-crumb-items="[{ path: '', label: this.$i18n.get('metadata') }]"/>
<metadata-list/>
</div>
</template>

View File

@ -272,7 +272,7 @@
...mapGetters('capability', [
'getRoles'
]),
filteByCapabilitiesRelatedTo(entityName) {
filterByCapabilitiesRelatedTo(entityName) {
this.currentRelatedEntity = entityName;
switch(entityName) {
case 'repository':