Merged in feature/VBV-739-berufsbildner-und-ausbildungsverantwortliche-vorschau-teilnehmer (pull request #388)

VBV-739: Berufsbildner und Ausbildungsverantwortlicher: Vorschau Teilnehmer

* Improve “preview link” handling

* Deploy preview to ARM64 caprover

* Revert "Deploy preview to ARM64 caprover"

This reverts commit 822312137e043708d543bb825184ea8a39bd4d3b.

* Merged develop into feature/VBV-739-berufsbildner-und-ausbildungsverantwortliche-vorschau-teilnehmer


Approved-by: Dario Aebersold
Approved-by: Daniel Egger
This commit is contained in:
Elia Bieri 2024-09-27 16:17:57 +00:00 committed by Daniel Egger
parent a5a1bd124d
commit d9a89dd0be
3 changed files with 18 additions and 19 deletions

View File

@ -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>

View File

@ -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
)

View File

@ -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):