minor refactor

This commit is contained in:
Steffen Jost 2023-11-13 17:10:27 +01:00
parent 71c290996d
commit a6fb00f072
3 changed files with 19 additions and 17 deletions

View File

@ -298,7 +298,7 @@ mkFirmAllTable isAdmin uid = do
)
)
, single ("foreign-supervisor", FilterColumn $ \row (getLast -> criterion) ->
-- let checkSuper = do
-- let checkSuper = do -- expensive
-- usrSpr <- E.from $ E.table @UserSupervisor
-- E.where_ $ E.notExists (do
-- spr <- E.from $ E.table @UserCompany

View File

@ -239,25 +239,27 @@ commR CommunicationRoute{..} = do
recipientsListMsg <- messageI Info MsgCommRecipientsList
$logWarnS "COMM" "Communication handler some definitions done"
attachmentsMaxSize <- getsYesod $ view _appCommunicationAttachmentsMaxSize
let attachmentField = genericFileField $ return FileField
{ fieldIdent = Nothing
, fieldUnpackZips = FileFieldUserOption True False
, fieldMultiple = True
, fieldRestrictExtensions = Nothing
, fieldAdditionalFiles = _FileReferenceFileReferenceTitleMap # Map.empty
, fieldMaxFileSize = Nothing, fieldMaxCumulativeSize = attachmentsMaxSize
, fieldAllEmptyOk = True
}
-- attachmentsMaxSize <- getsYesod $ view _appCommunicationAttachmentsMaxSize
-- let attachmentField = genericFileField $ return FileField
-- { fieldIdent = Nothing
-- , fieldUnpackZips = FileFieldUserOption True False
-- , fieldMultiple = True
-- , fieldRestrictExtensions = Nothing
-- , fieldAdditionalFiles = _FileReferenceFileReferenceTitleMap # Map.empty
-- , fieldMaxFileSize = Nothing, fieldMaxCumulativeSize = attachmentsMaxSize
-- , fieldAllEmptyOk = True
-- }
$logWarnS "COMM" "Communication handler some parameters done" -- SEEN
((commRes,commWdgt),commEncoding) <- runFormPost . identifyForm FIDCommunication . withButtonForm' universeF . renderAForm FormStandard $ Communication
<$> recipientAForm
<* aformMessage recipientsListMsg
<*> ( CommunicationContent
<$> aopt textField (fslI MsgCommSubject & addAttr "uw-enter-as-tab" "") Nothing
<*> (markupOutput <$> areq htmlField (fslI MsgCommBody) Nothing)
<*> fmap fold (aopt (convertFieldM (runConduit . (.| C.foldMap Set.singleton)) yieldMany attachmentField) (fslI MsgCommAttachments & setTooltip MsgCommAttachmentsTip) Nothing)
)
<*> (pure (CommunicationContent (Just "subject") (text2Html "body") Set.empty) :: AForm Handler CommunicationContent)
-- <*> ( CommunicationContent
-- <$> aopt textField (fslI MsgCommSubject & addAttr "uw-enter-as-tab" "") Nothing
-- <*> (markupOutput <$> areq htmlField (fslI MsgCommBody) Nothing)
-- <*> fmap fold (aopt (convertFieldM (runConduit . (.| C.foldMap Set.singleton)) yieldMany attachmentField)
-- (fslI MsgCommAttachments & setTooltip MsgCommAttachmentsTip) Nothing)
-- )
$logWarnS "COMM" "Communication handler run form post done" -- NOT SEEN ANYMORE
formResult commRes $ \case
(comm, BtnCommunicationSend) -> do

View File

@ -81,7 +81,7 @@ dispatchNotificationQualificationExpired nQualification jRecipient = do
$logInfoS "LMS" $ "Notified " <> tshow encRecipient <> " about expired qualification " <> qname
else
$logErrorS "LMS" $ "Failed to notify " <> tshow encRecipient <> " about expired qualification " <> qname
else $logErrorS "LMS" $ "Suppressed repeated notification " <> tshow encRecipient <> " about expired qualification " <> qname
else $logInfoS "LMS" $ "Suppressed repeated notification " <> tshow encRecipient <> " about expired qualification " <> qname
_ -> $logErrorS "LMS" $ "Failed to notify " <> tshow encRecipient <> " about expired qualification " <> tshow nQualification