-
Notifications
You must be signed in to change notification settings - Fork 333
Search contacts by email inside team. #1286
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
Conversation
daec004
to
7721e35
Compare
@fisx Feel free to "review" :) |
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.
services/brig/src/Brig/IO/Intra.hs
Outdated
@@ -172,9 +173,10 @@ updateSearchIndex orig e = case e of | |||
or | |||
[ isJust eupName, | |||
isJust eupAccentId, | |||
isJust eupHandle | |||
isJust eupHandle, | |||
isJust eupManagedBy |
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.
what about idp, role?
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.
@smatting Wanted to split this into two PRs I think. One for the general search endpoint and another one for sorting and filtering for these additional properties.
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.
idp: I've added a commit for that
role: not possible (easily) as this change to role originates in galley and I couldn't find an existing mechanism for creating Event
s (Brig.User.Event
) externally
Doc.response 200 "The search result." Doc.end | ||
|
||
get "/teams/:tid/search" (continue browseTeamH) $ |
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.
With this route, should it be moved to the module where the other routes under /teams/:tid/
are stored?
Donno, our routing table tree is a bit out of sorts anyway, so I'm not sure how to keep this from getting worse. Leaving it here makes sense because it's also about searching.
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.
Generally /teams/{tid}/...
makes sense when you need the teamId
. That would match the pattern for most of the team endpoints looking from the outside.
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'd also prefer keeping it closer to search and the cost to lookup a path in the code is quite low
withSettingsOverrides newOpts f <* deleteIndex opts indexName | ||
withSettingsOverrides newOpts f |
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.
what's this about?
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.
left-over from debugging and accidentally commited. I reverted it
Co-authored-by: fisx <[email protected]>
Co-authored-by: fisx <[email protected]>
) -> | ||
Handler Response | ||
teamUserSearchH (_ ::: uid ::: tid ::: mQuery ::: mRoleFilter ::: mSortBy ::: mSortOrder ::: size) = do | ||
json <$> teamUserSearch uid tid mQuery (undefined mRoleFilter) mSortBy mSortOrder size |
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.
What is this undefined doing here?
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 was probably a reminder to not use this argument. mbRoleFilter
has the wrong type for the function call. A quick and dirty way to make the type checker happy. It wouldn't cause problems since mRoleFilter, mSortB, mSortOrder are not used, but I should have caught this in my review, and it shouldn't get released like this.
https://wearezeta.atlassian.net/browse/SQSERVICES-145
Stefan:
This PR adds a new endpoint
/teams/:tid/search
to brig that allows admins to search for team members. A reindex is required for this endpoint to work. If reindexing is skipped all existing endpoints that make use of ES are still fully functional.