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

Feature: Surface documentation links #2219

Merged
merged 51 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
72da8c0
change resource signature to support links
thewahome Nov 8, 2022
84dd932
get matching resource for URL
thewahome Nov 8, 2022
fea3c8f
show documentation link on query input
thewahome Nov 8, 2022
6d6b1eb
refactor into a documentation service
thewahome Nov 8, 2022
18dd9fa
fix failing version validator
thewahome Nov 9, 2022
ad3788f
rephrase test assertions to remove magic numbers
thewahome Nov 9, 2022
08c731e
change label to 'documentation'
thewahome Nov 15, 2022
eb262cb
optional chaining name value
thewahome Dec 6, 2022
7db51f7
Merge branch 'dev' into feature/documentation-links
thewahome Dec 6, 2022
b25e81a
Merge branch 'dev' into feature/documentation-links
thewahome Jan 31, 2023
fa06a8a
Merge branch 'dev' into feature/documentation-links
thewahome Feb 10, 2023
1fc15bb
Merge branch 'dev' into feature/documentation-links
thewahome Feb 13, 2023
d73c3e6
Merge branch 'dev' into feature/documentation-links
thewahome Mar 8, 2023
72a405d
remove extra step to click on documentation
thewahome Mar 9, 2023
6168dc2
Merge branch 'dev' into feature/documentation-links
thewahome Mar 16, 2023
e98052a
Merge branch 'dev' into feature/documentation-links
thewahome Mar 23, 2023
344bfe8
backwards compatibility: documentation source
thewahome Mar 27, 2023
9a0f36c
backwards compatibility: method display
thewahome Mar 28, 2023
0f94c74
Merge branch 'dev' into feature/documentation-links
thewahome Mar 28, 2023
5b298f6
remove unnecessary assertion
thewahome Mar 29, 2023
c76c070
make methods uppercase
thewahome Apr 3, 2023
4ce7322
ensure exported methods are uppercase
thewahome Apr 3, 2023
687ce06
get documentation link from payload
thewahome Apr 4, 2023
163c686
show documentation link in resource link
thewahome Apr 4, 2023
3802cf0
display icons only on hover
thewahome Apr 4, 2023
daef891
Merge branch 'dev' into feature/documentation-links
thewahome Apr 4, 2023
51ef441
fix code smell, remove unused code
thewahome Apr 4, 2023
d046da1
change function declaration
thewahome Apr 4, 2023
0e0b7ef
use named functions
thewahome Apr 4, 2023
b143dc0
use similar named function
thewahome Apr 4, 2023
34310ea
align chevron
ElinorW Apr 4, 2023
cd48d36
remove all references to isolate
thewahome Apr 4, 2023
3930ba0
Merge branch 'dev' into feature/documentation-links
thewahome Apr 13, 2023
bde4204
fix failing segments test
thewahome Apr 14, 2023
e2c26df
fix linting error
thewahome Apr 14, 2023
eecf87c
show buttons when hover, active and expanded
thewahome Apr 17, 2023
c14dfc1
remove icons on expand
thewahome Apr 18, 2023
4bf22ea
prevent screen from jumping around
thewahome Apr 24, 2023
adbb48d
fix alignment for preview collection button
thewahome Apr 24, 2023
579448d
prevent page title from jumping around when added to collection
thewahome Apr 24, 2023
45d1281
show buttons on parent focus
thewahome Apr 24, 2023
2520874
reorder buttons; change tooltip text
thewahome Apr 24, 2023
2b50f28
add "read documentation" text
thewahome Apr 24, 2023
b4bd531
Merge branch 'dev' into feature/documentation-links
thewahome Apr 24, 2023
df5e0d7
add correct documentation label
thewahome Apr 25, 2023
b6c601e
change test to use regex
thewahome Apr 25, 2023
60147b3
fix flickering tooltip
thewahome Apr 25, 2023
cfd3186
align buttons properly
thewahome Apr 25, 2023
17dd0b6
add hovering effects
thewahome Apr 26, 2023
1f3476d
reuse old url
thewahome Apr 26, 2023
49b91ca
Merge branch 'dev' into feature/documentation-links
thewahome Apr 26, 2023
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 src/app/services/graph-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const BETA_USER_INFO_URL = `${GRAPH_URL}/beta/me/profile`;
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 DEVX_API_URL = 'https://devxapitest.azurewebsites.net'; // Used only for testing resource documentation
export const GRAPH_API_SANDBOX_URL =
'https://proxy.apisandbox.msdn.microsoft.com/svc';
export const GRAPH_API_SANDBOX_ENDPOINT_URL =
Expand Down
38 changes: 34 additions & 4 deletions src/app/services/reducers/resources-reducer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,33 @@ const paths = [{
url: '/issues',
name: 'issues (1)',
labels: [
{ name: 'v1.0', methods: ['Get', 'Post'] },
{ name: 'beta', methods: ['Get', 'Post'] }
{
name: 'v1.0', methods: [{
name: 'Get',
documentationUrl: null
}, {
name: 'Post',
documentationUrl: null
}]
},
{
name: 'beta', methods: [{
name: 'Get',
documentationUrl: null
}, {
name: 'Post',
documentationUrl: null
}]
}
],
version: 'v1.0',
methods: ['Get', 'Post'],
methods: [{
name: 'Get',
documentationUrl: null
}, {
name: 'Post',
documentationUrl: null
}],
isExpanded: true,
parent: '/',
level: 1,
Expand All @@ -94,7 +116,15 @@ const paths = [{
const resourceLinks: IResourceLink[] = [
{
labels: [
{ name: 'v1.0', methods: ['Get', 'Post'] }
{
name: 'v1.0', methods: [{
name: 'Get',
documentationUrl: null
}, {
name: 'Post',
documentationUrl: null
}]
}
],
key: '5-issues',
url: '/issues',
Expand Down
5 changes: 4 additions & 1 deletion src/app/utils/resources/resources-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ function getResourcesSupportedByVersion(
}

function versionExists(resource: IResource, version: string): boolean {
return resource.labels.some((k) => k.name === version);
return resource &&
resource.labels &&
resource.labels.length > 0 &&
resource.labels.some((k) => k.name === version);
}

function searchResources(haystack: IResource[], needle: string): IResource[] {
Expand Down
Loading