rubyforgood / homeward-tails

Homeward Tails is an application making it easy to link adopters/fosters with pets. We work with grassroots pet rescue organizations to understand how we can make the most impact.
MIT License
64 stars 108 forks source link

Feedback Form: Render it within both dashboard templates instead of redirecting #984

Open kasugaijin opened 1 month ago

kasugaijin commented 1 month ago

We have the Feedback link in the Staff Dashboard, and the Adopter Foster Dashboard, but this redirects to a new page. Instead, we should render this form within each dashboard layout. You'll probably want two new controllers to handle this. Look at the Organizations::AdopterFosterer::FaqController as an example.

Aaryanpal commented 1 month ago

@kasugaijin this too

kasugaijin commented 1 week ago

@Aaryanpal how's this going?

Aaryanpal commented 1 week ago

WIP @kasugaijin Sorrry for Late Response. I was out for some work. Resuming it Now

kasugaijin commented 1 week ago

@Aaryanpal no worries! Thanks for the update.

Aaryanpal commented 1 week ago

Hi @kasugaijin,

I'd like to propose a refactoring of our current feedback feature implementation. Here's an overview of the current situation and my proposed changes:

Current Implementation:

Proposed Changes:

  1. Rename the controller to FeedbackController to better reflect its purpose and follow Rails naming conventions
  2. Consolidate all feedback-related logic into this single controller with renaming the DevContactsMailer to FeedbackMailer
  3. Maintain the existing URL structure (/alta/feedback/new)

Rationale:

Please let me know your thoughts on this proposed refactoring. I'm happy to provide more detailed implementation plans if needed.

kasugaijin commented 1 week ago

Hey @Aaryanpal I appreciate the initiative! I think what you propose makes sense. The ony thing to handle differently if we use a single controller is the layout - we will want to use the dashboard layout if the link in the footer is clicked, and the adopter foster layout if the link in the adopter foster dash side nav if clicked...easy enough to handle with params and a before_action on the controller.

Aaryanpal commented 1 week ago

For Staff it will look like this

image

For Adopter it look something like this

image

Here's a rephrased version as a message to a dev:


I've noticed that the two sections have different styles in the layout. To better align them with the overall design, do you think it would be better to create a separate controller to manage the styles more cleanly? Or should we handle the styling directly within the ERB? Also, do you think it makes sense to adjust the position of the "Feedback" heading to the top-left for better alignment with the design and remove the sub-heading ( Found a bug? Want to request a feature? Contact our dev team with the form below.) as we didn't had one in every options?

Let me know your thoughts!

kasugaijin commented 1 week ago

For Staff it will look like this

image

For Adopter it look something like this

image

Here's a rephrased version as a message to a dev:

I've noticed that the two sections have different styles in the layout. To better align them with the overall design, do you think it would be better to create a separate controller to manage the styles more cleanly? Or should we handle the styling directly within the ERB? Also, do you think it makes sense to adjust the position of the "Feedback" heading to the top-left for better alignment with the design and remove the sub-heading ( Found a bug? Want to request a feature? Contact our dev team with the form below.) as we didn't had one in every options?

Let me know your thoughts!

Yeah that's what I was thinking in the original issue description - that two controllers would handle this more cleanly. Ideally, we do not have the Feedback Form title in the center on these dashboard scoped pages. The title should live in the header for each dashboard check the other pages under both dashboards to see how their headers are set with breadcrumbs). We should also move the shared components of the page (description and form) into a partial that can be shared between all three views (the form accessed via the footer, the form accessed via the two dashboards).