User status only for selected circle
This commit is contained in:
parent
4ba12cbec8
commit
d673f2fdc9
|
|
@ -8,7 +8,6 @@ import SubmissionsOverview from "@/pages/cockpit/cockpitPage/SubmissionsOverview
|
||||||
import { useCockpitStore } from "@/stores/cockpit";
|
import { useCockpitStore } from "@/stores/cockpit";
|
||||||
import { useCompetenceStore } from "@/stores/competence";
|
import { useCompetenceStore } from "@/stores/competence";
|
||||||
import { useLearningPathStore } from "@/stores/learningPath";
|
import { useLearningPathStore } from "@/stores/learningPath";
|
||||||
import groupBy from "lodash/groupBy";
|
|
||||||
import log from "loglevel";
|
import log from "loglevel";
|
||||||
import CockpitDates from "@/pages/cockpit/cockpitPage/CockpitDates.vue";
|
import CockpitDates from "@/pages/cockpit/cockpitPage/CockpitDates.vue";
|
||||||
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
|
import ItDropdownSelect from "@/components/ui/ItDropdownSelect.vue";
|
||||||
|
|
@ -24,13 +23,13 @@ const competenceStore = useCompetenceStore();
|
||||||
const learningPathStore = useLearningPathStore();
|
const learningPathStore = useLearningPathStore();
|
||||||
const courseSession = useCurrentCourseSession();
|
const courseSession = useCurrentCourseSession();
|
||||||
|
|
||||||
function userCountStatusForCircle(userId: string, translationKey: string) {
|
function userCountStatusForCircle(userId: string) {
|
||||||
if (!cockpitStore.selectedCircle) return { FAIL: 0, SUCCESS: 0, UNKNOWN: 0 };
|
if (!cockpitStore.selectedCircle) return { FAIL: 0, SUCCESS: 0, UNKNOWN: 0 };
|
||||||
const criteria = competenceStore.flatPerformanceCriteria(userId, [
|
const criteria = competenceStore.flatPerformanceCriteria(
|
||||||
cockpitStore.selectedCircle.translation_key,
|
userId,
|
||||||
]);
|
cockpitStore.selectedCircle.id
|
||||||
const grouped = groupBy(criteria, "circle.translation_key");
|
);
|
||||||
return competenceStore.calcStatusCount(grouped[translationKey] as []);
|
return competenceStore.calcStatusCount(criteria);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -127,11 +126,9 @@ function userCountStatusForCircle(userId: string, translationKey: string) {
|
||||||
csu.user_id
|
csu.user_id
|
||||||
) as LearningPath
|
) as LearningPath
|
||||||
"
|
"
|
||||||
:profile-user-id="`${csu.user_id}`"
|
|
||||||
:show-circle-translation-keys="[
|
:show-circle-translation-keys="[
|
||||||
cockpitStore.selectedCircle.translation_key,
|
cockpitStore.selectedCircle.translation_key,
|
||||||
]"
|
]"
|
||||||
:pull-up="false"
|
|
||||||
diagram-type="singleSmall"
|
diagram-type="singleSmall"
|
||||||
class="mr-4"
|
class="mr-4"
|
||||||
></LearningPathDiagram>
|
></LearningPathDiagram>
|
||||||
|
|
@ -144,12 +141,7 @@ function userCountStatusForCircle(userId: string, translationKey: string) {
|
||||||
class="mr-2 inline-block h-8 w-8"
|
class="mr-2 inline-block h-8 w-8"
|
||||||
></it-icon-smiley-thinking>
|
></it-icon-smiley-thinking>
|
||||||
<p class="text-bold inline-block w-6">
|
<p class="text-bold inline-block w-6">
|
||||||
{{
|
{{ userCountStatusForCircle(csu.user_id).FAIL }}
|
||||||
userCountStatusForCircle(
|
|
||||||
csu.user_id,
|
|
||||||
cockpitStore.selectedCircle.translation_key
|
|
||||||
).FAIL
|
|
||||||
}}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<li class="mr-6 flex flex-row items-center">
|
<li class="mr-6 flex flex-row items-center">
|
||||||
|
|
@ -157,12 +149,7 @@ function userCountStatusForCircle(userId: string, translationKey: string) {
|
||||||
class="mr-2 inline-block h-8 w-8"
|
class="mr-2 inline-block h-8 w-8"
|
||||||
></it-icon-smiley-happy>
|
></it-icon-smiley-happy>
|
||||||
<p class="text-bold inline-block w-6">
|
<p class="text-bold inline-block w-6">
|
||||||
{{
|
{{ userCountStatusForCircle(csu.user_id).SUCCESS }}
|
||||||
userCountStatusForCircle(
|
|
||||||
csu.user_id,
|
|
||||||
cockpitStore.selectedCircle.translation_key
|
|
||||||
).SUCCESS
|
|
||||||
}}
|
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
<li class="flex flex-row items-center">
|
<li class="flex flex-row items-center">
|
||||||
|
|
@ -170,12 +157,7 @@ function userCountStatusForCircle(userId: string, translationKey: string) {
|
||||||
class="mr-2 inline-block h-8 w-8"
|
class="mr-2 inline-block h-8 w-8"
|
||||||
></it-icon-smiley-neutral>
|
></it-icon-smiley-neutral>
|
||||||
<p class="text-bold inline-block w-6">
|
<p class="text-bold inline-block w-6">
|
||||||
{{
|
{{ userCountStatusForCircle(csu.user_id).UNKNOWN }}
|
||||||
userCountStatusForCircle(
|
|
||||||
csu.user_id,
|
|
||||||
cockpitStore.selectedCircle.translation_key
|
|
||||||
).UNKNOWN
|
|
||||||
}}
|
|
||||||
</p>
|
</p>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ export const useCompetenceStore = defineStore({
|
||||||
},
|
},
|
||||||
flatPerformanceCriteria(
|
flatPerformanceCriteria(
|
||||||
userId: string | undefined = undefined,
|
userId: string | undefined = undefined,
|
||||||
circleTranslationKeys: string[] | undefined = undefined
|
circleId: number | undefined = undefined
|
||||||
) {
|
) {
|
||||||
if (!userId) {
|
if (!userId) {
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|
@ -94,10 +94,8 @@ export const useCompetenceStore = defineStore({
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (circleTranslationKeys) {
|
if (circleId) {
|
||||||
criteria = criteria.filter((c) =>
|
criteria = criteria.filter((c) => circleId === c.circle.id);
|
||||||
circleTranslationKeys.includes(c.circle.translation_key)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return criteria;
|
return criteria;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue