Closed achou11 closed 4 months ago
I haven't reviewed the code, but I think we need to bring this to codesign. This is one of the blindspots where we thought we could just port it over from mapeo mobile.
In the mean time, I think we should get rid of that page, and just add the flow for importing a config when creating a project.
Also, we can handle errors with the < ErrorBottomSheet/ >
As far as the success state, i think in this case of creating a project, we need to tie the api call with create a project...So clicking the create project button will handle both importing the config and creating the project, and the success state of that is already handled
yeah makes sense. might just make a new PR in that case 😄
Im going to close this as your redoing the work on #161
Closes #161
As I understand it, config imports in Mapeo are treated differently from config imports in CoMapeo. In Mapeo, imports are entities that have metadata such as the name and version, so we surfaced that information in this screen. In CoMapeo, we do not have access to this metadata, as imports are solely treated as a method of updating information about a project. Due to this, it didn't make sense to directly port what exists in Mapeo.
Open questions to address, maybe as a follow-up:
[ ] what can/do we want to show in this screen? as currently implemented, i only have the button to import the config and an alert depending on the result of the import.
[ ] how should we surface errors and success? the ticket provides no information about this and i couldn't find the design for this screen in Figma. right now I'm just using alerts, which is what Mapeo more or less did.
Preview:
Screen:
Success flow:
https://github.com/digidem/comapeo-mobile/assets/18542095/df117de0-ca0c-4929-ae85-0e1cb5fdfc4e
Failure flow (happens if bad file type, or some error on backend):
https://github.com/digidem/comapeo-mobile/assets/18542095/d4b4aed2-e7fc-4ec7-bdb1-e588f9bd8d84