chore(mail): minor code cleanup mailCenterR
-- hiding currently unneded dbtForm -- slightly better formatting for MIME encoded word
This commit is contained in:
parent
e35a5e99a6
commit
c1dbd61c14
@ -105,8 +105,8 @@ mkMCTable = do
|
|||||||
dbtRowKey = queryMail >>> (E.^. SentMailId)
|
dbtRowKey = queryMail >>> (E.^. SentMailId)
|
||||||
dbtProj = dbtProjId
|
dbtProj = dbtProjId
|
||||||
dbtColonnade = mconcat
|
dbtColonnade = mconcat
|
||||||
[ dbSelect (applying _2) id (return . view (resultMail . _entityKey))
|
[ -- dbSelect (applying _2) id (return . view (resultMail . _entityKey))
|
||||||
, sortable (Just "sent") (i18nCell MsgPrintJobCreated) $ \( view $ resultMail . _entityVal . _sentMailSentAt -> t) -> dateTimeCell t
|
sortable (Just "sent") (i18nCell MsgPrintJobCreated) $ \( view $ resultMail . _entityVal . _sentMailSentAt -> t) -> dateTimeCell t
|
||||||
, sortable (Just "recipient") (i18nCell MsgPrintRecipient) $ \(preview resultRecipient -> u) -> maybeCell u $ cellHasUserLink AdminUserR
|
, sortable (Just "recipient") (i18nCell MsgPrintRecipient) $ \(preview resultRecipient -> u) -> maybeCell u $ cellHasUserLink AdminUserR
|
||||||
, sortable Nothing (i18nCell MsgCommSubject) $ \(view resultMail -> Entity k v) ->
|
, sortable Nothing (i18nCell MsgCommSubject) $ \(view resultMail -> Entity k v) ->
|
||||||
let subject = v ^? _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject"
|
let subject = v ^? _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject"
|
||||||
@ -139,15 +139,17 @@ mkMCTable = do
|
|||||||
{ dbParamsFormMethod = POST
|
{ dbParamsFormMethod = POST
|
||||||
, dbParamsFormAction = Nothing -- Just $ SomeRoute currentRoute
|
, dbParamsFormAction = Nothing -- Just $ SomeRoute currentRoute
|
||||||
, dbParamsFormAttrs = []
|
, dbParamsFormAttrs = []
|
||||||
, dbParamsFormSubmit = FormSubmit
|
, dbParamsFormSubmit = FormNoSubmit
|
||||||
, dbParamsFormAdditional
|
, dbParamsFormAdditional = \_csrf -> return (FormMissing, mempty)
|
||||||
= let acts :: Map MCTableAction (AForm Handler MCTableActionData)
|
-- , dbParamsFormSubmit = FormSubmit
|
||||||
acts = mconcat
|
-- , dbParamsFormAdditional
|
||||||
[ singletonMap MCActDummy $ pure MCActDummyData
|
-- = let acts :: Map MCTableAction (AForm Handler MCTableActionData)
|
||||||
]
|
-- acts = mconcat
|
||||||
in renderAForm FormStandard
|
-- [ singletonMap MCActDummy $ pure MCActDummyData
|
||||||
$ (, mempty) . First . Just
|
-- ]
|
||||||
<$> multiActionA acts (fslI MsgTableAction) Nothing
|
-- in renderAForm FormStandard
|
||||||
|
-- $ (, mempty) . First . Just
|
||||||
|
-- <$> multiActionA acts (fslI MsgTableAction) Nothing
|
||||||
, dbParamsFormEvaluate = liftHandler . runFormPost
|
, dbParamsFormEvaluate = liftHandler . runFormPost
|
||||||
, dbParamsFormResult = id
|
, dbParamsFormResult = id
|
||||||
, dbParamsFormIdent = def
|
, dbParamsFormIdent = def
|
||||||
@ -267,4 +269,9 @@ part2widget Part{partContent=PartContent (LB.toStrict -> pc), partType=pt, partD
|
|||||||
|
|
||||||
-- | decode the MIME encoded-word format, which is used in email headers to encode non-ASCII text. This format is specified in RFC 2047.
|
-- | decode the MIME encoded-word format, which is used in email headers to encode non-ASCII text. This format is specified in RFC 2047.
|
||||||
decodeMime :: Text -> Text
|
decodeMime :: Text -> Text
|
||||||
decodeMime = id -- TODO
|
decodeMime t = t
|
||||||
|
-- decodeMime t
|
||||||
|
-- | Just r <- T.stripPrefix "=?utf-8?Q?" t
|
||||||
|
-- = T.replace "_" " " $ T.replace "?=" "" r -- TODO: this only works in plain cases without special characters; e.g. umlauts are not handled correctly
|
||||||
|
-- | otherwise
|
||||||
|
-- = t
|
||||||
|
|||||||
@ -307,7 +307,7 @@ qualificationOption (Entity qid Qualification{..}) =
|
|||||||
qualificationsOptionList :: [Entity Qualification] -> OptionList QualificationId
|
qualificationsOptionList :: [Entity Qualification] -> OptionList QualificationId
|
||||||
qualificationsOptionList = mkOptionList . map qualificationOption
|
qualificationsOptionList = mkOptionList . map qualificationOption
|
||||||
|
|
||||||
{- Should we encrypt the external value or simply rely on uniqueness?
|
{- Should we encrypt the external value or simply rely on uniqueness? --TODO: still used in Handler.Admin.Avs
|
||||||
qualOpt :: Entity Qualification -> Handler (Option QualificationId)
|
qualOpt :: Entity Qualification -> Handler (Option QualificationId)
|
||||||
qualOpt (Entity qualId qual) = do
|
qualOpt (Entity qualId qual) = do
|
||||||
cQualId :: CryptoUUIDQualification <- encrypt qualId
|
cQualId :: CryptoUUIDQualification <- encrypt qualId
|
||||||
|
|||||||
Reference in New Issue
Block a user