Show all project contributors, not just those with a revenue share.
[?]
Feb 14, 2021, 12:59 AM
ZEAH247RECTEYICYRFRX574BZWZYVGFWETVVKDCAPTKIGRYQT4IQCDependencies
- [2]
RKY3XCSIGet the correct contributor data. - [3]
XXJFUZOVAdd first revenue date to project payout computation. - [4]
W3PIWHDKFix logged hours display error. - [5]
4354Y4PEAdd endpoint to list project contributors. - [6]
U7YAT2ZKAdd error reporting to signup form. - [*]
PBD7LZYQPostgres & auth are beginning to function.
Change contents
- edit in server/Aftok/Snaplet/Projects.hs at line 115
contributors <- snapEval $ listProjectContributors pid uid - replacement in server/Aftok/Snaplet/Projects.hs at line 118[3.1756]→[4.25736:25937](∅→∅),[4.25736]→[4.25736:25937](∅→∅),[4.25937]→[2.145:213](∅→∅),[2.213]→[4.26004:26177](∅→∅),[4.26004]→[4.26004:26177](∅→∅),[4.26177]→[4.876:969](∅→∅),[4.969]→[4.26269:26357](∅→∅),[4.26269]→[4.26269:26357](∅→∅)
toContributorRecord = \case(CreditToUser uid', ws) -> do(user, joinedOn') <-fromMaybeT(snapError 500 $ "No user record found for logged-in user.")(mapMaybeT snapEval $ findUserProjectDetail uid' pid)pure . Just . (uid',) $Contributor{ _userId = uid',_handle = user ^. username,_joinedOn = joinedOn',_timeDevoted = Hours . (`div` 3600) . round . C.toSeconds' $ ws ^. wsLogged,_revenueShare = ws ^. wsShare}_ -> pure NothingtoContributorRecord uid' ws = do(user, joinedOn') <- findUserProjectDetail uid' pidpure $Contributor{ _userId = uid',_handle = user ^. username,_joinedOn = joinedOn',_timeDevoted = Hours . (`div` 3600) . round . C.toSeconds' $ ws ^. wsLogged,_revenueShare = ws ^. wsShare}findContributorPayouts (uid', h, t) = dolet userShares = M.lookup (CreditToUser uid') (p ^. creditToShares)zeroContrib = Contributor uid' h t (Hours 0) 0in (uid',) <$> maybe (pure zeroContrib) (toContributorRecord uid') userShares - replacement in server/Aftok/Snaplet/Projects.hs at line 135
fmap (M.fromList . catMaybes). traverse toContributorRecord$ M.assocs (p ^. creditToShares)fromMaybeT(snapError 500 $ "No user record found for credited user."). mapMaybeT snapEval. fmap M.fromList$ traverse findContributorPayouts contributors