avo icon indicating copy to clipboard operation
avo copied to clipboard

feature: added a preview when editing/creating images, video or audio

Open maxencehenneron opened this issue 1 year ago • 3 comments
trafficstars

Description

It adds a preview when adding an image/video/audio to a "file" field.

Note: a preview already exists when the record is created, but does not automatically update when you select another file. While my code works, I don't think it's the cleanest.

Some logic is duplicated between edit_component.html.erb (file field) and grid_item_component.html.erb. grid_item_component references file_field_controller and I don't know if it's a bad practice. I also cannot think of a better way to do this as I don't use stimulus in my projects

Checklist:

  • [x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

https://github.com/avo-hq/avo/assets/377682/f6d3cc4c-cfac-4595-b4a8-d967b52f122f

maxencehenneron avatar Feb 01 '24 05:02 maxencehenneron

Code Climate has analyzed commit fcc4c0a5 and detected 0 issues on this pull request.

View more on Code Climate.

qlty-cloud-legacy[bot] avatar Feb 01 '24 05:02 qlty-cloud-legacy[bot]

@maxencehenneron are you able to move this past the finish line?

adrianthedev avatar Feb 27 '24 04:02 adrianthedev

@maxencehenneron are you able to move this past the finish line?

Sorry I don't have much time to complete this, I don't see any simple way to achieve this without significant refactoring as we do not have a file yet when first creating the object

maxencehenneron avatar Mar 04 '24 23:03 maxencehenneron

This PR has been marked as stale because there was no activity for the past 15 days.

github-actions[bot] avatar Mar 20 '24 01:03 github-actions[bot]

Closing this because there was no activity for the past 15 days. Feel free to reopen if new information pops up ✌️

github-actions[bot] avatar Apr 04 '24 01:04 github-actions[bot]