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

Try-it button opens a blank window in some concept topics in Microsoft Graph docs #843

Closed
angelgolfer-ms opened this issue Feb 11, 2021 · 4 comments · Fixed by #966
Closed
Assignees
Labels
Area: Try-it priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days. promote type:bug Something isn't working

Comments

@angelgolfer-ms
Copy link

angelgolfer-ms commented Feb 11, 2021

Describe the bug
Try-it button appears in some concept topics in Microsoft Graph docs but opens a blank window, like enable online meeting in Outlook, share or delegate calendar.

To Reproduce
Steps to reproduce the behavior:

  1. Open this topic in a browser: https://docs.microsoft.com/en-us/graph/outlook-share-or-delegate-calendar
  2. Scroll down to the first REST query example (GET https://graph.microsoft.com/beta/users/AlexW@contoso.OnMicrosoft.com/calendar/calendarPermissions).
  3. Click the Try It button.
  4. Wait for a minute to verify that nothing is going to be displayed in the right pane in the browser.

Expected behavior
If the snippet tool enables the try-it capability in a concept topic (inserts the ```msgraph-interactive tag) and inserts the try-it button for an example REST request, then clicking the button should open Graph Explorer side-by-side on the right pane in the browser.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Edge
  • Version 88.0.705.63 (Official build) (64-bit)

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.
Blank try-it pane in concept topic

AB#8114

@ghost ghost added the ToTriage label Feb 11, 2021
@ghost ghost added this to To do in Graph Explorer V4 Feb 11, 2021
@Shjokie Shjokie added type:bug Something isn't working Bug – P1 promote labels Feb 11, 2021
@thewahome thewahome self-assigned this Feb 11, 2021
@ghost ghost removed the ToTriage label Feb 11, 2021
@thewahome
Copy link
Collaborator

thewahome commented Mar 12, 2021

I had a chat offline with @angelgolfer-ms
The work from the team running the try-it experience from the concept docs would simply be to pass an empty list of permissions since the concept pages do not have a permissions block

Graph Explorer V4 automation moved this from To do to Done May 26, 2021
@thewahome thewahome reopened this May 31, 2021
Graph Explorer V4 automation moved this from Done to To do May 31, 2021
@thewahome
Copy link
Collaborator

thewahome commented May 31, 2021

The experimental fix to make the permissions optional failed
i.e changing permission: string[]; to permission?: string[]; so that the team does not need to pass a permissions property to the iframe

@thewahome
Copy link
Collaborator

There are two types of pages:

  1. API pages
  2. Concept pages

The technical difference with the pages that's related to this task is that Concept pages do not have a permissions block.
The contract between the docs pages and Graph Explorer as they load the iframe is this:

export interface IInitMessage {
  /** Message type. */
  type: 'init';
  /** The user's locale on Docs. */
  locale: string;
  /** The current Docs theme. */
  theme: 'light' | 'dark' | 'high-contrast';
  /** The text within the Docs code block. */
  code: string;
  /** Data extracted from the permissions table. Will be null if Docs cannot locate the permissions table. */
  permission: string[];
}

The work of the permissions property was historically to help in authentication with the required scopes. We do not require this now since we have the scope consent functionality.

The lack of a permissions block in a Concept page causes a failure in the logic that loads the iframe that houses Graph Explorer. Thus the work here is for the docs team to remove the functionality to get the permissions altogether and pass an empty array into the IInitMessage contract.

Thus this:

		const rootElement = document.getElementById('main') as HTMLDivElement;
		const permissions = getPermissions(rootElement);

		// data to send to postMessage instead of passing via query strings
		const initMessage: DocsMessage = {
			type: 'init',
			locale: msDocs.data.userLocale,
			theme: currentTheme,
			code: '', // this is determined when we know what try it button the user clicked
			permissions
               };

Should change to:

	       const rootElement = document.getElementById('main') as HTMLDivElement;
		// data to send to postMessage instead of passing via query strings
		const initMessage: DocsMessage = {
			type: 'init',
			locale: msDocs.data.userLocale,
			theme: currentTheme,
			code: '', // this is determined when we know what try it button the user clicked
			Permissions: []
               };

@thewahome thewahome added the status:by-design This will not be worked on because it's by design label Jun 2, 2021
@thewahome
Copy link
Collaborator

The docs team has agreed to tackle the problem and has created a work-item here. We will close this once they are done.

@adhiambovivian adhiambovivian added priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days. and removed status:by-design This will not be worked on because it's by design Bug – P1 labels May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Try-it priority:p1 High priority but not blocking. Causes major but not critical loss of functionality SLA <=7days. promote type:bug Something isn't working
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

6 participants