Commit Graph

51 Commits

Author SHA1 Message Date
Amanda Bullington
045ce6f789 Improve Jest performance (#1160)
* Use faker import with specific locale

* Add global beforeAll to initiate i18next
2024-02-16 16:17:00 -08:00
Amanda Bullington
8e6269c8d0 Wrap realm.write in safeRealmWrite transaction (#1123)
* Add a safeRealmWrite transaction for better logging around writes; code cleanup and realm update

* Add safeRealmWrite to tests and make sure action is called synchronously

* Fix final test

* Only write to realm when useObservationsUpdates data changes; code cleanup

* Code cleanup
2024-02-09 16:16:32 -08:00
Amanda Bullington
b69e5a9923 Reset IconicTaxonChooser when navigating multiple observations (#1100)
* Reset IconicTaxonChooser when navigating multiple observations; closes #1092

* Fix test undefined key error

* Remove console log
2024-01-31 15:42:22 -08:00
Amanda Bullington
bb6a180527 Observation deletion on MyObservations (#1082)
* Delete local & remote observations on MyObs; show progress

* Update tests & add test for delete hook

* Fix test failures

* Add tests for deletion strings in Toolbar; add test for multiple deletion

* Clear deletion text on toolbar when user navigates away from MyObs

* Add a check in e2e test to make sure observation was deleted
2024-01-24 17:32:11 -08:00
Amanda Bullington
1d23c1f1fa Make entire dropdown for notes tappable; closes #860 (#1012) 2024-01-09 18:30:29 -08:00
budowski
6e944f68bb 856 reordering photos (#979)
* #856 - support for modifying and updating observation photos locally/remotely; reordering of photos fix

* ESLint fix

* Fixed tests

* Fixed tests

* Fixes related to tests
2023-12-18 15:27:27 -08:00
Ken-ichi
f7dc08a704 Suggestions fixes (#972)
* Bugfix: TaxonDetails was crashing if it received a null taxon
* Send lat and lng instead of latitude and longitude to the score_image
  endpoint
* Show offline suggestions when you are offline
* Show notice when viewing offline suggestions
* Moved code unique to useOnlineSuggestions into that file
* Ensure we use a medium size image to get suggestions when dealing with
  remote URLs
* More logging around React Query retries
* Use default retry logic for useAuthenticatedQuery
* Made a module-resolver shortcut for tests
* Move offline notice above top suggestion; hide when offlines exist but onlines do too
2023-12-15 19:58:12 -08:00
Ken-ichi
8119a3e5ca Taxon detail media viewer (#966)
* Access MediaViewer from TaxonDetails
* Added our own presets for ActivityIndicator
* TaxonDetail should show a local taxon if one is available
* Made it a little easier to import the custom logger
* Refactored MediaViewer to accept photo-like objects instead of URIs
* Added license / attribution button to MediaViewer
* Moved delete button into MainPhotoDisplay so each photo has its own button
  and it can be laid out relative to its photo
* Add custom header to MediaViewer when accessed from TaxonDetial
* Allow DisplayTaxonName to accept custom text components as props
* Added darker bg to photo on TaxonDetail to make title more legible
2023-12-14 17:18:41 -08:00
Amanda Bullington
35f87cce43 Update title for unsynced observations, ObsEdit (#965)
* Show edit title; add tests; set current obs before nav to ObsEdit screen

* Use edit title when obs is not synced; rewrite ObsEdit tests to show nav works correctly with useStore

* Remove uuid in params to ObsEdit; no longer needed

* Fix e2e by ensuring ObsEdit doesn't rerender with deleted obs
2023-12-14 11:46:46 -08:00
Amanda Bullington
04af1720d1 Show save button when user logged out; add BottomButtons tests (#964) 2023-12-13 15:48:47 -08:00
Amanda Bullington
f32a8812f5 Offline suggestions (#961)
* Use offline model for displaying sugggestions

* Simplify Suggestions/TaxonSearch screens using hooks

* Use updateObsKeys function from useStore

* Simplify code and fix unit tests

* Fix tests for offline predictions

* Fix faker urls

* Fetch remote taxa to display taxon photos in Suggestions

* Fix useTaxon code and test

* Use online vision results as backup for offline results

* Fix tests and add test for online predictions

* Use Flatlist for Suggestions and fix tests

* Move API call out of Attribution and fix test

* Fix tests

* Fix test warnings
2023-12-13 10:11:21 -08:00
Amanda Bullington
808cbee452 Replace ObsEditProvider with zustand for global state management (#948)
* Add zustand to app

* Begin replacing ObsEditProvider with zustand for global state

* Use store and add tests

* Fix bugs

* Add test to check for deleted photos in StandardCamera

* Make sure evidence is only added to current observation; submit comment with ID on ObsDetail

* Fix ObsEditWithoutProvider tests

* Move store to where it's needed

* Fix tests

* Await evidence being added to obsPhotos from camera

* Add a note about slices to useStore
2023-12-05 14:10:00 -08:00
Ken-ichi
0c7c807b56 Realm & other bugfixes (#950)
* Updated faker; fixed bug w/ DisplayTaxonName trying to modify a Realm object
* Fixed crash going from ObsDetail to ObsEdit
* Fixed bug fetching observation dates (not clear how this didn't instantly crash_
* Bugfix: MyObs observation fetch was failing on taxa w/ float rank_level
2023-12-04 13:47:00 -08:00
Amanda Bullington
74f4238079 Increase pressable area of back button, Obs Edit (#931)
* Use custom header instead of react nav set options; expand back button padding; closes #907

* Wrap ObsEdit in SafeAreaView
2023-11-28 15:51:09 -08:00
Amanda Bullington
1a27ef68cb Upgrade to Realm 12 (#925)
* Update to realm 12

* Remove unused mocks to fix some tests

* Fix test by unmocking ObsEditProvider

* Fix more tests by removing mocks/changing when tests write to realm

* Remove mocks on ObsEdit component test and fix accessibility labels

* Fix hooks tests with realm

* Set test path for realm; finish fixing tests

* Small tweak

* Upgrade realm/react library

* Migrate schema
2023-11-22 13:01:59 -08:00
Ken-ichi Ueda
38e75d3cdf Remove some unecessary react-navigation mocks 2023-11-20 11:09:36 -08:00
Amanda Bullington
361ad1d1f5 Performance: simplify ObsEditProvider (#908)
* Simplify ObsEditProvider by moving functions into local state & calling reducer less frequently

* Fix delete all observations

* Fixes

* Move index selection to MediaViewer via params

* Access ObsEditContext on top level of ObsEdit and pass props

* Move context to top level screen components

* Fix tests

* Use waitFor to fix ObsDetails integration test

* Alphabetize props; remove realm check; refactor new Id method

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-11-17 12:35:29 -08:00
Amanda Bullington
5913fb511e Energy usage / performance improvements (#844)
* Remove console statements in production build

* Move uploadReducer into separate file

* Create reducer for creating obs; combine reducers

* Fixes with createObsReducer

* Move album, passes test states out of global context

* Bug fixes for ObsEdit flow

* Create photo gallery container

* Set accessibility test todo for PhotoGallery

* Improve FlashList performance MyObs

* Prevent flicker on modal close

* Create less rerenders in MyObservations

* Memoize drawer items for less rerendering

* Memoize custom tab bar

* Remove unused libraries and update snapshot

* Fix and prune dependencies

* Add AddObsModal tests

* Fix e2e test android by making comment confirm button visible
2023-11-02 11:03:48 -07:00
Ken-ichi
dacd8788ec Permission gate layouts (#743)
Primarily adds designed layouts for permission gates (also referred to as permissions priming).

* moved permission gate business logic into a container
* use react-native-permissions exclusively
* Show PermissionGate as a modal
* Basic unit tests for PermissionGate
* Consistent content width on tablet, other minor style changes
* Allow PermissionGate to be used outside of nav hierarchy
* Use user location on Explore after getting permission
* Remove redundant 'always' location perm in ios
* Isolate current location button in the Map component, which uses location fetching functionality from react-native-maps instead of our own
* Updated cocoapods; matched INatIcon.ttf to sha1 hashes
2023-10-18 16:47:12 -07:00
Amanda Bullington
7d20f6aa81 Suggestions (using server data) (#821)
* UI overhaul for Suggestions

* Updates to suggestions

* Update permissions library and Podfile

* Get tests passing

* Add tests for suggestions

* Update snapshot

* Add comment prompt & box to TaxonSearch

* Add empty state

* Nav and loading fixes

* Add more tests to Suggestions flow

* Fix tests

* Fix tests
2023-10-13 14:46:05 -07:00
Amanda Bullington
47c5d8e2fd Drag and drop photos (#813)
* Use drag and drop to let a user change photo positions

* Fix tests

* Add test for EvidenceList

* Fix tests

* Fix state for no evidence / no observation photos

* Add unit tests for empty list and displaying obs photos
2023-10-11 13:55:27 -07:00
Amanda Bullington
d05c2f5405 Hide iconic taxon chooser when non-iconic taxon selected (#791)
* Hide iconic taxon chooser if user chooses a non-iconic taxon

* Add tests for iconic taxon chooser
2023-09-25 11:46:45 -07:00
Amanda Bullington
bc350c77b9 Nested navigators (#741)
* Move login and camera screens into stack navigators

* Navigation fixes

* Create ObservationsStackNavigator

* Move drawer items into drawer nav

* Navigator fixes and improvements

* Nav improvements

* Fix navigation from ObsEdit

* Fix test

* Fix test

* Redo bottom tab nav with Explore as part of ObservationsStack

* Use ObsEdit and AddID in two stacks

* Move identify into ObservationsStack and fix headers

* Fix ObsEdit bottom button issue by using fixed positioning for tab bar

That required a few other changes to places where we were explicitly
compensating for the height of the tab bar. Also fixed some other minor
layout issues.

* Typo

* Add LocationPicker to ObservationsStackNavigator

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-08-23 22:07:07 -07:00
Amanda Bullington
9c6106f5d0 Refactor tests to use minimum viable test factories (#681)
* Make minimum viable RemoteComment

* Minimum vialbe RemoteIdentification

* Minimum viable remote project, place, and messages

* Create minimum viable records for all remote factories

* Remove factories for local device data

* Minimum viable local taxon, comment, id

* Minimum viable for local observation photo (photo has no primary key)

* Minimum viable LocalUser

* Minimum viable record for LocalObservation
2023-06-27 17:06:01 -07:00
Ken-ichi
00ae38ddda Standard camera photo delete (#615)
* Ensure layout of the PhotoCarousel photos doesn't change in delete mode
* Stop conflating screen-size layout differences with tablet layout differences
* Bugfix: deleting one photo in the StandardCamera removed all photos
* Animated rotation of rotatable elements on StandardCamera
* Ensure loading status shows while first photo is being taken
* Tried to remove some open handles and shore up some unhappy tests
2023-05-19 13:16:32 -07:00
Amanda Bullington
81be995ad4 Media Viewer with landscape UI (#608)
* Make MediaViewer a navigation screen; support changing landscape/portrait orientations

* Move device orientation into hook

* Minor fixes to styling

* Styling updates based on breakpoints
2023-05-15 13:04:40 -07:00
Amanda Bullington
fa94ab5b42 ObsEdit - bottom sheets (#570)
* Add KebabMenu to shared components index

* Separate EvidenceList from PhotoCarousel component

* Remove unneeded props from PhotoCarousel

* Create notes bottom sheet

* Fix tests for delete obs sheet

* Add wild status sheet

* Show date from observations uploaded via website

* Move media viewer modal into evidence section

* Fix mock

* Move location fetching into its own hook

* Refactor ObsEdit header; move code into Header component

* Add discard changes sheet

* Styling updates and save changes button

* Add classes to buttons based on evidence/id missing

* Add imprecise location sheet

* Add jest.fn from provider to ObsEdit tests

* Remove fakeTimers from ObsEditWithoutProvider.test.js; minor cleanup

* Show discard obs sheet anytime a user tries to navigate back

* Fixes to bottom sheet backdrop, evidence, add discard changes sheet

* Switch to paper radio buttons instead of checkmarks

* Fix bottom sheet backdrop in android by wrapping with GestureHandlerRootView

* Update bottom sheet for add comment & notes

* Fix test

* Remove fake timer from ObsEdit test to get tests passing

* Force update github actions cache

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-04-20 17:02:19 -07:00
Amanda Bullington
0db7558abb Reverse geocode only when internet is connected (#552)
* Only reverse geocode from fetchPlaceName function; skip geocoding when no internet
* Reverse geocode when internet is reachable; closes #390
2023-03-29 11:47:02 -07:00
Amanda Bullington
7a98b6faf1 Timeless dates (#457)
* Add DateDisplay to ObsCard and make first pass at translation strings

* Add failing tests (due to lack of localization) for timeless dates

* WIP: trying to ensure i18next gets initialized before tests run

The remaining test failures might be legit. This probably breaks the actual
app, though.

* Got the rest of the tests working

* Updated tests to assume UTC
* Updated README to advise against using `npx jest` so test runs always have
  the env vars we specify in our `npm test` script
* Moved i18next initialization to an explicitly-named file
* Use i18next init function in app
* Fixed up remaining tests

* Added test for non-English localization of date format

* Cleanup

* Made DateDisplay explicitly handle strings not Dates

* Restore skipped localization tests for MyObservations

* Remove duplicative tests from DateDisplay unit test

* Added note to the README about initializing i18next

* Updated change to DateDisplay in main

---------

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2023-02-14 22:14:38 +01:00
Amanda Bullington
ba181e75fd Remove warnings about custom icons / Material icons in jest (#429)
* Mock INatPaperProvider to remove warnings about wrong icon names in jest; closes #421

* Remove unnecessary paper provider mock

* Add mocked views back to tests
2023-02-03 08:38:51 -08:00
Johannes Klein
1b4039eb36 417 eslint testing (#419)
* Add eslint-plugin-testing-library dependency

* Enable plugin inside tests folder

* Fix errors given by eslint-plugin
2023-02-01 12:50:59 +01:00
Johannes Klein
14d0239468 308 accessibility tests (#393)
* Regroup accessibility label strings at end of strings file
* Add accessibility test to AddID
* Add a11y labels to AddID
* Add a11y test to StandardCamera
* Add a11y props to StandardCamera
* Remove unit test with only todos
* Add a11y test to Messages
* Refactor PhotoScroll test into own file
* Add a11y test to ObsDetails
* Add a11y test to ObsList
* Add a11y matcher to PhotoGallery test
* Add a11y matcher to ProjectDetails test
* Add a11y matcher to ProjectObservations test
* Add a11y matcher to Projects test
* Add a11y props to ProjectList
* Add a11y props to ProjectTabs
* Add a11y matcher to Search
* Add a11y matcher to UserProfile test
* Add a11y test matcher to UserText test
* Update react-native-accessibility-engine
* Add a11y matcher to Tabs test
* Add a11y label to a selectable photo
* Refactor DataTab tests into separate file
* Refactor ActivityTab test out into own file
* Added a test how to check if a component uses a mocked container
* Add wrong a11y props to TextInput left icon
* Enable a11y test with actual BottomSheet because mock does not pass a11y props down
* Add a11y default props to Button
2023-01-27 12:30:57 -08:00
Ken-ichi
aa0eabcc59 Fix crash on Android after login (#347)
The problem has something to do with the unicode capitalization code that got
ported from the web. It seems like the JS engine in Android has a problem
with calling toUpperCase() on some unicode characters, and this gets around
that particular bug, plus one problem with a null check on a Realm
collection.
2023-01-10 15:35:59 -08:00
Amanda Bullington
310d2e743d Add eslint rules for React Query (#319)
* Use eslint rules to clean up useQuery code

* Code cleanup for useAuthenticatedMutation

* Add realm deletion and clear mock before each test in DeleteObservationDialog
2022-12-30 13:30:07 -08:00
Amanda Bullington
d51685b488 Fix: don't make API call for deleting local observations (#318)
* Check synced status before deleting observation remotely; closes #315

* Add tests for deleting observation from dialog

* Add jest settings for vscode; fix failing test from App.js

* Ignore vscode settings files

* Remove cached version of vscode settings file from git

* Update gitignore

* Add a test for canceling deletion
2022-12-30 08:34:32 -08:00
Amanda Bullington
ec0a686df6 Eslint: disallow console logs (#312)
* Remove console.logs; remote useLoggedIn hook and instead use useCurrentUser; closes #310

* Comment out locale test
2022-12-29 10:56:50 -08:00
Amanda Bullington
8d738d9d8c Delete observations from ObsEdit (#277)
* Remove delete option for observations not in realm
* Add mutation for delete observation
* Hide delete option for observations not persisted to realm
* Close kebab menu when item pressed; this allows dialog to respond to first user
   press

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-12-09 17:36:47 -08:00
Angie
21a49aa903 Dont fetch location for existing observations (#256)
* Tests for fetch location for existing observations ObsEdit. Closes #199.
* Fixed a bug fetching location for existing obs that weren't synced

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-12-06 23:36:08 -08:00
Amanda Bullington
b88030eab2 Allow existing id to be edited in ObsEdit (#242)
* Allow editing of existing id; remove unused id buttons; closes #230 and closes #231
* Remove unused text component & update IdentificationSection to tailwind css
* Remove unused obsEdit styles; convert styles to tailwind
* Remove unused bottom modal component and obsedit stylesheet
* Add comments to useEffect for opening local observation; convert realm object to JSON
* ObsEdit loads obs from db only when required
* Use observation update API call for observations already on the server
* Change wasSynced to instance method; only upload unsynced evidence
* Move keyboard aware scroll mock to jest.setup
* Await uploading evidence instead of returning a different response

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-12-03 15:32:44 -08:00
Amanda Bullington
e57ed1fdee Move notes input field above keyboard on focus (#252)
* Move optional notes text field above keyboard on focus
* Fix test with keyboard-aware mock
2022-11-30 14:14:26 -08:00
Amanda Bullington
a96e379b09 Standardize headers with react navigation (#243)
* Use react navigation header for photo gallery / album picker
* Use react navigation for group photos header
* Use react nav header for Add ID
* Use react navigation header for ObsEdit
* Fix tests by mocking navigation setOptions
* Show all buttons in camera options modal; remove header from StandardCamera
* Only show obs edit header when observations have loaded

Closes #226
2022-11-23 14:09:17 -08:00
Amanda Bullington
b700573327 Fixes for ObsEdit & adding evidence to an existing observation (#220)
* Fix for chosen photos persisting after cancelling new obs, closes #204
* Clear observations when a user backs out of ObsEdit screen
* Add android back handler condition to make sure a user can't back out of ObsEdit & see old observations
* Make sure local observations are properly updated in ObsEdit
* Create subcomponents for ObsEditHeader and AddEvidenceModal
* Fix add evidence functionality; separate ObsEdit into smaller components; rename UploadProvider
* Add disabled check for gallery photos previously selected; fix number of imports in add evidence
* Move fetch location into relevant component; ideally this makes ObsEdit stop rerendering every second
* Fix for android build in build.gradle
* Styling fix for photo gallery grid of images
* Renaming obs to observation, bulk uploader to photo importer, upload provider back to obs edit provider
* Update pods and rename test directory to PhotoImporter

Also closes #218
2022-11-08 12:16:23 -08:00
Amanda Bullington
c4d9cd4dc6 Use babel-plugin-module-resolver (#188)
* Add alias and update eslint/flow to resolve modules

* Update aliases for components and api

* Add other src directories to module resolver aliases
2022-10-07 10:20:55 -07:00
Amanda Bullington
3d65b1e294 UI updates to bulk uploader (#128)
* UI updates to photo gallery

* Add filter icons to group photos

* Styling for carets, multiple ObsEdit

* Standardize kebab menu in shared component

* Fix bug in removePhotos; change selection to kebab menu

* Create delete obs dialog which deletes obs from bulk uploader obs edit

* UI tweaks; closes #100

* Add precommit hook to translate strings

* Fix styling for obs edit header; add fonts to xcode

* Fix lint errors

* Add safe area provider to test & app

* Fix tests
2022-07-18 14:44:20 -07:00
Ken-ichi
e929764c25 Adopted and enforced code style from other iNat Javascript projects
These rules are largely based on the AirBnB ones, which are not quite standard
for the React Native world, where Prettier seems to be more common, but I
think they add a lot of useful checks, and unlike Prettier we can customize
them. This also just makes it easier for people on the iNat team to work on
the mobile app.

Some specific changes:

* Added eslint-plugin-react-hooks to eslint rules
* Added eslint-plugin-simple-import-sort to eslint rules
* Bugfix: could not import photo from gallery
* Added support for react-native/no-inline-styles eslint rule
* useUser should not bother fetching a user for a blank userId
2022-07-13 13:55:59 -07:00
Amanda Bullington
17122fc46e Delete user JWT on 401 error (#112)
* Sign out user when encountering a 401 error while fetching JWT
* Save currently signed in user in Realm
* Check for logged in user on app start, add loading wheel to obs list, sign user out when no user ID

Closes #99 

Co-authored-by: Ken-ichi Ueda <kenichi.ueda@gmail.com>
2022-06-15 10:26:46 -07:00
Amanda Bullington
1f2becdef6 Media Viewer (#107)
* Create basic media viewer with full sized image, selection, carousel, and header

* Create photo delete dialog component

* Wrap camera stack in Mortal component instead of resetting state on camera blur

* Use photo carousel in PhotoPreview for standardized photo sizes

* Make media viewer accessible from ObsEdit

* Remove evidencelist component and use photo carousel instead in ObsEdit/suggestions

* code tweaks

* Create realm ObsPhotos in standard camera for passing to media viewer, ObsEdit

* Move resize image function into Photo model

* Update photo preview to use delete photo functions from photo and obsphoto model

* Allow photo deletion in media viewer from ObsEdit, StandardCamera; switch to Modal view

* Swap in zoom functionality instead of carousel, media viewer

* Remove media viewer from nav, now that it's a modal

* Remove comment

* Update babel config with react-native-paper plugin for production

* Mock RN paper Portal component

* Media viewer takes photo uris; handles obsPhoto updates in ObsEdit and photo uri updates in StandardCamera

* Make sure tests pass with optional chaining for obsPhotos

* Update styling for StandardCamera

* Create obsPhotos attached to photos from camera

* Pass photos to StandardCamera from ObsEdit to reflect any changes made in MediaViewer

* Get tests passing

* Fix flow issues

* Change flow type for photoUris

* Add pre-commit hook for flow

* Fix flow erros
2022-06-01 11:10:03 -07:00
Amanda Bullington
f46d4086ad Save observations, photos, sounds in Realm for upload (#78)
* Break uploader into helper function; add bottom model for uploading from obs list

* Create mapping function for uploading observations to iNat

* Mark observations as uploaded when id is returned from server

* Format dates on obs list

* Save all obs locally before trying to upload

* Resize grouped photo gallery photos for upload

* Resize photos btw group photos screen and obs edit

* Get sound, photo, obs uploads saving to realm and uploading later

* ObsEdit progresses to next or prev screen after one obs is saved locally

* Format date in camera; use time observed to show new local obs in ObsList

* Remove time zone attribute, since this is handled by server

* Submit sound and photo uuids as the file name for sound/photo uploads

* Make obsSounds an array in case there are multiple sounds for upload

* Removing time synced from Photo model bc not sure it's necessary

* Save _synced_at and _created_at time for all remote obs

* Fix back button, obs edit

* Don't show obs edit for unuploaded obs

* Get rid of ObservationProvider, move useObservations hook

* Fix place name; add date/time and location to no evidence uploads

* Add species_guess to observation when taxon_id changes

* Format date from picker; use string for sending to server

* Styling cleanup with react-native-paper; make ObsEdit into section components

* Add vector icons to ios (for searchbar)

* Add empty text to CV suggestions

* Cleanup code for marking records synced & uploading to server

* Use placeholder icons on bottom tab bar

* Add icons to ObsList; fix grid view when photo === null

* Fix jest tests

* Simplify setting an identification in ObsEdit

* Move inline styles to separate files

* Display all relevant saved obs data on ObsDetails; function to check for camel or snake case attributes

* Move logic for creating new sound observation to model, not sound recorder

* Add android vector icons

* Move create obs and create with no evidence into Observation model

* Add mock for react-native-fs

* Show option to edit user obs in ObsDetail; fix captive/geoprivacy/date fields for uploaded obs

* Move obsPhoto creation and obs with obsPhoto creation into models

* Create obs with sound from Obs model

* Create multiple obs from gallery photos; move logic into model

* Pass observation to ObsDetails via navigation to avoid opening and closing realm twice

* Lint error fixes

* Fix jest tests

* Use icons on normal camera

* Use timestamps from gallery and camera for new observations

* Keep simplifying code

* Update version/build number; add key to info.plist for faster ios build

* Remove TranslatedHeadline component

* Move saveLocalObservation logic to model

* Move all FIELDS for api calls into models (except messages, which doesn't have a model yet)

* Only show upload UI if user is logged in

* Fix obs edit link so it works for both logged in and logged out users

* Bug fixes: get fields from models; addListener function in test

* Model code cleanup

* More code cleanup

* Remove unused imports
2022-05-10 14:41:31 -07:00
Ken-ichi
0c8c9020ec Test fixes (#80)
* Comment model needs a UUID attribute
* mocked useLoggedIn in ObsEdit test
* updated caniuse
* Close Realm when hooks are done
2022-04-26 17:07:55 -07:00
Amanda Bullington
6e228dd2b2 Observation uploader (photos, sound, no evidence) (#52)
* Get observation upload and obs_photo upload working with staging v1

* Add location with accuracy to normal camera uploads

* Add location and date to sound recordings

* Add camera options button to end of evidence list

* Add photos to obsEditProvider from camera, sound, and photo library

* Code cleanup

* Use ObsEditProvider as global state for uploader; support multi photo/sound; get test passing

* Set config to API v2
2022-03-01 16:56:25 -08:00