-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve "Broodkruimelpad toevoegen" Closes #14 See merge request ictu/devops/algoritmeregister/algoritmeregister!14
- Loading branch information
Showing
9 changed files
with
123 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,58 @@ | ||
<template> | ||
<div class="row row--page-opener"> | ||
<div class="row row--page-opener" v-if="breadcrumbs.length != 0"> | ||
<div class="container"> | ||
<div class="breadcrumb"> | ||
<p>U bent hier:</p> | ||
<p>{{ t('you-are-here') }}:</p> | ||
<ol> | ||
<li> | ||
<a href="#">Zoeken</a> | ||
<li v-for="crumb in breadcrumbsWithLinks"> | ||
<a v-if="crumb.routeName != null" :href="`/${crumb.routeName}`">{{ | ||
crumb.label | ||
}}</a> | ||
<span v-if="crumb.routeName == null">{{ crumb.label }}</span> | ||
</li> | ||
<li> | ||
<a href="#">Zoekresultaten</a> | ||
</li> | ||
<li>Regeling</li> | ||
<li>{{ pathTail.label }}</li> | ||
</ol> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { navigationItems } from '@/config/config' | ||
import { useI18n } from 'vue-i18n' | ||
import algoritmeService from '@/services/algoritme' | ||
import { AlgNamesOnly } from '~~/types/algoritme' | ||
const { t } = useI18n() | ||
const currentRoute = useRoute() | ||
const { data } = await algoritmeService.getNames() | ||
let nameList = ref(data.value as AlgNamesOnly[]) | ||
const navigationItemsTranslated = computed(() => | ||
navigationItems.map((item) => { | ||
return { label: t(item.label), routeName: item.routeName } | ||
}) | ||
) | ||
const navigationItemsWithoutLink = ['footer'] | ||
const breadcrumbs = computed(() => { | ||
const path = currentRoute.path | ||
const breadCrumbs = path != '/' ? path.split('/').slice(1) : [] | ||
return breadCrumbs.map((crumb) => { | ||
return { | ||
label: | ||
// translate path parts with a name matching a navigation item | ||
navigationItemsTranslated.value.find((item) => item.routeName == crumb) | ||
?.label || // translate path parts with a name matching an algorithm id | ||
nameList.value.find((alg: any) => alg.id == crumb)?.name || | ||
crumb, | ||
routeName: navigationItemsWithoutLink.includes(crumb) ? null : crumb, | ||
} | ||
}) | ||
}) | ||
const breadcrumbsWithLinks = computed(() => breadcrumbs.value.slice(0, -1)) | ||
const pathTail = computed(() => breadcrumbs.value.slice(-1)[0]) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters