-
Notifications
You must be signed in to change notification settings - Fork 84
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: list all permissions #477
Conversation
This seems like it might be difficult to discover based in settings would be my concern. seems like somewhere on the modify permissions tab is where i'd first look. |
@@ -9,47 +13,60 @@ export function fetchScopesSuccess(response: object): IAction { | |||
}; | |||
} | |||
|
|||
export function fetchScopesPending(): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any [](start = 38, length = 3)
i know you don't like creating an interface for something this simple but it really does help keep the code more readable and maintainable.
@@ -11,15 +11,21 @@ export function scopes(state = initialState, action: IAction): any { | |||
switch (action.type) { | |||
case FETCH_SCOPES_SUCCESS: | |||
return { | |||
...state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...state [](start = 8, length = 8)
wouldn't this still be good to have in case the state object ever adds new items.
data: {}, | ||
error: null | ||
}; | ||
export function snippets(state = initialState, action: IAction): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any [](start = 65, length = 3)
great place to use typescript to ensure the type coming out is the state type. #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can create a base type for all the initial states that involve fetching data from APIs other than graph can inherit from so that it can be consistent,
This is some chunk of work which will make this PR a headache to review. I can add this to the backlog as technical debt... #Resolved
src/messages/GE.json
Outdated
"Fetching code snippet": "Fetching code snippet", | ||
"Snippet not available": "Snippet not available" | ||
"Snippet not available": "Snippet not available", | ||
"Select different permissions": "To try out Microsoft Graph API endpoints, select different permissions then click Consent", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like how classic links to the permissions page which gives you a little bit better idea of what messing with the different permissions will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add the link to the permissions page on the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not blocking this PR for me. Can be done on another change
Fixes AB#4427 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thewahome I tested this with my Microsoft account and didn't see any delegated permissions. I thought it was a bug. Can you add a message letting the user know they have no delegated permissions?
Also, the panel doesn't open immeadiately after closing it.
export function consentToScopes(scopes: string[]): Function { | ||
return async (dispatch: Function) => { | ||
const authResponse = await acquireNewAccessToken(scopes); | ||
if (authResponse && authResponse.accessToken) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to have an authResponse
that doesn't have an accessToken
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jobala I want to say there is :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not repeat ourselves
@@ -25,7 +25,7 @@ export function fetchSamplesPending(): any { | |||
export function fetchSamples(): Function { | |||
return async (dispatch: Function, getState: Function) => { | |||
const devxApi = getState().devxApi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: Use object destructuring
const { devxApi } = getState()
Good catch on the accessibility error... Localisation strings get updated once we make a merge to dev. However I see that our current implementation of using 'injectIntl' method instead of the FormattedMessage tag fails to give us a fallback string. I am going to tackle this as its own work item |
Please link the work item to this PR. |
Should be fixed when #490 is done |
@thewahome link the accesibility bug then this will be good to go. |
Done #495 |
* shows message to direct users to the full graph explorer * hides the auth tab in try it * add function to delete items in bulk from storage * enables removal of bulk items from state * adds functionality to remove items in bulk from UI * changes text to get more features * increases padding between spinner and message * disables query sharing from the try-it experience * disables response expansion in try it * prevents response flickering after version change * attempts to fix sign in errors in edge * abstracts the create share link functionality * appends created share link to the try-it full experience url * renames query to shareableLink * reduces code into one-liner * renames action to be triggered * sets the production url as the share location * adds dialog to confirm deletion * fixes linting error * stops showing authentication text when minimised * adds localisation for history delete * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Check for instumentation key * Fix prop errors * Refactor getInstrumentationKey * Remove unused variable * increases spacing in profile to show names properly * changes wording and colour on info bar * shares link with authentication token * Sanitise url * commit translated contents * adds the language to the share liink * commit translated contents * replaces access token with email address in share link * adds a dialog to prompt mismatched users to login * commit translated contents * commit translated contents * commit translated contents * renames auth tab and snippets tabs * improves display of auth token * renames the Officedev link * adds modify permissions labelling * changes naming styles to sentence case * changes wording on delete history feature * adds tooltip message to share query and expand response button * adds a close button to expanded response * commit translated contents * fixes re-rendering problems on query response * Experiment: Check if a user can switch context without logging in * shows message instead of components when history items are missing * Fix lint errors * commit translated contents * commit translated contents * commit translated contents * Ask user to sign in if no session id * Asks user to log in if they do not have a session id * changes implementation from using an email to a session id * adds the language to the share link * commit translated contents * checks authentication status before creating link * adds the category to filters in the sidebar * bumps version to 4.0.5 * commit translated contents * commit translated contents * commit translated contents * adds tests for sample url generation * adds checks to url generation steps * utilises the parseUrl function for consistency * prevents fetching of scopes if url is invalid * fixes permissions error when url invalid * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Get instrumentation key from window object * Use dot instead of string * refactors showProfile logic to show correct profile * enhance vertical alignment * handles errors in catch statements; line spacing improvements * fixes faulty url encoding in the url * only show get requests - anonymous try-it * prepares march 17 2020 release * Bump acorn from 5.7.3 to 5.7.4 Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@5.7.3...5.7.4) Signed-off-by: dependabot[bot] <support@github.com> * shows long endpoints * increases padding in search texts * give context to the search place holder * moves files to feature folders * enables headers scrolling * remove cartoon references * adds icons to pivot items * displays icons only when on mobile view * adds an authentication required icon * displays tip after 403 error * change header names and add them to localisation * adds descriptive text to permissions tab * remove har as a property of Ihistory item * export query * exports bulk items * change modify permissions message * add aria controls to localization; hide icon when logged in * append category name to exported history item * change the privacy statement layout and words * change empty access token wording * adds a descriptive phrase below the samples tab * fix linting errors * adds headers tp share query link * refactor sample headers to display shared headers * fix linting errors * remove request headers reducers tests * change default value * use autolayout grids * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * fixes enter key press not running new query * add tooltips to the pivot items * add tooltip to request pivot items * fix linting errors * bump to v4.1.0 * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: align try it scroll bars (#478) * Feature: list all permissions (#477) * change samples endpoint * creates a new setting to handle permissions * changes permission to allow panel view and tab view * allow consent of multiple items at a go * enhance action creator to take state's url * enhance permissions hooks to enable dispatch fetchScopes * perform search when sample url changes * change snippets to use state devX api url * fix failing test * fix liniting errors * subscribe permissions to selected verb * move consent function to action creator for reusability * displays the permissions in order when in the panel * adds sorting tests * remove bulk permissions consent * create groups to categorise permissions * convert to class component :-( * select multiiple permissions for consent * accessibility edits * Improve messaging * display message of empty permissions * use object destructuring * change settings class component to hooks to fix close/reopen bug * Feature: Display blue dot present adaptive cards (#493) * create blue dot on tab * abstract adaptive cards lookup function * display dot on adaptive cards title when card template is present * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: responsive views (#496) * add app sections to make app.tsx more readable * treat screens with width less than 992px as mobile screens At point 992 is where the screen breaks * Fix: provide account choice on sign in (#497) * commit translated contents * Fix: Share query errors (#501) * fixes header undefined error when sharing link * add null check for headers passed from url * Fix: Stop Infinite spinning when login fails (#492) * stop infinite spinning and display error * add status text to localisation * fix failing internationalization * FIx: Build static assets for master & dev (#498) * Build static assets for master & dev * Build prod assets with prod client id * Fix typo * Fix typo in yml * Fix: try it logout (#502) * displays authentication section * enables logging out using a popup * add try it check when displaying authentication * Feature: add locale to headers devxapi (#500) * add accept-language to queries to the devxApi * remove localisation from sample queries * add placeholder texts to localisation * reuse locale code to enable url overriding * add reference to new translation files * delete unused translation files * add try catch to sample queries fetch * Fix: Remove redundant authentication (#518) * Task: responsive sidebar (#519) * bump breakpoint to 1260px * remove comments * Task: translate key value pair (#517) * Task: Remove opt out toggle (#516) * remove opt out toggle * remove opt out function * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Task: GA bug bash (#526) * add tooltip on the sample query name * add current locale to all links * fix permissions column misalignment * fix permissions tooltip mismatch * Fix: sidebar http methods (#527) * fixes unresponsive method badge * adds horizontal scrolling to the sidebar * Fix: Portuguese locale not loading (#529) * Task: refine permission column sizes (#528) * Fix: Misaligned sidebar elements (#530) * Task: localised login popup (#534) * Task: display settings icon mobile view (#535) * display the auth and settings on sidebar in mobile view * align auth to the left instead of indented * only show adaptive card after response is set * Release: 4.1.1 (#536) * bump to version 4.1.1 * create build files for 4.1.1 * Fix: remove duplicate content type header (#537) * dispatch thrown response * remove content type header * add comment on the reliance on the graph client * bump version to 4.1.2 * create build files Co-authored-by: Japheth Obala <japhethobalak@gmail.com> Co-authored-by: olprod <olprod@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* commit translated contents * Check for instumentation key * Fix prop errors * Refactor getInstrumentationKey * Remove unused variable * increases spacing in profile to show names properly * changes wording and colour on info bar * shares link with authentication token * Sanitise url * commit translated contents * adds the language to the share liink * commit translated contents * replaces access token with email address in share link * adds a dialog to prompt mismatched users to login * commit translated contents * commit translated contents * commit translated contents * renames auth tab and snippets tabs * improves display of auth token * renames the Officedev link * adds modify permissions labelling * changes naming styles to sentence case * changes wording on delete history feature * adds tooltip message to share query and expand response button * adds a close button to expanded response * commit translated contents * fixes re-rendering problems on query response * Experiment: Check if a user can switch context without logging in * shows message instead of components when history items are missing * Fix lint errors * commit translated contents * commit translated contents * commit translated contents * Ask user to sign in if no session id * Asks user to log in if they do not have a session id * changes implementation from using an email to a session id * adds the language to the share link * commit translated contents * checks authentication status before creating link * adds the category to filters in the sidebar * bumps version to 4.0.5 * commit translated contents * commit translated contents * commit translated contents * adds tests for sample url generation * adds checks to url generation steps * utilises the parseUrl function for consistency * prevents fetching of scopes if url is invalid * fixes permissions error when url invalid * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Get instrumentation key from window object * Use dot instead of string * refactors showProfile logic to show correct profile * enhance vertical alignment * handles errors in catch statements; line spacing improvements * fixes faulty url encoding in the url * only show get requests - anonymous try-it * prepares march 17 2020 release * Bump acorn from 5.7.3 to 5.7.4 Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](acornjs/acorn@5.7.3...5.7.4) Signed-off-by: dependabot[bot] <support@github.com> * shows long endpoints * increases padding in search texts * give context to the search place holder * moves files to feature folders * enables headers scrolling * remove cartoon references * adds icons to pivot items * displays icons only when on mobile view * adds an authentication required icon * displays tip after 403 error * change header names and add them to localisation * adds descriptive text to permissions tab * remove har as a property of Ihistory item * export query * exports bulk items * change modify permissions message * add aria controls to localization; hide icon when logged in * append category name to exported history item * change the privacy statement layout and words * change empty access token wording * adds a descriptive phrase below the samples tab * fix linting errors * adds headers tp share query link * refactor sample headers to display shared headers * fix linting errors * remove request headers reducers tests * change default value * use autolayout grids * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * fixes enter key press not running new query * add tooltips to the pivot items * add tooltip to request pivot items * fix linting errors * bump to v4.1.0 * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: align try it scroll bars (#478) * Feature: list all permissions (#477) * change samples endpoint * creates a new setting to handle permissions * changes permission to allow panel view and tab view * allow consent of multiple items at a go * enhance action creator to take state's url * enhance permissions hooks to enable dispatch fetchScopes * perform search when sample url changes * change snippets to use state devX api url * fix failing test * fix liniting errors * subscribe permissions to selected verb * move consent function to action creator for reusability * displays the permissions in order when in the panel * adds sorting tests * remove bulk permissions consent * create groups to categorise permissions * convert to class component :-( * select multiiple permissions for consent * accessibility edits * Improve messaging * display message of empty permissions * use object destructuring * change settings class component to hooks to fix close/reopen bug * Feature: Display blue dot present adaptive cards (#493) * create blue dot on tab * abstract adaptive cards lookup function * display dot on adaptive cards title when card template is present * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Fix: responsive views (#496) * add app sections to make app.tsx more readable * treat screens with width less than 992px as mobile screens At point 992 is where the screen breaks * Fix: provide account choice on sign in (#497) * commit translated contents * Fix: Share query errors (#501) * fixes header undefined error when sharing link * add null check for headers passed from url * Fix: Stop Infinite spinning when login fails (#492) * stop infinite spinning and display error * add status text to localisation * fix failing internationalization * FIx: Build static assets for master & dev (#498) * Build static assets for master & dev * Build prod assets with prod client id * Fix typo * Fix typo in yml * Fix: try it logout (#502) * displays authentication section * enables logging out using a popup * add try it check when displaying authentication * Feature: add locale to headers devxapi (#500) * add accept-language to queries to the devxApi * remove localisation from sample queries * add placeholder texts to localisation * reuse locale code to enable url overriding * add reference to new translation files * delete unused translation files * add try catch to sample queries fetch * Fix: Remove redundant authentication (#518) * Task: responsive sidebar (#519) * bump breakpoint to 1260px * remove comments * Task: translate key value pair (#517) * Task: Remove opt out toggle (#516) * remove opt out toggle * remove opt out function * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Task: GA bug bash (#526) * add tooltip on the sample query name * add current locale to all links * fix permissions column misalignment * fix permissions tooltip mismatch * Fix: sidebar http methods (#527) * fixes unresponsive method badge * adds horizontal scrolling to the sidebar * Fix: Portuguese locale not loading (#529) * Task: refine permission column sizes (#528) * Fix: Misaligned sidebar elements (#530) * Task: localised login popup (#534) * Task: display settings icon mobile view (#535) * display the auth and settings on sidebar in mobile view * align auth to the left instead of indented * only show adaptive card after response is set * Release: 4.1.1 (#536) * bump to version 4.1.1 * create build files for 4.1.1 * Fix: remove duplicate content type header (#537) * dispatch thrown response * remove content type header * add comment on the reliance on the graph client * Release/v4.1.2 (#538) * bump version to 4.1.2 * create build files * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * commit translated contents * Make Run Query button responsive * Fix indentation * Fix: select permissions pop up (#559) * fully closes the select permissions panel * remove false authenticated check * Fix: lowercase locales (#551) * change share query location from preview * adds a redirecturi in lowercase when signing in * localise locale section * Fix: snippets generation for queries with search parameters (#549) * re-render list when user consents to permission * Support for tenanted endpoint in Graph explorer. Currently to go a tenant in Graph Explorer, we need to create a local account in tenant. After this change a tenantId queryString parameter can be passed and then all login requests will go to that tenant. sample request https://developer.microsoft.com/en-us/graph/graph-explorer?tenantId=abc.onmicrosoft.com if no tenantId is specified, the request goes to common endpoint. Tested the redirection is happening correctly. * fixed lint errors * working changes * doe * displays logout option in dropdown on smaller screens * fixes documentation link colour and responsiveness * adds a token for user-id in the presence api * Updated redirect URI * linting checks * view query when history item is clicked * add json validation for sample queries * add message to localisation * add action to message * bump to version 4.1.3 * add 4.1.3 build files Co-authored-by: olprod <olprod@microsoft.com> Co-authored-by: jobala <japhethobalak@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Abhishek Agrawal <abhiagr@microsoft.com>
Overview
Adds the ability to see all the delegated permissions available to a GE user.
A sliding panel is available behind the gear icon for logged in users and gives a user the opportunity to consent to multiple permissions at a go.
Fixes #471 and AB#4427
Demo
How to activate:
![image](https://user-images.githubusercontent.com/58787602/79737439-fc583080-8303-11ea-8610-7768bfca152e.png)
Permissions display
![image](https://user-images.githubusercontent.com/58787602/79737344-dd599e80-8303-11ea-8724-d4bb624c5e60.png)
Notes
Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.
Testing Instructions
*Click the gear icon