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

Capture telemetry for graph toolkit example link #1125

Merged
merged 2 commits into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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