From 4a96ede0774608c83e0e70c4739c9121bc83e1d0 Mon Sep 17 00:00:00 2001 From: Henri Remonen Date: Tue, 10 Oct 2023 11:57:52 +0300 Subject: [PATCH] feat: Add Sisu link for admins to the CUR page. refs: #1073 --- public/locales/en/translation.json | 4 +++- public/locales/fi/translation.json | 4 +++- public/locales/sv/translation.json | 4 +++- src/client/pages/FeedbackTarget/FeedbackTargetInformation.js | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index a5622bb04..e2d06a0bf 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -90,7 +90,8 @@ "adminGraylog": "-", "courseUnitPage": "-", "courseUnitPageStudent": "-", - "courseRealisationPage": "-" + "courseRealisationPage": "-", + "courseSisuPage": "https://sisu.helsinki.fi/teacher/role/staff/teaching/course-unit-realisations/view/{{sisuId}}/information/basicinfo" }, "userFeedbacks": { "mainHeading": "My feedback", @@ -465,6 +466,7 @@ "feedbackPeriod": "Feedback open", "coursePage": "Course page", "courseSummary": "Summary of course's instances", + "courseSisuPage": "Course Sisu page", "teachers": "Teachers", "responsibleTeachers": "Responsible teachers", "administrativePersons": "Administrative persons", diff --git a/public/locales/fi/translation.json b/public/locales/fi/translation.json index 663eb5254..d3f7c2808 100644 --- a/public/locales/fi/translation.json +++ b/public/locales/fi/translation.json @@ -90,7 +90,8 @@ "adminGraylog": "-", "courseUnitPage": "-", "courseUnitPageStudent": "-", - "courseRealisationPage": "-" + "courseRealisationPage": "-", + "courseSisuPage": "https://sisu.helsinki.fi/teacher/role/staff/teaching/course-unit-realisations/view/{{sisuId}}/information/basicinfo" }, "userFeedbacks": { "mainHeading": "Kurssipalautteeni", @@ -464,6 +465,7 @@ "feedbackPeriod": "Palaute käynnissä", "coursePage": "Kurssisivu", "courseSummary": "Kurssin toteutusten yhteenveto", + "courseSisuPage": "Kurssin Sisu sivu", "teachers": "Opettajat", "responsibleTeachers": "Vastuuopettajat", "administrativePersons": "Hallintohenkilöt", diff --git a/public/locales/sv/translation.json b/public/locales/sv/translation.json index 18a79f98d..bb6315785 100644 --- a/public/locales/sv/translation.json +++ b/public/locales/sv/translation.json @@ -88,7 +88,8 @@ "markdownHelp": "https://commonmark.org/help/", "adminGraylog": "", "courseUnitPage": "", - "courseRealisationPage": "" + "courseRealisationPage": "", + "courseSisuPage": "https://sisu.helsinki.fi/teacher/role/staff/teaching/course-unit-realisations/view/{{sisuId}}/information/basicinfo" }, "userFeedbacks": { "mainHeading": "Mina responser", @@ -463,6 +464,7 @@ "editFeedbackTab": "Redigera responsen", "coursePage": "Kurssida", "courseSummary": "Sammandrag av kursens genomföranden", + "courseSisuPage": "Course Sisu page", "teachers": "Lärare", "responsibleTeachers": "Ansvariga lärare", "administrativePersons": "Administrativ person", diff --git a/src/client/pages/FeedbackTarget/FeedbackTargetInformation.js b/src/client/pages/FeedbackTarget/FeedbackTargetInformation.js index 72a81d159..2f28528ed 100644 --- a/src/client/pages/FeedbackTarget/FeedbackTargetInformation.js +++ b/src/client/pages/FeedbackTarget/FeedbackTargetInformation.js @@ -14,7 +14,7 @@ import { TagChip } from '../../components/common/TagChip' import TeacherList from './TeacherList/TeacherList' const FeedbackTargetInformation = () => { - const { feedbackTarget, organisation, isStudent, isTeacher } = useFeedbackTargetContext() + const { feedbackTarget, organisation, isStudent, isTeacher, isAdmin } = useFeedbackTargetContext() const { i18n, t } = useTranslation() const { enqueueSnackbar } = useSnackbar() @@ -44,6 +44,7 @@ const FeedbackTargetInformation = () => { const courseRealisationName = getLanguageValue(courseRealisation?.name, i18n.language) const visibleCourseCode = courseRealisationName.indexOf(courseUnit?.courseCode) > -1 ? '' : courseUnit?.courseCode const coursePageUrl = `${t('links:courseRealisationPage')}${courseRealisation.id}` + const sisuPageUrl = `${t('links:courseSisuPage', { sisuId: courseRealisation.id })}` const courseSummaryPath = getCourseUnitSummaryPath(feedbackTarget) const showTags = feedbackTarget?.tags?.length > 0 const courseUnitName = getLanguageValue(courseUnit?.name, i18n.language) @@ -163,6 +164,8 @@ const FeedbackTargetInformation = () => { {isTeacher && } + + {isAdmin && }