UI: Browse: List team parents
This commit is contained in:
parent
74af2ea223
commit
bef8a77d84
2 changed files with 36 additions and 5 deletions
|
@ -408,10 +408,34 @@ getBrowseR = do
|
|||
E.orderBy [E.asc $ person E.^. PersonId]
|
||||
return (person, actor)
|
||||
)
|
||||
<*> (E.select $ E.from $ \ (group `E.InnerJoin` actor) -> do
|
||||
<*> (do js <-
|
||||
E.select $ E.from $ \ (group `E.InnerJoin` actor) -> do
|
||||
E.on $ group E.^. GroupActor E.==. actor E.^. ActorId
|
||||
E.orderBy [E.asc $ group E.^. GroupId]
|
||||
return (group, actor)
|
||||
for js $ \ (j@(Entity groupID _), jactor) -> do
|
||||
parents <- E.select $ E.from $ \ (deleg `E.InnerJoin` holder) -> do
|
||||
E.on $ deleg E.^. SourceUsSendDelegatorSource E.==. holder E.^. SourceHolderGroupSource
|
||||
E.where_ $ holder E.^. SourceHolderGroupGroup E.==. E.val groupID
|
||||
return $ holder E.^. SourceHolderGroupSource
|
||||
parents' <- for parents $ \ (E.Value sourceID) -> do
|
||||
byKeyOrRaid <- bimap snd snd <$> getSourceTopic sourceID
|
||||
bitraverse
|
||||
(\case
|
||||
Left _j -> error "I'm a group and I have a parent who is a local Project"
|
||||
Right g -> do
|
||||
actorID <- groupActor <$> getJust g
|
||||
actor <- getJust actorID
|
||||
return (g, actor)
|
||||
)
|
||||
(\ remoteActorID -> do
|
||||
remoteActor <- getJust remoteActorID
|
||||
remoteObject <- getJust $ remoteActorIdent remoteActor
|
||||
inztance <- getJust $ remoteObjectInstance remoteObject
|
||||
return (inztance, remoteObject, remoteActor)
|
||||
)
|
||||
byKeyOrRaid
|
||||
return (j, jactor, parents')
|
||||
)
|
||||
<*> (E.select $ E.from $ \ (repo `E.InnerJoin` actor) -> do
|
||||
E.on $ repo E.^. RepoActor E.==. actor E.^. ActorId
|
||||
|
|
|
@ -81,10 +81,17 @@ $# #forgefed @ Libera Chat
|
|||
<h2>Teams
|
||||
|
||||
<ul>
|
||||
$forall (Entity groupID _, Entity _ actor) <- groups
|
||||
$forall (Entity groupID _, Entity _ actor, parents) <- groups
|
||||
<li>
|
||||
<a href=@{GroupR $ hashGroup groupID}>
|
||||
&#{keyHashidText $ hashGroup groupID} #{actorName actor}
|
||||
<ul>
|
||||
$if not $ null parents
|
||||
<li>Parents
|
||||
<ul>
|
||||
$forall p <- parents
|
||||
<li>
|
||||
^{groupLinkFedW p}
|
||||
|
||||
<h2>Repos
|
||||
|
||||
|
|
Loading…
Reference in a new issue