Skip to content

Commit

Permalink
feat: implement manual gps coordinate entry screen
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed Apr 23, 2024
1 parent cdf151a commit 2560f0d
Show file tree
Hide file tree
Showing 14 changed files with 1,447 additions and 21 deletions.
112 changes: 112 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,118 @@
"description": "v is short for version. the translation for version can be used instead",
"message": "V"
},
"screens.ManualGpsScreen.DdForm.east": {
"message": "East"
},
"screens.ManualGpsScreen.DdForm.invalidCoordinates": {
"message": "Invalid coordinates"
},
"screens.ManualGpsScreen.DdForm.latInputLabel": {
"message": "Latitude value"
},
"screens.ManualGpsScreen.DdForm.latitude": {
"message": "Latitude"
},
"screens.ManualGpsScreen.DdForm.lonInputLabel": {
"message": "Longitude value"
},
"screens.ManualGpsScreen.DdForm.longitude": {
"message": "Longitude"
},
"screens.ManualGpsScreen.DdForm.north": {
"message": "North"
},
"screens.ManualGpsScreen.DdForm.selectLatCardinality": {
"message": "Select latitude cardinality"
},
"screens.ManualGpsScreen.DdForm.selectLonCardinality": {
"message": "Select longitude cardinality"
},
"screens.ManualGpsScreen.DdForm.south": {
"message": "South"
},
"screens.ManualGpsScreen.DdForm.west": {
"message": "West"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.MinutesInputLabel": {
"message": "{field} minutes input"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.SecondsInputLabel": {
"message": "{field} seconds input"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.degrees": {
"message": "Degrees"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.degreesInputLabel": {
"message": "{field} degrees input"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.direction": {
"message": "Direction"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.minutes": {
"message": "Minutes"
},
"screens.ManualGpsScreen.DmsForm.DmsInputGroup.seconds": {
"message": "Seconds"
},
"screens.ManualGpsScreen.DmsForm.east": {
"message": "East"
},
"screens.ManualGpsScreen.DmsForm.invalidCoordinates": {
"message": "Invalid coordinates"
},
"screens.ManualGpsScreen.DmsForm.latitude": {
"message": "Latitude"
},
"screens.ManualGpsScreen.DmsForm.longitude": {
"message": "Longitude"
},
"screens.ManualGpsScreen.DmsForm.north": {
"message": "North"
},
"screens.ManualGpsScreen.DmsForm.selectLatCardinality": {
"message": "Select latitude cardinality"
},
"screens.ManualGpsScreen.DmsForm.south": {
"message": "South"
},
"screens.ManualGpsScreen.DmsForm.west": {
"message": "West"
},
"screens.ManualGpsScreen.coordinateFormat": {
"message": "Coordinate Format"
},
"screens.ManualGpsScreen.decimalDegrees": {
"message": "Decimal Degrees (DD)"
},
"screens.ManualGpsScreen.degreesMinutesSeconds": {
"message": "Degrees/Minutes/Seconds (DMS)"
},
"screens.ManualGpsScreen.easting": {
"message": "East"
},
"screens.ManualGpsScreen.eastingSuffix": {
"message": "mE"
},
"screens.ManualGpsScreen.northing": {
"message": "North"
},
"screens.ManualGpsScreen.northingSuffix": {
"message": "mN"
},
"screens.ManualGpsScreen.title": {
"description": "title of manual GPS screen",
"message": "Enter coordinates"
},
"screens.ManualGpsScreen.universalTransverseMercator": {
"message": "Universal Transverse Mercator (UTM)"
},
"screens.ManualGpsScreen.zoneLetter": {
"message": "Zone Letter"
},
"screens.ManualGpsScreen.zoneNumber": {
"message": "Zone Number"
},
"screens.ObscurePasscode.description": {
"message": "Obscure Passcode is a security feature that allows you to open Mapeo in a decoy mode that hides all of your data. Entering the Obscure Passcode on the intro screen will display an empty version of Mapeo which allows you to create demonstration observations that are not saved to the Mapeo database."
},
Expand Down
9 changes: 9 additions & 0 deletions src/frontend/Navigation/ScreenGroups/AppScreens.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ import {useLocationProviderStatus} from '../../hooks/useLocationProviderStatus';
import {getLocationStatus} from '../../lib/utils';
import {InviteDeclined} from '../../screens/Settings/ProjectSettings/YourTeam/InviteDeclined';
import {UnableToCancelInvite} from '../../screens/Settings/ProjectSettings/YourTeam/ReviewAndInvite/UnableToCancelInvite';
import {
ManualGpsScreen,
createNavigationOptions as createManualGpsNavigationOptions,
} from '../../screens/ManualGpsScreen';

export type HomeTabsList = {
Map: undefined;
Expand Down Expand Up @@ -347,5 +351,10 @@ export const createDefaultScreenGroup = (
component={UnableToCancelInvite}
options={{headerShown: false}}
/>
<RootStack.Screen
name="ManualGpsScreen"
component={ManualGpsScreen}
options={createManualGpsNavigationOptions({intl})}
/>
</RootStack.Group>
);
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const draftObservationSlice: StateCreator<DraftObservationSlice> = (
metadata: {
...prevValue.metadata,
position: props.position,
manualLocation: props.manualLocation,
},
},
});
Expand Down
7 changes: 7 additions & 0 deletions src/frontend/hooks/persistedState/usePersistedSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,22 @@ import {CoordinateFormat} from '../../sharedTypes';

type SettingsSlice = {
coordinateFormat: CoordinateFormat;
manualCoordinateEntryFormat: CoordinateFormat;
actions: {
setCoordinateFormat: (coordinateFormat: CoordinateFormat) => void;
setManualCoordinateEntryFormat: (
coordinateFormat: CoordinateFormat,
) => void;
};
};

const settingsSlice: StateCreator<SettingsSlice> = (set, get) => ({
coordinateFormat: 'utm',
manualCoordinateEntryFormat: 'utm',
actions: {
setCoordinateFormat: coordinateFormat => set({coordinateFormat}),
setManualCoordinateEntryFormat: coordinateFormat =>
set({manualCoordinateEntryFormat: coordinateFormat}),
},
});

Expand Down
Loading

0 comments on commit 2560f0d

Please sign in to comment.