From cdbe12c7268ee923cf0ed8c5609584a0f5193dc0 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Sun, 22 Mar 2020 17:55:33 +0100 Subject: [PATCH 01/11] feat(applications-list): add warning regarding features of study --- messages/uniworx/de-de-formal.msg | 2 +- src/Handler/Course/Application/List.hs | 2 ++ templates/course/applications-list.hamlet | 1 + templates/i18n/applications-list-info/de-de-formal.hamlet | 7 +++++++ templates/i18n/applications-list-info/en-eu.hamlet | 7 +++++++ 5 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 templates/i18n/applications-list-info/de-de-formal.hamlet create mode 100644 templates/i18n/applications-list-info/en-eu.hamlet diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index 854adf135..efe4e061e 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -2423,4 +2423,4 @@ AllocationUserNewMatches: Neue Zuteilungen AllocationUsersCount: Teilnehmer AllocationCoursesCount: Kurse -CourseOption tid@TermId ssh@SchoolId coursen@CourseName: #{tid} - #{ssh} - #{coursen} \ No newline at end of file +CourseOption tid@TermId ssh@SchoolId coursen@CourseName: #{tid} - #{ssh} - #{coursen} diff --git a/src/Handler/Course/Application/List.hs b/src/Handler/Course/Application/List.hs index 3c6835c06..dbdc50c61 100644 --- a/src/Handler/Course/Application/List.hs +++ b/src/Handler/Course/Application/List.hs @@ -680,6 +680,8 @@ postCApplicationsR tid ssh csh = do mapM_ addMessage' <=< execWriterT $ registerUsers cid applicants redirect $ CourseR tid ssh csh CUsersR + let + studyFeaturesWarning = $(i18nWidgetFile "applications-list-info") siteLayoutMsg title $ do setTitleI title diff --git a/templates/course/applications-list.hamlet b/templates/course/applications-list.hamlet index fde01d6e1..cc6a07744 100644 --- a/templates/course/applications-list.hamlet +++ b/templates/course/applications-list.hamlet @@ -25,4 +25,5 @@ $if mayAccept

_{MsgMenuCourseApplications} + ^{notification NotificationBroad =<< messageWidget Warning studyFeaturesWarning} ^{table} diff --git a/templates/i18n/applications-list-info/de-de-formal.hamlet b/templates/i18n/applications-list-info/de-de-formal.hamlet new file mode 100644 index 000000000..d1aa9b4a8 --- /dev/null +++ b/templates/i18n/applications-list-info/de-de-formal.hamlet @@ -0,0 +1,7 @@ +$newline never +

+ Beachten Sie bitte, dass Uni2work die Studiendaten von der zentralen Verwaltung bezieht und deswegen die Daten, insbesondere das Fachsemester und das Studienfach, oft nicht dem aktuellen Stand entsprechen oder gar fehlen können (Studiengangswechsel, Fachsemestereinstufungen, ...). +

+ Widersprechen Sie daher bitte nicht aufgrund der Studiendaten, oder weil Studiendaten fehlen, der Zuteilung eines Studierenden zu Ihrem Kurs (Veto bzw. 5.0). +

+ Der Studienfortschritt der Bewerber fließt über die Berechnung der Dringlichkeit, mit der ein Studierender einen Platz benötigt, in die Vergabe mit ein. diff --git a/templates/i18n/applications-list-info/en-eu.hamlet b/templates/i18n/applications-list-info/en-eu.hamlet new file mode 100644 index 000000000..235cb6345 --- /dev/null +++ b/templates/i18n/applications-list-info/en-eu.hamlet @@ -0,0 +1,7 @@ +$newline never +

+ Please note that Uni2work obtains the features of study from the central administration and therefore this data (especially semester and subject) often is out of date or may even be missing (change of field of study, semester classification, ...). +

+ Therefore, please do not reject applicants because of their features of study or because of missing features of study (veto or 5.0). +

+ The study progress of the applicants influences the allocation by means of the urgency with which a student needs a place. From a4d4c224e9badc4028e0ce0454d62309cfd35a07 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Sun, 22 Mar 2020 18:35:47 +0100 Subject: [PATCH 02/11] chore(release): 14.2.0 --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- package.yaml | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f41c8867..97ebb0040 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,32 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [14.2.0](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.1.1...v14.2.0) (2020-03-22) + + +### Bug Fixes + +* **dbtable:** improve sorting for haskell+sql ([fd8255d](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/fd8255d)) +* **exams:** provide bonus information in return of examBonusGrade ([731231d](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/731231d)) +* configure sessions to be strictly same-site ([a7e64bc](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/a7e64bc)) +* **i18n:** add missing translations ([773c6c5](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/773c6c5)) +* fix .dual-heated.degenerate ([6058692](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/6058692)) + + +### Features + +* **allocations:** compute & accept allocations ([20ef95c](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/20ef95c)) +* **allocations:** display new allocations in user table ([bb20062](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/bb20062)) +* **allocations:** improve accept ui and logging ([3422fd7](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/3422fd7)) +* **allocations:** improve acceptance display ([cf03277](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/cf03277)) +* **allocations:** improve display ([26f8f39](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/26f8f39)) +* **applications-list:** add warning regarding features of study ([cdbe12c](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/cdbe12c)) +* **exams:** convenience for automatic grade calculation ([ec6a8ae](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/ec6a8ae)) +* **serversessions:** move session storage to dedicated memcached ([9960059](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/9960059)), closes [#390](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/issues/390) +* more date & time formats ([936c366](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/936c366)) + + + ### [14.1.1](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.1.0...v14.1.1) (2020-03-06) diff --git a/package-lock.json b/package-lock.json index 65e052675..163b4f11b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.1.1", + "version": "14.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0a395567a..803a28b9c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.1.1", + "version": "14.2.0", "description": "", "keywords": [], "author": "", diff --git a/package.yaml b/package.yaml index 713a25260..22d4907ab 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: uniworx -version: 14.1.1 +version: 14.2.0 dependencies: - base From 6ad8f2ee290d5b9166b07ba3be329483a769e097 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 14:07:37 +0200 Subject: [PATCH 03/11] feat(course-events): add optional note to course events --- messages/uniworx/de-de-formal.msg | 1 + messages/uniworx/en-eu.msg | 1 + models/courses.model | 1 + src/Handler/Course/Events/Edit.hs | 1 + src/Handler/Course/Events/Form.hs | 4 ++++ src/Handler/Course/Events/New.hs | 1 + 6 files changed, 9 insertions(+) diff --git a/messages/uniworx/de-de-formal.msg b/messages/uniworx/de-de-formal.msg index efe4e061e..d603bb15a 100644 --- a/messages/uniworx/de-de-formal.msg +++ b/messages/uniworx/de-de-formal.msg @@ -2218,6 +2218,7 @@ CourseEventType: Art CourseEventTypePlaceholder: Vorlesung, Zentralübung, ... CourseEventTime: Zeit CourseEventRoom: Regulärer Raum +CourseEventNote: Notiz CourseEventActions: Aktionen CourseEventsActionEdit: Bearbeiten CourseEventsActionDelete: Löschen diff --git a/messages/uniworx/en-eu.msg b/messages/uniworx/en-eu.msg index b0b72dc39..9862452f0 100644 --- a/messages/uniworx/en-eu.msg +++ b/messages/uniworx/en-eu.msg @@ -2218,6 +2218,7 @@ CourseEventType: Type CourseEventTypePlaceholder: Lecture, Exercise discussion, ... CourseEventTime: Time CourseEventRoom: Regular room +CourseEventNote: Note CourseEventActions: Actions CourseEventsActionEdit: Edit CourseEventsActionDelete: Delete diff --git a/models/courses.model b/models/courses.model index bea256759..aae38df9a 100644 --- a/models/courses.model +++ b/models/courses.model @@ -30,6 +30,7 @@ CourseEvent course CourseId room Text time Occurrences + note Text Maybe lastChanged UTCTime default=now() CourseAppInstructionFile diff --git a/src/Handler/Course/Events/Edit.hs b/src/Handler/Course/Events/Edit.hs index e762b3ae0..5ac391d5d 100644 --- a/src/Handler/Course/Events/Edit.hs +++ b/src/Handler/Course/Events/Edit.hs @@ -24,6 +24,7 @@ postCEvEditR tid ssh csh cID = do , courseEventType = cefType , courseEventRoom = cefRoom , courseEventTime = cefTime + , courseEventNote = cefNote , courseEventLastChanged = now } addMessageI Success MsgCourseEventEdited diff --git a/src/Handler/Course/Events/Form.hs b/src/Handler/Course/Events/Form.hs index bf9d99ca8..b6a9fbd76 100644 --- a/src/Handler/Course/Events/Form.hs +++ b/src/Handler/Course/Events/Form.hs @@ -15,6 +15,7 @@ data CourseEventForm = CourseEventForm { cefType :: CI Text , cefRoom :: Text , cefTime :: Occurrences + , cefNote :: Maybe Text } courseEventForm :: Maybe CourseEventForm -> Form CourseEventForm @@ -34,15 +35,18 @@ courseEventForm template = identifyForm FIDCourseEvent . renderWForm FormStandar cefType' <- wreq (textField & cfStrip & cfCI & addDatalist courseEventTypes) (fslI MsgCourseEventType & addPlaceholder (mr MsgCourseEventTypePlaceholder)) (cefType <$> template) cefRoom' <- wreq (textField & cfStrip & addDatalist courseEventRooms) (fslI MsgCourseEventRoom) (cefRoom <$> template) cefTime' <- aFormToWForm $ occurrencesAForm ("time" :: Text) (cefTime <$> template) + cefNote' <- wopt textField (fslI MsgCourseEventNote) (cefNote <$> template) return $ CourseEventForm <$> cefType' <*> cefRoom' <*> cefTime' + <*> cefNote' courseEventToForm :: CourseEvent -> CourseEventForm courseEventToForm CourseEvent{..} = CourseEventForm { cefType = courseEventType , cefRoom = courseEventRoom , cefTime = courseEventTime + , cefNote = courseEventNote } diff --git a/src/Handler/Course/Events/New.hs b/src/Handler/Course/Events/New.hs index 248856cad..b01f17af5 100644 --- a/src/Handler/Course/Events/New.hs +++ b/src/Handler/Course/Events/New.hs @@ -22,6 +22,7 @@ postCEventsNewR tid ssh csh = do , courseEventType = cefType , courseEventRoom = cefRoom , courseEventTime = cefTime + , courseEventNote = cefNote , courseEventLastChanged = now } encrypt eId :: DB CryptoUUIDCourseEvent From b2c4125ca3f76e65aa4eb4390e6d1e7013d1eb0d Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 14:11:25 +0200 Subject: [PATCH 04/11] feat(course-events): show notes in course events table --- templates/course.hamlet | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/course.hamlet b/templates/course.hamlet index 151a3291a..4d99c9288 100644 --- a/templates/course.hamlet +++ b/templates/course.hamlet @@ -213,12 +213,14 @@ $# $if NTop (Just 0) < NTop (courseCapacity course) _{MsgCourseEventTime} _{MsgCourseEventRoom} + + _{MsgCourseEventNote} $if mayCreateEvents _{MsgCourseEventActions} \ #{iconInvisible} - $forall (cID, CourseEvent{courseEventType, courseEventTime, courseEventRoom}) <- events + $forall (cID, CourseEvent{courseEventType, courseEventTime, courseEventRoom, courseEventNote}) <- events toPathPiece cID}>

@@ -229,6 +231,9 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
#{courseEventRoom} + +
+ #{courseEventNote} $if mayCreateEvents
    From c8904d10b679e77bd7d4adaf80cd37bb3288275f Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 14:22:42 +0200 Subject: [PATCH 05/11] feat(course-events): course event note text -> html --- models/courses.model | 2 +- src/Handler/Course/Events/Form.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/models/courses.model b/models/courses.model index aae38df9a..12a945535 100644 --- a/models/courses.model +++ b/models/courses.model @@ -30,7 +30,7 @@ CourseEvent course CourseId room Text time Occurrences - note Text Maybe + note Html Maybe lastChanged UTCTime default=now() CourseAppInstructionFile diff --git a/src/Handler/Course/Events/Form.hs b/src/Handler/Course/Events/Form.hs index b6a9fbd76..3cb291f89 100644 --- a/src/Handler/Course/Events/Form.hs +++ b/src/Handler/Course/Events/Form.hs @@ -15,7 +15,7 @@ data CourseEventForm = CourseEventForm { cefType :: CI Text , cefRoom :: Text , cefTime :: Occurrences - , cefNote :: Maybe Text + , cefNote :: Maybe Html } courseEventForm :: Maybe CourseEventForm -> Form CourseEventForm @@ -35,7 +35,7 @@ courseEventForm template = identifyForm FIDCourseEvent . renderWForm FormStandar cefType' <- wreq (textField & cfStrip & cfCI & addDatalist courseEventTypes) (fslI MsgCourseEventType & addPlaceholder (mr MsgCourseEventTypePlaceholder)) (cefType <$> template) cefRoom' <- wreq (textField & cfStrip & addDatalist courseEventRooms) (fslI MsgCourseEventRoom) (cefRoom <$> template) cefTime' <- aFormToWForm $ occurrencesAForm ("time" :: Text) (cefTime <$> template) - cefNote' <- wopt textField (fslI MsgCourseEventNote) (cefNote <$> template) + cefNote' <- wopt htmlField (fslI MsgCourseEventNote) (cefNote <$> template) return $ CourseEventForm <$> cefType' From 1138f9e32712eb879f76792a68a870e7a48c4b90 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 14:56:31 +0200 Subject: [PATCH 06/11] feat(course-events): add HideColumns for course events --- templates/course.hamlet | 92 +++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/templates/course.hamlet b/templates/course.hamlet index 4d99c9288..a41c11ded 100644 --- a/templates/course.hamlet +++ b/templates/course.hamlet @@ -203,53 +203,55 @@ $# $if NTop (Just 0) < NTop (courseCapacity course) $if null events \ #{iconInvisible}
    -
    - - - - - $forall (cID, CourseEvent{courseEventType, courseEventTime, courseEventRoom, courseEventNote}) <- events - toPathPiece cID}> -
    - _{MsgCourseEventType} - - _{MsgCourseEventTime} - - _{MsgCourseEventRoom} - - _{MsgCourseEventNote} - $if mayCreateEvents - - _{MsgCourseEventActions} - \ #{iconInvisible} -
    -
    - #{courseEventType} -
    -
    - ^{occurrencesWidget courseEventTime} -
    -
    - #{courseEventRoom} -
    -
    - #{courseEventNote} +
    +
    + + + + + $forall (cID, CourseEvent{courseEventType, courseEventTime, courseEventRoom, courseEventNote}) <- events + toPathPiece cID}> - - + +
    + _{MsgCourseEventType} + + _{MsgCourseEventTime} + + _{MsgCourseEventRoom} + + _{MsgCourseEventNote} $if mayCreateEvents + + _{MsgCourseEventActions} + \ #{iconInvisible} +
    -
      -
    • - ^{modal (i18n MsgCourseEventsActionEdit) (Left (SomeRoute (CEventR tid ssh csh cID CEvEditR)))} -
    • - ^{modal (i18n MsgCourseEventsActionDelete) (Left (SomeRoute (CEventR tid ssh csh cID CEvDeleteR)))} - $if mayCreateEvents -
    - - - -
    - ^{modal (i18n MsgCourseEventsActionCreate) (Left (SomeRoute (CourseR tid ssh csh CEventsNewR)))} +
    + #{courseEventType} +
    +
    + ^{occurrencesWidget courseEventTime} +
    +
    + #{courseEventRoom} +
    +
    + #{courseEventNote} + $if mayCreateEvents +
    +
      +
    • + ^{modal (i18n MsgCourseEventsActionEdit) (Left (SomeRoute (CEventR tid ssh csh cID CEvEditR)))} +
    • + ^{modal (i18n MsgCourseEventsActionDelete) (Left (SomeRoute (CEventR tid ssh csh cID CEvDeleteR)))} + $if mayCreateEvents +
    + + + + +
    + ^{modal (i18n MsgCourseEventsActionCreate) (Left (SomeRoute (CourseR tid ssh csh CEventsNewR)))} $if hasTutorials From 1ac7f4e8811d9272a10aa28420b4e3fb0c976009 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 16:35:32 +0200 Subject: [PATCH 07/11] feat(course-events): hide note column if there are no notes to display --- frontend/src/app.sass | 3 +++ src/Handler/Course/Show.hs | 1 + templates/course.hamlet | 6 +++--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/app.sass b/frontend/src/app.sass index c1f05706c..265d516b2 100644 --- a/frontend/src/app.sass +++ b/frontend/src/app.sass @@ -831,6 +831,9 @@ th, td font-style: normal color: var(--color-font) +.course-event-note--hidden + display: none + .bound_explanation color: var(--color-fontsec) font-style: italic diff --git a/src/Handler/Course/Show.hs b/src/Handler/Course/Show.hs index 1c8a6cca4..e419b3cce 100644 --- a/src/Handler/Course/Show.hs +++ b/src/Handler/Course/Show.hs @@ -198,6 +198,7 @@ getCShowR tid ssh csh = do , length fs <= 3 , all (notElem pathSeparator . view _2) fs ] + hiddenEventNotes = all (\(_,CourseEvent{..}) -> is _Nothing courseEventNote) events mayCreateNews <- hasWriteAccessTo $ CourseR tid ssh csh CNewsNewR mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR diff --git a/templates/course.hamlet b/templates/course.hamlet index a41c11ded..6aee55dc5 100644 --- a/templates/course.hamlet +++ b/templates/course.hamlet @@ -214,7 +214,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course) _{MsgCourseEventTime}
    _{MsgCourseEventRoom} - + _{MsgCourseEventNote} $if mayCreateEvents @@ -232,7 +232,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
    #{courseEventRoom} -
    +
    #{courseEventNote} $if mayCreateEvents @@ -248,7 +248,7 @@ $# $if NTop (Just 0) < NTop (courseCapacity course)
    - +
    ^{modal (i18n MsgCourseEventsActionCreate) (Left (SomeRoute (CourseR tid ssh csh CEventsNewR)))} From fbc36806b13a7d674be3aa64a4c6491e8f051587 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 17:34:26 +0200 Subject: [PATCH 08/11] fix(exam-form): allow finished without start --- src/Handler/Exam/Form.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index b6df32911..f8953f843 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -339,7 +339,7 @@ validateExam = do guardValidation MsgExamStartMustBeAfterPublishOccurrenceAssignments . fromMaybe True $ (>=) <$> efStart <*> efPublishOccurrenceAssignments guardValidation MsgExamEndMustBeAfterStart $ NTop efEnd >= NTop efStart guardValidation MsgExamFinishedMustBeAfterEnd . fromMaybe True $ (>=) <$> efFinished <*> efEnd - guardValidation MsgExamFinishedMustBeAfterStart $ NTop efFinished >= NTop efStart + guardValidation MsgExamFinishedMustBeAfterStart . fromMaybe True $ (>=) <$> efFinished <*> efStart forM_ efOccurrences $ \ExamOccurrenceForm{..} -> do guardValidation (MsgExamOccurrenceEndMustBeAfterStart eofName) $ NTop eofEnd >= NTop (Just eofStart) From 6283f01b9f0094f73a3107c9178e36a58428cedd Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Tue, 31 Mar 2020 18:18:51 +0200 Subject: [PATCH 09/11] chore(release): 14.3.0 --- CHANGELOG.md | 18 ++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- package.yaml | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97ebb0040..48e618a1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [14.3.0](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.2.0...v14.3.0) (2020-03-31) + + +### Bug Fixes + +* **exam-form:** allow finished without start ([fbc3680](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/fbc3680)) + + +### Features + +* **course-events:** add HideColumns for course events ([1138f9e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/1138f9e)) +* **course-events:** add optional note to course events ([6ad8f2e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/6ad8f2e)) +* **course-events:** course event note text -> html ([c8904d1](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/c8904d1)) +* **course-events:** hide note column if there are no notes to display ([1ac7f4e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/1ac7f4e)) +* **course-events:** show notes in course events table ([b2c4125](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/b2c4125)) + + + ## [14.2.0](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.1.1...v14.2.0) (2020-03-22) diff --git a/package-lock.json b/package-lock.json index 163b4f11b..74cef7d3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.2.0", + "version": "14.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 803a28b9c..934602efd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.2.0", + "version": "14.3.0", "description": "", "keywords": [], "author": "", diff --git a/package.yaml b/package.yaml index 22d4907ab..5c67c5080 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: uniworx -version: 14.2.0 +version: 14.3.0 dependencies: - base From d8040e7aa864e2078962ed2c938ae91408dd9e50 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 7 Apr 2020 14:31:55 +0200 Subject: [PATCH 10/11] feat: persist bearer tokens in session --- src/Foundation.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 66568e795..bc289fd3e 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -100,6 +100,8 @@ import UnliftIO.Pool import qualified Web.ServerSession.Core as ServerSession import qualified Web.ServerSession.Frontend.Yesod.Jwt as JwtSession +import Jose.Jwt (Jwt(..)) + -- | Convenient Type Synonyms: type DB = YesodDB UniWorX type Form x = Html -> MForm (HandlerFor UniWorX) (FormResult x, Widget) @@ -1511,7 +1513,7 @@ instance Yesod UniWorX where -- b) Validates that incoming write requests include that token in either a header or POST parameter. -- To add it, chain it together with the defaultMiddleware: yesodMiddleware = defaultYesodMiddleware . defaultCsrfMiddleware -- For details, see the CSRF documentation in the Yesod.Core.Handler module of the yesod-core package. - yesodMiddleware = observeYesodCacheSizeMiddleware . languagesMiddleware appLanguages . headerMessagesMiddleware . defaultYesodMiddleware . normalizeRouteMiddleware . defaultCsrfMiddleware . updateFavouritesMiddleware + yesodMiddleware = observeYesodCacheSizeMiddleware . languagesMiddleware appLanguages . headerMessagesMiddleware . defaultYesodMiddleware . normalizeRouteMiddleware . defaultCsrfMiddleware . updateFavouritesMiddleware . storeBearerMiddleware where updateFavouritesMiddleware :: Handler a -> Handler a updateFavouritesMiddleware handler = (*> handler) . runMaybeT $ do @@ -1545,6 +1547,13 @@ instance Yesod UniWorX where addCustomHeader HeaderAlerts . decodeUtf8 . urlEncode True . toStrict . JSON.encode observeYesodCacheSizeMiddleware :: Handler a -> Handler a observeYesodCacheSizeMiddleware handler = handler `finally` observeYesodCacheSize + storeBearerMiddleware :: Handler a -> Handler a + storeBearerMiddleware handler = do + askBearer >>= \case + Just (Jwt bs) -> setSessionBS (toPathPiece SessionBearer) bs + Nothing -> return () + + handler -- Since we implement `errorHandler` ourselves we don't need `defaultMessageWidget` defaultMessageWidget _title _body = error "defaultMessageWidget: undefined" From 81b5e0fdd20ec703888a53585cb846766afcaaec Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 7 Apr 2020 14:42:20 +0200 Subject: [PATCH 11/11] chore(release): 14.4.0 --- CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++ package-lock.json | 2 +- package.json | 2 +- package.yaml | 2 +- 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48e618a1e..28fc94b75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,39 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [14.4.0](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.1.1...v14.4.0) (2020-04-07) + + +### Bug Fixes + +* **dbtable:** improve sorting for haskell+sql ([fd8255d](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/fd8255d)) +* **exam-form:** allow finished without start ([fbc3680](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/fbc3680)) +* **exams:** provide bonus information in return of examBonusGrade ([731231d](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/731231d)) +* configure sessions to be strictly same-site ([a7e64bc](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/a7e64bc)) +* **i18n:** add missing translations ([773c6c5](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/773c6c5)) +* fix .dual-heated.degenerate ([6058692](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/6058692)) + + +### Features + +* persist bearer tokens in session ([d8040e7](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/d8040e7)) +* **allocations:** compute & accept allocations ([20ef95c](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/20ef95c)) +* **allocations:** display new allocations in user table ([bb20062](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/bb20062)) +* **allocations:** improve accept ui and logging ([3422fd7](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/3422fd7)) +* **allocations:** improve acceptance display ([cf03277](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/cf03277)) +* **allocations:** improve display ([26f8f39](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/26f8f39)) +* **applications-list:** add warning regarding features of study ([cdbe12c](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/cdbe12c)) +* **course-events:** add HideColumns for course events ([1138f9e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/1138f9e)) +* **course-events:** add optional note to course events ([6ad8f2e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/6ad8f2e)) +* **course-events:** course event note text -> html ([c8904d1](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/c8904d1)) +* **course-events:** hide note column if there are no notes to display ([1ac7f4e](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/1ac7f4e)) +* **course-events:** show notes in course events table ([b2c4125](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/b2c4125)) +* **exams:** convenience for automatic grade calculation ([ec6a8ae](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/ec6a8ae)) +* **serversessions:** move session storage to dedicated memcached ([9960059](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/9960059)), closes [#390](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/issues/390) +* more date & time formats ([936c366](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/commit/936c366)) + + + ## [14.3.0](https://gitlab2.rz.ifi.lmu.de/uni2work/uni2work/compare/v14.2.0...v14.3.0) (2020-03-31) diff --git a/package-lock.json b/package-lock.json index 74cef7d3a..8047ddc19 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.3.0", + "version": "14.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 934602efd..bb1079892 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "uni2work", - "version": "14.3.0", + "version": "14.4.0", "description": "", "keywords": [], "author": "", diff --git a/package.yaml b/package.yaml index 5c67c5080..9ae53b290 100644 --- a/package.yaml +++ b/package.yaml @@ -1,5 +1,5 @@ name: uniworx -version: 14.3.0 +version: 14.4.0 dependencies: - base