Skip to content
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

Merged
merged 9 commits into from
Oct 9, 2017
Merged

Conversation

petschekr
Copy link
Member

@petschekr petschekr commented Oct 9, 2017

  • Adds a bunch more information accessible via the GraphQL API such as:
    • Search result information (offset, count, total matching)
    • Login methods and admin status for users
    • Name of team
    • Label of form items (not just name)
    • Human formatted file size
  • Allows you to search through applicants by name or email
  • You can enable or disable searching with regular expressions
  • Filter by confirmed / not confirmed in addition to accepted / no decision
    • (Filtering by confirmed / not confirmed only searches through accepted applicants)

Probably coming soon:tm:: displaying confirmation data in addition to the application data already present

Closes #183

@petschekr petschekr added enhancement Adds or suggests a new feature, rewrite, or other enhancement to the codebase high priority labels Oct 9, 2017
@petschekr petschekr added this to the HackGT 4 milestone Oct 9, 2017
@hackgbot
Copy link

hackgbot commented Oct 9, 2017

Hey y'all! A deployment of this PR can be found here:
https://registration-search-applicants.pr.hack.gt

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is SearchResult nullable?

Copy link
Member Author

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>
Copy link
Member

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)?

Copy link
Member Author

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 {
Copy link
Member

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
Copy link
Member

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?

Copy link
Member Author

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) {
Copy link
Member

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

@petschekr petschekr merged commit bb30d43 into master Oct 9, 2017
@petschekr petschekr deleted the search-applicants branch February 25, 2019 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adds or suggests a new feature, rewrite, or other enhancement to the codebase high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants