TEST: Does ist build with everything except for makeClassy ''Entity? Probably the functional dependency is to blame?!

This commit is contained in:
SJost 2019-02-21 16:11:04 +01:00
parent e74555c40b
commit bb552c472f
3 changed files with 16 additions and 16 deletions

View File

@ -632,10 +632,11 @@ userTableQuery whereClause returnStatement t@((user `E.InnerJoin` participant) `
E.where_ $ whereClause t E.where_ $ whereClause t
return $ returnStatement t return $ returnStatement t
-- TEST HADDOCK instance HasUser UserTableData where
-- instance HasUser UserTableData where -- hasUser = _entityVal
-- hasUser = _entityVal hasUser = _dbrOutput . _1 . _entityVal
--
-- TEST HADDOCK
-- instance HasEntity UserTableData User where -- instance HasEntity UserTableData User where
-- hasEntity = _dbrOutput . _1 -- hasEntity = _dbrOutput . _1
@ -651,17 +652,17 @@ courseIs cid ((_user `E.InnerJoin` participant) `E.LeftOuterJoin` _note) = parti
-- colUserParticipant' = sortable (Just "participant") (i18nCell MsgCourseMember) -- colUserParticipant' = sortable (Just "participant") (i18nCell MsgCourseMember)
-- $ \DBRow { dbrOutput=(Entity _ user,_,_) } -> userCell (userDisplayName user) (userSurname user) -- $ \DBRow { dbrOutput=(Entity _ user,_,_) } -> userCell (userDisplayName user) (userSurname user)
-- TEST HADDOCK
-- colUserParticipant :: IsDBTable m a => Colonnade _ UserTableData (DBCell m a) colUserParticipant :: IsDBTable m a => Colonnade _ UserTableData (DBCell m a)
-- colUserParticipant = sortable (Just "participant") (i18nCell MsgCourseMember) cellHasUser colUserParticipant = sortable (Just "participant") (i18nCell MsgCourseMember) cellHasUser
-- colUserParticipantLink :: IsDBTable m a => TermId -> SchoolId -> CourseShorthand -> Colonnade _ UserTableData (DBCell m a) -- colUserParticipantLink :: IsDBTable m a => TermId -> SchoolId -> CourseShorthand -> Colonnade _ UserTableData (DBCell m a)
-- colUserParticipantLink tid ssh csh = sortable (Just "participant") (i18nCell MsgCourseMember) (cellHasUserLink courseLink) -- colUserParticipantLink tid ssh csh = sortable (Just "participant") (i18nCell MsgCourseMember) (cellHasUserLink courseLink)
-- where -- where
-- courseLink = CourseR tid ssh csh . CUserR -- courseLink = CourseR tid ssh csh . CUserR
-- colUserMatriclenr :: IsDBTable m a => Colonnade _ UserTableData (DBCell m a) colUserMatriclenr :: IsDBTable m a => Colonnade _ UserTableData (DBCell m a)
-- colUserMatriclenr = sortable (Just "matriclenumber") (i18nCell MsgMatrikelNr) cellHasMatrikelnummer colUserMatriclenr = sortable (Just "matriclenumber") (i18nCell MsgMatrikelNr) cellHasMatrikelnummer
colUserComment :: IsDBTable m a => TermId -> SchoolId -> CourseShorthand -> Colonnade _ UserTableData (DBCell m a) colUserComment :: IsDBTable m a => TermId -> SchoolId -> CourseShorthand -> Colonnade _ UserTableData (DBCell m a)
colUserComment tid ssh csh = colUserComment tid ssh csh =

View File

@ -34,9 +34,8 @@ timeCell t = cell $ formatTime SelFormatDateTime t >>= toWidget
userCell :: IsDBTable m a => Text -> Text -> DBCell m a userCell :: IsDBTable m a => Text -> Text -> DBCell m a
userCell displayName surname = cell $ nameWidget displayName surname userCell displayName surname = cell $ nameWidget displayName surname
-- TEST HADDOCK cellHasUser :: (IsDBTable m a, HasUser c) => c -> DBCell m a
-- cellHasUser :: (IsDBTable m a, HasUser c) => c -> DBCell m a cellHasUser = liftA2 userCell (view _userDisplayName) (view _userSurname)
-- cellHasUser = liftA2 userCell (view _userDisplayName) (view _userSurname)
-- cellHasUserLink :: (IsDBTable m a, HasEntity u User) => (CryptoUUIDUser -> Route UniWorX) -> u -> DBCell m a -- cellHasUserLink :: (IsDBTable m a, HasEntity u User) => (CryptoUUIDUser -> Route UniWorX) -> u -> DBCell m a
-- cellHasUserLink toLink user = -- cellHasUserLink toLink user =
@ -44,8 +43,8 @@ userCell displayName surname = cell $ nameWidget displayName surname
-- nWdgt = nameWidget (user ^. _entityVal . _userDisplayName) (user ^. _entityVal . _userSurname) -- nWdgt = nameWidget (user ^. _entityVal . _userDisplayName) (user ^. _entityVal . _userSurname)
-- in anchorCellM (toLink <$> encrypt uid) nWdgt -- in anchorCellM (toLink <$> encrypt uid) nWdgt
-- cellHasMatrikelnummer :: (IsDBTable m a, HasUser c) => c -> DBCell m a cellHasMatrikelnummer :: (IsDBTable m a, HasUser c) => c -> DBCell m a
-- cellHasMatrikelnummer = maybe mempty textCell . view _userMatrikelnummer cellHasMatrikelnummer = maybe mempty textCell . view _userMatrikelnummer
-- Just for documentation purposes; inline this code instead: -- Just for documentation purposes; inline this code instead:
maybeTimeCell :: IsDBTable m a => Maybe UTCTime -> DBCell m a maybeTimeCell :: IsDBTable m a => Maybe UTCTime -> DBCell m a

View File

@ -26,8 +26,8 @@ _InnerJoinRight :: Lens' (E.InnerJoin l r) r
_InnerJoinRight f (E.InnerJoin l r) = (l `E.InnerJoin`) <$> f r _InnerJoinRight f (E.InnerJoin l r) = (l `E.InnerJoin`) <$> f r
-- makeLenses_ ''Entity makeLenses_ ''Entity
makeClassyFor_ "HasEntity" "hasEntity" ''Entity -- makeClassyFor_ "HasEntity" "hasEntity" ''Entity
-- class HasEntity c record | c -> record where -- class HasEntity c record | c -> record where
-- hasEntity :: Lens' c (Entity record) -- hasEntity :: Lens' c (Entity record)