Skip to content
Snippets Groups Projects
Commit aca64f8c authored by Petar Hristov's avatar Petar Hristov :speech_balloon:
Browse files

Minor fixes (coscine/issues#1970)

parent 25401c2d
No related tags found
1 merge request!26New: Add Breadcrumbs (coscine/issues#1970)
Pipeline #663522 passed
......@@ -4,12 +4,8 @@
:to="{ name: 'list-projects' }"
:active="crumbs.length === 0"
>
<b-icon
icon="house-fill"
scale="1.25"
shift-v="1.25"
aria-hidden="true"
></b-icon>
<b-icon v-if="crumbs.length === 0" icon="house-fill" aria-hidden="true" />
<b-icon v-else icon="house" aria-hidden="true" />
{{ $t(`breadcrumbs.home`) }}
</b-breadcrumb-item>
<b-breadcrumb-item
......@@ -25,13 +21,15 @@
<script lang="ts">
import { defineComponent } from "vue-demi";
// import the main store
import { useMainStore } from "@/store/index";
// import the project store
import { useProjectStore } from "@/modules/project/store";
// import the resource store
import { useResourceStore } from "@/modules/resource/store";
import {
import type {
ProjectObject,
ResourceObject,
} from "@coscine/api-client/dist/types/Coscine.Api.Project";
......@@ -51,6 +49,7 @@ export default defineComponent({
return { mainStore, projectStore, resourceStore };
},
computed: {
crumbs(): RouteLink[] {
let pathArray = this.$route.path.split("/");
......@@ -79,7 +78,7 @@ export default defineComponent({
? this.project.displayName
: path,
resourceName: this.resource
? this.resource.displayName
? `${this.resource.type?.displayName?.toUpperCase()}: ${this.resource.displayName}`
: path,
}
).toString()
......@@ -108,15 +107,17 @@ export default defineComponent({
}
return breadcrumbs;
},
parentProjects(): ProjectObject[] | null {
return this.projectStore.currentParentProjects;
},
project(): ProjectObject | null {
return this.projectStore.currentProject;
},
resource(): ResourceObject | null {
// TODO: Return current resource
return null;
return this.resourceStore.currentResource;
},
},
});
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment