From fe987ff16f1ee9ea214b5e96cae92cb4473e44a6 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 16 Aug 2023 16:03:33 -0700 Subject: [PATCH 01/18] temp --- package-lock.json | 31 +++++-------------------------- package.json | 2 +- src/components/DistanceRequest.js | 12 ++++++++++++ 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index c4165ec34101..d27c4dbed1cb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.6", + "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -150,7 +150,6 @@ "@types/js-yaml": "^4.0.5", "@types/lodash": "^4.14.195", "@types/mapbox-gl": "^2.7.13", - "@types/metro-config": "^0.76.3", "@types/mock-fs": "^4.13.1", "@types/pusher-js": "^5.1.0", "@types/react": "^18.2.12", @@ -20390,16 +20389,6 @@ "integrity": "sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==", "dev": true }, - "node_modules/@types/metro-config": { - "version": "0.76.3", - "resolved": "https://registry.npmjs.org/@types/metro-config/-/metro-config-0.76.3.tgz", - "integrity": "sha512-tq9IyKm1JzNRpM7V7LALxXiAyTlV5eZwoqntpnRIbnqDsIyNlnPkWQEoX77f40pzcUuAH4CiHRDxW5VskPlgtQ==", - "deprecated": "This is a stub types definition. metro-config provides its own type definitions, so you do not need this installed.", - "dev": true, - "dependencies": { - "metro-config": "*" - } - }, "node_modules/@types/mime": { "version": "3.0.1", "dev": true, @@ -43436,8 +43425,8 @@ }, "node_modules/react-native-x-maps": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.6.tgz", - "integrity": "sha512-aGqhdjBPDI6ZXhccjnetjA88eYFB5l8wtpY1ooGwEbiAUOaCqEWqeUHMI79q3VByBOgfP51gJOtpZbk9JOIKcw==", + "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#cbc30575c6a89e6607a3340918d1b4b4f3679ea3", + "license": "MIT", "peerDependencies": { "@math.gl/web-mercator": "^3.6.3", "@rnmapbox/maps": "^10.0.11", @@ -64513,15 +64502,6 @@ "integrity": "sha512-76CqzuD6Q7LC+AtbPqrvD9AqsN0k8bsYo2bM2J8pmNldP1aIPAbzUQ7QbobyXL4eLr1wK5x8FZFe8eF/ubRuBg==", "dev": true }, - "@types/metro-config": { - "version": "0.76.3", - "resolved": "https://registry.npmjs.org/@types/metro-config/-/metro-config-0.76.3.tgz", - "integrity": "sha512-tq9IyKm1JzNRpM7V7LALxXiAyTlV5eZwoqntpnRIbnqDsIyNlnPkWQEoX77f40pzcUuAH4CiHRDxW5VskPlgtQ==", - "dev": true, - "requires": { - "metro-config": "*" - } - }, "@types/mime": { "version": "3.0.1", "dev": true @@ -80257,9 +80237,8 @@ } }, "react-native-x-maps": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.6.tgz", - "integrity": "sha512-aGqhdjBPDI6ZXhccjnetjA88eYFB5l8wtpY1ooGwEbiAUOaCqEWqeUHMI79q3VByBOgfP51gJOtpZbk9JOIKcw==", + "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#cbc30575c6a89e6607a3340918d1b4b4f3679ea3", + "from": "react-native-x-maps@github:Expensify/react-native-x-maps#hayata-test-new-version", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index bfb47c805da0..865c7777f06f 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.6", + "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 28ec8311c262..b0bffc696411 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -20,6 +20,17 @@ import BlockingView from './BlockingViews/BlockingView'; import useNetwork from '../hooks/useNetwork'; import useLocalize from '../hooks/useLocalize'; +const waypointsData = [ + { + coordinate: [0, 37], + markerComponent: () => , + }, + { + coordinate: [0, 38], + markerComponent: () => , + }, +]; + const MAX_WAYPOINTS = 25; const MAX_WAYPOINTS_TO_DISPLAY = 4; @@ -167,6 +178,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { zoom: DEFAULT_ZOOM_LEVEL, }} style={styles.mapView} + waypoints={waypointsData} /> ) : ( From b98ee9aff9175c191e1863f3fc73159636681f7a Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 16 Aug 2023 16:59:56 -0700 Subject: [PATCH 02/18] feat: display way points --- src/components/DistanceRequest.js | 35 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index b0bffc696411..3099e7777ee5 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -20,17 +20,6 @@ import BlockingView from './BlockingViews/BlockingView'; import useNetwork from '../hooks/useNetwork'; import useLocalize from '../hooks/useLocalize'; -const waypointsData = [ - { - coordinate: [0, 37], - markerComponent: () => , - }, - { - coordinate: [0, 38], - markerComponent: () => , - }, -]; - const MAX_WAYPOINTS = 25; const MAX_WAYPOINTS_TO_DISPLAY = 4; @@ -85,10 +74,32 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { const {translate} = useLocalize(); const waypoints = lodashGet(transaction, 'comment.waypoints', {}); - const waypointCoordinates = _.map(waypoints, (waypoint) => [waypoint.lat, waypoint.lng]); const numberOfWaypoints = _.size(waypoints); const lastWaypointIndex = numberOfWaypoints - 1; + const waypointsData = _.map(waypoints, (waypoint, key) => { + const index = Number(key.replace('waypoint', '')); + let MarkerComponent; + if (index === 0) { + MarkerComponent = Expensicons.DotIndicatorUnfilled; + } else if (index === lastWaypointIndex) { + MarkerComponent = Expensicons.Location; + } else { + MarkerComponent = Expensicons.DotIndicator; + } + + return { + coordinate: [0, 0], + // coordinate: [waypoint.lat, waypoint.lng], + markerComponent: () => ( + + ), + }; + }); + // Show up to the max number of waypoints plus 1/2 of one to hint at scrolling const halfMenuItemHeight = Math.floor(variables.baseMenuItemHeight / 2); const scrollContainerMaxHeight = variables.baseMenuItemHeight * MAX_WAYPOINTS_TO_DISPLAY + halfMenuItemHeight; From da602066bb7cb63243d5ecb0b2c05782619d5199 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 16 Aug 2023 22:02:37 -0700 Subject: [PATCH 03/18] chore: use SF coordinate for placeholder data --- src/components/DistanceRequest.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 3099e7777ee5..0b2835571650 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -89,7 +89,8 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { } return { - coordinate: [0, 0], + coordinate: CONST.SF_COORDINATES, + // Because coordinates of test waypoints are undefined, the SF coordinate is used temporarily. The below line should be uncommented once waypoints in correct format are saved in the waypoints editor page // coordinate: [waypoint.lat, waypoint.lng], markerComponent: () => ( Date: Wed, 16 Aug 2023 23:34:09 -0700 Subject: [PATCH 04/18] style: run prettier --- src/styles/styles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/styles.js b/src/styles/styles.js index fbe865f5335d..c40b5ae0c47f 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -3697,7 +3697,7 @@ const styles = { ...flex.flex1, borderRadius: variables.componentBorderRadiusLarge, }, - + userReportStatusEmoji: { fontSize: variables.fontSizeNormal, marginRight: 4, From 5e195504f96da09f55094942491c4c36a27b06c9 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Wed, 16 Aug 2023 23:34:29 -0700 Subject: [PATCH 05/18] fix: filter out undefined waypoints --- src/components/DistanceRequest.js | 51 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 0b2835571650..383d7a9c1c28 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -77,29 +77,34 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { const numberOfWaypoints = _.size(waypoints); const lastWaypointIndex = numberOfWaypoints - 1; - const waypointsData = _.map(waypoints, (waypoint, key) => { - const index = Number(key.replace('waypoint', '')); - let MarkerComponent; - if (index === 0) { - MarkerComponent = Expensicons.DotIndicatorUnfilled; - } else if (index === lastWaypointIndex) { - MarkerComponent = Expensicons.Location; - } else { - MarkerComponent = Expensicons.DotIndicator; - } - - return { - coordinate: CONST.SF_COORDINATES, - // Because coordinates of test waypoints are undefined, the SF coordinate is used temporarily. The below line should be uncommented once waypoints in correct format are saved in the waypoints editor page - // coordinate: [waypoint.lat, waypoint.lng], - markerComponent: () => ( - - ), - }; - }); + const waypointsData = _.filter( + _.map(waypoints, (waypoint, key) => { + if (waypoint.lng === undefined || waypoint.lat === undefined) { + return; + } + + const index = Number(key.replace('waypoint', '')); + let MarkerComponent; + if (index === 0) { + MarkerComponent = Expensicons.DotIndicatorUnfilled; + } else if (index === lastWaypointIndex) { + MarkerComponent = Expensicons.Location; + } else { + MarkerComponent = Expensicons.DotIndicator; + } + + return { + coordinate: [waypoint.lng, waypoint.lat], + markerComponent: () => ( + + ), + }; + }), + (waypoint) => waypoint, + ); // Show up to the max number of waypoints plus 1/2 of one to hint at scrolling const halfMenuItemHeight = Math.floor(variables.baseMenuItemHeight / 2); From 342f344cd9cc75d186b9046b5078d9f9b50a5f45 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 17 Aug 2023 15:29:29 -0700 Subject: [PATCH 06/18] chore(deps): install new version of x-maps --- package-lock.json | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index d27c4dbed1cb..744313b60488 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", + "react-native-x-maps": "1.0.7", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -43424,9 +43424,9 @@ } }, "node_modules/react-native-x-maps": { - "version": "1.0.6", - "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#cbc30575c6a89e6607a3340918d1b4b4f3679ea3", - "license": "MIT", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.7.tgz", + "integrity": "sha512-dfuEPWAXjESTTZ2tLFkYLHjd++s/goGvksiPib4a6DoPfF1HA6jXvasB9ddjG1iHMVmHY8Cvc2OVZTGNaAp0RA==", "peerDependencies": { "@math.gl/web-mercator": "^3.6.3", "@rnmapbox/maps": "^10.0.11", @@ -80237,8 +80237,9 @@ } }, "react-native-x-maps": { - "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#cbc30575c6a89e6607a3340918d1b4b4f3679ea3", - "from": "react-native-x-maps@github:Expensify/react-native-x-maps#hayata-test-new-version", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.7.tgz", + "integrity": "sha512-dfuEPWAXjESTTZ2tLFkYLHjd++s/goGvksiPib4a6DoPfF1HA6jXvasB9ddjG1iHMVmHY8Cvc2OVZTGNaAp0RA==", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index 865c7777f06f..eac2aceb4466 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", + "react-native-x-maps": "1.0.7", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From dd7f3f4d34e66ee9dab3540be5afca248e595faa Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 17 Aug 2023 20:10:44 -0700 Subject: [PATCH 07/18] chore: use the code from test branch for the map lib --- package-lock.json | 13 ++++++------- package.json | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 744313b60488..c11bb7cde369 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.7", + "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -43424,9 +43424,9 @@ } }, "node_modules/react-native-x-maps": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.7.tgz", - "integrity": "sha512-dfuEPWAXjESTTZ2tLFkYLHjd++s/goGvksiPib4a6DoPfF1HA6jXvasB9ddjG1iHMVmHY8Cvc2OVZTGNaAp0RA==", + "version": "1.0.6", + "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#fe69c26a1a80c3b1f5ddeef389b5d1a179a94dfc", + "license": "MIT", "peerDependencies": { "@math.gl/web-mercator": "^3.6.3", "@rnmapbox/maps": "^10.0.11", @@ -80237,9 +80237,8 @@ } }, "react-native-x-maps": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.7.tgz", - "integrity": "sha512-dfuEPWAXjESTTZ2tLFkYLHjd++s/goGvksiPib4a6DoPfF1HA6jXvasB9ddjG1iHMVmHY8Cvc2OVZTGNaAp0RA==", + "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#fe69c26a1a80c3b1f5ddeef389b5d1a179a94dfc", + "from": "react-native-x-maps@github:Expensify/react-native-x-maps#hayata-test-new-version", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index eac2aceb4466..865c7777f06f 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.7", + "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From b31cea81c6d493062024a26a5d633423246ca66f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Thu, 17 Aug 2023 20:11:02 -0700 Subject: [PATCH 08/18] chore: update pod version --- ios/Podfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 66482252f95e..505624b3c455 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1276,4 +1276,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 845537d35601574adcd0794e17003ba7dbccdbfd -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1 From bd84bb84ce3469c8a5704a362cd7779d254fba4d Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sun, 20 Aug 2023 21:08:57 -0700 Subject: [PATCH 09/18] fix: pass width prop so that marker is displayed on ios --- src/components/DistanceRequest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 383d7a9c1c28..71662f1a7017 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -97,6 +97,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { coordinate: [waypoint.lng, waypoint.lat], markerComponent: () => ( From 9387d158b6ddc5e0f83c80c0626aee0a0360eb98 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Sun, 20 Aug 2023 21:40:06 -0700 Subject: [PATCH 10/18] chore: change test branch --- package-lock.json | 31 +++++-------------------------- package.json | 2 +- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index c11bb7cde369..e984d50aa348 100644 --- a/package-lock.json +++ b/package-lock.json @@ -104,7 +104,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", + "react-native-x-maps": "github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -5597,16 +5597,6 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, - "node_modules/@math.gl/web-mercator": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-3.6.3.tgz", - "integrity": "sha512-UVrkSOs02YLehKaehrxhAejYMurehIHPfFQvPFZmdJHglHOU4V2cCUApTVEwOksvCp161ypEqVp+9H6mGhTTcw==", - "peer": true, - "dependencies": { - "@babel/runtime": "^7.12.0", - "gl-matrix": "^3.4.0" - } - }, "node_modules/@mdx-js/mdx": { "version": "1.6.22", "dev": true, @@ -43424,11 +43414,10 @@ } }, "node_modules/react-native-x-maps": { - "version": "1.0.6", - "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#fe69c26a1a80c3b1f5ddeef389b5d1a179a94dfc", + "version": "1.0.7", + "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#6dbe84db037bae4dc43d146bd7ed112f09758c27", "license": "MIT", "peerDependencies": { - "@math.gl/web-mercator": "^3.6.3", "@rnmapbox/maps": "^10.0.11", "mapbox-gl": "^2.15.0", "react": "^18.2.0", @@ -54160,16 +54149,6 @@ "sort-object": "^3.0.3" } }, - "@math.gl/web-mercator": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-3.6.3.tgz", - "integrity": "sha512-UVrkSOs02YLehKaehrxhAejYMurehIHPfFQvPFZmdJHglHOU4V2cCUApTVEwOksvCp161ypEqVp+9H6mGhTTcw==", - "peer": true, - "requires": { - "@babel/runtime": "^7.12.0", - "gl-matrix": "^3.4.0" - } - }, "@mdx-js/mdx": { "version": "1.6.22", "dev": true, @@ -80237,8 +80216,8 @@ } }, "react-native-x-maps": { - "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#fe69c26a1a80c3b1f5ddeef389b5d1a179a94dfc", - "from": "react-native-x-maps@github:Expensify/react-native-x-maps#hayata-test-new-version", + "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#6dbe84db037bae4dc43d146bd7ed112f09758c27", + "from": "react-native-x-maps@github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index 865c7777f06f..475ff2b2ff14 100644 --- a/package.json +++ b/package.json @@ -144,7 +144,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#hayata-test-new-version", + "react-native-x-maps": "github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From c7e472cded75066f5e38ea9a95ddba10e9b65d8f Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 08:56:25 -0700 Subject: [PATCH 11/18] chore(dep): bump package version --- package-lock.json | 13 +++++++------ package.json | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index b385335a3d55..2391d7b45d13 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,7 +107,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", + "react-native-x-maps": "^1.0.8", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -43447,9 +43447,9 @@ } }, "node_modules/react-native-x-maps": { - "version": "1.0.7", - "resolved": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#6dbe84db037bae4dc43d146bd7ed112f09758c27", - "license": "MIT", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.8.tgz", + "integrity": "sha512-9JSm/6QvK7tKgNqloJ4rqlDCDvbAe0pJSn58aPvesA24pLK3lSm3CIGLT2sx7wHEgzQiXEtC0sM+Qa0p/z2xKw==", "peerDependencies": { "@rnmapbox/maps": "^10.0.11", "mapbox-gl": "^2.15.0", @@ -80288,8 +80288,9 @@ } }, "react-native-x-maps": { - "version": "git+ssh://git@github.com/Expensify/react-native-x-maps.git#6dbe84db037bae4dc43d146bd7ed112f09758c27", - "from": "react-native-x-maps@github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.8.tgz", + "integrity": "sha512-9JSm/6QvK7tKgNqloJ4rqlDCDvbAe0pJSn58aPvesA24pLK3lSm3CIGLT2sx7wHEgzQiXEtC0sM+Qa0p/z2xKw==", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index ae07570ef6a8..2c0f6475f57e 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "github:Expensify/react-native-x-maps#test-hayata-fix-bounds-calculation", + "react-native-x-maps": "1.0.8", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From bc099f1441a0fc5ff23b96f45bc96235211559a2 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 08:58:06 -0700 Subject: [PATCH 12/18] chore(dep): run npm install --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 2391d7b45d13..655c0c3d5ab3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,7 +107,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "^1.0.8", + "react-native-x-maps": "1.0.8", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From 5518086071e7f6f3b07c55eb75149458e20b494b Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 13:40:13 -0700 Subject: [PATCH 13/18] style: rename a variable --- src/components/DistanceRequest.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 6a461d6f2d9a..e2c486801b81 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -80,7 +80,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { const numberOfWaypoints = _.size(waypoints); const lastWaypointIndex = numberOfWaypoints - 1; - const waypointsData = _.filter( + const waypointMarkers = _.filter( _.map(waypoints, (waypoint, key) => { if (waypoint.lng === undefined || waypoint.lat === undefined) { return; @@ -205,7 +205,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { zoom: DEFAULT_ZOOM_LEVEL, }} style={styles.mapView} - waypoints={waypointsData} + waypoints={waypointMarkers} /> ) : ( From 40eecdb61a851807bdb4808579237ad747823770 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 13:43:52 -0700 Subject: [PATCH 14/18] fix: check for null --- src/components/DistanceRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index e2c486801b81..f0fae054a9b0 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -82,7 +82,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { const waypointMarkers = _.filter( _.map(waypoints, (waypoint, key) => { - if (waypoint.lng === undefined || waypoint.lat === undefined) { + if (!waypoint || waypoint.lng === undefined || waypoint.lat === undefined) { return; } From a9b1cde48097686790e79aace1696b21f84c56f4 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 14:06:15 -0700 Subject: [PATCH 15/18] fix: change icon color --- src/components/DistanceRequest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index f0fae054a9b0..6ba8ebbf3d01 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -102,7 +102,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { ), }; From 9fa23b0f7d9753d79c580761bd10470fc7f0c3be Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 14:09:42 -0700 Subject: [PATCH 16/18] feat: use Expensify style in map --- src/CONST.js | 1 + src/components/DistanceRequest.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/CONST.js b/src/CONST.js index e7d2fa6f4d03..0494fed3589c 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -2553,6 +2553,7 @@ const CONST = { }, STATUS_TEXT_MAX_LENGTH: 100, SF_COORDINATES: [-122.4194, 37.7749], + MAPBOX_STYLE_URL: 'mapbox://styles/expensify/cllcoiqds00cs01r80kp34tmq', NAVIGATION: { TYPE: { FORCED_UP: 'FORCED_UP', diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index 6ba8ebbf3d01..a3431ed8eccf 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -206,6 +206,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { }} style={styles.mapView} waypoints={waypointMarkers} + styleURL={CONST.MAPBOX_STYLE_URL} /> ) : ( From 0c08d09ed0aaa9d85e1bee856a3b6de6c44e48f4 Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 15:12:26 -0700 Subject: [PATCH 17/18] chore(deps): update x-maps version --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 655c0c3d5ab3..a5ca972bb42e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107,7 +107,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.8", + "react-native-x-maps": "1.0.9", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", @@ -43447,9 +43447,9 @@ } }, "node_modules/react-native-x-maps": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.8.tgz", - "integrity": "sha512-9JSm/6QvK7tKgNqloJ4rqlDCDvbAe0pJSn58aPvesA24pLK3lSm3CIGLT2sx7wHEgzQiXEtC0sM+Qa0p/z2xKw==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.9.tgz", + "integrity": "sha512-EEb0BcAWwTnN18J2QL7WHbafV/NLaxtPKJbB0SYJp4KzGK1lRTT3Pl/LYodEUhLUbYk04Y0jcA8ifiImc7yn6A==", "peerDependencies": { "@rnmapbox/maps": "^10.0.11", "mapbox-gl": "^2.15.0", @@ -80288,9 +80288,9 @@ } }, "react-native-x-maps": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.8.tgz", - "integrity": "sha512-9JSm/6QvK7tKgNqloJ4rqlDCDvbAe0pJSn58aPvesA24pLK3lSm3CIGLT2sx7wHEgzQiXEtC0sM+Qa0p/z2xKw==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/react-native-x-maps/-/react-native-x-maps-1.0.9.tgz", + "integrity": "sha512-EEb0BcAWwTnN18J2QL7WHbafV/NLaxtPKJbB0SYJp4KzGK1lRTT3Pl/LYodEUhLUbYk04Y0jcA8ifiImc7yn6A==", "requires": {} }, "react-pdf": { diff --git a/package.json b/package.json index 2c0f6475f57e..bd9ff1d2b5a1 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,7 @@ "react-native-web-linear-gradient": "^1.1.2", "react-native-web-lottie": "^1.4.4", "react-native-webview": "^11.17.2", - "react-native-x-maps": "1.0.8", + "react-native-x-maps": "^1.0.9", "react-pdf": "^6.2.2", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", From b2416eb347644128feea876f22a1908afc58f30a Mon Sep 17 00:00:00 2001 From: Hayata Suenaga Date: Mon, 21 Aug 2023 15:48:05 -0700 Subject: [PATCH 18/18] fix: hide link url --- src/components/DistanceRequest.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/DistanceRequest.js b/src/components/DistanceRequest.js index a3431ed8eccf..8f07c7c05ecf 100644 --- a/src/components/DistanceRequest.js +++ b/src/components/DistanceRequest.js @@ -214,6 +214,7 @@ function DistanceRequest({transactionID, transaction, mapboxAccessToken}) { icon={Expensicons.EmptyStateRoutePending} title={translate('distance.mapPending.title')} subtitle={isOffline ? translate('distance.mapPending.subtitle') : translate('distance.mapPending.onlineSubtitle')} + shouldShowLink={false} /> )}