-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add ability to search through applicants #186
Conversation
Hey y'all! A deployment of this PR can be found here: |
api.graphql
Outdated
@@ -13,7 +13,7 @@ type Query { | |||
# seen from the latest page retrieved, if you want the first page leave this out. | |||
users(pagination_token: ID, n: Int!, filter: UserFilter): [User!]! | |||
# Search through a user's name and email through regex | |||
search_user(search: String!, use_regex: Boolean = false, offset: Int!, n: Int!, filter: UserFilter): [User!]! | |||
search_user(search: String!, use_regex: Boolean = false, offset: Int!, n: Int!, filter: UserFilter): SearchResult |
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.
Is SearchResult nullable?
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.
No it's not, I'll fix that
</select> | ||
</th> | ||
<th> | ||
<select id="status-filter"> | ||
<option value="no-decision">No decision</option> | ||
<option value="accepted">Accepted</option> | ||
<option value="not-confirmed">Not confirmed</option> |
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 the difference between accepted and not-confirmed? Where does not-confirmed apply to a user (since a single application branch can potentially have multiple confirmation branches)?
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.
Accepted includes all accepted applicants regardless of whether or not they have confirmed whereas not confirmed only includes accepted applicants who have not confirmed
offset, | ||
count, | ||
total, | ||
users { |
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.
@illegalprime Is there a way to just specify "Get all info about the user"? That would clean up this query a lot
}, | ||
{ | ||
email: { | ||
$regex: queryRegExp |
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.
Do we have to worry about escaping here since this is user supplied input?
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.
Escaping happens on line 54 right above this. Input is normally escaped unless the user ticks the Use Regex box in which case it is directly passed through. I don't see any security implications to doing that because the regular expressions only retrieve data and because this feature is already restricted to admins only.
start_time: user.confirmationStartTime && | ||
user.confirmationStartTime.toDateString(), | ||
submit_time: user.confirmationSubmitTime && | ||
user.confirmationSubmitTime.toDateString() | ||
} : undefined; | ||
|
||
let loginMethods: string[] = []; | ||
if (user.githubData && user.githubData.id) { |
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.
Might want to refactor this later if we ever want to add other login providers in a modular way
…e, and form item labels to GraphQL API
869501e
to
b11bb20
Compare
25235be
to
f93e73b
Compare
Probably coming soon:tm:: displaying confirmation data in addition to the application data already present
Closes #183