Fix hlint
This commit is contained in:
parent
cb3bb18a5d
commit
98026b2a40
@ -111,7 +111,7 @@ commR CommunicationRoute{..} = do
|
|||||||
let
|
let
|
||||||
lookupUser :: UserId -> User
|
lookupUser :: UserId -> User
|
||||||
lookupUser lId
|
lookupUser lId
|
||||||
= entityVal . unsafeHead . filter ((== lId) . entityKey) $ (concat $ Map.elems suggestedRecipients) ++ chosenRecipients
|
= entityVal . unsafeHead . filter ((== lId) . entityKey) $ concat (Map.elems suggestedRecipients) ++ chosenRecipients
|
||||||
|
|
||||||
let chosenRecipients' = Map.fromList $
|
let chosenRecipients' = Map.fromList $
|
||||||
[ ( (EnumPosition $ RecipientGroup g, pos)
|
[ ( (EnumPosition $ RecipientGroup g, pos)
|
||||||
@ -156,7 +156,7 @@ commR CommunicationRoute{..} = do
|
|||||||
-> Widget
|
-> Widget
|
||||||
miLayout liveliness state cellWdgts _delButtons addWdgts = do
|
miLayout liveliness state cellWdgts _delButtons addWdgts = do
|
||||||
checkedIdentBase <- newIdent
|
checkedIdentBase <- newIdent
|
||||||
let checkedCategories = Set.mapMonotonic (unEnumPosition . fst) . Set.filter (\k' -> Map.foldrWithKey (\k (_, checkState) -> (||) $ k == k' && checkState /= FormSuccess False && (checkState /= FormMissing || fromMaybe True (fmap snd $ chosenRecipients' !? k))) False state) $ Map.keysSet state
|
let checkedCategories = Set.mapMonotonic (unEnumPosition . fst) . Set.filter (\k' -> Map.foldrWithKey (\k (_, checkState) -> (||) $ k == k' && checkState /= FormSuccess False && (checkState /= FormMissing || maybe True snd (chosenRecipients' !? k))) False state) $ Map.keysSet state
|
||||||
checkedIdent c = checkedIdentBase <> "-" <> toPathPiece c
|
checkedIdent c = checkedIdentBase <> "-" <> toPathPiece c
|
||||||
categoryIndices c = Set.filter ((== c) . unEnumPosition . fst) $ review liveCoords liveliness
|
categoryIndices c = Set.filter ((== c) . unEnumPosition . fst) $ review liveCoords liveliness
|
||||||
$(widgetFile "widgets/communication/recipientLayout")
|
$(widgetFile "widgets/communication/recipientLayout")
|
||||||
|
|||||||
@ -16,12 +16,11 @@ import Data.List ((!!))
|
|||||||
|
|
||||||
tupleBoxCoord :: Int -> DecQ
|
tupleBoxCoord :: Int -> DecQ
|
||||||
tupleBoxCoord tupleDim = do
|
tupleBoxCoord tupleDim = do
|
||||||
cs <- sequence . replicate tupleDim $ newName "c"
|
cs <- replicateM tupleDim $ newName "c"
|
||||||
|
|
||||||
let tupleType = foldl appT (tupleT tupleDim) $ map varT cs
|
let tupleType = foldl appT (tupleT tupleDim) $ map varT cs
|
||||||
tCxt = cxt $ concat
|
tCxt = cxt
|
||||||
[ [ [t|IsBoxCoord $(varT c)|] | c <- cs ]
|
[ [t|IsBoxCoord $(varT c)|] | c <- cs ]
|
||||||
]
|
|
||||||
fieldLenses =
|
fieldLenses =
|
||||||
[ [e|_1|]
|
[ [e|_1|]
|
||||||
, [e|_2|]
|
, [e|_2|]
|
||||||
|
|||||||
@ -19,7 +19,7 @@ maybeBearerToken = runMaybeT $ catchIfMaybeT cPred requireBearerToken
|
|||||||
|
|
||||||
requireBearerToken :: (MonadHandler m, HandlerSite m ~ UniWorX) => m (BearerToken UniWorX)
|
requireBearerToken :: (MonadHandler m, HandlerSite m ~ UniWorX) => m (BearerToken UniWorX)
|
||||||
requireBearerToken = liftHandlerT $ do
|
requireBearerToken = liftHandlerT $ do
|
||||||
token <- exceptT (guardAuthResult >=> error "askToken should not throw `Authorized`") return $ askTokenUnsafe
|
token <- exceptT (guardAuthResult >=> error "askToken should not throw `Authorized`") return askTokenUnsafe
|
||||||
mAuthId <- maybeAuthId
|
mAuthId <- maybeAuthId
|
||||||
currentRoute <- maybe (permissionDeniedI MsgUnauthorizedToken404) return =<< getCurrentRoute
|
currentRoute <- maybe (permissionDeniedI MsgUnauthorizedToken404) return =<< getCurrentRoute
|
||||||
isWrite <- isWriteRequest currentRoute
|
isWrite <- isWriteRequest currentRoute
|
||||||
|
|||||||
@ -32,7 +32,7 @@ dispatchJobCorrectorInvitation jInviter jCorrectorInvitation@SheetCorrectorInvit
|
|||||||
invitationUrl' <- toTextUrl invitationUrl
|
invitationUrl' <- toTextUrl invitationUrl
|
||||||
|
|
||||||
mailT def $ do
|
mailT def $ do
|
||||||
_mailTo .= [Address Nothing (CI.original $ sheetCorrectorInvitationEmail)]
|
_mailTo .= [Address Nothing $ CI.original sheetCorrectorInvitationEmail]
|
||||||
replaceMailHeader "Reply-To" . Just . renderAddress $ Address (Just userDisplayName) (CI.original userEmail)
|
replaceMailHeader "Reply-To" . Just . renderAddress $ Address (Just userDisplayName) (CI.original userEmail)
|
||||||
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
||||||
setSubjectI $ MsgMailSubjectCorrectorInvitation courseTerm courseSchool courseShorthand sheetName
|
setSubjectI $ MsgMailSubjectCorrectorInvitation courseTerm courseSchool courseShorthand sheetName
|
||||||
|
|||||||
@ -31,7 +31,7 @@ dispatchJobLecturerInvitation jInviter jLecturerInvitation@LecturerInvitation{..
|
|||||||
invitationUrl' <- toTextUrl invitationUrl
|
invitationUrl' <- toTextUrl invitationUrl
|
||||||
|
|
||||||
mailT def $ do
|
mailT def $ do
|
||||||
_mailTo .= [Address Nothing (CI.original $ lecturerInvitationEmail)]
|
_mailTo .= [Address Nothing $ CI.original lecturerInvitationEmail]
|
||||||
replaceMailHeader "Reply-To" . Just . renderAddress $ Address (Just userDisplayName) (CI.original userEmail)
|
replaceMailHeader "Reply-To" . Just . renderAddress $ Address (Just userDisplayName) (CI.original userEmail)
|
||||||
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
replaceMailHeader "Auto-Submitted" $ Just "auto-generated"
|
||||||
setSubjectI $ MsgMailSubjectLecturerInvitation courseTerm courseSchool courseShorthand
|
setSubjectI $ MsgMailSubjectLecturerInvitation courseTerm courseSchool courseShorthand
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
module Utils.Lens ( module Utils.Lens ) where
|
module Utils.Lens ( module Utils.Lens ) where
|
||||||
|
|
||||||
import ClassyPrelude.Yesod hiding ((.=))
|
import ClassyPrelude.Yesod
|
||||||
import Model
|
import Model
|
||||||
import Control.Lens as Utils.Lens hiding ((<.>), universe, snoc)
|
import Control.Lens as Utils.Lens hiding ((<.>), universe, snoc)
|
||||||
import Control.Lens.Extras as Utils.Lens (is)
|
import Control.Lens.Extras as Utils.Lens (is)
|
||||||
|
|||||||
@ -75,8 +75,8 @@ tuplePathPiece tupleDim = do
|
|||||||
tupleSeparator :: Text
|
tupleSeparator :: Text
|
||||||
tupleSeparator = ","
|
tupleSeparator = ","
|
||||||
|
|
||||||
xs <- sequence . replicate tupleDim $ newName "x" :: Q [Name]
|
xs <- replicateM tupleDim $ newName "x" :: Q [Name]
|
||||||
xs' <- sequence . replicate tupleDim $ newName "x'" :: Q [Name]
|
xs' <- replicateM tupleDim $ newName "x'" :: Q [Name]
|
||||||
|
|
||||||
let tupleType = foldl appT (tupleT tupleDim) $ map varT xs
|
let tupleType = foldl appT (tupleT tupleDim) $ map varT xs
|
||||||
tCxt = cxt
|
tCxt = cxt
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import Yesod.Auth (AuthId)
|
|||||||
|
|
||||||
import Utils (NTop(..), hoistMaybe, SessionKey(..))
|
import Utils (NTop(..), hoistMaybe, SessionKey(..))
|
||||||
import Utils.Parameters
|
import Utils.Parameters
|
||||||
import Utils.Lens hiding ((.=))
|
import Utils.Lens
|
||||||
|
|
||||||
import Model
|
import Model
|
||||||
import Model.Tokens
|
import Model.Tokens
|
||||||
|
|||||||
Reference in New Issue
Block a user