-
Notifications
You must be signed in to change notification settings - Fork 20
Migrate all links to use getPath() #2821
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b66e261
Migrate all links to use getPath()
NatSquared 7123ea1
Update public dashboard link test
NatSquared fb4e9a3
Update public comments URL
NatSquared 28f606b
Fix syntax in EngagementSurveyBlock.tsx
NatSquared 7cb0d9a
Fix issues from review comments
NatSquared 091c5b0
More fixes
NatSquared b655932
Convert more links
NatSquared 7a5f97a
Fix sonarcloud issue
NatSquared abf60a5
Merge branch 'main' into DEP-256-migrate-links-to-getpath
NatSquared 5bb0805
Fix unit test
NatSquared 07f8bf4
Fix unit test
NatSquared File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ import { RouterLinkRenderer } from 'components/common/Navigation/Link'; | |
| import { faArrowUpRightFromSquare } from '@fortawesome/free-solid-svg-icons'; | ||
| import { EngagementViewSections } from 'components/engagement/public/view'; | ||
| import { useAuthoringPreviewWindow } from './AuthoringPreviewWindowContext'; | ||
| import { getPath, ROUTES } from 'routes/routes'; | ||
| const PREVIEW_CLOSE_GRACE_MS = 800; | ||
|
|
||
| const AuthoringBottomNav = ({ | ||
|
|
@@ -86,7 +87,8 @@ const AuthoringBottomNav = ({ | |
| } | ||
| }; | ||
|
|
||
| const getTargetPreviewBasePath = () => `${getBasePathPrefix()}/engagements/${engagementId}/preview`; | ||
| const getTargetPreviewBasePath = () => | ||
| `${getBasePathPrefix()}/${getPath(ROUTES.ADMIN_ENGAGEMENT_PREVIEW, { engagementId: engagementId ?? '' })}`; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could simplify this line a bit if you validate the engagementId (or any other route params) within your getPath() function. Then you just need to use { engagementId } for the second arg. |
||
|
|
||
| const postPreviewScrollMessage = (previewWindow: Window, section?: string) => { | ||
| const targetHash = getPreviewSectionHash(section); | ||
|
|
@@ -167,7 +169,7 @@ const AuthoringBottomNav = ({ | |
| const previewWindow = getActivePreviewWindow(); | ||
| if (!previewWindow || previewWindow.closed) return; | ||
|
|
||
| const expectedPathPrefix = `${getBasePathPrefix()}/engagements/${engagementId}/preview`; | ||
| const expectedPathPrefix = `${getBasePathPrefix()}/${getPath(ROUTES.ADMIN_ENGAGEMENT_PREVIEW, { engagementId: engagementId ?? '' })}`; | ||
| try { | ||
| if (!previewWindow.location.pathname.startsWith(expectedPathPrefix)) { | ||
| syncPreviewWindowUrl(pageName); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice, one less unneeded prop.