diff --git a/package-lock.json b/package-lock.json index 4e56fd50c..ee32a0cb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1109,9 +1109,9 @@ "integrity": "sha512-/aRXzHhaloOUdEPq1bUNYkriDGz984BUQcOab8222NWpTwycUad/dqjTlG8iI51vXqj4RFr1XGqUfamXBOIM+w==" }, "@microsoft/microsoft-graph-client": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-client/-/microsoft-graph-client-2.0.0.tgz", - "integrity": "sha512-njofq1RCCN41ZccJH6/akJWk64fl0k3Csvi1+WS4nKsuev0NqsnmmTYfSBC12GPLOHvZz6ygoGmvE6X8scKkdQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@microsoft/microsoft-graph-client/-/microsoft-graph-client-2.1.0.tgz", + "integrity": "sha512-2OjZjz9ink5cXdY3107ZaLe9E32muYhQJy7e0II9cPyBeOXnuJwySzXC4Fv3UhPO2CjVvysiHIQo5gfszIOJHw==", "requires": { "@babel/runtime": "^7.4.4", "tslib": "^1.9.3" diff --git a/package.json b/package.json index 2fcf4ec25..793eeeeee 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "@babel/core": "7.2.2", "@microsoft/applicationinsights-react-js": "2.3.1", "@microsoft/applicationinsights-web": "2.3.1", - "@microsoft/microsoft-graph-client": "2.0.0", + "@microsoft/microsoft-graph-client": "2.1.0", "@svgr/webpack": "4.1.0", "@uifabric/react-cards": "0.109.101", "@uifabric/styling": "7.13.1", diff --git a/src/app/services/actions/query-action-creator-util.ts b/src/app/services/actions/query-action-creator-util.ts index 6238854d3..01e24cc96 100644 --- a/src/app/services/actions/query-action-creator-util.ts +++ b/src/app/services/actions/query-action-creator-util.ts @@ -100,11 +100,6 @@ const makeRequest = (httpVerb: string, scopes: string[]): Function => { if (query.sampleHeaders && query.sampleHeaders.length > 0) { query.sampleHeaders.forEach(header => { - - // We are relying on the graph client to set the content type header. - if (header.name.toLowerCase() === 'content-type') { - return; - } sampleHeaders[header.name] = header.value; }); } diff --git a/src/app/views/query-runner/request/Request.tsx b/src/app/views/query-runner/request/Request.tsx index 8b706a4ad..7e4d03433 100644 --- a/src/app/views/query-runner/request/Request.tsx +++ b/src/app/views/query-runner/request/Request.tsx @@ -24,7 +24,6 @@ export class Request extends Component { handleOnEditorChange, sampleBody, mode, - mobileScreen, intl: { messages }, }: any = this.props; @@ -64,7 +63,7 @@ export class Request extends Component { itemIcon='AuthenticatorApp' onRenderItemLink={this.getTooltipDisplay} title={messages['Access Token']} - headerText={ messages['Access Token']}> + headerText={messages['Access Token']}> ); diff --git a/src/app/views/sidebar/sample-queries/SampleQueries.tsx b/src/app/views/sidebar/sample-queries/SampleQueries.tsx index 6c675d01a..c69b6eb3d 100644 --- a/src/app/views/sidebar/sample-queries/SampleQueries.tsx +++ b/src/app/views/sidebar/sample-queries/SampleQueries.tsx @@ -17,7 +17,7 @@ import { styled, TooltipHost } from 'office-ui-fabric-react'; -import React, { ChangeEvent, Component } from 'react'; +import React, { Component } from 'react'; import { FormattedMessage, injectIntl } from 'react-intl'; import { connect } from 'react-redux'; import { bindActionCreators, Dispatch } from 'redux'; @@ -35,6 +35,7 @@ import { getStyleFor } from '../../../utils/badge-color'; import { substituteTokens } from '../../../utils/token-helpers'; import { classNames } from '../../classnames'; import { sidebarStyles } from '../Sidebar.styles'; +import { isJsonString } from './sample-query-utils'; export class SampleQueries extends Component { @@ -86,11 +87,11 @@ export class SampleQueries extends Component { telemetry.trackEvent( LINK_CLICK_EVENT, { - ComponentName: 'Documentation link', - SampleId: item.id, - SampleName: item.humanName, - SampleCategory: item.category, - Link: item.docLink + ComponentName: 'Documentation link', + SampleId: item.id, + SampleName: item.humanName, + SampleCategory: item.category, + Link: item.docLink }); } @@ -271,16 +272,17 @@ export class SampleQueries extends Component { actions.runQuery(sampleQuery); } telemetry.trackEvent( - LISTITEM_CLICK_EVENT, - { + LISTITEM_CLICK_EVENT, + { ComponentName: 'Sample query list item', SampleId: selectedQuery.id, SampleName: selectedQuery.humanName, SampleCategory: selectedQuery.category, QuerySignature: '' - }); + }); } else { - sampleQuery.sampleBody = (sampleQuery.sampleBody) ? JSON.parse(sampleQuery.sampleBody) : undefined; + sampleQuery.sampleBody = (sampleQuery.sampleBody && isJsonString(sampleQuery.sampleBody)) + ? JSON.parse(sampleQuery.sampleBody) : undefined; if (selectedQuery.tip) { displayTipMessage(actions, selectedQuery); } } actions.setSampleQuery(sampleQuery); @@ -368,7 +370,7 @@ export class SampleQueries extends Component { - +