-
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
Integrate Mapbox in App #24306
Integrate Mapbox in App #24306
Conversation
I linked this PR to the issue for you. Please do that right away when you create your next draft PR since it makes the organization easier. |
I also changed the base branch to make it easier to review. When my PR is merged it will automatically update the base branch to main. |
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.
Looking good so far. Please also handle the set up of the secret tokens during deployment.
echo -e "1. \033[1m$NETRC_PATH\033[0m" | ||
echo -e "2. \033[1m$GRADLE_PROPERTIES_PATH\033[0m" | ||
echo -e "\nYou can grant permissions using the commands:" | ||
echo -e "\033[1mchmod u+rw $NETRC_PATH\033[0m" | ||
echo -e "\033[1mchmod u+rw $GRADLE_PROPERTIES_PATH\033[0m" |
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.
Can we check and update the permissions in the script?
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.
I don't know if that's a good idea. I don't want to mess with contributor's file system with my script 😭 also I think I have to deal with other edge cases if I want to change the permissions in the script
so maybe it's better if a contributor change directory/file permissions by themselves
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.
Fair enough, but what about when it's running in an GH action? We need to make sure the permissions are correct in that case. Idk if it's bad to change permissions from a script, but in the interactive version they would probably have to enter their login password to authorize it anyways.
@parasharrajat 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] |
I noticed a bug. I am yet to verify this but it happened twice. Bug: ios: Android chrome: Nothing is shown in the map area. Screen.Recording.2023-08-18.at.1.18.50.AM.movSteps:
|
thanks again for the thorough testing 🙇 This seems to be a separate bug with how the force offline works. From the code logic, there should be some component that should be displayed (either MapView or offline placeholder component) one possibility is that MapView is being displayed but the token is not there so a blank MapView is being displayed anyway, this is a bug for the force offline (which is a feature for developers) this shouldn't block merge. |
if other things look good, could you complete the Reviewer Checklist 🙇 @parasharrajat |
@hayata-suenaga As I can we all the bugs we've discussed would be picked up in the next issues, I am not blocking the checklist for the issue list, we can look at it once the PR is merged. |
@hayata-suenaga I can still reproduce that immediately opening the Mapview after sign-in doesn't load the Map. I think this is being addressed with Api.read change here? web-first-load-map.mov |
@mananjadhav yes that's right it's being addressed in a separate PR 👍 |
Reviewer Checklist
Screenshots/VideosiOSios-mapbox.movAndroidandroid-mapbox.moviOS and Android builds are running. |
Still running the Android build. |
@hayata-suenaga Finally completed the checklist 😌 |
Created the issue for rewriting bash scripts in node: #25442 |
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.
Looks good!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Thanks @mananjadhav for covering up the checklist, I fell asleep. But I already tested so all good. |
We should have tested the AdHoc builds here as the script was modified. The AdHoc build fails with these changes which are blocking us from testing lots of PRs and delaying the App deployment. Can we revert? |
Reverted here |
@@ -80,7 +80,7 @@ jobs: | |||
sed -i 's/ENVIRONMENT=staging/ENVIRONMENT=adhoc/' .env.adhoc | |||
echo "PULL_REQUEST_NUMBER=$PULL_REQUEST_NUMBER" >> .env.adhoc | |||
|
|||
- uses: Expensify/App/.github/actions/composite/setupNode@main | |||
- uses: ./.github/actions/composite/setupNode |
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.
here
🚀 Deployed to staging by https://github.com/hayata-suenaga in version: 1.3.56-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.56-24 🚀
|
Details
This PR does three things
Add scripts necessary to setup the environment to download Mapbox iOS and Android SDKs
You have to get credentials from Mapbox and add them to appropriate files to download Mapbox SDKs. Added scripts to streamline that process.
Configure the project for Mapbox SDKs
Mapbox SDKs requires configurations in
build.gradle
andPodfile
.Install
react-native-x-maps
which uses Mapbox mobile and web SDKs under the hood to display mapsAdded a map in the Distance Request page (where users can report expenses for automobile transportations).
Fixed Issues
$ #22703
PROPOSAL: N/A
Tests / QA Steps
Map test
For engineers, if you're building and testing this PR in the development environment, you first need to run
npm run configure-mapbox
to setup the development environment.Bash script test (This doesn't have to be QAed by the QA team)
Run
npm run configure-mapbox
for the project root.Check you see an output like below.
![Screenshot 2023-08-15 at 9 15 38 AM](https://private-user-images.githubusercontent.com/98560306/260771953-6b6e6896-a71a-4355-a413-b14461edda2b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTUxMTYsIm5iZiI6MTczOTMxNDgxNiwicGF0aCI6Ii85ODU2MDMwNi8yNjA3NzE5NTMtNmI2ZTY4OTYtYTcxYS00MzU1LWE0MTMtYjE0NDYxZWRkYTJiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIzMDAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ0NmRjMWMzMWFlNWQzOThkYzVlMWY5YTQ2NTQzNjk1MDc1YTA1OTM4NmJhZTI0MjM0NDNmYWFiNjQ3MDAwZDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.chtQze9BoJR0dB13r6LaNkF1VKxvH8owVo32fP4A4Bc)
Don't enter anything for the secret token prompt and hit enter. Check you receive the following message
![Screenshot 2023-08-15 at 9 16 56 AM](https://private-user-images.githubusercontent.com/98560306/260772275-70829920-a2f0-4160-b433-1cb0bff7da8e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTUxMTYsIm5iZiI6MTczOTMxNDgxNiwicGF0aCI6Ii85ODU2MDMwNi8yNjA3NzIyNzUtNzA4Mjk5MjAtYTJmMC00MTYwLWI0MzMtMWNiMGJmZjdkYThlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIzMDAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMyOGM2YzI5YTBkYzUyYmNlNjZjN2M2MzljNTQ4YmVmOTlhNjE1YzU0MGZjMTdlMDExMTk2MDUyNzlmMDFlZTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.BrIApbwV3nUhKDFUIh-xXk4xoxTHBMix3Xq6GWkNDh4)
Run
![Screenshot 2023-08-15 at 9 18 09 AM](https://private-user-images.githubusercontent.com/98560306/260772543-1e33a573-c7c1-4455-9c6c-2a4715ef69ab.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTUxMTYsIm5iZiI6MTczOTMxNDgxNiwicGF0aCI6Ii85ODU2MDMwNi8yNjA3NzI1NDMtMWUzM2E1NzMtYzdjMS00NDU1LTljNmMtMmE0NzE1ZWY2OWFiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIzMDAxNlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTcyZGE3NTQyMzI5Mzk1MjYwZTg3NjY4MzQyNjdmMzE3ZDZkOWNmYTQzZGQyYTQwNzJjN2Q3MWQzM2RiODA0ODYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.Wv27b5A539SJE45NDah4C0LlU8Hs-VLBOSJFdSon-n8)
npm run configure-mapbox
. Type something for the secret token prompt (it doesn't have to be the actual token). Note that you don't see what's you're typing. Check you see an output like below.Open
~/.netrc
. Check that you have an entry like the followingOpen
/.gradle/gradle.properties
. Check you have an entry like the following.Offline tests
If you open
DistanceRequest
page by following the test instruction for "Map test" while offline, you should not see the map.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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android