-
Notifications
You must be signed in to change notification settings - Fork 94
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: clickable links on message bar #835
Conversation
package.json
Outdated
@@ -81,7 +81,7 @@ | |||
"scripts": { | |||
"start": "node scripts/start.js", | |||
"build": "node scripts/build.js && node versioned-build.js", | |||
"test": "node scripts/test.js --no-watch --testPathIgnorePatterns=src/tests/accessibility", | |||
"test": "node scripts/test.js --watch --testPathIgnorePatterns=src/tests/accessibility", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did you change this part?
won't it look for the accessibility test, which is a separate job?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the --watch
flag makes the tests watch for changes as you work. So if you change a file, as long as you had ran npm run test
you would see the results of the tests immediately without running it again. with the --no-watch
you need to run the tests command again
The --testPathIgnorePatterns
flag is a different parameter that helps the runner know which file to ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the filename status.util.ts
and not status.ts
?
src/app/utils/status.util.ts
Outdated
@@ -0,0 +1,46 @@ | |||
export function replaceLinks(message: string): string { | |||
if (linkExists(message)) { | |||
const urls = extractUrl(message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible to avoid the implementation of linkExists
by checking the result of extractUrl.
const urls = extractUrl(message)
// instead of if linkExists(message)
if (urls.length > 0) {
...
}
src/app/utils/status.util.ts
Outdated
return exists; | ||
} | ||
|
||
export function extractUrl(value: string): any { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return type here should be an array of strings or an empty array
src/app/utils/status.util.ts
Outdated
export function extractUrl(value: string): any { | ||
const matches = value.match(/\bhttps?:\/\/\S+/gi); | ||
if (matches) { | ||
return matches; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can achieve the same with
return value.match(...)
src/tests/utils/url-to-html.spec.ts
Outdated
@@ -0,0 +1,36 @@ | |||
import { linkExists, extractUrl, replaceLinks, convertArrayToObject } from "../../app/utils/status.util"; | |||
|
|||
describe('url should', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a best practise to put the test suit name here, something like URL TestSuite
Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-835.centralus.azurestaticapps.net |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://jolly-sand-0ac78c710-835.centralus.azurestaticapps.net |
* Fix: support different content types (#814) * Feature: Add Adaptive cards JSON Schema code (#828) * Feature: samples testing (#833) * Feature: Adds 'Report an Issue' menu option (#834) * Feature: clickable links on message bar (#835) * fix: intermittent create page error (#837) * Fix: Add 'Maximize sidebar' aria-label (#842) * Task: upgrade technologies (#844) * Fix: expand maxWidth allow more humanName chars (#764) * Fix: autocomplete options not displaying (#847) * fix: adaptive cards destroy (#848) * Fix: Graph Explorer link colors (#846) * Fix: Adaptive cards instrumentation (#849) * Fix: adjust column width (#850) * Task: prevent storing access token (#851) Co-authored-by: jobala <[email protected]> Co-authored-by: Charles Wahome <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: Azure Static Web Apps <[email protected]> Co-authored-by: Millicent Achieng <[email protected]> Co-authored-by: Sébastien Levert <[email protected]> Co-authored-by: Ezrqn Kemboi <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: Joseph Ngugi <[email protected]> Co-authored-by: Maggie Kimani <[email protected]>
* Fix: support different content types (#814) * Feature: Add Adaptive cards JSON Schema code (#828) * Feature: samples testing (#833) * Feature: Adds 'Report an Issue' menu option (#834) * Feature: clickable links on message bar (#835) * fix: intermittent create page error (#837) * HB of localized GE.jsons (#830) * Fix: Add 'Maximize sidebar' aria-label (#842) * Task: upgrade technologies (#844) * Fix: expand maxWidth allow more humanName chars (#764) * Fix: autocomplete options not displaying (#847) * fix: adaptive cards destroy (#848) * Fix: Graph Explorer link colors (#846) * Fix: Adaptive cards instrumentation (#849) * Fix: adjust column width (#850) * Task: prevent storing access token (#851) * HB of localized GE.jsons (#854) * chore(release): 4.3.0 (#857) * Fix: rename component name (#859) * chore(release): 4.4.0 Co-authored-by: jobala <[email protected]> Co-authored-by: Charles Wahome <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: OfficeGlobal <[email protected]> Co-authored-by: Azure Static Web Apps <[email protected]> Co-authored-by: Millicent Achieng <[email protected]> Co-authored-by: Sébastien Levert <[email protected]> Co-authored-by: Ezrqn Kemboi <[email protected]> Co-authored-by: Vincent Biret <[email protected]> Co-authored-by: Joseph Ngugi <[email protected]> Co-authored-by: Maggie Kimani <[email protected]>
Overview
Makes links available in the samples clickable
Fixes #862
Fixes #705
Demo
Has clickable link:
Notes
Some tip messages will not be shown when the user is not signed in
Testing Instructions
Scenario 1 - External link
list Azure AD gallery apps
example from the sidebarScenario 2 - Graph API link
get ediscovery case
example from the sidebar