forked from microsoftgraph/microsoft-graph-explorer-v4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: add version select (microsoftgraph#215)
* 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
- Loading branch information
Showing
11 changed files
with
114 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ export function sampleQuery(state = {}, action: IAction): any { | |
default: | ||
return state; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { GRAPH_URL } from '../services/graph-constants'; | ||
|
||
export function parseSampleUrl(url: string, version?: string) { | ||
let requestUrl = ''; | ||
let queryVersion = ''; | ||
let sampleUrl = ''; | ||
let search = ''; | ||
|
||
if (url !== '') { | ||
const urlObject: URL = new URL(url); | ||
requestUrl = urlObject.pathname.substr(6).replace(/\/$/, ''); | ||
queryVersion = (version) ? version : urlObject.pathname.substring(1, 5); | ||
search = decodeURI(urlObject.search); | ||
sampleUrl = `${GRAPH_URL}/${queryVersion}/${requestUrl + search}`; | ||
} | ||
|
||
return { queryVersion, requestUrl, sampleUrl, search }; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.