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

[Admin] Add a ui/panel component #5371

Merged
merged 1 commit into from
Sep 13, 2023
Merged

[Admin] Add a ui/panel component #5371

merged 1 commit into from
Sep 13, 2023

Conversation

elia
Copy link
Member

@elia elia commented Sep 5, 2023

Summary

image

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Sep 5, 2023
@elia elia marked this pull request as ready for review September 5, 2023 16:10
@elia elia requested a review from a team as a code owner September 5, 2023 16:10
@elia elia requested a review from rainerdema September 5, 2023 16:10
@codecov
Copy link

codecov bot commented Sep 6, 2023

Codecov Report

Merging #5371 (0b45920) into nebulab/admin (8656765) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@              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           
Files Changed Coverage Δ
...app/components/solidus_admin/ui/panel/component.rb 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia force-pushed the elia/admin/ui-panel branch 2 times, most recently from 32c1ce6 to e62130d Compare September 7, 2023 10:07
@elia elia requested a review from the-krg September 7, 2023 12:20
Copy link
Contributor

@the-krg the-krg left a 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
Copy link
Contributor

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 %>

Copy link
Member Author

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 👍👍👍

@elia elia force-pushed the elia/admin/ui-panel branch 2 times, most recently from 9da2d1e to 37cedc1 Compare September 13, 2023 09:29
@elia elia force-pushed the elia/admin/ui-panel branch from 37cedc1 to 0b45920 Compare September 13, 2023 09:50
Copy link
Contributor

@rainerdema rainerdema left a comment

Choose a reason for hiding this comment

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

👍

@elia elia merged commit cefb5e6 into nebulab/admin Sep 13, 2023
4 checks passed
@elia elia deleted the elia/admin/ui-panel branch September 13, 2023 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants