Merged develop into feature/VBV-717-teilnehmer-profil-in-dashboard-fullscreen
This commit is contained in:
commit
975b9966ae
|
|
@ -65,20 +65,6 @@ const actionButtonProps = computed<{ href: string; text: string; cyKey: string }
|
|||
cyKey: "lm-dashboard-link",
|
||||
};
|
||||
}
|
||||
if (props.courseConfig?.role_key === "Berufsbildner") {
|
||||
return {
|
||||
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
||||
text: "a.Vorschau Teilnehmer",
|
||||
cyKey: "progress-dashboard-continue-course-link",
|
||||
};
|
||||
}
|
||||
if (props.courseConfig?.role_key === "Ausbildungsverantwortlicher") {
|
||||
return {
|
||||
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
||||
text: "a.Vorschau Teilnehmer",
|
||||
cyKey: "tr-dashboard-link",
|
||||
};
|
||||
}
|
||||
return {
|
||||
href: getLearningPathUrl(props.courseConfig?.course_slug),
|
||||
text: "Weiter lernen",
|
||||
|
|
@ -88,7 +74,11 @@ const actionButtonProps = computed<{ href: string; text: string; cyKey: string }
|
|||
);
|
||||
|
||||
function hasActionButton(): boolean {
|
||||
return props.courseConfig?.role_key !== "MentorUK";
|
||||
return (
|
||||
props.courseConfig?.role_key !== "MentorUK" &&
|
||||
props.courseConfig?.role_key !== "Ausbildungsverantwortlicher" &&
|
||||
props.courseConfig?.role_key !== "Berufsbildner"
|
||||
);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
import CourseSessionsMenu from "@/components/header/CourseSessionsMenu.vue";
|
||||
import type { User } from "@/stores/user";
|
||||
import type { CourseSession } from "@/types";
|
||||
import { useRouteLookups } from "@/utils/route";
|
||||
import { computed } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const props = defineProps<{
|
||||
|
|
@ -13,6 +15,9 @@ const props = defineProps<{
|
|||
const emit = defineEmits(["selectCourseSession", "logout", "close"]);
|
||||
|
||||
const router = useRouter();
|
||||
const { inCourse } = useRouteLookups();
|
||||
|
||||
const showCourseSessionMenu = computed(() => inCourse() && props.courseSessions.length);
|
||||
|
||||
async function navigate(routeName: string) {
|
||||
await router.push({ name: routeName });
|
||||
|
|
@ -41,7 +46,7 @@ async function navigate(routeName: string) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="props.courseSessions.length" class="border-b py-4">
|
||||
<div v-if="showCourseSessionMenu" class="border-b py-4">
|
||||
<CourseSessionsMenu
|
||||
:items="courseSessions"
|
||||
:selected="selectedCourseSession"
|
||||
|
|
|
|||
|
|
@ -90,12 +90,17 @@ const hasMediaLibraryMenu = computed(() =>
|
|||
)
|
||||
);
|
||||
|
||||
const hasCockpitMenu = computed(() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("expert-cockpit"))
|
||||
const hasCockpitMenu = computed(
|
||||
() =>
|
||||
Boolean(
|
||||
courseSessionsStore.currentCourseSession?.actions.includes("expert-cockpit")
|
||||
) && inCourse()
|
||||
);
|
||||
|
||||
const hasPreviewMenu = computed(() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("preview"))
|
||||
const hasPreviewMenu = computed(
|
||||
() =>
|
||||
Boolean(courseSessionsStore.currentCourseSession?.actions.includes("preview")) &&
|
||||
inCourse()
|
||||
);
|
||||
|
||||
const hasAppointmentsMenu = computed(() =>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ let logoutRedirectUrl = import.meta.env.VITE_LOGOUT_REDIRECT || "/";
|
|||
if (import.meta.env.VITE_OAUTH_API_BASE_URL) {
|
||||
logoutRedirectUrl = `${
|
||||
import.meta.env.VITE_OAUTH_API_BASE_URL
|
||||
}logout/?post_logout_redirect_uri=${window.location.origin}`;
|
||||
}logout/?post_logout_redirect_uri=${window.location.origin}&client_id=iterativ`;
|
||||
}
|
||||
|
||||
const AVAILABLE_LANGUAGES = ["de", "fr", "it"];
|
||||
|
|
|
|||
|
|
@ -259,8 +259,15 @@ def collect_course_sessions_by_course(
|
|||
|
||||
|
||||
def has_preview(role_key: RoleKeyType) -> bool:
|
||||
print("has_preview", role_key)
|
||||
return (
|
||||
role_key in [RoleKeyType.MENTOR_VV, RoleKeyType.MENTOR_UK]
|
||||
role_key
|
||||
in [
|
||||
RoleKeyType.MENTOR_VV,
|
||||
RoleKeyType.MENTOR_UK,
|
||||
RoleKeyType.BERUFSBILDNER,
|
||||
RoleKeyType.TRAINING_RESPONSIBLE,
|
||||
]
|
||||
and not role_key == RoleKeyType.MEMBER
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,11 @@ def has_course_session_preview(user, course_session_id: int):
|
|||
if is_course_session_member(user, course_session_id):
|
||||
return False
|
||||
|
||||
return is_course_session_learning_mentor(
|
||||
user, course_session_id
|
||||
) or is_course_session_expert(user, course_session_id)
|
||||
return (
|
||||
is_course_session_learning_mentor(user, course_session_id)
|
||||
or is_course_session_berufsbildner(user, course_session_id)
|
||||
or is_course_session_expert(user, course_session_id)
|
||||
)
|
||||
|
||||
|
||||
def has_media_library(user, course_session_id: int):
|
||||
|
|
|
|||
|
|
@ -40,12 +40,12 @@ def sync_sso_roles_from_admin(user: User, request):
|
|||
for csu in CourseSessionUser.objects.filter(user=user)
|
||||
}
|
||||
|
||||
course_roles += {
|
||||
course_roles.update(
|
||||
(relation.participant.course_session.course.slug, "LEARNING_MENTOR")
|
||||
for relation in AgentParticipantRelation.objects.filter(
|
||||
agent=user, role=AgentParticipantRoleType.LEARNING_MENTOR.value
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
for csg in CourseSessionGroup.objects.filter(supervisor=user):
|
||||
for course_session in csg.course_session.all():
|
||||
|
|
|
|||
Loading…
Reference in New Issue