-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Feature: Title and description for tabs #3442
Feature: Title and description for tabs #3442
Conversation
Code Climate has analyzed commit 19ed23c and detected 0 issues on this pull request. View more on Code Climate. |
I think I mede it as I should, but I do not know what can I put into title and description of tabs. Also I don't know why tab_group_component_spec and tab_swicher_component_spec are empty. |
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.
Looking good already, @Nevelito. Thank you!
Let's make two minor changes:
- Use the instance variable directly in the component instead of defining a public reader. Instance variable access is faster than reader access.
- In the tab header component, let's add the
def render?
method, and inside it, define the logic as(@title || @description).present?
. This way, we avoid rendering an emptydiv
if there is neither a title nor a description.
Otherwise, it's looking good! 👍
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.
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.
Seems a bit to much to render the whole Avo::PanelComponent
when we only want to render the header section. Le'ts create a new component, extract the header section into that component and use the new Avo::PanelHeaderComponent
require "rails_helper" | ||
|
||
RSpec.describe Avo::PanelHeaderComponent, type: :component do | ||
# it "renders something useful" do |
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.
should we actually implement this spec?
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.
I think we should. Not sure why it's commented out.
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.
All of spec are made like this.
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.
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.
should we actually implement this spec?
Not really, it was generated while generating the component
I think we should. Not sure why it's commented out.
It was generated during the component generation, we don't implement component tests yet so it can be removed for this PR
Co-authored-by: Kamil Milewski <[email protected]>
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.
Thank you @Nevelito! It's looking good!
I've made some minor commits to complete this PR and include it in tomorrow's release.
Description
Fixes #3421
Checklist: