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 field for a SHA, with autocomplete #689

Merged
merged 12 commits into from
Oct 30, 2018
Merged

Add field for a SHA, with autocomplete #689

merged 12 commits into from
Oct 30, 2018

Conversation

lukebjerring
Copy link
Contributor

Description

Starting towards #687 (for the all-the-same SHA case)

Adds a WPT flag for queryBuilderSHA which supports fetching the /api/shas endpoint for the current query, and populating the autocomplete of the SHA field using possibilities.

Review Information

Visit /flags, enable both queryBuilder and queryBuilderSHA, type stuff.

@lukebjerring lukebjerring requested a review from Hexcles October 24, 2018 19:43
@wpt-pr-bot
Copy link

Staging instance deployed by Travis CI!
Running at https://sha-dot-wptdashboard-staging.appspot.com

Copy link
Member

@Hexcles Hexcles left a comment

Choose a reason for hiding this comment

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

LGTM % a nit

let same = true;
for (let i = 0; i < shas.length && same; i++) {
if (i >= curr.length || shas[i] !== curr[i]) {
same = false;
Copy link
Member

Choose a reason for hiding this comment

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

A few suggestions about this loop:

  1. Why do we need to check i >= curr.length? The whole loop only runs if curr and shas have the same length.
  2. We can simply break here, instead of checking same every time.
  3. Once 1 & 2 are done, then we can simplify the 3-clause for into a for...of (which, unlike for...in, is guaranteed to iterate in order).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to match the versions autocomplete logic I simplified earlier today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants