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

Highlights the previously selected query #1006

Conversation

gracet9182
Copy link
Contributor

@gracet9182 gracet9182 commented Jun 30, 2021

Overview

  • Couldn't previously see which query was selected
  • Now highlights the previously selected query by allowing the color to be the same as when you hover over it

Demo

Graph.Explorer.and.16.more.pages.-.Work.-.Microsoft.Edge.2021-08-04.22-33-08.mp4

Testing Instructions

  • Checkout this branch
  • Run Graph Explorer locally
  • Select any query

@gracet9182 gracet9182 force-pushed the interns/gracet9182/38280-highlight-active-query branch from 50b5829 to 1aad577 Compare August 5, 2021 16:18
Comment on lines 35 to 39
groups: any[];
constructor(props: ISampleQueriesProps) {
super(props);
this.resetCollapse = true;
this.groups = [];
Copy link
Collaborator

@thewahome thewahome Aug 9, 2021

Choose a reason for hiding this comment

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

The variables groups and resetCollapse can be declared and initialized at the point of declaration instead of declaring outside the constructor then initialising inside the constructor

Copy link
Collaborator

Choose a reason for hiding this comment

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

On taking a second look, the two variables groups and resetCollapse are not necessary, since the selectedQuery state variable is present

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if (prevProps.samples.queries !== this.props.samples.queries) {
this.groups = generateGroupsFromList(sampleQueries, 'category');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Calculating it close to its point of need prevents having to track its location and state elsewhere in the page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it with 8c67a81 since your suggestion had it closer together to where it was needed

gracet9182 and others added 4 commits August 9, 2021 13:12
Co-authored-by: Charles Wahome <thewahome.cw@gmail.com>
Co-authored-by: Charles Wahome <thewahome.cw@gmail.com>
Co-authored-by: Charles Wahome <thewahome.cw@gmail.com>
@thewahome thewahome merged commit 47ba6c3 into microsoftgraph:dev Aug 10, 2021
thewahome added a commit that referenced this pull request Aug 10, 2021
thewahome added a commit that referenced this pull request Sep 1, 2021
* Feature: Highlights the previously selected query (#1006)

* Task: upgrade packages flagged by dependabot (#1054)

* Task: Fluent upgrade (#1056)

* Fix: ProfileType persistence (#1074)

* Enhancement: error hints (#1060)

* Bug: Persisting request body (#1055)

* Fix: Sample queries UI bugs (#1084)

* Fix: Disable aria-required children rule (#1080)

* Task: Fix failing profile test (#1086)

* Enhancement: permissions radio buttons change (#1087)

* Task: add English file transfer automation (#1075)
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.

2 participants