Skip to content
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

Added option to get user's current location #26546

Merged
merged 59 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
cd8cb9b
Added getCurrentPosition util
huzaifa-99 Sep 1, 2023
27f52d2
Added option to use current location in waypoint select
huzaifa-99 Sep 1, 2023
6d55057
Keep suggestion open on empty text with predefined suggestions
huzaifa-99 Sep 1, 2023
4f3c0ff
Disable current location button when offline
huzaifa-99 Sep 1, 2023
8203e03
Updated translation keys for address search hint
huzaifa-99 Sep 1, 2023
a55358c
Updated config for getting current location
huzaifa-99 Sep 1, 2023
f718ed6
Disable text select on current location button when offline
huzaifa-99 Sep 2, 2023
98f7570
Added missing comma in spanish translation
huzaifa-99 Sep 2, 2023
c2d67b8
Updated current location timeout to 5 seconds
huzaifa-99 Sep 2, 2023
1221d12
Updated function name
huzaifa-99 Sep 2, 2023
1be54a1
Use sentense case for comments
huzaifa-99 Sep 2, 2023
c097915
Move success/error callbacks inline
huzaifa-99 Sep 2, 2023
fa5aaef
Used index.platform file format for getCurrentPosition lib
huzaifa-99 Sep 2, 2023
befbb1f
Updated locationErrorCode prop type
huzaifa-99 Sep 2, 2023
fab2259
Moved navigator callback outside component body
huzaifa-99 Sep 2, 2023
19d0742
Updated desktop geolocation implementation
huzaifa-99 Sep 2, 2023
f7654d6
Prevent saving current location waypoint as recent wauypoint
huzaifa-99 Sep 2, 2023
cc97747
Updated location error text style
huzaifa-99 Sep 3, 2023
67c7c8a
Added location permission in android manifest
huzaifa-99 Sep 3, 2023
45947ce
Show system location enable prompt for geolocation on android
huzaifa-99 Sep 3, 2023
a7f6e18
Fix action argument type doc
huzaifa-99 Sep 3, 2023
7656511
Fix lint
huzaifa-99 Sep 4, 2023
f4ee7d7
Added loader when fetching location
huzaifa-99 Sep 4, 2023
fb37344
Prevent modal close on location fetch
huzaifa-99 Sep 4, 2023
40792cc
Moved location callback branch case to UserCurrentLocationButton
huzaifa-99 Sep 4, 2023
e0be146
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 6, 2023
79c187d
Hide keyboard immediately after clicking 'current location' btn
huzaifa-99 Sep 6, 2023
cb65a73
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 15, 2023
49c619b
Added null as default for locationErrorCode prop
huzaifa-99 Sep 18, 2023
08debbc
Inlined User.clearLocationError function call
huzaifa-99 Sep 18, 2023
809a449
Added comment for onyx props
huzaifa-99 Sep 18, 2023
1d31921
Updated location not found translation
huzaifa-99 Sep 18, 2023
1122848
Updated JSDoc for function definition
huzaifa-99 Sep 18, 2023
7d7f05f
Remove react-native-geolocation lib
huzaifa-99 Sep 18, 2023
07d3da3
Updated locationErrorCode proptype
huzaifa-99 Sep 18, 2023
393d582
Updated location error link style
huzaifa-99 Sep 18, 2023
b1a7da2
Filter 'Your Location' from recent waypoints without flag param
huzaifa-99 Sep 20, 2023
774fcd1
Updated navigator branch condition
huzaifa-99 Sep 20, 2023
50680b4
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 20, 2023
caa536d
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 21, 2023
7f309ad
Reverted undefined check
huzaifa-99 Sep 21, 2023
63b4379
Fix lint
huzaifa-99 Sep 21, 2023
7c8109e
Fix package-lock.json
huzaifa-99 Sep 25, 2023
2ba6260
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 25, 2023
74b16e2
Fix lint
huzaifa-99 Sep 25, 2023
2f0c0f0
Updated comment about ms delay for getCurrentPosition call
huzaifa-99 Sep 25, 2023
8d16400
Fix lint
huzaifa-99 Sep 25, 2023
c0d32e2
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 26, 2023
2f04195
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 28, 2023
3e8a077
Use state for location error message
huzaifa-99 Sep 28, 2023
572cd7a
Updated import
huzaifa-99 Sep 28, 2023
853f7e4
Pass default props to location error message
huzaifa-99 Sep 28, 2023
2b34ccd
Added comment about using withLocalize
huzaifa-99 Sep 28, 2023
6c505e4
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Sep 29, 2023
ae8ec7a
Updated comments
huzaifa-99 Oct 2, 2023
37a47c2
Added line break before condition
huzaifa-99 Oct 2, 2023
98fcdc5
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Oct 2, 2023
8a5cc0b
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Oct 3, 2023
c226384
Merge branch 'main' into 25855-get-user-location
huzaifa-99 Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use sentense case for comments
  • Loading branch information
huzaifa-99 committed Sep 2, 2023
commit 1be54a1c237974d594104064274cfa4f6ca5fafa
2 changes: 1 addition & 1 deletion src/components/LocationErrorMessage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import CONST from '../../CONST';
import BaseLocationErrorMessage from './BaseLocationErrorMessage';

function LocationErrorMessage() {
/** opens expensify help site in a new browser tab */
/** Opens expensify help site in a new browser tab */
const navigateToExpensifyHelpSite = () => {
Linking.openURL(CONST.NEWHELP_URL);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/LocationErrorMessage/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Linking} from 'react-native';
import BaseLocationErrorMessage from './BaseLocationErrorMessage';

function LocationErrorMessage() {
/** opens app level settings from the system settings */
/** Opens app level settings from the system settings */
const openAppSettings = () => {
hayata-suenaga marked this conversation as resolved.
Show resolved Hide resolved
Linking.openSettings();
};
Expand Down
8 changes: 4 additions & 4 deletions src/components/UserCurrentLocationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function UserCurrentLocationButton({onLocationFetched, isDisabled, translate}) {
const isFetchingLocation = useRef(false);

/**
* handles error when failed to get user's current location
* Handles error when failed to get user's current location
* @param {Object} errorData
* @param {Number} errorData.code
*/
Expand All @@ -40,7 +40,7 @@ function UserCurrentLocationButton({onLocationFetched, isDisabled, translate}) {
};

/**
* handles success after getting user's current location
* Handles success after getting user's current location
* @param {Object} successData
* @param {Object} successData.coords
* @param {Number} successData.coords.longitude
Expand All @@ -62,13 +62,13 @@ function UserCurrentLocationButton({onLocationFetched, isDisabled, translate}) {
isFetchingLocation.current = true;

getCurrentPosition(onSuccess, onError, {
maximumAge: 0, // no cache, always get fresh location info
maximumAge: 0, // No cache, always get fresh location info
timeout: 5000,
});
};

useEffect(() => {
// clear location errors on mount
// Clear location errors on mount
User.clearLocationError();
}, []);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/iou/WaypointEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function WaypointEditor({transactionID, route: {params: {iouType = '', waypointI
};

/**
* sets user current location as a waypoint
* Sets user current location as a waypoint
* @param {Object} geolocationData
* @param {Object} geolocationData.coords.latitude
* @param {Object} geolocationData.coords.longitude
Expand Down