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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{DeckOutboxR deckHash}>
[📤 Outbox]
<span>
<a href=@{DeckErrboxR deckHash}>
[💥 Errbox]
<span>
<a href=@{DeckFollowersR deckHash}>
[🐤 Followers]

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -29,6 +29,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{PersonOutboxR hash}>
[📤 Outbox]
<span>
<a href=@{PersonErrboxR hash}>
[💥 Errbox]
<span>
<a href=@{PersonFollowersR hash}>
[🐤 Followers]

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{GroupOutboxR groupHash}>
[📤 Outbox]
<span>
<a href=@{GroupErrboxR groupHash}>
[💥 Errbox]
<span>
<a href=@{GroupFollowersR groupHash}>
[🐤 Followers]

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{LoomOutboxR loomHash}>
[📤 Outbox]
<span>
<a href=@{LoomErrboxR loomHash}>
[💥 Errbox]
<span>
<a href=@{LoomFollowersR loomHash}>
[🐤 Followers]

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{PersonOutboxR personHash}>
[📤 Outbox]
<span>
<a href=@{PersonErrboxR personHash}>
[💥 Errbox]
<span>
<a href=@{PersonFollowersR personHash}>
[🐤 Followers]

View file

@ -1,6 +1,6 @@
$# 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.
$#
@ -24,6 +24,9 @@ $# <http://creativecommons.org/publicdomain/zero/1.0/>.
<span>
<a href=@{ProjectOutboxR projectHash}>
[📤 Outbox]
<span>
<a href=@{ProjectErrboxR projectHash}>
[💥 Errbox]
<span>
<a href=@{ProjectFollowersR projectHash}>
[🐤 Followers]

View file

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

View file

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

View file

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