ui for selecting a repository group
This commit is contained in:
parent
39be7eea40
commit
4e2e08b45a
4 changed files with 28 additions and 17 deletions
|
@ -68,9 +68,7 @@ makeGroupMap byuuid = GroupMap byuuid bygroup
|
|||
explode (u, s) = map (\g -> (g, S.singleton u)) (S.toList s)
|
||||
|
||||
{- If a repository is in exactly one standard group, returns it. -}
|
||||
getStandardGroup :: UUID -> GroupMap -> Maybe StandardGroup
|
||||
getStandardGroup u m = maybe Nothing go $ u `M.lookup` groupsByUUID m
|
||||
where
|
||||
go s = case catMaybes $ map toStandardGroup $ S.toList s of
|
||||
[g] -> Just g
|
||||
_ -> Nothing
|
||||
getStandardGroup :: S.Set Group -> Maybe StandardGroup
|
||||
getStandardGroup s = case catMaybes $ map toStandardGroup $ S.toList s of
|
||||
[g] -> Just g
|
||||
_ -> Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue