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

Update with Image frontend buttons #618

Merged
merged 76 commits into from
May 1, 2024

Conversation

ErinClaudio
Copy link
Collaborator

@ErinClaudio ErinClaudio commented Apr 2, 2024

🔗 Issue

#592

✍️ Description

  • Overview: Update the dashboard to allow staff to manage Page Text options, including updating Hero Text, About Us text, and corresponding images on the organization's root/home page.
  • Implementation:
    • Utilize PageText model with has_one_attached :hero_image and has_many_attached :about_us_images.
    • Add form inputs for attachments on the PageText form: one clearly labeled for Hero Image (single attachment) and one for About Us images (one or two attachments).
    • Implement model validations for image file type and size restrictions, referencing the Pets Controller for examples.
    • Update PageTextsController to handle image attachments and purging.
    • Ensure staff can upload and purge images.
    • Reuse partials for upload inputs and image display tables, similar to those used in Pet tabs.
    • On the org's root/home page, render the hero_image and one or both about_us_images as applicable, with a default image for the second if only one is uploaded.
  • Testing:
    • Modify tests to accommodate changes to the page_text model. Pay special attention to these modifications.

I do not like how the about us images upload but I could use a little feedback

📷 Screenshots/Demos

@ErinClaudio ErinClaudio self-assigned this Apr 2, 2024
dependabot bot and others added 27 commits April 3, 2024 12:23
Bumps [debug](https://github.com/ruby/debug) from 1.9.1 to 1.9.2.
- [Release notes](https://github.com/ruby/debug/releases)
- [Commits](ruby/debug@v1.9.1...v1.9.2)

---
updated-dependencies:
- dependency-name: debug
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
* commit annotation change

* update contacts create route to use post and update url on contacts form

* add tests for contacts

* replace hardcoded url, add instance variable for org name to use in mailer

* replace current_tenant because it was coming up nil

* add scope to contact form and update controller action to use stong params

* update tests to use correct params format

* fix test desciptions
* Move constants outside of class

* Add active staff requirement to InvitationPolicy

* Correct StaffAccountPolicyTest file name

* Add active staff requirement to StaffAccountPolicy

* Refactor AdoptablePetPolicy rule to utilize allowed_to? instead of checking permissions directly to benefit from other policy's prechecks

* Fix pets factory traits to associate has_ relationship objects correctly

* Add relation_scope test for AdoptablePetPolicyTest

* Fix factory trait to work with build strategy
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

---------

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
…631)

* Add toggle Stimulus controller

* Modify Geeks UI CSS
@ErinClaudio ErinClaudio marked this pull request as ready for review April 18, 2024 15:24
@ErinClaudio ErinClaudio requested a review from kasugaijin April 18, 2024 15:24
@kasugaijin
Copy link
Collaborator

Hey @ErinClaudio the implementation looks good! Just a couple small details to tweak.

For tests, I think we can handle setting up the PageText differently - see my comment on that.
I also think we could add a controller test for uploading an image.

Also, when I run the tests locally, this test keeps failing for me (though in the pipeline it passes, so maybe there's something going on locally for me...does it pass for you locally?

Organizations::PageTextsControllerTest#test_: PATCH #update should update page text.  [test/controllers/organizations/page_texts_controller_test.rb:53]:
Expected: "canine caped crusader"
  Actual: "Eius id minus et."

@ErinClaudio ErinClaudio requested a review from kasugaijin May 1, 2024 16:23
Copy link
Collaborator

@kasugaijin kasugaijin left a comment

Choose a reason for hiding this comment

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

Good job @ErinClaudio! This is good chunk of work that adds value to the customization of the home page for each org. Thank you for seeing it through!

@kasugaijin kasugaijin merged commit 9685fc4 into main May 1, 2024
5 checks passed
@kasugaijin kasugaijin deleted the Hero-Image-and-up-to-two-About-Us-images branch May 1, 2024 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants