Skip to content

Commit 3f0b96c

Browse files
authored
fix: update doc links (#3729)
1 parent 39df321 commit 3f0b96c

File tree

5 files changed

+31
-17
lines changed

5 files changed

+31
-17
lines changed

src/app/services/graph-constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ export const CONSENT_TYPE_DOC_LINK = 'https://learn.microsoft.com/en-us/graph/ap
3434
export const CURRENT_THEME='CURRENT_THEME';
3535
export const EXP_URL='https://default.exp-tas.com/exptas76/9b835cbf-9742-40db-84a7-7a323a77f3eb-gedev/api/v1/tas'
3636
export const BANNER_IS_VISIBLE = 'bannerIsVisible';
37+
export const REPORTANISSUELINK = 'https://github.com/microsoftgraph/microsoft-graph-explorer-v4/issues/new/choose';
38+
export const GEDOCSLINK =
39+
'https://learn.microsoft.com/graph/graph-explorer/graph-explorer-overview?view=graph-rest-1.0'
40+
export const GRAPHDOCSLINK =
41+
'https://learn.microsoft.com/graph/api/overview?view=graph-rest-1.0'
42+
export const GITHUBLINK = 'https://github.com/microsoftgraph/microsoft-graph-explorer-v4#readme'
43+
export const TRACKINGPARAMS = '/?WT.mc_id=msgraph_inproduct_graphexhelp'

src/app/views/main-header/Help.tsx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,19 @@ import {
1111
} from '../../../telemetry/component-names'
1212
import { translateMessage } from '../../utils/translate-messages'
1313
import { useHeaderStyles } from './utils'
14+
import { REPORTANISSUELINK,
15+
GEDOCSLINK,
16+
TRACKINGPARAMS,
17+
GRAPHDOCSLINK,
18+
GITHUBLINK
19+
} from '../../services/graph-constants'
1420

1521
const trackHelpButtonClickEvent = () => {
1622
telemetry.trackEvent(eventTypes.BUTTON_CLICK_EVENT, {
1723
ComponentName: componentNames.HELP_BUTTON
1824
});
1925
}
2026

21-
const reportAnIssueLink = 'https://github.com/microsoftgraph/microsoft-graph-explorer-v4/issues/new/choose';
22-
const geDocsLink = 'https://learn.microsoft.com/graph/graph-explorer/graph-explorer-overview?view=graph-rest-1.0'
23-
const graphDocsLink = 'https://learn.microsoft.com/graph/api/overview?view=graph-rest-1.0'
24-
const ghLink = 'https://github.com/microsoftgraph/microsoft-graph-explorer-v4#readme'
25-
2627
const trackLinkClick = (e: React.MouseEvent<HTMLAnchorElement>, componentName: string) => {
2728
telemetry.trackLinkClickEvent(e.currentTarget.href, componentName)
2829
}
@@ -32,42 +33,42 @@ const Help = ()=>{
3233

3334
return (
3435
<Menu>
35-
<Tooltip content={translateMessage('Help')} relationship="description">
36+
<Tooltip content={translateMessage('Help')} relationship='description'>
3637
<MenuTrigger disableButtonEnhancement>
3738
<Button
3839
aria-label={translateMessage('Help')}
3940
onClick={trackHelpButtonClickEvent}
40-
className={styles.iconButton} appearance="subtle" icon={<ChatHelp20Regular />} />
41+
className={styles.iconButton} appearance='subtle' icon={<ChatHelp20Regular />} />
4142
</MenuTrigger>
4243
</Tooltip>
4344

4445
<MenuPopover>
4546
<MenuList>
4647
<MenuItemLink
4748
as='a'
48-
href={reportAnIssueLink} target="_blank"
49+
href={REPORTANISSUELINK} target='_blank'
4950
onClick={(e: React.MouseEvent<HTMLAnchorElement>)=> trackLinkClick(e, REPORT_AN_ISSUE_LINK)}
5051
icon={<DocumentQuestionMark20Regular />}>{translateMessage('Report an Issue')}</MenuItemLink>
5152
</MenuList>
5253
<MenuDivider />
5354
<MenuList>
5455
<MenuItemLink
5556
as='a'
56-
href={geDocsLink} target="_blank"
57+
href={GEDOCSLINK + TRACKINGPARAMS} target='_blank'
5758
onClick={(e: React.MouseEvent<HTMLAnchorElement>)=> trackLinkClick(e, GE_DOCUMENTATION_LINK)}
5859
icon={<DocumentOnePage20Regular />}>{translateMessage('Get started with Graph Explorer')}</MenuItemLink>
5960
</MenuList>
6061
<MenuList>
6162
<MenuItemLink
6263
as='a'
63-
href={graphDocsLink} target="_blank"
64+
href={GRAPHDOCSLINK + TRACKINGPARAMS} target='_blank'
6465
onClick={(e: React.MouseEvent<HTMLAnchorElement>)=> trackLinkClick(e, GRAPH_DOCUMENTATION_LINK)}
6566
icon={<DocumentMultiple20Regular />}>{translateMessage('Graph Documentation')}</MenuItemLink>
6667
</MenuList>
6768
<MenuList>
6869
<MenuItemLink
6970
as='a'
70-
href={ghLink} target="_blank"
71+
href={GITHUBLINK} target='_blank'
7172
onClick={(e: React.MouseEvent<HTMLAnchorElement>)=> trackLinkClick(e, GITHUB_LINK)}
7273
icon={<Branch20Regular />}>GitHub</MenuItemLink>
7374
</MenuList>

src/app/views/query-runner/query-input/auto-complete/suffix/SuffixRenderer.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@ const SuffixRenderer = () => {
4545
source: queries
4646
}).getDocumentationLink();
4747

48-
return sampleDocumentationUrl || resourceDocumentationUrl || null;
49-
};
48+
const documentationUrl = sampleDocumentationUrl || resourceDocumentationUrl;
49+
if (documentationUrl) {
50+
const hasQuery = documentationUrl.includes('?');
51+
const param = 'WT.mc_id=msgraph_inproduct_graphexhelp';
52+
return `${documentationUrl}${hasQuery ? '&' : '?'}${param}`;
53+
}
54+
return null;
55+
}
5056

5157
const documentationLink = getDocumentationLink();
5258
const documentationLinkAvailable = !!documentationLink;

src/app/views/sidebar/sample-queries/SampleQueries.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import React, { useEffect, useRef, useState } from 'react';
3333
import { useAppDispatch, useAppSelector } from '../../../../store';
3434
import { componentNames, telemetry } from '../../../../telemetry';
3535
import { IQuery, ISampleQuery } from '../../../../types/query-runner';
36-
import { GRAPH_URL } from '../../../services/graph-constants';
36+
import { GRAPH_URL, GRAPHDOCSLINK, TRACKINGPARAMS } from '../../../services/graph-constants';
3737
import { setQueryResponseStatus } from '../../../services/slices/query-status.slice';
3838
import { setSampleQuery } from '../../../services/slices/sample-query.slice';
3939
import { fetchSamples } from '../../../services/slices/samples.slice';
@@ -116,7 +116,7 @@ export const SampleQueries = () => {
116116
const LoadingSamples = ()=> {
117117
return (
118118
<Spinner
119-
size="large"
119+
size='large'
120120
label={`${translateMessage('loading samples')} ...`}
121121
labelPosition='below'
122122
/>
@@ -166,7 +166,7 @@ const SeeMoreQueriesMessageBar = () => {
166166
componentNames.MICROSOFT_GRAPH_API_REFERENCE_DOCS_LINK
167167
)
168168
}
169-
href='https://learn.microsoft.com/graph/api/overview?view=graph-rest-1.0'
169+
href={GRAPHDOCSLINK + TRACKINGPARAMS}
170170
inline={true}
171171
>
172172
{translateMessage('Microsoft Graph API Reference docs')}

src/messages/GE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@
515515
"Banner notification 1 header": "New to Graph Explorer?",
516516
"Banner notification 1 content": "Graph Explorer is a developer tool that let's you learn about Microsoft Graph APIs. Use Graph Explorer to try the APIs on the default sample tenant to explore capabilities.",
517517
"Banner notification 1 link text": "Follow a step-by-step tutorial",
518-
"Banner notification 1 link": "https://learn.microsoft.com/graph/graph-explorer/graph-explorer-overview?view=graph-rest-1.0",
518+
"Banner notification 1 link": "https://learn.microsoft.com/graph/graph-explorer/graph-explorer-overview?view=graph-rest-1.0/?WT.mc_id=msgraph_inproduct_graphex",
519519
"Dismiss banner": "Dismiss banner",
520520
"list of permissions": "The following is the list of least-privileged permissions required to call the operations in your API Collection. For more information, see ",
521521
"Preview permissions": "Preview permissions",

0 commit comments

Comments
 (0)