chore(versionbump): Add Instances, reordered code, removed redundant constraints, added missing constraints.

This commit is contained in:
Stephan Barth 2024-10-08 04:01:01 +02:00
parent 8661932a28
commit 79714d2971
4 changed files with 7 additions and 6 deletions

View File

@ -809,7 +809,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
return (user, Just occId)
deregisterExamUsersCount :: (MonadIO m, HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m Int64
deregisterExamUsersCount :: (HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m Int64
deregisterExamUsersCount eId uids = do
partResults <- E.select . E.from $ \(examPart `E.InnerJoin` examPartResult) -> do
E.on $ examPart E.^. ExamPartId E.==. examPartResult E.^. ExamPartResultExamPart
@ -836,7 +836,7 @@ deregisterExamUsersCount eId uids = do
audit $ TransactionExamDeregister examRegistrationExam examRegistrationUser
return 1
deregisterExamUsers :: (MonadIO m, HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m ()
deregisterExamUsers :: (HandlerSite m ~ UniWorX, MonadHandler m, MonadCatch m) => ExamId -> [UserId] -> SqlPersistT m ()
deregisterExamUsers eId uids = void $ deregisterExamUsersCount eId uids

View File

@ -172,6 +172,8 @@ data ButtonSubmitDelete = BtnSubmit' | BtnDelete'
instance Universe ButtonSubmitDelete
instance Finite ButtonSubmitDelete
nullaryPathPiece ''ButtonSubmitDelete $ camelToPathPiece' 1 . dropSuffix "'"
embedRenderMessage ''UniWorX ''ButtonSubmitDelete $ dropSuffix "'"
instance Button UniWorX ButtonSubmitDelete where
btnClasses BtnSubmit' = [BCIsButton, BCPrimary]
@ -180,8 +182,6 @@ instance Button UniWorX ButtonSubmitDelete where
btnValidate _ BtnSubmit' = True
btnValidate _ BtnDelete' = False
nullaryPathPiece ''ButtonSubmitDelete $ camelToPathPiece' 1 . dropSuffix "'"
-- | Looks like a button, but is just a link (e.g. for create course, etc.)
linkButton :: Widget -- ^ Widget to display if unauthorized

View File

@ -127,11 +127,11 @@ newtype BoundedPosition coord = BoundedPosition { unBoundedPosition :: coord }
deriving (Eq, Ord, Generic, Read, Show)
makeWrapped ''BoundedPosition
instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord, Ord coord) => IsBoxCoord (BoundedPosition coord) where
instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord) => IsBoxCoord (BoundedPosition coord) where
boxDimensions = [BoxDimension _Wrapped]
boxOrigin = minBound'
instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord, Ord coord) => Liveliness (BoundedLiveliness coord) where
instance (LowerBounded coord, PathPiece coord, ToJSON coord, FromJSON coord, ToJSONKey coord, FromJSONKey coord) => Liveliness (BoundedLiveliness coord) where
type BoxCoord (BoundedLiveliness coord) = BoundedPosition coord
liveCoords = iso (Set.mapMonotonic $ view _Wrapped) (Set.mapMonotonic $ view _Unwrapped) . _Unwrapped

View File

@ -45,6 +45,7 @@ class ( PersistRecordBackend junction (YesodPersistBackend UniWorX)
, Eq (InvitationDBData junction)
, PersistRecordBackend (InvitationFor junction) (YesodPersistBackend UniWorX)
, Typeable junction
, SafeToInsert junction
) => IsInvitableJunction junction where
-- | One side of the junction is always `User`; `InvitationFor junction` is the other
type InvitationFor junction :: Type