From e6fbf0d276a0a7f4bffdd852566a517f61fca9e5 Mon Sep 17 00:00:00 2001 From: Daniel Egger Date: Fri, 15 Sep 2023 10:59:44 +0200 Subject: [PATCH] Fix link in to KompetenzNavi in main navigation bar --- .../components/header/MainNavigationBar.vue | 6 ++++- client/src/stores/competence.ts | 23 +++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/client/src/components/header/MainNavigationBar.vue b/client/src/components/header/MainNavigationBar.vue index bbaa5c82..13c6d8ac 100644 --- a/client/src/components/header/MainNavigationBar.vue +++ b/client/src/components/header/MainNavigationBar.vue @@ -126,7 +126,11 @@ onMounted(() => { diff --git a/client/src/stores/competence.ts b/client/src/stores/competence.ts index e20c128d..bd83b35a 100644 --- a/client/src/stores/competence.ts +++ b/client/src/stores/competence.ts @@ -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"] + ); } }