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

Feature: autocomplete #480

Merged
merged 100 commits into from
Nov 30, 2020
Merged

Feature: autocomplete #480

merged 100 commits into from
Nov 30, 2020

Conversation

thewahome
Copy link
Collaborator

@thewahome thewahome commented Apr 20, 2020

Overview

Integrates with the open api endpoint of the devx api
Fixes #343 AB#4591

Tasks

  • Create redux service

  • Connect to available query parameters

  • Create autocomplete component

  • Give autocomplete component all the functionalities of the url text field

  • Populate autocomplete component with available query parameter results

  • Enable drilling into the properties of the listed query parameters

  • Support requests other than GET requests

  • Support requests with IDs

  • Connect to links

  • Enable keyboard navigation when selecting options provided

  • Show root entities when no query is passed

Commands

  • esc - dismisses suggestions
  • / or ? or CTRL+. or CTRL+space - initiates autocomplete
  • tab or enter - selects autocomplete option
  • up or down - navigates through autocomplete options available

@thewahome thewahome marked this pull request as draft April 21, 2020 08:32
@thewahome thewahome marked this pull request as ready for review April 24, 2020 10:04
@thewahome thewahome requested review from jobala and ddyett April 24, 2020 10:04
Copy link
Contributor

@jobala jobala left a comment

Choose a reason for hiding this comment

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

Enhancements

  • Show a spinner when we are fetching auto complete options, that way a user knows that the application is getting them auto complete features.
  • Let us cache results if the url doesn't change

Recommendation

  • Some functions are large and do multiple things. Break down the functions so that they do one and only thing.
  • Let us use meaningful variable names

@thewahome thewahome mentioned this pull request Apr 27, 2020
3 tasks
@thewahome thewahome linked an issue Oct 6, 2020 that may be closed by this pull request
* trigger setsuggestions with key combination

* filter recreated suggestions

* append selected suggestion

* fix failing query parameter re-triggering

* combine if checks

* fix linting errors
* trigger setsuggestions with key combination

* filter recreated suggestions

* append selected suggestion

* fix failing query parameter re-triggering

* combine if checks

* fix linting errors

* trigger api call via key combinations

* retrigger previous suggestions

* add checks for compare string
@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-480.centralus.azurestaticapps.net

@microsoftgraph microsoftgraph deleted a comment from github-actions bot Oct 13, 2020
@microsoftgraph microsoftgraph deleted a comment from github-actions bot Oct 13, 2020
@microsoftgraph microsoftgraph deleted a comment from github-actions bot Oct 13, 2020
@microsoftgraph microsoftgraph deleted a comment from github-actions bot Oct 13, 2020
@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-480.centralus.azurestaticapps.net

* chore(release): 4.1.9

* Add query url normalization function

* Populate QuerySignature property with normalized query url

* Update how query parameters are fetched for telemetry processing

* Rename query url normalization to sanitization

* add tests to check sanitized urls

* add property for expected result

* task:enhance sanitise query function (#743)

* check url segments with special characters

* add tests for the queries

* replace items with special characters in the request url

* checks for alphanumeric identifiers in the url

* add test for url with all parameters replaced

* add type check to special characters function

* split identifier check into functions

* add numeric string check for ids with pure numeric numbers

* ignore sanitisation if segment is fully alphabetic

* call api using url signature
* move auto-complete components to own folder

* fetch content from autocomplete store

* add ttl for cached items

* specify function return type

* enable hashing of the url to improve performance

* create suggestions module

* use suggestions module in action creator

* rename suggestion methods

* create barrel file

* change naming conventions

* make fetchsuggestions function private
@darrelmiller
Copy link
Contributor

@thewahome @irvinesunday I'm assuming at somepoint there was a decision made to drop the host from the URL. The problem seems to be that in dropping the host we also dropped the version.

https://graphexplorerapi.azurewebsites.net/openapi?url=/&style=geautocomplete

There does not seem to be any way to get different autocomplete for V1 vs beta. Can we put the full URL back?

@irvinesunday
Copy link
Contributor

irvinesunday commented Nov 25, 2020

@thewahome @irvinesunday I'm assuming at somepoint there was a decision made to drop the host from the URL. The problem seems to be that in dropping the host we also dropped the version.

https://graphexplorerapi.azurewebsites.net/openapi?url=/&style=geautocomplete

There does not seem to be any way to get different autocomplete for V1 vs beta. Can we put the full URL back?

@darrelmiller GE can send DevX API the request: /geautocomplete?url=/me&graphVersion=v1.0 for autocomplete and https://graphexplorerapi.azurewebsites.net/openapi?url=/&style=geautocomplete&graphVersion=v1.0 for OpenAPI operations and DevX API should be able to handle fetching OpenAPI descriptions from either v1.0 or beta endpoints. There is already support for this in DevX API. We need to keep the url relative since we are now doing strict regex matching of the entire url.

@github-actions
Copy link
Contributor

Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-480.centralus.azurestaticapps.net

@thewahome thewahome merged commit 0648f1e into dev Nov 30, 2020
ElinorW added a commit that referenced this pull request Dec 9, 2020
* Telemetry: Normalize Query URL and Redact PII (#734)

* Feature: autocomplete (#480)

* Localized GE.jsons HB (#776)

* Prevent remote dependency and trace information telemetry types from being captured (#770)

* Fix: sample query sample body (#775)

* Fix: stop display of options when fetching suggestions (#778)

* add aria-label (#780)

* chore(release): 4.1.12
@millicentachieng millicentachieng deleted the feature/autocomplete branch January 28, 2021 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants