Fix link in to KompetenzNavi in main navigation bar

This commit is contained in:
Daniel Egger 2023-09-15 10:59:44 +02:00
parent 68d37e4f8e
commit e6fbf0d276
2 changed files with 19 additions and 10 deletions

View File

@ -126,7 +126,11 @@ onMounted(() => {
<router-link
v-if="inCourse() && courseSessionsStore.currentCourseSession"
:to="`${courseSessionsStore.currentCourseSession.competence_url}`"
:to="`${courseSessionsStore.currentCourseSession.competence_url.replace(
// TODO: remove the `competence_url` with url to Navi...
'/competences',
''
)}`"
class="nav-item"
:class="{ 'nav-item--active': inCompetenceProfile() }"
>

View File

@ -9,6 +9,7 @@ import type {
PerformanceCriteria,
} from "@/types";
import i18next from "i18next";
import _ from "lodash";
import cloneDeep from "lodash/cloneDeep";
import groupBy from "lodash/groupBy";
import orderBy from "lodash/orderBy";
@ -115,15 +116,19 @@ export const useCompetenceStore = defineStore({
const competenceProfilePage = this.competenceProfilePages.get(userId);
if (competenceProfilePage?.children.length) {
return competenceProfilePage.children.filter((competence) => {
let criteria = competence.children;
if (this.selectedCircle.id != "all") {
criteria = criteria.filter((criteria) => {
return criteria.circle.translation_key === this.selectedCircle.id;
});
}
return criteria.length > 0;
});
return _.orderBy(
competenceProfilePage.children.filter((competence) => {
let criteria = competence.children;
if (this.selectedCircle.id != "all") {
criteria = criteria.filter((criteria) => {
return criteria.circle.translation_key === this.selectedCircle.id;
});
}
return criteria.length > 0;
}),
["competence_id"],
["asc"]
);
}
}