-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Admin] Add a ui/panel
component
#5371
Conversation
Codecov Report
@@ Coverage Diff @@
## nebulab/admin #5371 +/- ##
==============================================
Coverage 88.00% 88.01%
==============================================
Files 613 614 +1
Lines 14892 14897 +5
==============================================
+ Hits 13106 13111 +5
Misses 1786 1786
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
32c1ce6
to
e62130d
Compare
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.
Great work! Approved it but left a small suggestion. What do you think? :)
def initialize(title: nil, title_hint: nil, actions: nil) | ||
@title = title | ||
@title_hint = title_hint | ||
@actions = actions |
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.
Recently I've discovered that ViewComponent allows us to add new slots
to the blocks we open when creating a component.
What do you think on turning the actions
section into a slot? (Just like the content) So the dev can have more freedom instead of just passing the HTML on the initializer.
https://viewcomponent.org/guide/slots.html
like
has_one :actions
and
<%= render current_component.new(title: "SEO", title_hint: "Search Engine Optimization") do |panel| %>
<label>
SKU:
ABC-123
</label>
<% panel.with_actions do %>
...HTML
<% end %>
<% end %>
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.
Thanks great call! I'll embed this change in the products#show PR and update this later on 👍👍👍
9da2d1e
to
37cedc1
Compare
37cedc1
to
0b45920
Compare
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.
👍
Summary
Checklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed: