e-picsa / picsa-apps

Monorepo for building tools to support E-PICSA Apps
https://picsa.app
GNU General Public License v3.0
5 stars 1 forks source link

feat(farmer-activity): Add Support for photo upload #282

Closed OchiengPaul442 closed 6 days ago

OchiengPaul442 commented 1 month ago

Description

This commit introduces a new Photo-input component with the following features:

  1. Photo Upload UI: A simple user interface with a button for photo upload has been created.
  2. Capacitor Camera Integration: The @capacitor/camera package has been integrated and registered to provide camera support on native devices.
  3. Web Photo Upload Support: A file input tag has been used to enable photo upload functionality on web platforms.
  4. Temporary Photo-input Service: A temporary service has been created (just a simple template) to simulate the saving and retrieval of images. This will be replaced with actual storage setup in the future.
  5. Photo Removal Options: Users have the option to remove a selected photo. If more than one photo is uploaded, an option to delete all photos is revealed.
  6. Testing: Preliminary tests have been carried out on both web and native devices. Photo upload works fine on the web. However, the CameraSource.Prompt option, which is supposed to prompt the user to select either the photo album or take a photo on native devices, is not functioning as expected. Further investigation is needed to resolve this issue.

NOTE:

  1. Upgrade Capacitor from Version 5 to 6: Successfully upgraded Capacitor from version 5 to 6, following the provided documentation. This upgrade enables the use of the @capacitor/camera on native devices. To verify the upgrade, execute yarn cap --version. Additionally, before running the application on a native platform, ensure to install the new modules compatible with the current version by running yarn install (might need to delete the node_modules folder for this). Due to issues running the sync command, I manually updated the different files as per the documentation for the app to run on a native device (Android).

Note: An attempt was made to create the component as an input component, but had issues with how to approach this after reading through the documentation. requesting further guidance on this.

Discussion

Preview

Link to app preview if relevant

Screenshots / Videos

https://github.com/e-picsa/picsa-apps/assets/97807374/9f7e8f35-0562-4801-93cc-9d8556935c59

WhatsApp Image 2024-06-26 at 7 25 01 PM

OchiengPaul442 commented 2 weeks ago

Hey @chrismclarke, apologies these tags confuse me sometimes and I forget when to change them. Won't happen again.

OchiengPaul442 commented 2 weeks ago

Hi @chrismclarke, I’m currently encountering some difficulties with the CameraSource.Prompt option on a native device. During my tests, I’ve noticed that the prompt doesn’t appear as expected and am not sure why.

OchiengPaul442 commented 1 week ago

Hey @chrismclarke, thank you. I will take on task #288, incorporate the suggestions and use this PR to implement the upgrades and conduct thorough testing.

chrismclarke commented 6 days ago

@OchiengPaul442

I've added https://github.com/e-picsa/picsa-apps/issues/291 to follow-up for photo storage if you are happy to take it on for next issue?