Welcome message wrong link 33230#33723
Conversation
|
@shubham1206agra 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] |
There was a problem hiding this comment.
@roryabraham I am thinking we should go to report without any reportId in this case. What do you think?
There was a problem hiding this comment.
No, I think HOME is ok. It's the same effect as report w/o any reportID, right?
|
@samilabud it looks like there are merge conflicts that need to be resolved here |
5d50bb2 to
f630d73
Compare
|
This is ready for another review @shubham1206agra |
| const reportActionID = route?.params?.reportActionID; | ||
| const regexValidReportActionID = new RegExp(/^\d*$/); | ||
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
| Navigation.goBack(ROUTES.HOME); | ||
| return; | ||
| } |
There was a problem hiding this comment.
@samilabud We should move this logic inside if (route?.params?.reportID) {
There was a problem hiding this comment.
And one more thing, lets not use Navigation.goBack(ROUTES.HOME), use Navigation.navigate instead as this is causing to go back in the stack to previously opened report instead of staying on the same report.
There was a problem hiding this comment.
Fixed thanks!, it seems there is a test failing on the main branch, I'm going to keep testing on the main until I see it is fixed and let you know.
| const reportActionID = route?.params?.reportActionID; | ||
| const regexValidReportActionID = new RegExp(/^\d*$/); | ||
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
| Navigation.navigate(ROUTES.HOME); |
There was a problem hiding this comment.
Lets navigate to the report without the reportActionID in this case instead.
| @@ -45,6 +47,14 @@ function ReportScreenIDSetter({route, reports, policies, navigation, isFirstTime | |||
| // Don't update if there is a reportID in the params already | |||
| if (route?.params?.reportID) { | |||
| App.confirmReadyToOpenApp(); | |||
There was a problem hiding this comment.
Is there a reason for this line to be above this logic?
There was a problem hiding this comment.
Not really, additional lines were removed.
| App.confirmReadyToOpenApp(); | ||
| const reportActionID = route?.params?.reportActionID; | ||
| const regexValidReportActionID = new RegExp(/^\d*$/); | ||
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | ||
| return; | ||
| } |
There was a problem hiding this comment.
| App.confirmReadyToOpenApp(); | |
| const reportActionID = route?.params?.reportActionID; | |
| const regexValidReportActionID = new RegExp(/^\d*$/); | |
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
| return; | |
| } | |
| const reportActionID = route?.params?.reportActionID; | |
| const regexValidReportActionID = new RegExp(/^\d*$/); | |
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
| return; | |
| } | |
| App.confirmReadyToOpenApp(); |
Do this instead
There was a problem hiding this comment.
It makes sense, thank you!
| const reportActionID = route?.params?.reportActionID; | ||
| const regexValidReportActionID = new RegExp(/^\d*$/); | ||
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | ||
| return; | ||
| } |
There was a problem hiding this comment.
| const reportActionID = route?.params?.reportActionID; | |
| const regexValidReportActionID = new RegExp(/^\d*$/); | |
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
| Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
| return; | |
| } | |
| const reportActionID = route?.params?.reportActionID; | |
| const regexValidReportActionID = new RegExp(/^\d*$/); | |
| if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
| navigation.setParams({reportActionID: ''}); | |
| } |
Sorry, but this works better.
There was a problem hiding this comment.
Can you change to this?
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-01.at.9.55.49.PM.movAndroid: mWeb ChromeScreen.Recording.2024-01-01.at.10.40.56.PM.moviOS: NativeScreen.Recording.2024-01-01.at.10.50.04.PM.moviOS: mWeb SafariScreen.Recording.2024-01-01.at.10.36.22.PM.movMacOS: Chrome / SafariScreen.Recording.2024-01-01.at.10.31.30.PM.movMacOS: DesktopScreen.Recording.2024-01-01.at.10.46.29.PM.mov |
|
@roryabraham The jest test is failing due to current month is January |
|
Agree the failing tests are unrelated |
|
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
Not an emergency, see last comment |
|
✋ 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/roryabraham in version: 1.4.21-0 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
1 similar comment
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
Details
We are not validating the URL route for the second parameter when we are building our routes for 'r' parameter, here we going edit the component ReportScreenIDSetter
and validate the reportActionID which should be numeric, and if not return the user to the last report page (chat window).
Fixed Issues
$ #33230
PROPOSAL: #33230 (comment)
Tests
Offline tests
n/a
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel so the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
n/a
Android: mWeb Chrome
Android.Chrome.-.Test.Deep.Link.mp4
iOS: Native
n/a
iOS: mWeb Safari
Iphone.Safari.-.Test.Deep.Link.mp4
MacOS: Chrome / Safari
Chrome.Mac.-.Test.Deep.Link.mp4
MacOS: Desktop
n/a