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

Feedback index #136

Merged
merged 15 commits into from
Jul 3, 2023
Merged

Feedback index #136

merged 15 commits into from
Jul 3, 2023

Conversation

JoshDevHub
Copy link
Collaborator

@JoshDevHub JoshDevHub commented Jul 2, 2023

Issue

Closes #125

Description

  • Update feedback's show? policy to not authorize draft feedback for receivers
  • Small refactor for Feedback::EditButtonComponent to allow it to fit more usecases.
  • Create Feedback::ItemComponent to represent an individual feedback "item" in the list of feedback on a user's index page
  • Set up route and controller action for feedbacks#index
  • Add link to feedback index page in navbar
  • Create and style the feedback index page using a tab layout - Stimulus Tab Component used for managing the tab behavior

Screenshots

Mobile

Selection_191

Desktop

Selection_193

Copy link
Collaborator

@toyhammered toyhammered left a 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).

app/components/feedback/edit_button_component.rb Outdated Show resolved Hide resolved
edit_feedback_path(feedback),
class: "btn btn-sm capitalize #{variant} #{classes}"
) do
content || 'Edit'
Copy link
Collaborator

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?

Copy link
Collaborator Author

@JoshDevHub JoshDevHub Jul 2, 2023

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.

Copy link
Collaborator

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!

@toyhammered toyhammered merged commit 96e1b07 into main Jul 3, 2023
1 check passed
@toyhammered toyhammered deleted the feedback-index branch July 3, 2023 00:59
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.

[Feedback Epic] Feedback#index
2 participants