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

Fix: add version select #215

Merged
12 commits merged into from
Oct 16, 2019
Merged

Fix: add version select #215

12 commits merged into from
Oct 16, 2019

Conversation

ghost
Copy link

@ghost ghost commented Oct 14, 2019

Overview

Adds a version selector option
The version selection changes automatically when you select queries from the sidebar.

Improves #205
Fixes #200

Demo

image

Testing Instructions

  • Change the version from v1.0 to beta and notice how the query url changes
  • Click on a url in the queries and notice the change in the version selector

Kachulio1 and others added 4 commits October 14, 2019 12:09
* add urlVersions type

* add version handler function

* add version dropdown

* change the version to lowerCase

* change the url version
@ghost ghost requested review from irvinesunday and andrueastman October 14, 2019 11:41
@ghost ghost changed the title Fix/add version select Fix: add version select Oct 14, 2019
@ghost ghost requested a review from jobala October 15, 2019 08:16
irvinesunday
irvinesunday previously approved these changes Oct 15, 2019
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.

In the current version of Graph Explorer changing the version in the URL changes the selected version in the version dropdown. I am assuming this is how this feature should behave as well. @bettirosengugi is this correct?

@jobala
Copy link
Contributor

jobala commented Oct 15, 2019

@bettirosengugi a while back there was the issue reported by @jthake-msft where for certain screen sizes the http methods were shown to have an ellipsis ie D... for DELETE. This implementation will re-introduce that behaviour. Please advise.

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.

Requesting changes so that this is merged after we have resolved the ongoing conversations.

@Shjokie
Copy link
Contributor

Shjokie commented Oct 15, 2019

@bettirosengugi a while back there was the issue reported by @jthake-msft where for certain screen sizes the http methods were shown to have an ellipsis ie D... for DELETE. This implementation will re-introduce that behaviour. Please advise.

@jobala why don't we have the same issue in classic yet it has the three tabs (Request Options, Version and query tabs) ? May be investigate?

@Shjokie
Copy link
Contributor

Shjokie commented Oct 15, 2019

In the current version of Graph Explorer changing the version in the URL changes the selected version in the version dropdown. I am assuming this is how this feature should behave as well. @bettirosengugi is this correct?

This is correct to give an example if the version selected is V1, the url for /me should be https://graph.microsoft.com/v1.0/me and when you change the version to beta the url should change to https://graph.microsoft.com/beta/me and the selected version should show on the drop down tab.

@cwahome @jobala

@jobala
Copy link
Contributor

jobala commented Oct 15, 2019

This is correct to give an example if the version selected is V1, the url for /me should be https://graph.microsoft.com/v1.0/me and when you change the version to beta the url should change to https://graph.microsoft.com/beta/me

There's also a third type of url version other. This is used when a user specifies a version that is neither v1.0 nor beta.

@jobala
Copy link
Contributor

jobala commented Oct 15, 2019

why don't we have the same issue in classic yet it has the three tabs (Request Options, Version and query tabs) ? May be investigate?

That's a good question. AFAIK classic uses MWF and v2 uses Fabric, these are different component providers. It's worth investigating.

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.

    const requestUrl = query.url.replace(GRAPH_URL, '');
    const queryVersion = requestUrl.substring(1, 5);

The above code snippet has been duplicated in various places. It will be wise to abstract it into a function.

Why do we need a reducer and an action-creator for the version selector?

src/app/views/query-runner/QueryRunner.tsx Outdated Show resolved Hide resolved
src/app/views/query-runner/QueryRunner.tsx Outdated Show resolved Hide resolved
src/app/views/sidebar/history/History.tsx Outdated Show resolved Hide resolved
@ghost
Copy link
Author

ghost commented Oct 15, 2019

In the current version of Graph Explorer changing the version in the URL changes the selected version in the version dropdown...

Now changes when you change the url in the editor. Good catch @jobala

@bettirosengugi a while back there was the issue reported by @jthake-msft where for certain screen sizes the http methods were shown to have an ellipsis ie D... for DELETE. This implementation will re-introduce that behaviour. Please advise.

I have improved the column definitions to reduce the need for the ellipsis in smaller screen sizes

The above code snippet has been duplicated in various places. It will be wise to abstract it into a function.

I have added a utility function for reuse for this.

Why do we need a reducer and an action-creator for the version selector?

The version is used and changed at different points of the application.

@ghost ghost merged commit 9bdd6b2 into dev Oct 16, 2019
@andrueastman andrueastman deleted the fix/add-version-select branch October 16, 2019 11:24
asith-w pushed a commit to asith-w/microsoft-graph-explorer-v2 that referenced this pull request Nov 7, 2019
* Add version select (microsoftgraph#205)

* add urlVersions type

* add version handler function

* add version dropdown

* change the version to lowerCase

* change the url version

* moves version selection to redux

* moves state properties from query runner to input

* changes to appropriate query version when query clicked

* adds tests for SELECT_VERSION_SUCCESS

* adds displayRequestComponent toggle for try it

* renames selectQueryVersion to setQueryVersion

* describes options variable as urlVersion | method

* creates and utilises a function to parse urls to sample urls

* sets the selected version when editor changed

* increases control sizes to reduce ellipsis use

* moves selectedVersion to sampleQuery property
This pull request was closed.
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.

Add the version selection bar
5 participants