-
-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add action icon * Refactoring icon method * Refactoring icon method * Add icon option to action in resources * Refactor render_entity method * Add divider action functionality * Fix indentation quit * Refactor action CSS class to conditionally include border-bottom * Rename method render_entity to render_item * Refactor action_css_class * Set default play icon when no icon is providerd * Refactor action_component and base_controller * Change icon parameter type from string to symbol * Add tests for icon and divider * tweaks --------- Co-authored-by: Paul Bob <paul.ionut.bob@gmail.com>
- Loading branch information
1 parent
2887838
commit 44d4bb6
Showing
9 changed files
with
83 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<div class="relative col-span-full border-t border-gray-300 border-solid" style= "border-width: 1.75px;"> | ||
<div class="absolute inset-auto -translate-y-1/2 -translate-x-1/2 ml-1/2 z-20 text-xs font-semibold uppercase leading-none text-gray-500 bg-application px-2"></div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
class Avo::DividerComponent < ViewComponent::Base | ||
def initialize(**args) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe "action icon and divider", type: :feature do | ||
describe "icon and divider" do | ||
let(:user) { create(:user) } | ||
|
||
it "Viewing actions with icon and divider" do | ||
visit "admin/resources/users" | ||
|
||
expect(page).to have_css("button[data-action='click->toggle#togglePanel']") | ||
|
||
expect(page).to have_css("path[stroke-linecap='round'][stroke-linejoin='round'][d*='M3.055 11']") | ||
expect(page).to have_css("path[stroke-linecap='round'][stroke-linejoin='round'][d*='M10.5 19.5']") | ||
|
||
expect(page).to have_css(".relative.col-span-full.border-t.border-gray-300.border-solid") | ||
end | ||
end | ||
end |