e-picsa / picsa-apps

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

feat(farmer-activity): photo storage #291

Closed chrismclarke closed 2 months ago

chrismclarke commented 3 months ago

Is your feature request related to a problem? Please describe. Following work in #282, it would be good to have a system whereby photos a user has taken are stored within the app and available after app restart.

Describe the solution you'd like

  1. Move photo-input code to the libs\shared\src\features folder (as will be a shared feature, consisting of both components and service)
  2. Create a database schema to store photos. Likely this should include an id, the photo data, a timestamp, and optional custom_meta fields.
  3. Update component to retrieve photo from database as required and display

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context

Additionally, for use in debugging you may want to create a route for /photos and display components to show a list of all available photos in db. The easiest way to do this would be to create the photo-list component in the same feature folder and register within the extension app apps\picsa-apps\extension-app\src\app\app-routing.module.ts

 {
    path: 'photos',
    loadComponent: () =>
      import('@picsa/shared/features/photo-input/photo-list.component').then((mod) => mod.PicsaPhotoListComponent),
  },

(the loadComponent syntax can be used to display a route for any component that has been setup as a standalone component - https://blog.angular-university.io/angular-standalone-components/)