platelet-app / platelet

Dispatch system for emergency volunteer couriers.
https://platelet.app
Apache License 2.0
38 stars 10 forks source link

Users/locations/vehicles graphql #5

Closed duckbytes closed 3 years ago

duckbytes commented 3 years ago

Integrates the users/locations/vehicles lists and user/location/vehicle profiles with the graphql backend using amplify DataStore.

A lambda function that replicates new users in Cognito to the database once the user is confirmed.

whoami state in redux now gets data from Cognito and the API.

Added a new view for admins to add new users. Eventually I'd like the view to be simplified so that the admin only needs to specify the email address and their name and a password will be generated for them and sent in an email. On first login the new user could change their password to what they like.

Graphql schema changes that puts the contact details for a User directly on the model itself and not connected to AddressAndContactDetails.

Removed some code that was generated by amplify mock but doesn't seem to be necessary.

duckbytes commented 3 years ago

@jeremywarrick I thought it might be better after all to add the contact details fields directly to the User model. Mutating objects that are linked by connection is more awkward than I thought, so less separation seems to create cleaner code on the front end and in lambda functions. We could take this approach with other models later too. What do you think?

DataStore seems like the easiest way to interact with the API. It has offline support and should result in less API calls, so I'm going with that for the time being.

The users components still needs work on the layout and will need more changes once DataStore is set up to sync with the API, but if this seems fine I think we can merge it and start working on integrating other views with DataStore.