From 7984cd9ecba2d7b0710cfcf6a57eeb2161f4aa7c Mon Sep 17 00:00:00 2001 From: Steffen Jost Date: Tue, 14 Jun 2022 18:21:51 +0200 Subject: [PATCH] chore(lms): hide lms pin column by default --- src/Handler/LMS/Users.hs | 3 ++- src/Handler/Utils/Table/Pagination.hs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Handler/LMS/Users.hs b/src/Handler/LMS/Users.hs index e63e90c13..57954e912 100644 --- a/src/Handler/LMS/Users.hs +++ b/src/Handler/LMS/Users.hs @@ -93,7 +93,8 @@ mkUserTable _sid qsh qid = do dbtProj = dbtProjFilteredPostId -- TODO: or dbtProjSimple what is the difference? dbtColonnade = dbColonnade $ mconcat [ sortable (Just csvLmsIdent) (i18nCell MsgTableLmsIdent) $ \(view $ _dbrOutput . _entityVal . _lmsUserIdent . _getLmsIdent -> ident) -> textCell ident - , sortable (Just csvLmsPin) (i18nCell MsgTableLmsPin) $ \(view $ _dbrOutput . _entityVal . _lmsUserPin -> pin ) -> textCell pin + , sortable (Just csvLmsPin) (i18nCell MsgTableLmsPin & cellAttrs <>~ [("uw-hide-column-default-hidden",mempty)] + ) $ \(view $ _dbrOutput . _entityVal . _lmsUserPin -> pin ) -> textCell pin , sortable (Just csvLmsResetPin) (i18nCell MsgTableLmsResetPin) $ \(view $ _dbrOutput . _entityVal . _lmsUserResetPin -> reset) -> ifIconCell reset IconReset , sortable (Just csvLmsDelete) (i18nCell MsgTableLmsDelete) $ \(view $ _dbrOutput . _entityVal . _lmsUserToDelete -> del ) -> ifIconCell del IconRemoveUser , sortable Nothing (i18nCell MsgTableLmsStaff) $ const mempty diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index 60e80d1c5..69845b554 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -1869,7 +1869,7 @@ dbSelectIf :: forall x h r i a. (Headedness h, Monoid' x) -> (DBRow r -> MForm (HandlerFor UniWorX) i) -> (DBRow r -> Bool) -> Colonnade h (DBRow r) (DBCell (MForm (HandlerFor UniWorX)) x) -dbSelectIf resLens selLens genIndex condition = Colonnade.singleton (headednessPure $ mempty & cellAttrs <>~ [("uw-hide-columns--no-hide","")] ) fCell +dbSelectIf resLens selLens genIndex condition = Colonnade.singleton (headednessPure $ mempty & cellAttrs <>~ [("uw-hide-columns--no-hide", mempty)] ) fCell where fCell = formCell resLens genIndex genForm genForm row mkUnique = do