UI: Error-inbox ("Errbox") display for all local actors

This commit is contained in:
Pere Lev 2024-04-27 23:17:22 +03:00
parent 29e7581b19
commit a60b05b1ca
No known key found for this signature in database
GPG key ID: 5252C5C863E5E57D
17 changed files with 72 additions and 8 deletions

View file

@ -1048,3 +1048,10 @@ instance YesodBreadcrumbs App where
ProjectApproveChildR _ _ -> ("", Nothing) ProjectApproveChildR _ _ -> ("", Nothing)
ProjectApproveParentR _ _ -> ("", Nothing) ProjectApproveParentR _ _ -> ("", Nothing)
PersonErrboxR p -> ("Errbox", Just $ PersonR p)
GroupErrboxR g -> ("Errbox", Just $ GroupR g)
ProjectErrboxR j -> ("Errbox", Just $ ProjectR j)
RepoErrboxR r -> ("Errbox", Just $ RepoR r)
DeckErrboxR d -> ("Errbox", Just $ DeckR d)
LoomErrboxR l -> ("Errbox", Just $ LoomR l)

View file

@ -17,6 +17,7 @@
module Vervis.Handler.Deck module Vervis.Handler.Deck
( getDeckR ( getDeckR
, getDeckInboxR , getDeckInboxR
, getDeckErrboxR
, postDeckInboxR , postDeckInboxR
, getDeckOutboxR , getDeckOutboxR
, getDeckOutboxItemR , getDeckOutboxItemR
@ -187,6 +188,9 @@ getDeckR deckHash = do
getDeckInboxR :: KeyHashid Deck -> Handler TypedContent getDeckInboxR :: KeyHashid Deck -> Handler TypedContent
getDeckInboxR = getInbox DeckInboxR deckActor getDeckInboxR = getInbox DeckInboxR deckActor
getDeckErrboxR :: KeyHashid Deck -> Handler TypedContent
getDeckErrboxR = getInbox' actorErrbox DeckErrboxR deckActor
postDeckInboxR :: KeyHashid Deck -> Handler () postDeckInboxR :: KeyHashid Deck -> Handler ()
postDeckInboxR deckHash = do postDeckInboxR deckHash = do
deckID <- decodeKeyHashid404 deckHash deckID <- decodeKeyHashid404 deckHash

View file

@ -20,6 +20,7 @@ module Vervis.Handler.Group
, getGroupR , getGroupR
, getGroupInboxR , getGroupInboxR
, getGroupErrboxR
, postGroupInboxR , postGroupInboxR
, getGroupOutboxR , getGroupOutboxR
, getGroupOutboxItemR , getGroupOutboxItemR
@ -211,6 +212,9 @@ getGroupR groupHash = do
getGroupInboxR :: KeyHashid Group -> Handler TypedContent getGroupInboxR :: KeyHashid Group -> Handler TypedContent
getGroupInboxR = getInbox GroupInboxR groupActor getGroupInboxR = getInbox GroupInboxR groupActor
getGroupErrboxR :: KeyHashid Group -> Handler TypedContent
getGroupErrboxR = getInbox' actorErrbox GroupErrboxR groupActor
postGroupInboxR :: KeyHashid Group -> Handler () postGroupInboxR :: KeyHashid Group -> Handler ()
postGroupInboxR groupHash = do postGroupInboxR groupHash = do
groupID <- decodeKeyHashid404 groupHash groupID <- decodeKeyHashid404 groupHash

View file

@ -16,6 +16,7 @@
module Vervis.Handler.Loom module Vervis.Handler.Loom
( getLoomR ( getLoomR
, getLoomInboxR , getLoomInboxR
, getLoomErrboxR
, postLoomInboxR , postLoomInboxR
, getLoomOutboxR , getLoomOutboxR
, getLoomOutboxItemR , getLoomOutboxItemR
@ -143,6 +144,9 @@ getLoomR loomHash = do
getLoomInboxR :: KeyHashid Loom -> Handler TypedContent getLoomInboxR :: KeyHashid Loom -> Handler TypedContent
getLoomInboxR = getInbox LoomInboxR loomActor getLoomInboxR = getInbox LoomInboxR loomActor
getLoomErrboxR :: KeyHashid Loom -> Handler TypedContent
getLoomErrboxR = getInbox' actorErrbox LoomErrboxR loomActor
postLoomInboxR :: KeyHashid Loom -> Handler () postLoomInboxR :: KeyHashid Loom -> Handler ()
postLoomInboxR loomHash = do postLoomInboxR loomHash = do
loomID <- decodeKeyHashid404 loomHash loomID <- decodeKeyHashid404 loomHash

View file

@ -17,6 +17,7 @@
module Vervis.Handler.Person module Vervis.Handler.Person
( getPersonR ( getPersonR
, getPersonInboxR , getPersonInboxR
, getPersonErrboxR
, postPersonInboxR , postPersonInboxR
, getPersonOutboxR , getPersonOutboxR
, postPersonOutboxR , postPersonOutboxR
@ -139,6 +140,9 @@ getPersonR personHash = do
getPersonInboxR :: KeyHashid Person -> Handler TypedContent getPersonInboxR :: KeyHashid Person -> Handler TypedContent
getPersonInboxR = getInbox PersonInboxR personActor getPersonInboxR = getInbox PersonInboxR personActor
getPersonErrboxR :: KeyHashid Person -> Handler TypedContent
getPersonErrboxR = getInbox' actorErrbox PersonErrboxR personActor
postPersonInboxR :: KeyHashid Person -> Handler () postPersonInboxR :: KeyHashid Person -> Handler ()
postPersonInboxR personHash = do postPersonInboxR personHash = do
personID <- decodeKeyHashid404 personHash personID <- decodeKeyHashid404 personHash

View file

@ -17,6 +17,7 @@
module Vervis.Handler.Project module Vervis.Handler.Project
( getProjectR ( getProjectR
, getProjectInboxR , getProjectInboxR
, getProjectErrboxR
, postProjectInboxR , postProjectInboxR
, getProjectOutboxR , getProjectOutboxR
, getProjectOutboxItemR , getProjectOutboxItemR
@ -191,6 +192,9 @@ getProjectR projectHash = do
getProjectInboxR :: KeyHashid Project -> Handler TypedContent getProjectInboxR :: KeyHashid Project -> Handler TypedContent
getProjectInboxR = getInbox ProjectInboxR projectActor getProjectInboxR = getInbox ProjectInboxR projectActor
getProjectErrboxR :: KeyHashid Project -> Handler TypedContent
getProjectErrboxR = getInbox' actorErrbox ProjectErrboxR projectActor
postProjectInboxR :: KeyHashid Project -> Handler () postProjectInboxR :: KeyHashid Project -> Handler ()
postProjectInboxR projectHash = do postProjectInboxR projectHash = do
projectID <- decodeKeyHashid404 projectHash projectID <- decodeKeyHashid404 projectHash

View file

@ -17,6 +17,7 @@
module Vervis.Handler.Repo module Vervis.Handler.Repo
( getRepoR ( getRepoR
, getRepoInboxR , getRepoInboxR
, getRepoErrboxR
, postRepoInboxR , postRepoInboxR
, getRepoOutboxR , getRepoOutboxR
, getRepoOutboxItemR , getRepoOutboxItemR
@ -243,6 +244,9 @@ getRepoR repoHash = do
getRepoInboxR :: KeyHashid Repo -> Handler TypedContent getRepoInboxR :: KeyHashid Repo -> Handler TypedContent
getRepoInboxR = getInbox RepoInboxR repoActor getRepoInboxR = getInbox RepoInboxR repoActor
getRepoErrboxR :: KeyHashid Repo -> Handler TypedContent
getRepoErrboxR = getInbox' actorErrbox RepoErrboxR repoActor
postRepoInboxR :: KeyHashid Repo -> Handler () postRepoInboxR :: KeyHashid Repo -> Handler ()
postRepoInboxR repoHash = do postRepoInboxR repoHash = do
repoID <- decodeKeyHashid404 repoHash repoID <- decodeKeyHashid404 repoHash

View file

@ -16,6 +16,7 @@
module Vervis.Web.Actor module Vervis.Web.Actor
( getInbox ( getInbox
, getInbox'
, postInbox , postInbox
, getOutbox , getOutbox
, getOutboxItem , getOutboxItem
@ -135,12 +136,14 @@ objectId o =
"'id' field not found" ++ "'id' field not found" ++
TL.unpack (P.encodePrettyToLazyText o) TL.unpack (P.encodePrettyToLazyText o)
getInbox here actor hash = do getInbox = getInbox' actorInbox
getInbox' grabInbox here actor hash = do
key <- decodeKeyHashid404 hash key <- decodeKeyHashid404 hash
(total, pages, mpage) <- runDB $ do (total, pages, mpage) <- runDB $ do
inboxID <- do inboxID <- do
actorID <- actor <$> get404 key actorID <- actor <$> get404 key
actorInbox <$> getJust actorID grabInbox <$> getJust actorID
getPageAndNavCount getPageAndNavCount
(countItems inboxID) (countItems inboxID)
(\ off lim -> map adaptItem <$> getItems inboxID off lim) (\ off lim -> map adaptItem <$> getItems inboxID off lim)

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2019, 2022, 2023 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2019, 2022, 2023, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{DeckOutboxR deckHash}> <a href=@{DeckOutboxR deckHash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{DeckErrboxR deckHash}>
[💥 Errbox]
<span> <span>
<a href=@{DeckFollowersR deckHash}> <a href=@{DeckFollowersR deckHash}>
[🐤 Followers] [🐤 Followers]

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2016, 2019, 2022 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2016, 2019, 2022, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -29,6 +29,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{PersonOutboxR hash}> <a href=@{PersonOutboxR hash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{PersonErrboxR hash}>
[💥 Errbox]
<span> <span>
<a href=@{PersonFollowersR hash}> <a href=@{PersonFollowersR hash}>
[🐤 Followers] [🐤 Followers]

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2019, 2022, 2023 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2019, 2022, 2023, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{GroupOutboxR groupHash}> <a href=@{GroupOutboxR groupHash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{GroupErrboxR groupHash}>
[💥 Errbox]
<span> <span>
<a href=@{GroupFollowersR groupHash}> <a href=@{GroupFollowersR groupHash}>
[🐤 Followers] [🐤 Followers]

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2019, 2022, 2023 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2019, 2022, 2023, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{LoomOutboxR loomHash}> <a href=@{LoomOutboxR loomHash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{LoomErrboxR loomHash}>
[💥 Errbox]
<span> <span>
<a href=@{LoomFollowersR loomHash}> <a href=@{LoomFollowersR loomHash}>
[🐤 Followers] [🐤 Followers]

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2019, 2020, 2022 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2019, 2020, 2022, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{PersonOutboxR personHash}> <a href=@{PersonOutboxR personHash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{PersonErrboxR personHash}>
[💥 Errbox]
<span> <span>
<a href=@{PersonFollowersR personHash}> <a href=@{PersonFollowersR personHash}>
[🐤 Followers] [🐤 Followers]

View file

@ -1,6 +1,6 @@
$# This file is part of Vervis. $# This file is part of Vervis.
$# $#
$# Written in 2019, 2022, 2023 by fr33domlover <fr33domlover@riseup.net>. $# Written in 2019, 2022, 2023, 2024 by fr33domlover <fr33domlover@riseup.net>.
$# $#
$# ♡ Copying is an act of love. Please copy, reuse and share. $# ♡ Copying is an act of love. Please copy, reuse and share.
$# $#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span> <span>
<a href=@{ProjectOutboxR projectHash}> <a href=@{ProjectOutboxR projectHash}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{ProjectErrboxR projectHash}>
[💥 Errbox]
<span> <span>
<a href=@{ProjectFollowersR projectHash}> <a href=@{ProjectFollowersR projectHash}>
[🐤 Followers] [🐤 Followers]

View file

@ -42,6 +42,9 @@ $# ^{personNavW user}
<span> <span>
<a href=@{RepoOutboxR repo}> <a href=@{RepoOutboxR repo}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{RepoErrboxR repo}>
[💥 Errbox]
<span> <span>
<a href=@{RepoFollowersR repo}> <a href=@{RepoFollowersR repo}>
[🐤 Followers] [🐤 Followers]

View file

@ -42,6 +42,9 @@ $# ^{personNavW user}
<span> <span>
<a href=@{RepoOutboxR repo}> <a href=@{RepoOutboxR repo}>
[📤 Outbox] [📤 Outbox]
<span>
<a href=@{RepoErrboxR repo}>
[💥 Errbox]
<span> <span>
<a href=@{RepoFollowersR repo}> <a href=@{RepoFollowersR repo}>
[🐤 Followers] [🐤 Followers]

View file

@ -144,6 +144,7 @@
/people/#PersonKeyHashid PersonR GET /people/#PersonKeyHashid PersonR GET
/people/#PersonKeyHashid/inbox PersonInboxR GET POST /people/#PersonKeyHashid/inbox PersonInboxR GET POST
/people/#PersonKeyHashid/errbox PersonErrboxR GET
/people/#PersonKeyHashid/outbox PersonOutboxR GET POST /people/#PersonKeyHashid/outbox PersonOutboxR GET POST
/people/#PersonKeyHashid/outbox/#OutboxItemKeyHashid PersonOutboxItemR GET /people/#PersonKeyHashid/outbox/#OutboxItemKeyHashid PersonOutboxItemR GET
/people/#PersonKeyHashid/followers PersonFollowersR GET /people/#PersonKeyHashid/followers PersonFollowersR GET
@ -164,6 +165,7 @@
/groups/#GroupKeyHashid GroupR GET /groups/#GroupKeyHashid GroupR GET
/groups/#GroupKeyHashid/inbox GroupInboxR GET POST /groups/#GroupKeyHashid/inbox GroupInboxR GET POST
/groups/#GroupKeyHashid/errbox GroupErrboxR GET
/groups/#GroupKeyHashid/outbox GroupOutboxR GET /groups/#GroupKeyHashid/outbox GroupOutboxR GET
/groups/#GroupKeyHashid/outbox/#OutboxItemKeyHashid GroupOutboxItemR GET /groups/#GroupKeyHashid/outbox/#OutboxItemKeyHashid GroupOutboxItemR GET
/groups/#GroupKeyHashid/followers GroupFollowersR GET /groups/#GroupKeyHashid/followers GroupFollowersR GET
@ -184,6 +186,7 @@
/repos/#RepoKeyHashid RepoR GET /repos/#RepoKeyHashid RepoR GET
/repos/#RepoKeyHashid/inbox RepoInboxR GET POST /repos/#RepoKeyHashid/inbox RepoInboxR GET POST
/repos/#RepoKeyHashid/errbox RepoErrboxR GET
/repos/#RepoKeyHashid/outbox RepoOutboxR GET /repos/#RepoKeyHashid/outbox RepoOutboxR GET
/repos/#RepoKeyHashid/outbox/#OutboxItemKeyHashid RepoOutboxItemR GET /repos/#RepoKeyHashid/outbox/#OutboxItemKeyHashid RepoOutboxItemR GET
/repos/#RepoKeyHashid/followers RepoFollowersR GET /repos/#RepoKeyHashid/followers RepoFollowersR GET
@ -218,6 +221,7 @@
/decks/#DeckKeyHashid DeckR GET /decks/#DeckKeyHashid DeckR GET
/decks/#DeckKeyHashid/inbox DeckInboxR GET POST /decks/#DeckKeyHashid/inbox DeckInboxR GET POST
/decks/#DeckKeyHashid/errbox DeckErrboxR GET
/decks/#DeckKeyHashid/outbox DeckOutboxR GET /decks/#DeckKeyHashid/outbox DeckOutboxR GET
/decks/#DeckKeyHashid/outbox/#OutboxItemKeyHashid DeckOutboxItemR GET /decks/#DeckKeyHashid/outbox/#OutboxItemKeyHashid DeckOutboxItemR GET
/decks/#DeckKeyHashid/followers DeckFollowersR GET /decks/#DeckKeyHashid/followers DeckFollowersR GET
@ -276,6 +280,7 @@
/looms/#LoomKeyHashid LoomR GET /looms/#LoomKeyHashid LoomR GET
/looms/#LoomKeyHashid/inbox LoomInboxR GET POST /looms/#LoomKeyHashid/inbox LoomInboxR GET POST
/looms/#LoomKeyHashid/errbox LoomErrboxR GET
/looms/#LoomKeyHashid/outbox LoomOutboxR GET /looms/#LoomKeyHashid/outbox LoomOutboxR GET
/looms/#LoomKeyHashid/outbox/#OutboxItemKeyHashid LoomOutboxItemR GET /looms/#LoomKeyHashid/outbox/#OutboxItemKeyHashid LoomOutboxItemR GET
/looms/#LoomKeyHashid/followers LoomFollowersR GET /looms/#LoomKeyHashid/followers LoomFollowersR GET
@ -331,6 +336,7 @@
/projects/#ProjectKeyHashid ProjectR GET /projects/#ProjectKeyHashid ProjectR GET
/projects/#ProjectKeyHashid/inbox ProjectInboxR GET POST /projects/#ProjectKeyHashid/inbox ProjectInboxR GET POST
/projects/#ProjectKeyHashid/errbox ProjectErrboxR GET
/projects/#ProjectKeyHashid/outbox ProjectOutboxR GET /projects/#ProjectKeyHashid/outbox ProjectOutboxR GET
/projects/#ProjectKeyHashid/outbox/#OutboxItemKeyHashid ProjectOutboxItemR GET /projects/#ProjectKeyHashid/outbox/#OutboxItemKeyHashid ProjectOutboxItemR GET
/projects/#ProjectKeyHashid/followers ProjectFollowersR GET /projects/#ProjectKeyHashid/followers ProjectFollowersR GET