-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Remove redundant and trailing slashes in route path #33444
Conversation
@rushatgabhane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
src/libs/Navigation/Navigation.ts
Outdated
@@ -117,7 +117,7 @@ function getActiveRoute(): string { | |||
*/ | |||
function isActiveRoute(routePath: Route): boolean { | |||
// We remove First forward slash from the URL before matching | |||
return getActiveRoute().substring(1) === routePath; | |||
return getActiveRoute().substring(1) === routePath.replace(/\/{2,}/g, '/').replace(/\/$/, ''); |
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 regex should be moved to CONST
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.
Updated.
src/ROUTES.ts
Outdated
@@ -314,61 +314,61 @@ const ROUTES = { | |||
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/start/${transactionID}/${reportID}` as const, | |||
}, | |||
MONEY_REQUEST_STEP_CONFIRMATION: { | |||
route: 'create/:iouType/confirmation/:transactionID/:reportID/', | |||
route: 'create/:iouType/confirmation/:transactionID/:reportID', | |||
getRoute: (iouType: ValueOf<typeof CONST.IOU.TYPE>, transactionID: string, reportID: string) => `create/${iouType}/confirmation/${transactionID}/${reportID}/` as const, |
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.
@tienifr should we remove the trailing /
from all getRoute
?
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.
Yes, let's please clean them all up.
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.
Updated!
Reviewer Checklist
Screenshots/VideosScreen.Recording.2024-01-08.at.19.36.04.movMacOS: Chrome / SafariScreen.Recording.2024-01-08.at.19.34.18.mov |
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.
LGTM
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/tgolen in version: 1.4.23-0 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.23-4 🚀
|
Details
This PR removes redundant (consecutive) and trailing slashes in route path.
Fixed Issues
$ #33205
PROPOSAL: #33205 (comment)
Tests
/settings///preferences//language/
) >> EnterOffline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
Screen.Recording.2023-12-22.at.15.13.49-compressed.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2023-12-22.at.15.09.33-compressed.mov
MacOS: Chrome / Safari
Screen.Recording.2023-12-22.at.14.30.00-compressed.mov
Screen.Recording.2023-12-22.at.15.03.50-compressed.mov
MacOS: Desktop
Screen.Recording.2023-12-22.at.15.06.48-compressed.mov
Screen.Recording.2023-12-22.at.15.07.13-compressed.mov