-
Notifications
You must be signed in to change notification settings - Fork 10
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
Feedback index #136
Feedback index #136
Conversation
This also removes the `index?` specifications because it's kind of unnecessary to have and I didn't want to account for it in the test updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is all great! When displaying the feedback, the order should be desc (latest on top).
edit_feedback_path(feedback), | ||
class: "btn btn-sm capitalize #{variant} #{classes}" | ||
) do | ||
content || 'Edit' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where does thecontent
come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a ViewComponent thing. It comes from a block that's passed to the component. This is a way for the button to have different kinds of text. So if I wanted the button to say "Edit Feedback" instead of just edit ->
<%= render Feedback::EditButtonComponent(**args) do %>
Edit Feedback
<% end %>
The content
will be "Edit Feedback" and that's what will get rendered. With no block passed, content
is nil
, so I have it default to "Edit".
Could also in the future pass an icon in through this or some markup that would be nested in the button.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha! That is really cool!
Done to distinguish between ruby "classes" and HTML classes
Issue
Closes #125
Description
show?
policy to not authorize draft feedback for receiversFeedback::EditButtonComponent
to allow it to fit more usecases.Feedback::ItemComponent
to represent an individual feedback "item" in the list of feedback on a user's index pagefeedbacks#index
Screenshots
Mobile
Desktop