-
Notifications
You must be signed in to change notification settings - Fork 333
SQSERVICES 1011 Servantify Galley/Team API #2008
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQSERVICES 1011 Servantify Galley/Team API #2008
Conversation
libs/wire-api/src/Wire/API/Team.hs
Outdated
deriving (S.ToSchema) via (Schema NonBindingNewTeam) | ||
|
||
instance ToSchema NonBindingNewTeam where | ||
schema = error "todo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this, will fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh!! we should not have non-binding teams any more in the code, they have never been implemented on the client side and have been dead code since the beginning. i expect this to take less than an hour, but now i want to remove non-binding teams again. immediately!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry about missing the non-binding teams thing in the issue, but i'm hopeful that most of the code is still going to be usdful for non-dead end-points?
I can take another look tomorrow when the last hole is filled, then this should be good to merge.
@@ -317,7 +317,7 @@ testObject_NewTeamMember_team_19 = | |||
|
|||
testObject_NewTeamMember_team_20 :: NewTeamMember | |||
testObject_NewTeamMember_team_20 = | |||
( newNewTeamMember | |||
( mkNewTeamMember |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be helpful if you did these renamings in separate PRs.
@@ -724,6 +706,7 @@ getTeamMemberH :: | |||
Sem r Response | |||
getTeamMemberH (zusr ::: tid ::: uid ::: _) = do | |||
(member, withPerms) <- getTeamMember zusr tid uid | |||
-- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, except for the missing schema. I guess since we don't need this endpoint at all, it's maybe better if we just remove it instead of servantifying it (and then we don't need the missing schema either).
I left some minor comments, most of which are about mistakes that I made.
|
||
deriving instance Show (PermissionType tag) => Show (TeamMember' tag) | ||
|
||
deriving instance Generic (TeamMember' tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one instance has no context, so it doesn't need to be standalone.
-- FUTUREWORK: | ||
-- There must be a cleaner way to do this, with a separate type | ||
-- instead of logic in the JSON instance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove this FUTUREWORK now.
|
||
deriving instance (Show (PermissionType tag)) => Show (NewTeamMember' tag) | ||
|
||
deriving instance (Generic (PermissionType tag)) => Generic (NewTeamMember' tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need a context, so it can also be a normal deriving
clause.
invitation :: Lens' TeamMember (Maybe (UserId, UTCTimeMillis)) | ||
invitation = newTeamMember . nInvitation | ||
|
||
-- JSON serialisation utilities (TODO: remove after servantification) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since these are staying for the time being, we should turn the TODO
into a FUTUREWORK
.
@@ -724,6 +706,7 @@ getTeamMemberH :: | |||
Sem r Response | |||
getTeamMemberH (zusr ::: tid ::: uid ::: _) = do | |||
(member, withPerms) <- getTeamMember zusr tid uid | |||
-- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- pure $ member & permissions .~ \p -> guard (withPerms member) $> p |
|
I merged the schemas for binding and non-binding |
https://wearezeta.atlassian.net/browse/SQSERVICES-1011
Checklist
changelog.d
.