fix(rooms): honor roomHidden

This commit is contained in:
Gregor Kleen 2020-11-29 13:13:17 +01:00
parent 61c27d406c
commit ed5d871182
7 changed files with 20 additions and 5 deletions

View File

@ -97,7 +97,9 @@ getCShowR tid ssh csh = do
events' <- fmap (sortOn $ courseEventTime . entityVal . view _1) . lift . E.select . E.from $ \courseEvent -> do
E.where_ $ courseEvent E.^. CourseEventCourse E.==. E.val cid
return (courseEvent, maybe E.false (flip showCourseEventRoom courseEvent . E.val) mbAid)
let showRoom = maybe E.false (flip showCourseEventRoom courseEvent . E.val) mbAid
E.||. E.not_ (courseEvent E.^. CourseEventRoomHidden)
return (courseEvent, showRoom)
events <- mapM (\(Entity evId ev, E.Value showRoom) -> (, ev, showRoom) <$> encrypt evId) events'
hasSubmissionGroups <- lift . E.selectExists . E.from $ \(submissionGroupUser `E.InnerJoin` submissionGroup) -> do
@ -157,7 +159,9 @@ getCShowR tid ssh csh = do
dbtSQLQuery tutorial = do
E.where_ $ tutorial E.^. TutorialCourse E.==. E.val cid
return (tutorial, maybe E.false (flip showTutorialRoom tutorial . E.val) mbAid)
let showRoom = maybe E.false (flip showTutorialRoom tutorial . E.val) mbAid
E.||. E.not_ (tutorial E.^. TutorialRoomHidden)
return (tutorial, )
dbtRowKey = (E.^. TutorialId)
dbtProj = traverse $ return . over _2 E.unValue
dbtColonnade = dbColonnade $ mconcat

View File

@ -65,8 +65,10 @@ getEShowR tid ssh csh examn = do
= E.subSelectCount . E.from $ \examRegistration ->
E.where_ $ examRegistration E.^. ExamRegistrationExam E.==. E.val eId
E.&&. examRegistration E.^. ExamRegistrationOccurrence E.==. E.just (examOccurrence E.^. ExamOccurrenceId)
showRoom = maybe E.false (flip showExamOccurrenceRoom examOccurrence . E.val) mUid
E.||. E.not_ (examOccurrence E.^. ExamOccurrenceRoomHidden)
E.orderBy [E.desc registered, E.asc $ examOccurrence E.^. ExamOccurrenceStart, E.asc $ examOccurrence E.^. ExamOccurrenceRoom]
return (examOccurrence, registered, registeredCount, maybe E.false (flip showExamOccurrenceRoom examOccurrence . E.val) mUid)
return (examOccurrence, registered, registeredCount, showRoom)
registeredCount <- fromIntegral <$> count [ ExamRegistrationExam ==. eId ]

View File

@ -247,7 +247,9 @@ newsUpcomingExams uid = do
E.&&. earliestOccurrence E.<=. E.just (E.val fortnight)
-- E.&&. earliestOccurrence E.>=. E.just (E.val now)
E.where_ $ regToWithinFortnight E.||. startExamFortnight E.||. startOccurFortnight E.||. startEarliest
return (course, exam, register, occurrence, showExamOccurrenceRoom (E.val uid) occurrence)
let showRoom = showExamOccurrenceRoom (E.val uid) examOccurrence
E.||. E.not_ (examOccurrence E.^. ExamOccurrenceRoomHidden)
return (course, exam, register, occurrence, showRoom)
dbtRowKey = queryExam >>> (E.^. ExamId)
dbtProj = return
dbtColonnade = dbColonnade $ mconcat

View File

@ -34,7 +34,9 @@ getCTutorialListR tid ssh csh = do
let participants :: E.SqlExpr (E.Value Int)
participants = E.subSelectCount . E.from $ \tutorialParticipant ->
E.where_ $ tutorialParticipant E.^. TutorialParticipantTutorial E.==. tutorial E.^. TutorialId
return (tutorial, participants, maybe E.false (flip showTutorialRoom tutorial . E.val) muid)
let showRoom = maybe E.false (flip showTutorialRoom tutorial . E.val) muid
E.||. E.not_ (tutorial E.^. TutorialRoomHidden)
return (tutorial, participants, showRoom)
dbtRowKey = (E.^. TutorialId)
dbtProj = return . over (_dbrOutput . _2) E.unValue . over (_dbrOutput . _3) E.unValue
dbtColonnade = dbColonnade $ mconcat

View File

@ -40,6 +40,7 @@ classifyChangelogItem = \case
ChangelogAllocationCourseAcceptSubstitutesFixed -> ChangelogItemBugfix
ChangelogStoredMarkup -> ChangelogItemBugfix
ChangelogFixPersonalisedSheetFilesKeep -> ChangelogItemBugfix
ChangelogHonorRoomHidden -> ChangelogItemBugfix
_other -> ChangelogItemFeature
changelogItemDays :: Map ChangelogItem Day

View File

@ -0,0 +1,2 @@
$newline never
„Raum nur für Teilnehmer“ u.Ä. wird nun korrekt beachtet.

View File

@ -0,0 +1,2 @@
$newline never
“Room only for participants” and similiar settings are now honored.