Skip to content
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(direct-to-farmer): add support for photo input #240

Closed
chrismclarke opened this issue Feb 23, 2024 · 0 comments · Fixed by #282
Closed

feat(direct-to-farmer): add support for photo input #240

chrismclarke opened this issue Feb 23, 2024 · 0 comments · Fixed by #282
Assignees

Comments

@chrismclarke
Copy link
Collaborator

chrismclarke commented Feb 23, 2024

Is your feature request related to a problem? Please describe.
As part of the farmer activity tool there are some activities where the farmer is encouraged to complete a task using pen and paper (outside of the app). It would be a nice feature if the farmer can then take that photo and upload it into the app, to be stored alongside the specific activity

Describe the solution you'd like
Initial work should focus on the camera api integration (will create follow-up issue to manage file storage and association with farmer activities).

Ideally a custom photo-input component should be created, with a simple ui showing possibly a camera icon, a '+' icon and text for 'add photo'. Clicking the button should prompt the user to either take a photo using their camera, or upload a file

The code should use the Capacitor Plugin to provide access to native getPhoto() method which can either take a photo or upload a file on native.

On web I think probably better to handle as standard file input (no need to request access to user webcam or similar).

Once selected the UI should show the uploaded image, and give the option to remove.

Additional context
Documentation for capacitor camera plugin: https://capacitorjs.com/docs/apis/camera
Note - when adding to the project also make sure to include it in the list of plugins named in the apps\picsa-apps\extension-app-native\capacitor.config.ts file

It would be good if this could also be designed as an input component, so that it can be interoperable with things like ngModel data bindings and angular forms. It can be created in the libs\forms\components folder and named photo-input. See example form documentation in libs\forms\components\base\README.md for an overview of how custom shared form components are designed to work.

Example of farmer activity can be seen at https://picsa.app/farmer-activity/ram-activity.
There is a second tab for activity (currently empty). Ideally it is in that space where the add photo button should

@chrismclarke chrismclarke changed the title feat(direct-to-farmer): add support for native camera apis feat(direct-to-farmer): add support for native camera photo input Feb 23, 2024
@chrismclarke chrismclarke changed the title feat(direct-to-farmer): add support for native camera photo input feat(direct-to-farmer): add support for photo input Feb 23, 2024
@chrismclarke chrismclarke moved this to Next Priority in PICSA Apps Development Feb 23, 2024
@OchiengPaul442 OchiengPaul442 self-assigned this May 17, 2024
@OchiengPaul442 OchiengPaul442 linked a pull request May 30, 2024 that will close this issue
@chrismclarke chrismclarke moved this from Next Priority to In Progress in PICSA Apps Development Jun 4, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in PICSA Apps Development Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants