From 53c006206ed11175fd56e2a35dd5fe24286113d5 Mon Sep 17 00:00:00 2001 From: Veikko Suhonen Date: Mon, 28 Aug 2023 12:21:45 +0300 Subject: [PATCH] Fix teacher view not showing in navbar in some cases --- src/client/pages/CourseSummary/SummaryV2/SummaryRow.js | 3 --- src/server/routes/courseSummary/courseSummaryController.js | 4 +--- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/client/pages/CourseSummary/SummaryV2/SummaryRow.js b/src/client/pages/CourseSummary/SummaryV2/SummaryRow.js index 1de54ad1f..438b39d5a 100644 --- a/src/client/pages/CourseSummary/SummaryV2/SummaryRow.js +++ b/src/client/pages/CourseSummary/SummaryV2/SummaryRow.js @@ -2,7 +2,6 @@ import React from 'react' import { useTranslation } from 'react-i18next' import { ChevronRight } from '@mui/icons-material' import { Link as RouterLink } from 'react-router-dom' -import { grey } from '@mui/material/colors' import _ from 'lodash' import { useSummaries } from './api' import { getLanguageValue } from '../../../util/languageUtils' @@ -10,8 +9,6 @@ import SummaryResultItem from '../../../components/SummaryResultItem/SummaryResu import { LoadingProgress } from '../../../components/common/LoadingProgress' import { CourseUnitLabel, OrganisationLabel } from '../Labels' import PercentageCell from '../PercentageCell' -import { colors } from '../../../util/common' -import { generate } from '../../../util/randomColor' import useRandomColor from '../../../hooks/useRandomColor' const { Box, ButtonBase, Typography } = require('@mui/material') diff --git a/src/server/routes/courseSummary/courseSummaryController.js b/src/server/routes/courseSummary/courseSummaryController.js index a876ecccd..53c9a1a18 100644 --- a/src/server/routes/courseSummary/courseSummaryController.js +++ b/src/server/routes/courseSummary/courseSummaryController.js @@ -25,8 +25,7 @@ const getAccessibleCourseRealisationIds = async user => { WHERE user_feedback_targets.user_id = :userId AND is_teacher(user_feedback_targets.access_status) AND feedback_targets.feedback_type = 'courseRealisation' - AND course_realisations.start_date < NOW() - AND course_realisations.start_date > NOW() - interval '16 months'; + AND course_realisations.start_date > NOW() - interval '24 months'; `, { replacements: { @@ -54,7 +53,6 @@ const getAccessInfo = async (req, res) => { const { organisationAccess } = user const accesses = Object.entries(organisationAccess) const accessibleCourseRealisationIds = await getAccessibleCourseRealisationIds(user) - const hasReadOnSomeOrganisation = accesses.some(([, access]) => access.read) const isAdminOfSomeOrganisation = accesses.some(([, access]) => access.admin)