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

feature: profile and cover photos #2722

Merged
merged 15 commits into from
Jul 1, 2024
Merged

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented Apr 25, 2024

Description

Adds a cover and profile photo to the show view of the record.

Docs: https://docs.avohq.io/3.0/cover-and-profile-photos.html

CleanShot 2024-04-25 at 11 46 47@2x

Todo:

  • Add cover images to the index/edit page
  • add support for plain paths (interpolated with the record data) (Paul's suggestion)

Checklist:

  • 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

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@adrianthedev adrianthedev reopened this Apr 28, 2024
Copy link

codeclimate bot commented Apr 28, 2024

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

View more on Code Climate.

@adrianthedev adrianthedev marked this pull request as ready for review May 2, 2024 15:05
Copy link
Contributor

@Paul-Bob Paul-Bob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great!

I have one concern about the way to declare the cover/photo components. IMO it should not rely on existing fields, and pass the photo URL directly on the API like grid view cover.

Pros:

  • Any image can be used even an external URL
  • Custom path helpers can be used to get the image URL
  • No need of field declaration if user don't want to have that fields.
self.cover_photo = -> do
  {
    # size: :sm,
    source: main_app.url_for(record.cover_photo.url)
  }
end

@adrianthedev
Copy link
Collaborator Author

yup! makes sense!
Thanks for the review!

Copy link
Contributor

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

@github-actions github-actions bot added the Stale label May 23, 2024
@adrianthedev adrianthedev requested a review from Paul-Bob June 17, 2024 07:30
@adrianthedev
Copy link
Collaborator Author

adrianthedev commented Jun 17, 2024

Let's look into memoization of these obejcts (profile_photo & cover_photo) from the concern.

Maybe https://github.com/panorama-ed/memo_wise? Let's evaluate it

@adrianthedev
Copy link
Collaborator Author

Implements RSpec tests for Avo's event page cover and profile photos components, ensuring proper visibility under various conditions.

  • Adds component tests for both Avo::CoverPhotoComponent and Avo::ProfilePhotoComponent to verify rendering logic based on the presence and visibility of photos. These tests cover scenarios where photos are present, absent, not visible in the current view, and dynamically sourced.
  • Updates feature tests in spec/features/avo/cover_profile_photos_spec.rb to include scenarios for an event page without cover and profile photos, with only a cover photo, with only a profile photo, and with both photos. This ensures the application behaves as expected under each condition.

For more details, open the Copilot Workspace session.

adrianthedev and others added 2 commits June 30, 2024 22:31
Implements RSpec tests for Avo's event page cover and profile photos components, ensuring proper visibility under various conditions.

- **Adds component tests** for both `Avo::CoverPhotoComponent` and `Avo::ProfilePhotoComponent` to verify rendering logic based on the presence and visibility of photos. These tests cover scenarios where photos are present, absent, not visible in the current view, and dynamically sourced.
- **Updates feature tests** in `spec/features/avo/cover_profile_photos_spec.rb` to include scenarios for an event page without cover and profile photos, with only a cover photo, with only a profile photo, and with both photos. This ensures the application behaves as expected under each condition.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/avo-hq/avo/pull/2722?shareId=76ee8294-b3dd-4b08-b5a6-3fb721ad01af).
@Paul-Bob Paul-Bob removed the request for review from gabrielgiroe1 July 1, 2024 13:46
@adrianthedev adrianthedev merged commit 99bfd50 into main Jul 1, 2024
21 checks passed
@adrianthedev adrianthedev deleted the feature/profile-and-cover-photo branch July 1, 2024 15:31
Copy link
Contributor

github-actions bot commented Jul 1, 2024

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants