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

728 Adopter dashboard adoption applications #738

Merged
merged 12 commits into from
May 29, 2024

Conversation

jmilljr24
Copy link
Collaborator

🔗 Issue

Resolves #728

✍️ Description

This adds an Adoption Application list to the Adopters dashboard. The applications are listed in table for larger screens and cards for smaller screens. Application statuses are updated via turbo.

I also added a method to allow for enum's to be translated.

#example of AdopterApplication enum of :status

app = AdopterApplication.first
app.human_enum_name(:status)
=> "Under Review"

📷 Screenshots/Demos

Screencast.from.05-23-2024.10.20.06.AM.webm

Comment on lines +60 to +61
<%= active_link_to adopter_fosterer_adopter_applications_path, class: "nav-link" do %>
<i class="fe fe-book nav-icon"></i> <%= t("dashboard.applications.header_title")%>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry the diff is showing everything. This is the only real change for this file.

belongs_to :adopter_foster_account

broadcasts_refreshes
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really need to brush up on Turbo :) I have no idea how this works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is part of the new Turbo 8. When the adopter application is changed a message is sent over action cable.

This is a quick read on it

It makes it really easy to update without having to do a bunch of turbo_streams and targeting specific id's. You can see in the first half of the video the status and button is update after withdrawing. The second half is just a bonus. I didn't really need to do any extra work but if the staff were to change the status of the app while the adopter was looking at it, the status will be updated without the adopter having to refresh.
Screencast from 05-24-2024 03:16:29 PM.webm

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah that is so handy.

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.

Looks good!

I note we have a controller test for adopter applications. Do we currently need the like integration test as well? It's not really doing much.

We have a profile_show attribute on AdopterApplication. I used this in the old app to allow adopters to delete an application (only if the pet was adopted to someone else, or the adopter withdrew) so it no longer showed in their dashboard...but the record still exists and available on the staff end. If this makes sense, we could implement something similar here. Otherwise someone could end up with a load of withdrawn apps in their view. This could be in a new issue.

@jmilljr24
Copy link
Collaborator Author

Looks good!

I note we have a controller test for adopter applications. Do we currently need the like integration test as well? It's not really doing much.

We have a profile_show attribute on AdopterApplication. I used this in the old app to allow adopters to delete an application (only if the pet was adopted to someone else, or the adopter withdrew) so it no longer showed in their dashboard...but the record still exists and available on the staff end. If this makes sense, we could implement something similar here. Otherwise someone could end up with a load of withdrawn apps in their view. This could be in a new issue.

I'll take a glance and get back to you. I honestly only briefly looked at the tests since they were already implemented.

@jmilljr24
Copy link
Collaborator Author

jmilljr24 commented May 28, 2024

@kasugaijin Can you give more detail on this? I'm not sure what test/file you are referring to.

I note we have a controller test for adopter applications. Do we currently need the like integration test as well? It's not really doing much.



Yes I think that is a good idea based on the conditions mentioned. Sounds liked a good new issue. I will not have time before RFG.

We have a profile_show attribute on AdopterApplication. I used this in the old app to allow adopters to delete an application (only if the pet was adopted to someone else, or the adopter withdrew) so it no longer showed in their dashboard...but the record still exists and available on the staff end. If this makes sense, we could implement something similar here. Otherwise someone could end up with a load of withdrawn apps in their view. This could be in a new issue.

@kasugaijin
Copy link
Collaborator

@jmilljr24 this test file test/integration/adopter_application_test.rb I think we can delete it. It's just dead weight at the moment, and seems fitting on the PR?

@jmilljr24 jmilljr24 requested a review from kasugaijin May 28, 2024 19:02
@kasugaijin
Copy link
Collaborator

Thanks. Ready for merge I say.

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.

LGTM!

@kasugaijin kasugaijin merged commit b95a7a8 into main May 29, 2024
5 checks passed
@kasugaijin kasugaijin deleted the jmilljr24/728-adopter-dashboard-adoption-applications branch May 29, 2024 00:12
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.

Adopter Applications: As an adopter I can see my list of adoption applications in my dashboard
2 participants