-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: Tracks saving #271
Merged
Merged
feat: Tracks saving #271
Changes from all commits
Commits
Show all changes
148 commits
Select commit
Hold shift + click to select a range
77245ee
wip nav changes to allow displaying modal without changing screen
CDFN 2ba1cea
add custom tab bar icon and label
bohdanprog 733746e
add modal with different options
bohdanprog 6bd0461
tracks poc
CDFN 1f597d7
add check if permission granted, add function to request about permis…
bohdanprog bef576b
add animation, add function for check permission disable strart track…
bohdanprog d9dfbde
wip nav changes to allow displaying modal without changing screen
CDFN 9620c12
add custom tab bar icon and label
bohdanprog 1d8da9e
add modal with different options
bohdanprog 7245fe7
tracks poc
CDFN 8773faf
add check if permission granted, add function to request about permis…
bohdanprog dfa1791
add animation, add function for check permission disable strart track…
bohdanprog dee33fd
fixed problem with custom modal
bohdanprog 94db2fa
merged
bohdanprog 5e338f7
fix hooks dependencies, user location flick
CDFN e145973
cleanup
CDFN 5cfeb75
place observations exactly at track line
CDFN 8d398c5
store observations found on track
CDFN 82b5c5c
add check if foreground permission is granted, add gps indicator
bohdanprog d3c53ea
move gps indicator to map header
bohdanprog 9d125b0
create custom bottom sheet component with clicalbe backdrop
bohdanprog f1b7ede
add icon to start tracking and stop tracking button
bohdanprog 804f42b
fix hooks dependencies, user location flick
CDFN d56b2b5
cleanup
CDFN 02bab4b
place observations exactly at track line
CDFN f8b2a3a
store observations found on track
CDFN b35b1ec
add check if foreground permission is granted, add gps indicator
bohdanprog 577c6db
move gps indicator to map header
bohdanprog 07f8662
fix bug where observations don't display when there's no tracking line
CDFN 44aae30
cleanup track store naming
CDFN 41c3dd5
extract track layer to separate component
CDFN ce07f72
correct imports, remove unused ones
CDFN 07aab30
implement user location tooltip
CDFN b1effbe
Merge remote-tracking branch 'origin/feat/tracking-impl' into feat/tr…
CDFN 39abc58
path drawing fixes
CDFN a2119fb
add timer indicator to stop tracking modal
bohdanprog 1018be7
Merge branch 'main' of github.com:digidem/CoMapeo-mobile into feat/tr…
bohdanprog f806152
add show timer indicator in bottom tab bar
bohdanprog 8505add
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog a5fa8b6
remove tab bar label, changed tabbar height
bohdanprog c2d4080
save only required data for track path drawing
CDFN e8172db
move TrackPathLayer to track folder
CDFN d8327d6
move task definition to different place
CDFN 7d6b48d
fix layers order
CDFN 86ceb3a
create context where we keep timer data
bohdanprog 75728e5
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog 7033d6e
extract types from store to common types
CDFN 5593ed2
pre-review cleanups
CDFN 915f28e
add comment explaining distance calc algo
CDFN 56a0d18
correct import
CDFN 465ea18
use luxon for duration formatting
CDFN eb40ca0
fix eslint rule
CDFN d15f719
add translations to gps modal
bohdanprog 2c5eccd
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog 815c42c
add changes to en.json
bohdanprog d36f508
changed GPS pill
bohdanprog ed9ce3a
add enum type with tab names,changes check in navigation listener
bohdanprog 312bf28
set default route name to navigation store, use enum names in tabs name
bohdanprog 03d0933
add test case for calculate distance function, rename varialbes
bohdanprog adba278
changed gps pill padding
bohdanprog 9d28264
using in setCurrentTab function enum
bohdanprog 20a32ba
create save track screen, create discard modal
bohdanprog 78e4a87
add translations
bohdanprog 6fa47da
update calculate distance function
bohdanprog 2b1e4ee
remove comment
bohdanprog 2c7da91
fix problem with timing calculation
bohdanprog 9d5f7e4
improve typing a bit
CDFN 19f4ab9
add shared location context
CDFN fe1d388
fix problem with gps modal and tab screen
bohdanprog ebec3c1
change place where we get locaiton, using react.memo to memorize trac…
bohdanprog 213b61d
add back rounding of gps precision
CDFN 4070000
add description option to save track screen
bohdanprog 3be3b22
restore changes in podfile
bohdanprog 6f80c3a
create all fields in save track screen
bohdanprog e0196dd
add translations
bohdanprog cd7fc9f
update packages, create hook for creating track
bohdanprog 4497d29
add discard button icon
bohdanprog 2fce41a
update calculate distance function
bohdanprog 7e1dfcc
remove comment
bohdanprog 2be2a76
fix problem with timing calculation
bohdanprog ea50660
fix problem with gps modal and tab screen
bohdanprog 6139e68
improve typing a bit
CDFN 71bc132
add shared location context
CDFN 9d99998
chore: update Mapeo deps
EvanHahn 7c6d4fa
update libs, wip track saving
CDFN 1494b06
Fix @rollup/plugin-esm-shim bug
EvanHahn 8b5e0dd
Merge branch 'main' of github.com:digidem/CoMapeo-mobile into feat/sa…
bohdanprog 80f6899
Merge branch 'update-mapeo-deps' of github.com:digidem/CoMapeo-mobile…
bohdanprog 9167ea9
changed track description
bohdanprog 6c127b1
fixed problem with GPSmodal
bohdanprog f1e2971
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog 328e4c6
code quality improvement
CDFN c9e6199
implement track saving
CDFN bda1a0f
remove temp initial route
CDFN 08d7d30
remove irrelevant change
CDFN d3eb761
move BottomSheet to shared directory
CDFN 63068f1
general cleanups
CDFN d082363
extract inline style to stylesheet
CDFN a56e14d
remove unused var
CDFN c73ebda
use cheap-ruler instead own distance calc
CDFN b4f92a4
Use ellipsis symbol instead triple dot
CDFN cfc9ab7
add header to tab navigator, fixed problem with navigator in homeHead…
bohdanprog 998808a
rename gpsModal to GPSPermissionModal also renamed other connected co…
bohdanprog 4dfc34d
Merge branch 'main' of github.com:digidem/CoMapeo-mobile into feat/tr…
bohdanprog 255f590
fixed problem with dependency in useTracking hook
bohdanprog 719a83f
Apply review suggestions
CDFN 063f160
remove irrelevant changes to navigation
CDFN 119bf56
rename store from useNvigatorStore to useTabNvigatorStore
bohdanprog 44e0872
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog b9b5f28
restore changes with GPSPill
bohdanprog f26c348
Merge branch 'feat/tracking-impl' into feat/save-track
CDFN b59241a
Merge branch 'feat/tracking-impl' into feat/save-track
CDFN 4aef7bc
rename gps components
bohdanprog 9dbec7f
rename gps components
bohdanprog 4d89a79
fix bug with distance not zeroing, adjust store to type changes
CDFN f727a51
extract inline style to stylesheet
CDFN 3d97b51
unify keys in queries
CDFN 0cf1cb9
improve i18n
CDFN f32df4c
fixed issue with not resetitng trackingSince, move SharedLocationCont…
bohdanprog 6eb15e4
changed timer type
bohdanprog 22bbfdf
remove unnecessary props isFocused
bohdanprog ea50a90
remove navigation cast type to as never, add navigation types
bohdanprog 135c56d
remove unnecessary hook and inline task registration
CDFN 09c3bc3
fixed timer nulable case
bohdanprog c0283c5
rebase to main
bohdanprog 3de6ddf
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog da725cb
add another solution to track timer
bohdanprog bc88c90
Merge branch 'feat/tracking-impl' of github.com:digidem/CoMapeo-mobil…
bohdanprog 6b6fccd
save track notes
CDFN 80457ec
Merge branch 'feat/tracking-impl' into feat/save-track
CDFN c0e71f6
Merge branch 'main' into feat/save-track
CDFN 2c66b30
Merge branch 'feat/save-track' of github.com:digidem/CoMapeo-mobile i…
bohdanprog 358aa50
Merge branch 'main' into feat/save-track
CDFN 1817157
Merge branch 'main' of github.com:digidem/CoMapeo-mobile into feat/sa…
bohdanprog 3ae8458
revert changes in package.json and package.lock
bohdanprog 3f261a5
revert changes with mapeo/ipc
bohdanprog 1e0efcb
revert changes package.json and package-lock.json
bohdanprog 95bddae
add edit track screen, add update track method
bohdanprog 6854969
Merge branch 'feat/save-track' of github.com:digidem/CoMapeo-mobile i…
bohdanprog b4afdbe
bring back feature flag, remove unnecessary checks
CDFN 8a47fdf
fixed issue with discard track modal, using already created bottom sh…
bohdanprog c20cb74
create share component DiscardModal, fixed dependency in useTracking …
bohdanprog b19e32b
add edit track screen, add update track method
bohdanprog 0fa31af
add edit track screen, add update track method
bohdanprog 524b58a
add back handler on Save Track Screen
bohdanprog af009b0
changed save track screen, using header from react-native-navigation …
bohdanprog d73fdba
Merge branch 'main' into feat/save-track
CDFN d2da3c7
Merge branch 'feat/save-track' of github.com:digidem/CoMapeo-mobile i…
bohdanprog File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { | ||
useQueryClient, | ||
useMutation, | ||
useSuspenseQuery, | ||
} from '@tanstack/react-query'; | ||
import {useProject} from './projects'; | ||
import {TrackValue} from '@mapeo/schema'; | ||
|
||
export const TRACK_KEY = 'tracks'; | ||
|
||
export function useCreateTrack() { | ||
const queryClient = useQueryClient(); | ||
const project = useProject(); | ||
return useMutation({ | ||
mutationFn: async (params: TrackValue) => { | ||
return project.track.create(params); | ||
}, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({queryKey: [TRACK_KEY]}); | ||
}, | ||
}); | ||
} | ||
|
||
export function useTracksQuery() { | ||
const project = useProject(); | ||
return useSuspenseQuery({ | ||
queryKey: [TRACK_KEY], | ||
queryFn: async () => { | ||
return project.track.getMany(); | ||
}, | ||
}); | ||
} | ||
|
||
export function useTrackQuery(docId: string) { | ||
const project = useProject(); | ||
return useSuspenseQuery({ | ||
queryKey: [TRACK_KEY, docId], | ||
queryFn: async () => { | ||
return project.track.getByDocId(docId); | ||
}, | ||
}); | ||
} | ||
|
||
export function useDeleteTrackMutation() { | ||
const queryClient = useQueryClient(); | ||
const project = useProject(); | ||
return useMutation({ | ||
mutationFn: async (docId: string) => { | ||
return project.track.delete(docId); | ||
}, | ||
onSuccess: () => { | ||
queryClient.invalidateQueries({queryKey: [TRACK_KEY]}); | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: