feat(allocations): highlight app's of users without alloc'-user
This commit is contained in:
parent
5a23d87380
commit
300c378786
@ -970,7 +970,7 @@ th, td
|
|||||||
right: 5px
|
right: 5px
|
||||||
top: 5px
|
top: 5px
|
||||||
|
|
||||||
.occurrence--not-registered, .no-bonus, .allocation-course--excluded, .allocation-course--inactive, .occurrence--ignored
|
.occurrence--not-registered, .no-bonus, .allocation-course--excluded, .allocation-course--inactive, .occurrence--ignored, .allocation--no-allocation-user
|
||||||
text-decoration: line-through
|
text-decoration: line-through
|
||||||
|
|
||||||
.result
|
.result
|
||||||
|
|||||||
@ -28,6 +28,7 @@ AcceptApplicationsModeTip: Sollen akzeptierte Bewerber:innen direkt als Teilnehm
|
|||||||
AcceptApplicationsSecondary: Gleichstände auflösen
|
AcceptApplicationsSecondary: Gleichstände auflösen
|
||||||
AcceptApplicationsSecondaryTip: Wenn es im Laufe des Verfahrens mehrere Bewerber:innen mit der selben Bewertung für den selben Platz gibt, wie soll der Gleichstand aufgelöst werden?
|
AcceptApplicationsSecondaryTip: Wenn es im Laufe des Verfahrens mehrere Bewerber:innen mit der selben Bewertung für den selben Platz gibt, wie soll der Gleichstand aufgelöst werden?
|
||||||
CsvColumnUserAppStudyFeatures: Alle relevanten Studiendaten des/der Teilnehmers/Teilnehmerin als Semikolon (;) separierte Liste
|
CsvColumnUserAppStudyFeatures: Alle relevanten Studiendaten des/der Teilnehmers/Teilnehmerin als Semikolon (;) separierte Liste
|
||||||
|
ApplicationAllocationNoAllocationUser: Dieser Student/diese Studentin nimmt nicht (mehr) an der Zentralvergabe teil. Die Bewerbung existiert zwar noch, wird jedoch bis auf Weiteres sicherlich nicht zu einer Anmeldung führen.
|
||||||
|
|
||||||
CourseApplicationId: Bewerbungsnummer
|
CourseApplicationId: Bewerbungsnummer
|
||||||
CourseApplicationRatingPoints: Bewertung
|
CourseApplicationRatingPoints: Bewertung
|
||||||
|
|||||||
@ -28,6 +28,7 @@ AcceptApplicationsModeTip: Should accepted applications be enrolled in the cours
|
|||||||
AcceptApplicationsSecondary: Breaking ties
|
AcceptApplicationsSecondary: Breaking ties
|
||||||
AcceptApplicationsSecondaryTip: If a tie occurs during the acceptance process, how should it be broken?
|
AcceptApplicationsSecondaryTip: If a tie occurs during the acceptance process, how should it be broken?
|
||||||
CsvColumnUserAppStudyFeatures: All relevant features of study for the participant, separated by semicolon (;)
|
CsvColumnUserAppStudyFeatures: All relevant features of study for the participant, separated by semicolon (;)
|
||||||
|
ApplicationAllocationNoAllocationUser: This student does not (or does no longer) participate in the allocation. The application still exists, but will certainly not lead to a registriation while it is in this state.
|
||||||
|
|
||||||
CourseApplicationId: Application number
|
CourseApplicationId: Application number
|
||||||
CourseApplicationRatingPoints: Grading
|
CourseApplicationRatingPoints: Grading
|
||||||
|
|||||||
@ -41,6 +41,7 @@ type CourseApplicationsTableData = DBRow ( Entity CourseApplication
|
|||||||
, Maybe (Entity Allocation)
|
, Maybe (Entity Allocation)
|
||||||
, Bool -- isParticipant
|
, Bool -- isParticipant
|
||||||
, UserTableStudyFeatures
|
, UserTableStudyFeatures
|
||||||
|
, Bool -- hasAllocationUser
|
||||||
)
|
)
|
||||||
|
|
||||||
courseApplicationsIdent :: Text
|
courseApplicationsIdent :: Text
|
||||||
@ -61,6 +62,13 @@ queryHasFiles = to $ hasFiles . $(sqlIJproj 2 1) . $(sqlLOJproj 3 1)
|
|||||||
queryAllocation :: Getter CourseApplicationsTableExpr (E.SqlExpr (Maybe (Entity Allocation)))
|
queryAllocation :: Getter CourseApplicationsTableExpr (E.SqlExpr (Maybe (Entity Allocation)))
|
||||||
queryAllocation = to $(sqlLOJproj 3 2)
|
queryAllocation = to $(sqlLOJproj 3 2)
|
||||||
|
|
||||||
|
queryHasAllocationUser :: Getter CourseApplicationsTableExpr (E.SqlExpr (E.Value Bool))
|
||||||
|
queryHasAllocationUser = to hasAllocationUser
|
||||||
|
where
|
||||||
|
hasAllocationUser (view queryCourseApplication -> courseApplication) = E.exists . E.from $ \allocationUser ->
|
||||||
|
E.where_ $ E.just (allocationUser E.^. AllocationUserAllocation) E.==. courseApplication E.^. CourseApplicationAllocation
|
||||||
|
E.&&. allocationUser E.^. AllocationUserUser E.==. courseApplication E.^. CourseApplicationUser
|
||||||
|
|
||||||
queryCourseParticipant :: Getter CourseApplicationsTableExpr (E.SqlExpr (Maybe (Entity CourseParticipant)))
|
queryCourseParticipant :: Getter CourseApplicationsTableExpr (E.SqlExpr (Maybe (Entity CourseParticipant)))
|
||||||
queryCourseParticipant = to $(sqlLOJproj 3 3)
|
queryCourseParticipant = to $(sqlLOJproj 3 3)
|
||||||
|
|
||||||
@ -85,6 +93,9 @@ resultIsParticipant = _dbrOutput . _5
|
|||||||
resultStudyFeatures :: Lens' CourseApplicationsTableData UserTableStudyFeatures
|
resultStudyFeatures :: Lens' CourseApplicationsTableData UserTableStudyFeatures
|
||||||
resultStudyFeatures = _dbrOutput . _6
|
resultStudyFeatures = _dbrOutput . _6
|
||||||
|
|
||||||
|
resultHasAllocationUser :: Lens' CourseApplicationsTableData Bool
|
||||||
|
resultHasAllocationUser = _dbrOutput . _7
|
||||||
|
|
||||||
|
|
||||||
newtype CourseApplicationsTableVeto = CourseApplicationsTableVeto Bool
|
newtype CourseApplicationsTableVeto = CourseApplicationsTableVeto Bool
|
||||||
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
||||||
@ -253,6 +264,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
user <- view queryUser
|
user <- view queryUser
|
||||||
allocation <- view queryAllocation
|
allocation <- view queryAllocation
|
||||||
courseParticipant <- view queryCourseParticipant
|
courseParticipant <- view queryCourseParticipant
|
||||||
|
hasAllocationUser <- view queryHasAllocationUser
|
||||||
|
|
||||||
lift $ do
|
lift $ do
|
||||||
E.on $ E.just (user E.^. UserId) E.==. courseParticipant E.?. CourseParticipantUser
|
E.on $ E.just (user E.^. UserId) E.==. courseParticipant E.?. CourseParticipantUser
|
||||||
@ -269,12 +281,13 @@ postCApplicationsR tid ssh csh = do
|
|||||||
, hasFiles
|
, hasFiles
|
||||||
, allocation
|
, allocation
|
||||||
, E.not_ . E.isNothing $ courseParticipant E.?. CourseParticipantId
|
, E.not_ . E.isNothing $ courseParticipant E.?. CourseParticipantId
|
||||||
|
, hasAllocationUser
|
||||||
)
|
)
|
||||||
|
|
||||||
dbtProj :: _ CourseApplicationsTableData
|
dbtProj :: _ CourseApplicationsTableData
|
||||||
dbtProj = dbtProjSimple $ \(application, user, E.Value hasFiles, allocation, E.Value isParticipant) -> do
|
dbtProj = dbtProjSimple $ \(application, user, E.Value hasFiles, allocation, E.Value isParticipant, E.Value hasAllocationUser) -> do
|
||||||
feats <- courseUserStudyFeatures (application ^. _entityVal . _courseApplicationCourse) (user ^. _entityKey)
|
feats <- courseUserStudyFeatures (application ^. _entityVal . _courseApplicationCourse) (user ^. _entityKey)
|
||||||
return (application, user, hasFiles, allocation, isParticipant, feats)
|
return (application, user, hasFiles, allocation, isParticipant, feats, hasAllocationUser)
|
||||||
|
|
||||||
dbtRowKey = view $ queryCourseApplication . to (E.^. CourseApplicationId)
|
dbtRowKey = view $ queryCourseApplication . to (E.^. CourseApplicationId)
|
||||||
|
|
||||||
@ -282,7 +295,22 @@ postCApplicationsR tid ssh csh = do
|
|||||||
dbtColonnade = mconcat
|
dbtColonnade = mconcat
|
||||||
[ cap (Sortable Nothing generatedColumnsHeader) $ mconcat
|
[ cap (Sortable Nothing generatedColumnsHeader) $ mconcat
|
||||||
[ sortable (Just "participant") (i18nCell MsgCourseApplicationIsParticipant) $ bool mempty (cell $ toWidget iconOK) . view resultIsParticipant
|
[ sortable (Just "participant") (i18nCell MsgCourseApplicationIsParticipant) $ bool mempty (cell $ toWidget iconOK) . view resultIsParticipant
|
||||||
, emptyOpticColonnade (resultAllocation . _entityVal) $ \l -> anchorColonnade (views l allocationLink) $ colAllocationShorthand (l . _allocationShorthand)
|
, sortable (Just "allocation-short") (i18nCell MsgAllocation) $ \x ->
|
||||||
|
let noAllocationUserShort alloc =
|
||||||
|
[whamlet|
|
||||||
|
$newline never
|
||||||
|
<span .allocation--no-allocation-user>
|
||||||
|
#{view _allocationShorthand alloc}
|
||||||
|
|]
|
||||||
|
noAllocationUserTooltip = messageTooltip =<< messageIconI Warning IconNoAllocationUser MsgApplicationAllocationNoAllocationUser
|
||||||
|
in if | Just alloc <- x ^? resultAllocation . _entityVal
|
||||||
|
, x ^. resultHasAllocationUser
|
||||||
|
-> anchorCell (allocationLink alloc) $ alloc ^. _allocationShorthand
|
||||||
|
| Just alloc <- x ^? resultAllocation . _entityVal
|
||||||
|
-> anchorCell (allocationLink alloc) (noAllocationUserShort alloc)
|
||||||
|
& cellContents . mapped %~ (<> noAllocationUserTooltip)
|
||||||
|
| otherwise
|
||||||
|
-> mempty
|
||||||
, anchorColonnadeM (views (resultCourseApplication . _entityKey) applicationLink) $ colApplicationId (resultCourseApplication . _entityKey)
|
, anchorColonnadeM (views (resultCourseApplication . _entityKey) applicationLink) $ colApplicationId (resultCourseApplication . _entityKey)
|
||||||
, anchorColonnadeM (views (resultUser . _entityKey) participantLink) $ colUserDisplayName (resultUser . _entityVal . $(multifocusL 2) _userDisplayName _userSurname)
|
, anchorColonnadeM (views (resultUser . _entityKey) participantLink) $ colUserDisplayName (resultUser . _entityVal . $(multifocusL 2) _userDisplayName _userSurname)
|
||||||
, lmap (view $ resultUser . _entityVal) colUserEmail
|
, lmap (view $ resultUser . _entityVal) colUserEmail
|
||||||
|
|||||||
@ -98,6 +98,7 @@ data Icon
|
|||||||
| IconMenuWorkflows
|
| IconMenuWorkflows
|
||||||
| IconVideo
|
| IconVideo
|
||||||
| IconSubmissionUserDuplicate
|
| IconSubmissionUserDuplicate
|
||||||
|
| IconNoAllocationUser
|
||||||
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Typeable)
|
deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic, Typeable)
|
||||||
deriving anyclass (Universe, Finite, NFData)
|
deriving anyclass (Universe, Finite, NFData)
|
||||||
|
|
||||||
@ -179,6 +180,7 @@ iconText = \case
|
|||||||
IconMenuWorkflows -> "project-diagram"
|
IconMenuWorkflows -> "project-diagram"
|
||||||
IconVideo -> "video"
|
IconVideo -> "video"
|
||||||
IconSubmissionUserDuplicate -> "copy"
|
IconSubmissionUserDuplicate -> "copy"
|
||||||
|
IconNoAllocationUser -> "user-slash"
|
||||||
|
|
||||||
nullaryPathPiece ''Icon $ camelToPathPiece' 1
|
nullaryPathPiece ''Icon $ camelToPathPiece' 1
|
||||||
deriveLift ''Icon
|
deriveLift ''Icon
|
||||||
|
|||||||
Reference in New Issue
Block a user