Skip to content

Commit

Permalink
Capture telemetry for graph toolkit example link (#1125)
Browse files Browse the repository at this point in the history
  • Loading branch information
millicentachieng authored Sep 16, 2021
1 parent d617524 commit 5063716
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
24 changes: 14 additions & 10 deletions src/app/services/graph-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ 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/svc';
export const GRAPH_API_SANDBOX_ENDPOINT_URL = 'https://cdn.graph.office.net/en-us/graph/api/proxy/endpoint';
export const GRAPH_API_SANDBOX_URL =
'https://proxy.apisandbox.msdn.microsoft.com/svc';
export const GRAPH_API_SANDBOX_ENDPOINT_URL =
'https://cdn.graph.office.net/en-us/graph/api/proxy/endpoint';
export const HOME_ACCOUNT_KEY = 'fbf1ecbe-27ab-42d7-96d4-3e6b03682ee4';
export enum ACCOUNT_TYPE {
AAD = "AAD",
MSA = "MSA"
};
AAD = 'AAD',
MSA = 'MSA',
}
export enum PERMS_SCOPE {
WORK = "DelegatedWork",
APPLICATION = "Application",
PERSONAL = "DelegatedPersonal"
};
export const ADAPTIVE_CARD_URL = 'https://templates.adaptivecards.io/graph.microsoft.com';
WORK = 'DelegatedWork',
APPLICATION = 'Application',
PERSONAL = 'DelegatedPersonal',
}
export const ADAPTIVE_CARD_URL =
'https://templates.adaptivecards.io/graph.microsoft.com';
export const GRAPH_TOOOLKIT_EXAMPLE_URL = 'https://mgt.dev/?path=/story';
8 changes: 4 additions & 4 deletions src/app/utils/graph-toolkit-lookup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import templates from '../../graph-toolkit-examples';
import { IQuery } from '../../types/query-runner';
import { GRAPH_TOOOLKIT_EXAMPLE_URL } from '../services/graph-constants';
import { parseSampleUrl } from './sample-url-generation';

export function lookupToolkitUrl(sampleQuery: IQuery) {
Expand All @@ -14,13 +15,12 @@ export function lookupToolkitUrl(sampleQuery: IQuery) {
let { search: componentUrl } = parseSampleUrl(url);
componentUrl = componentUrl.replace('?id=', '');
return {
exampleUrl: `https://mgt.dev/?path=/story/${componentUrl}`,
toolkitUrl: url
exampleUrl: `${GRAPH_TOOOLKIT_EXAMPLE_URL}/${componentUrl}`,
toolkitUrl: url,
};
}
}
}

}
return { toolkitUrl: null, exampleUrl: null };
}
}
2 changes: 2 additions & 0 deletions src/telemetry/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ADAPTIVE_CARD_URL,
DEVX_API_URL,
GRAPH_API_SANDBOX_URL,
GRAPH_TOOOLKIT_EXAMPLE_URL,
GRAPH_URL,
HOME_ACCOUNT_KEY,
} from '../app/services/graph-constants';
Expand Down Expand Up @@ -39,6 +40,7 @@ export function filterRemoteDependencyData(envelope: ITelemetryItem): boolean {
GRAPH_API_SANDBOX_URL,
new URL(graphProxyUrl).origin,
new URL(ADAPTIVE_CARD_URL).origin,
new URL(GRAPH_TOOOLKIT_EXAMPLE_URL).origin,
];
if (!targetsToInclude.includes(urlObject.origin)) {
return false;
Expand Down

0 comments on commit 5063716

Please sign in to comment.