-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5293 from solidusio/elia/admin/connect-auth-to-si…
…debar [Admin] connect auth helpers to the sidebar
- Loading branch information
Showing
10 changed files
with
61 additions
and
47 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
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 |
---|---|---|
|
@@ -27,13 +27,22 @@ module ControllerHelper | |
extend ActiveSupport::Concern | ||
|
||
included do | ||
include SolidusAdmin::Auth | ||
helper ActionView::Helpers | ||
helper SolidusAdmin::ContainerHelper | ||
helper_method :current_component | ||
end | ||
|
||
private | ||
|
||
def spree_current_user | ||
Spree::LegacyUser.new(email: "[email protected]") | ||
end | ||
|
||
def authenticate_solidus_backend_user! | ||
# noop | ||
end | ||
|
||
def current_component | ||
@current_component ||= begin | ||
# Lookbook sets the @preview instance variable with a PreviewEntity instance, while ViewComponent uses the preview class. | ||
|
39 changes: 26 additions & 13 deletions
39
...components/previews/solidus_admin/sidebar/account_nav/component_preview/overview.html.erb
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 |
---|---|---|
@@ -1,16 +1,29 @@ | ||
<div class="flex h-screen"> | ||
<div class="flex h-4/5"> | ||
<div class="self-end"> | ||
<%= render current_component.new( | ||
user_label: "Alice Doe" | ||
) %> | ||
</div> | ||
<div class="mb-8"> | ||
<h6 class="text-gray-500 mb-3 mt-0"> | ||
Short name | ||
</h6> | ||
|
||
<div class="w-[17.78rem] pt-20 rounded border-dotted border-2 border-gray-300"> | ||
<%= render current_component.new( | ||
user_label: "Alice Doe", | ||
account_path: "#account", | ||
logout_path: "#logout", | ||
logout_method: :delete | ||
) %> | ||
</div> | ||
<div class="flex h-4/5"> | ||
<div class="self-end"> | ||
<%= render current_component.new( | ||
user_label: "Alice Supercalifragilisticexpialidocious" | ||
) %> | ||
</div> | ||
</div> | ||
|
||
<div class="mb-8"> | ||
<h6 class="text-gray-500 mb-3 mt-0"> | ||
Long name | ||
</h6> | ||
|
||
<div class="w-[17.78rem] pt-20 rounded border-dotted border-2 border-gray-300"> | ||
<%= render current_component.new( | ||
user_label: "Alice Supercalifragilisticexpialidocious", | ||
account_path: "#account", | ||
logout_path: "#logout", | ||
logout_method: :delete | ||
) %> | ||
</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
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