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

Release: July 2021 #1014

Merged
merged 177 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
a2a82d7
package.json
jobala Jul 9, 2020
b408cd0
Merge branch 'dev' of https://github.com/microsoftgraph/microsoft-gra…
jobala Jul 10, 2020
31d0e53
chore(release): 4.1.4
thewahome Jul 21, 2020
eeddfdf
add 4.1.4 build files
thewahome Jul 21, 2020
d21c5dc
chore(release): 4.1.5
thewahome Jul 23, 2020
66b7465
add version 4.1.5 build files
thewahome Jul 23, 2020
5b0c681
Merge branch 'master' into release/july-2020-2
thewahome Jul 23, 2020
a7b7f7a
Release: july 2020 2 (#657)
thewahome Aug 5, 2020
84eaeaa
fix copy paste failure when query bar is empty
thewahome Aug 5, 2020
f47d237
Fix: copy paste query address bar (#658)
thewahome Aug 6, 2020
4d9dc4c
HB of localized GE.jsons (#660)
OfficeGlobal Aug 6, 2020
886d437
Merge branch 'dev' of https://github.com/microsoftgraph/microsoft-gra…
jobala Aug 18, 2020
2fccf7b
ci: add Azure Static Web Apps workflow file
msftgits Aug 27, 2020
261b210
change multiline property
ElinorW Sep 1, 2020
569bf53
Fix: Message bar truncation (#679)
ElinorW Sep 1, 2020
764fda5
Merge branch 'dev' into fix/accessibility-support
ElinorW Sep 1, 2020
fffa620
remove main tag
ElinorW Sep 1, 2020
5e634dd
Fix: Remove main tag (#680)
ElinorW Sep 1, 2020
d0de298
Fix: sovereign clouds metadata (#676)
thewahome Sep 1, 2020
653e716
Feature: Add Graph toolkit tab (#452)
thewahome Sep 8, 2020
53a6d0e
Feature: History items ttl (#677)
thewahome Sep 14, 2020
4419110
Fix: add fallback texts to placeholder text (#690)
thewahome Sep 14, 2020
7ed34a4
Merge branch 'dev' into task/ui-polish
ElinorW Sep 14, 2020
6673abb
Localize tooltip message
ElinorW Sep 14, 2020
8e74a2e
add render details header function
ElinorW Sep 14, 2020
eee72a4
add tooltip on 'admin consent required' header
ElinorW Sep 14, 2020
44ca29c
remove unnecessary white space
ElinorW Sep 14, 2020
fb53cae
add translate message function
ElinorW Sep 14, 2020
72fee85
add tooltip on permissions panel
ElinorW Sep 14, 2020
e5ae6b2
Task: Add tooltip to 'admin consent required' header(#692)
ElinorW Sep 14, 2020
7aca4fc
Fix: remove unnecessary code snippets tab (#695)
thewahome Sep 16, 2020
01dd5e9
Task: update azure pipeline (#691)
thewahome Sep 16, 2020
76597e3
Task: HandBack of localized GE.jsons (#698)
OfficeGlobal Sep 16, 2020
a4dac37
Task: Reduce padding/spacing on request header (#696)
ElinorW Sep 16, 2020
e9ae01e
Release: sept 2020 (#701)
thewahome Sep 17, 2020
02060e7
Task: removes depracated setConsent method (#703)
thewahome Sep 18, 2020
a597572
Merge branch 'dev' of https://github.com/microsoftgraph/microsoft-gra…
jobala Sep 21, 2020
4fa4734
Merge branch 'master' into dev
thewahome Sep 29, 2020
956ae37
Task: Change adaptive cards message (#704)
ElinorW Oct 5, 2020
61e761f
Telemetry for Graph Explorer usage (#672)
millicentachieng Oct 8, 2020
ca4027c
HB of localized GE.jsons (#727)
OfficeGlobal Oct 8, 2020
c8e998c
Task: display history items ttl message (#733)
thewahome Oct 13, 2020
e3a6474
Fix: create onenote page (#708)
thewahome Oct 13, 2020
4551bd0
Merge branch 'dev' of https://github.com/microsoftgraph/microsoft-gra…
jobala Oct 15, 2020
65bed59
Format code on save and paste
jobala Oct 15, 2020
571ef64
Merge pull request #741 from microsoftgraph/task/code-formatting
jobala Oct 15, 2020
059acb3
Fix: breaking change with the adaptive cards templating library (#735)
ElinorW Oct 15, 2020
9ab8a05
HB of localized GE.jsons (#742)
OfficeGlobal Oct 15, 2020
51cf90f
Release: October 2020 (#748)
thewahome Oct 22, 2020
1a70245
Fix: duplicate aria labels (#752)
ElinorW Nov 9, 2020
105ea48
HB of localized GE.jsons (#757)
OfficeGlobal Nov 11, 2020
b7a82dc
Adding JWT.ms support in the Access Token view (#754)
sebastienlevert Nov 12, 2020
15e79ab
descriptive message after pop-up blocked in browser (#762)
ezkemboi Nov 17, 2020
938d1ac
Fix: focus order (#763)
ElinorW Nov 17, 2020
e0c349a
fix unformatted response preview safari
ezkemboi Nov 17, 2020
aa2028c
Merge branch 'dev' into issue-620
ezkemboi Nov 17, 2020
627c748
HB of localized GE.jsons (#767)
OfficeGlobal Nov 20, 2020
d1be4a1
chore(release): 4.1.11 (#769)
thewahome Nov 20, 2020
49e5e7f
Telemetry: Normalize Query URL and Redact PII (#734)
millicentachieng Nov 24, 2020
6e6c9b5
Merge branch 'dev' into issue-620
ezkemboi Nov 24, 2020
0648f1e
Feature: autocomplete (#480)
thewahome Nov 30, 2020
dd543f9
Localized GE.jsons HB (#776)
OfficeGlobal Dec 3, 2020
3cb2781
Prevent remote dependency and trace information telemetry types from …
millicentachieng Dec 3, 2020
b64a110
Fix: sample query sample body (#775)
thewahome Dec 4, 2020
4aad40d
Fix: stop display of options when fetching suggestions (#778)
thewahome Dec 7, 2020
9b5f5c2
add aria-label (#780)
ElinorW Dec 9, 2020
e0afab3
- adds security policy
baywet Dec 29, 2020
674b0c9
- adds code of conduct
baywet Dec 29, 2020
bc3aaee
Release: December 2020 (#782)
ElinorW Jan 8, 2021
4ea148e
Fix - replaces content-type header by accept to match HTTP and avoid …
baywet Jan 8, 2021
3d78f14
Merge branch 'dev' into feature/security-and-conduct
baywet Jan 11, 2021
2eec3b3
feature: security and conduct (#784)
thewahome Jan 11, 2021
dcefa4b
Fix: modify permissions tab UI (#790)
ElinorW Jan 12, 2021
40964df
Merge branch 'dev' into issue-620
ezkemboi Jan 12, 2021
89121d6
Track errors (#777)
millicentachieng Jan 13, 2021
2cafd8a
HB of localized GE.jsons (#792)
OfficeGlobal Jan 13, 2021
acfbba9
Fix: sanitize url when fetching permissions (#794)
thewahome Jan 14, 2021
07db101
Fix: remove wrongly placed working (#795)
ElinorW Jan 14, 2021
ed6815a
Fix: all permissions show as required (#797)
thewahome Jan 15, 2021
bafdee4
clean up
ezkemboi Jan 15, 2021
61ab5ab
Merge branch 'dev' into issue-620
ezkemboi Jan 15, 2021
9ea1200
Tells user they need to be signed in to use PUT/POST/DELETE/PATCH
jobala Jan 16, 2021
4270349
Use exact package version
jobala Jan 16, 2021
108b727
HB of localized GE.jsons (#799)
OfficeGlobal Jan 18, 2021
8af1165
Merge branch 'dev' into feat/login-to-enable
jobala Jan 18, 2021
388705f
Merge pull request #800 from microsoftgraph/feat/login-to-enable
jobala Jan 18, 2021
d24397a
Merge branch 'dev' into issue-620
jobala Jan 18, 2021
d526e94
Task: autocomplete hover styling (#801)
thewahome Jan 18, 2021
a66e724
Merge branch 'dev' into issue-620
jobala Jan 18, 2021
2f9f0bb
Merge pull request #765 from ezkemboi/issue-620
jobala Jan 18, 2021
dc7e1fd
HB of Localized GE.jsons (#803)
OfficeGlobal Jan 20, 2021
5bf4550
Fix: Enable screen reader confirmation feedback (#802)
ElinorW Jan 20, 2021
18b5106
Migrate to eslint (#627)
Kachulio1 Jan 20, 2021
392b517
Feature: resizable components (#766)
thewahome Jan 20, 2021
0498d39
Fix: add onItemInvoked action (#806)
ElinorW Jan 25, 2021
4dcd85e
Stop using look behind regex
jobala Jan 25, 2021
7c995ca
Merge branch 'dev' into fix/load-ge-safari
jobala Jan 25, 2021
743a0df
fix: permissions consent (#807)
thewahome Jan 25, 2021
1b5bfb8
HB of localized GE.jsons (#804)
OfficeGlobal Jan 25, 2021
b797c71
Merge branch 'dev' into fix/load-ge-safari
jobala Jan 26, 2021
0770800
Merge pull request #808 from microsoftgraph/fix/load-ge-safari
jobala Jan 26, 2021
b8b0807
Task/accessibility ci (#358)
jobala Jan 26, 2021
6f1234f
Fix: prevent resize when view expanded (#816)
thewahome Jan 27, 2021
24f597c
Feature/additional telemetry (#813)
millicentachieng Jan 28, 2021
a2098b9
Fix: permissions tab UI (#815)
ElinorW Jan 29, 2021
13074a4
Fix: shrink request section (#822)
thewahome Jan 29, 2021
dd5468a
Merge branch 'master' into dev
thewahome Feb 1, 2021
4542cbe
HB of localized GE.jsons (#825)
OfficeGlobal Feb 2, 2021
ccd8702
Fix: support different content types (#814)
thewahome Feb 3, 2021
ad0d2e4
Feature: Add Adaptive cards JSON Schema code (#828)
ElinorW Feb 5, 2021
60d8fa1
Feature: samples testing (#833)
MaggieKimani1 Feb 9, 2021
b83a09c
Feature: Adds 'Report an Issue' menu option (#834)
ElinorW Feb 10, 2021
4ab6fe9
Feature: clickable links on message bar (#835)
thewahome Feb 10, 2021
9b102b5
fix: intermittent create page error (#837)
thewahome Feb 10, 2021
5724995
HB of localized GE.jsons (#830)
thewahome Feb 10, 2021
4e14352
Fix: Add 'Maximize sidebar' aria-label (#842)
ElinorW Feb 11, 2021
5f5246e
Task: upgrade technologies (#844)
thewahome Feb 12, 2021
74d0401
Fix: expand maxWidth allow more humanName chars (#764)
ezkemboi Feb 12, 2021
100ddf1
Fix: autocomplete options not displaying (#847)
MaggieKimani1 Feb 12, 2021
933e9bb
fix: adaptive cards destroy (#848)
thewahome Feb 15, 2021
ededbe1
Fix: Graph Explorer link colors (#846)
ElinorW Feb 15, 2021
4022373
Fix: Adaptive cards instrumentation (#849)
ElinorW Feb 16, 2021
d054f35
Fix: adjust column width (#850)
ElinorW Feb 16, 2021
e95bbf1
Task: prevent storing access token (#851)
thewahome Feb 16, 2021
6b576f4
HB of localized GE.jsons (#854)
OfficeGlobal Feb 18, 2021
e43bf41
chore(release): 4.3.0 (#857)
ElinorW Feb 19, 2021
e31cc2c
Fix: rename component name (#859)
ElinorW Feb 19, 2021
e80af0b
Fix: autocomplete-onfocusout (#855)
thewahome Feb 23, 2021
20f6724
Feature: make paging easier (#861)
thewahome Feb 24, 2021
9d705d6
Fix: metadata syntax highlighting (#864)
thewahome Mar 1, 2021
23f08dd
chore(release): 4.4.0 (#874)
thewahome Mar 3, 2021
f225fe4
Fix: Adaptive cards changes (#873)
ElinorW Mar 3, 2021
b5c99a8
Fix: snippets not available (#877)
thewahome Mar 3, 2021
a49bde5
HB of localized GE jsons (#872)
OfficeGlobal Mar 3, 2021
d3b8f67
fix broken json Ge_de-DE file
thewahome Mar 3, 2021
697c2a4
HB of localized GE.jsons (#880)
OfficeGlobal Mar 10, 2021
cb9aeb1
Hotfix: march 2021 (#916)
thewahome Mar 31, 2021
6dffb02
Chore(deps): Bump elliptic from 6.5.3 to 6.5.4 (#917)
dependabot[bot] Mar 31, 2021
c941d8d
Chore(deps): Bump y18n from 3.2.1 to 3.2.2 (#919)
dependabot[bot] Mar 31, 2021
76cefec
Chore(deps): Bump react-dev-utils from 7.0.3 to 11.0.4 (#918)
dependabot[bot] Mar 31, 2021
fe5c842
Fix: Undo 'react-dev-utils' package update (#920)
ElinorW Mar 31, 2021
3fb99df
Track time it takes to get a response from DevX API (#875)
millicentachieng Apr 1, 2021
94bf808
Fix: javascript injection (#925)
thewahome Apr 13, 2021
6f26727
Task: state typings (#921)
thewahome Apr 13, 2021
305ae86
Feature: Enhance 'More actions' icon appearance (#907)
ElinorW Apr 14, 2021
7e42892
Feature: msal upgrade (#883)
thewahome Apr 22, 2021
593e7f6
HB of localized GE.jsons (#936)
OfficeGlobal Apr 29, 2021
5ecaeb5
Task: Add Cred Scan (#937)
ElinorW May 6, 2021
c0fd88b
Merge v4.6.1 (#952)
millicentachieng May 19, 2021
a080b37
Task/telemetry capture English theme names only (#958)
millicentachieng May 20, 2021
916f243
Feature/add telemetry middleware (#961)
millicentachieng May 21, 2021
81a57ae
Capture deployed version of application for all telemetry data collec…
millicentachieng May 24, 2021
81b0bab
Enable autocollection of unhandled exceptions (#963)
millicentachieng May 24, 2021
37a7372
Fix: prevent running empty requests (#972)
thewahome May 31, 2021
59d27a6
HB of Localized GE.jsons (#971)
OfficeGlobal May 31, 2021
c2b2f58
Task: add code-owners (#969)
thewahome Jun 2, 2021
3ae1470
Task: send notification when release is created (#967)
thewahome Jun 2, 2021
e5eca49
Fix: interaction in progress (#976)
thewahome Jun 3, 2021
a7e715e
Feature: Display Graph Explorer Version (#977)
ElinorW Jun 7, 2021
267cf08
HB of Localized GE.json (#980)
OfficeGlobal Jun 7, 2021
df6425b
show delta links when property is present (#978)
thewahome Jun 7, 2021
c57dde6
Fix: mgt story links (#981)
nmetulev Jun 8, 2021
1704e9e
Task: Update README.md for Azure auth steps (#982)
acchiang Jun 8, 2021
dd23224
deactivate version number
thewahome Jun 10, 2021
d9b5b6b
chore(release): 4.9.0
thewahome Jun 16, 2021
d1fb75a
HB of Localized GE.json (#990)
OfficeGlobal Jun 16, 2021
e2f7c37
Fix: Accessibility bugs - June (#991)
ElinorW Jun 16, 2021
1b323b8
Fix: Clear the user's profile on sign out (#1000)
thewahome Jun 17, 2021
f3732f8
Fix: repopulate modify permissions when panel closed (#999)
thewahome Jun 17, 2021
b1eee93
Fix: Accessibility bugs (Jul-Sep) (#1010)
ElinorW Jul 5, 2021
f5d799f
Task: Collect telemetry data for fetching adaptive card templates (#1…
millicentachieng Jul 6, 2021
d0a1e41
Task: Capture telemetry for response headers copy action (#1003)
millicentachieng Jul 6, 2021
678e45e
Task: Add telemetry for Report an Issue Link (#1011)
ElinorW Jul 6, 2021
f50c6f9
Fix: url truncation (#1012)
thewahome Jul 6, 2021
1ce5923
Task: refine url truncation (#1013)
thewahome Jul 6, 2021
6ad218d
Merge branch 'dev' into release/july-2021
thewahome Jul 6, 2021
19df185
chore(release): 4.10.0
thewahome Jul 6, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graph-explorer-v2",
"version": "4.9.0",
"version": "4.10.0",
"private": true,
"dependencies": {
"@azure/msal-browser": "2.12.0",
Expand Down
10 changes: 10 additions & 0 deletions src/app/middleware/telemetryMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IAction } from '../../types/action';
import { IQuery } from '../../types/query-runner';
import { IRootState } from '../../types/root';
import {
FETCH_ADAPTIVE_CARD_ERROR,
FETCH_SCOPES_ERROR,
GET_SNIPPET_ERROR,
SAMPLES_FETCH_ERROR,
Expand Down Expand Up @@ -45,6 +46,15 @@ const telemetryMiddleware =
);
break;
}
case FETCH_ADAPTIVE_CARD_ERROR: {
trackException(
componentNames.GET_ADAPTIVE_CARD_ACTION,
state.sampleQuery,
action.response,
{}
);
break;
}
}
return next(action);
};
Expand Down
22 changes: 6 additions & 16 deletions src/app/services/actions/adaptive-cards-action-creator.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { SeverityLevel } from '@microsoft/applicationinsights-web';
import * as AdaptiveCardsTemplateAPI from 'adaptivecards-templating';
import { componentNames, errorTypes, telemetry } from '../../../telemetry';
import { IAction } from '../../../types/action';
import { IAdaptiveCardContent } from '../../../types/adaptivecard';
import { IQuery } from '../../../types/query-runner';
import { lookupTemplate } from '../../utils/adaptive-cards-lookup';
import { sanitizeQueryUrl } from '../../utils/query-url-sanitization';
import { ADAPTIVE_CARD_URL } from '../graph-constants';
import {
FETCH_ADAPTIVE_CARD_ERROR,
FETCH_ADAPTIVE_CARD_PENDING,
Expand Down Expand Up @@ -56,24 +54,16 @@ export function getAdaptiveCard(

dispatch(getAdaptiveCardPending());
try {
const response = await fetch(`https://templates.adaptivecards.io/graph.microsoft.com/${templateFileName}`);
const response = await fetch(`${ADAPTIVE_CARD_URL}/${templateFileName}`);
const templatePayload = await response.json();
const card = createCardFromTemplate(templatePayload, payload);
const adaptiveCardContent: IAdaptiveCardContent = { card, template: templatePayload };
const adaptiveCardContent: IAdaptiveCardContent = {
card,
template: templatePayload,
};
return dispatch(getAdaptiveCardSuccess(adaptiveCardContent));

} catch (error) {
// something wrong happened
const sanitizedUrl = sanitizeQueryUrl(sampleQuery.sampleUrl);
telemetry.trackException(
new Error(errorTypes.NETWORK_ERROR),
SeverityLevel.Error,
{
ComponentName: componentNames.GET_ADAPTIVE_CARD_ACTION,
QuerySignature: `${sampleQuery.selectedVerb} ${sanitizedUrl}`,
Message: `${error}`
}
);
return dispatch(getAdaptiveCardError(error));
}
};
Expand Down
8 changes: 4 additions & 4 deletions src/app/services/actions/permissions-action-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { MessageBarType } from 'office-ui-fabric-react';
import { geLocale } from '../../../appLocale';
import { authenticationWrapper } from '../../../modules/authentication';
import { IAction } from '../../../types/action';
import { IQuery } from '../../../types/query-runner';
import { IRequestOptions } from '../../../types/request';
import { IRootState } from '../../../types/root';
import { sanitizeQueryUrl } from '../../utils/query-url-sanitization';
import { parseSampleUrl } from '../../utils/sample-url-generation';
import { translateMessage } from '../../utils/translate-messages';
Expand Down Expand Up @@ -39,14 +39,14 @@ export function fetchScopesError(response: object): IAction {
};
}

export function fetchScopes(query?: IQuery): Function {
export function fetchScopes(): Function {
return async (dispatch: Function, getState: Function) => {
let hasUrl = false; // whether permissions are for a specific url
try {
const { devxApi } = getState();
const { devxApi, permissionsPanelOpen, sampleQuery: query }: IRootState = getState();
let permissionsUrl = `${devxApi.baseUrl}/permissions`;

if (query) {
if (!permissionsPanelOpen) {
const signature = sanitizeQueryUrl(query.sampleUrl);
const { requestUrl, sampleUrl } = parseSampleUrl(signature);

Expand Down
9 changes: 9 additions & 0 deletions src/app/services/actions/profile-action-creators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ export function getProfileInfo(query: IQuery): Function {
return (dispatch: Function) => {
const respHeaders: any = {};

if (!query.sampleHeaders) {
query.sampleHeaders = [];
}

query.sampleHeaders.push({
name: 'Cache-Control',
value: 'no-cache'
});

return authenticatedRequest(dispatch, query).then(async (response: Response) => {

if (response && response.ok) {
Expand Down
11 changes: 7 additions & 4 deletions src/app/services/actions/query-action-creator-util.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import {
AuthenticationHandlerOptions,
ResponseType,
ResponseType
} from '@microsoft/microsoft-graph-client';
import { MSALAuthenticationProviderOptions } from '@microsoft/microsoft-graph-client/lib/src/MSALAuthenticationProviderOptions';

import { IAction } from '../../../types/action';
import { ContentType } from '../../../types/enums';
import { IQuery } from '../../../types/query-runner';
import { IRequestOptions } from '../../../types/request';
import { encodeHashCharacters } from '../../utils/query-url-sanitization';
import { authProvider, GraphClient } from '../graph-client';
import { DEFAULT_USER_SCOPES, GRAPH_API_SANDBOX_URL } from '../graph-constants';
import { QUERY_GRAPH_SUCCESS } from '../redux-constants';
Expand All @@ -21,8 +23,9 @@ export function queryResponse(response: object): IAction {

export async function anonymousRequest(dispatch: Function, query: IQuery) {
const authToken = '{token:https://graph.microsoft.com/}';
const escapedUrl = encodeURIComponent(query.sampleUrl);
const graphUrl = `${GRAPH_API_SANDBOX_URL}/svc?url=${escapedUrl}`;
const escapedUrl = encodeURIComponent(encodeHashCharacters(query));
const graphUrl = `${GRAPH_API_SANDBOX_URL}?url=${escapedUrl}`;

const sampleHeaders: any = {};
if (query.sampleHeaders && query.sampleHeaders.length > 0) {
query.sampleHeaders.forEach((header) => {
Expand Down Expand Up @@ -113,7 +116,7 @@ const makeRequest = (httpVerb: string, scopes: string[]): Function => {
msalAuthOptions
);
const client = GraphClient.getInstance()
.api(query.sampleUrl)
.api(encodeHashCharacters(query))
.middlewareOptions([middlewareOptions])
.headers(sampleHeaders)
.responseType(ResponseType.RAW);
Expand Down
3 changes: 2 additions & 1 deletion src/app/services/graph-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ export const USER_PICTURE_URL = `${GRAPH_URL}/beta/me/photo/$value`;
export const AUTH_URL = 'https://login.microsoftonline.com';
export const DEFAULT_USER_SCOPES = 'openid profile User.Read';
export const DEVX_API_URL = 'https://graphexplorerapi.azurewebsites.net';
export const GRAPH_API_SANDBOX_URL = 'https://proxy.apisandbox.msdn.microsoft.com';
export const GRAPH_API_SANDBOX_URL = 'https://proxy.apisandbox.msdn.microsoft.com/svc';
export const HOME_ACCOUNT_KEY = 'fbf1ecbe-27ab-42d7-96d4-3e6b03682ee4';
export const ADAPTIVE_CARD_URL = 'https://templates.adaptivecards.io/graph.microsoft.com';
5 changes: 4 additions & 1 deletion src/app/utils/generate-groups.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { IGroup } from "office-ui-fabric-react";

export function generateGroupsFromList(list: any[], property: string) {
const map = new Map();
const groups: any[] = [];
const groups: IGroup[] = [];

let isCollapsed = false;
let previousCount = 0;
Expand All @@ -23,6 +25,7 @@ export function generateGroupsFromList(list: any[], property: string) {
startIndex: previousCount,
isCollapsed,
count,
ariaLabel: listItem[property] + ' has ' + count + ' results'
});
previousCount += count;
}
Expand Down
5 changes: 5 additions & 0 deletions src/app/utils/query-url-sanitization.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable no-useless-escape */
import { IQuery } from '../../types/query-runner';
import { GRAPH_URL } from '../services/graph-constants';
import {
isAllAlpha,
Expand Down Expand Up @@ -142,3 +143,7 @@ function sanitizeQueryParameters(queryString: string): string {
queryString = queryString.substring(1);
return queryString.split('&').map(sanitizeQueryParameter).join('&');
}

export function encodeHashCharacters(query: IQuery): string {
return query.sampleUrl.replace(/#/g, '%2523');
}
6 changes: 3 additions & 3 deletions src/app/views/authentication/Authentication.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { SeverityLevel } from '@microsoft/applicationinsights-web';
import { Icon, Label, MessageBarType, Spinner, SpinnerSize, styled } from 'office-ui-fabric-react';
import { Icon, Label, MessageBar, MessageBarType, Spinner, SpinnerSize, styled } from 'office-ui-fabric-react';
import React, { useState } from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
Expand Down Expand Up @@ -79,9 +79,9 @@ const Authentication = (props: any) => {
</Label>

<br />
<Label>
<MessageBar messageBarType={MessageBarType.warning} isMultiline={true}>
<FormattedMessage id='Using demo tenant' /> <FormattedMessage id='To access your own data:' />
</Label>
</MessageBar>
</>;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IconButton, PrimaryButton } from 'office-ui-fabric-react';
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { translateMessage } from '../../../utils/translate-messages';
import Profile from '../profile/Profile';

export function showSignInButtonOrProfile(
Expand All @@ -11,12 +12,12 @@ export function showSignInButtonOrProfile(
) {

const signInButton = minimised ? <IconButton
ariaLabel='Sign-in button'
ariaLabel={translateMessage('sign in')}
role='button'
iconProps={{ iconName: 'Contact' }}
title='sign in'
title={translateMessage('sign in')}
onClick={() => signIn()} /> : <PrimaryButton
ariaLabel='Sign-in button'
ariaLabel={translateMessage('sign in')}
role='button'
iconProps={{ iconName: 'Contact' }}
onClick={() => signIn()}
Expand Down
17 changes: 15 additions & 2 deletions src/app/views/common/copy.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { telemetry } from '../../../telemetry';
import { IQuery } from '../../../types/query-runner';

export function genericCopy(text: string) {
const element = document.createElement('textarea');
element.value = text;
Expand All @@ -6,7 +9,7 @@ export function genericCopy(text: string) {

document.execCommand('copy');
document.body.removeChild(element);

return Promise.resolve('copied');
}

Expand All @@ -21,4 +24,14 @@ export function copy(id: string) {
textArea.blur();

return Promise.resolve('copied');
}
}

export function trackedGenericCopy(
text: string,
componentName: string,
sampleQuery?: IQuery,
properties?: { [key: string]: string }
) {
genericCopy(text);
telemetry.trackCopyButtonClickEvent(componentName, sampleQuery, properties);
}
4 changes: 3 additions & 1 deletion src/app/views/common/share.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { geLocale } from '../../../appLocale';
import { authenticationWrapper } from '../../../modules/authentication';
import { IQuery } from '../../../types/query-runner';
import { encodeHashCharacters } from '../../utils/query-url-sanitization';
import { parseSampleUrl } from '../../utils/sample-url-generation';

/**
Expand All @@ -10,7 +11,8 @@ import { parseSampleUrl } from '../../utils/sample-url-generation';
*/
export const createShareLink = (sampleQuery: IQuery, authenticated?: boolean): string => {
const { sampleBody, selectedVerb, sampleHeaders } = sampleQuery;
const { queryVersion, requestUrl, sampleUrl, search } = parseSampleUrl(sampleQuery.sampleUrl);
const { queryVersion, requestUrl, sampleUrl, search } =
parseSampleUrl(encodeHashCharacters(sampleQuery));

if (!sampleUrl) {
return '';
Expand Down
1 change: 1 addition & 0 deletions src/app/views/query-response/QueryResponse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ const QueryResponse = (props: IQueryResponseProps) => {
id='share-query-text'
className='share-query-params'
defaultValue={query}
aria-label={translateMessage('Share Query')}
/>
<DialogFooter>
<PrimaryButton text={messages.Copy} onClick={handleCopy} />
Expand Down
27 changes: 8 additions & 19 deletions src/app/views/query-response/adaptive-cards/AdaptiveCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { bindActionCreators, Dispatch } from 'redux';

import { componentNames, eventTypes, telemetry } from '../../../../telemetry';
import { componentNames, telemetry } from '../../../../telemetry';
import { IAdaptiveCardProps } from '../../../../types/adaptivecard';
import { IQuery } from '../../../../types/query-runner';
import { IRootState } from '../../../../types/root';
import { getAdaptiveCard } from '../../../services/actions/adaptive-cards-action-creator';
import { sanitizeQueryUrl } from '../../../utils/query-url-sanitization';
import { translateMessage } from '../../../utils/translate-messages';
import { classNames } from '../../classnames';
import { Monaco } from '../../common';
import { genericCopy } from '../../common/copy';
import { trackedGenericCopy } from '../../common/copy';
import { queryResponseStyles } from './../queryResponse.styles';

class AdaptiveCard extends Component<IAdaptiveCardProps> {
Expand Down Expand Up @@ -146,13 +145,15 @@ class AdaptiveCard extends Component<IAdaptiveCardProps> {
</a>
</MessageBar>
<IconButton className={classes.copyIcon}
ariaLabel={translateMessage('Copy')}
iconProps={{
iconName: 'copy',
}}
onClick={async () => {
genericCopy(JSON.stringify(data.template, null, 4));
trackJsonSchemaCopyEvent(sampleQuery)
}}
onClick={async () =>
trackedGenericCopy(
JSON.stringify(data.template, null, 4),
componentNames.JSON_SCHEMA_COPY_BUTTON,
sampleQuery)}
/>
<Monaco
language='json'
Expand All @@ -177,18 +178,6 @@ function onPivotItemClick(query: IQuery | undefined, item?: PivotItem) {
}
}

function trackJsonSchemaCopyEvent(query: IQuery | undefined) {
if (!query) {
return;
}
const sanitizedUrl = sanitizeQueryUrl(query.sampleUrl);
telemetry.trackEvent(eventTypes.BUTTON_CLICK_EVENT,
{
ComponentName: componentNames.JSON_SCHEMA_COPY_BUTTON,
QuerySignature: `${query.selectedVerb} ${sanitizedUrl}`
});
}

function mapStateToProps({ adaptiveCard, sampleQuery, queryRunnerStatus }: IRootState) {
return {
card: adaptiveCard,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { componentNames, telemetry } from '../../../../telemetry';
import { classNames } from '../../classnames';
import { queryResponseStyles } from '../queryResponse.styles';
import { IRootState } from '../../../../types/root';
import { translateMessage } from '../../../utils/translate-messages';

class GraphToolkit extends Component<any> {
constructor(props: any) {
Expand All @@ -36,7 +37,7 @@ class GraphToolkit extends Component<any> {
</a>
.
</MessageBar>
<iframe width='100%' height='470px' src={toolkitUrl} />
<iframe width='100%' height='470px' src={toolkitUrl} title={translateMessage('Graph toolkit')} />
</>
);
}
Expand Down
Loading