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

1058 Add Feedback Subject #1116

Merged
merged 19 commits into from
Nov 11, 2024
Merged

1058 Add Feedback Subject #1116

merged 19 commits into from
Nov 11, 2024

Conversation

jmilljr24
Copy link
Collaborator

#1058

✍️ Description

A required dropdown selection is added for Subject on the feedback form. Additionally, a link is added to updated a turbo_frame with additional information on how to submit feedback. The placement of the link and/or displayed information could use improvement.

📷 Screenshots/Demos

Screenshot from 2024-11-07 09-35-23
Screenshot from 2024-11-07 09-35-32

config/routes.rb Outdated Show resolved Hide resolved
@feedback = Feedback.new(feedback_params)

if @feedback.valid?
FeedbackMailer.with(feedback_params).send_message.deliver_later
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's use deliver_now for the time being, until we set up background processing.

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 Justin. Just a few comments to consider.

@jmilljr24
Copy link
Collaborator Author

How does this look?
Screencast from 2024-11-10 10-42-02.webm

end
end

def path
Copy link
Collaborator

@kasugaijin kasugaijin Nov 10, 2024

Choose a reason for hiding this comment

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

I have been starting at this method as it just doesn't quite feel 'right'. We are defining the path based on the layout. It works. But the layout is defined based on whether there is no current_user, the user is an adopter, the user is a staff. It seems to me we should use the same checks for the redirect path. Using the layout feels like it's a proxy, and it's coupled with the layout unnecessarily. The driver here should be the user type, or lack thereof. Thoughts on this?

It's not a hill I am going to die on...but I think it would be clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For sure. I think I originally was trying to keep things DRY and use the set_layout method and I kinda just went down that hole. Then I was lazy and just moved the case into a method without thinking about it more.

Maybe something like

  def path
    if current_user.nil?
     root_path
    elsif current_user.has_role?(:adopter, ActsAsTenant.current_tenant)
      adopter_fosterer_dashboard_index_path
    else
      staff_dashboard_index_path
    end
  end

Same as set_layout but returning the path instead. Maybe there is a simple way to use set_layout for both but I can't think of it at the moment or even if that is a smart idea.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes I think that works ^. I also wondered about setting both at once...but single responsibility is probably better to stick to when in doubt!

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 great @jmilljr24! Just one comment to consider on that private method. Your call on what you think is best.

@jmilljr24 jmilljr24 merged commit 49e62a7 into main Nov 11, 2024
5 checks passed
@jmilljr24 jmilljr24 deleted the 1058-add-feedback-subject branch November 11, 2024 00:01
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.

4 participants