forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nesting for "Users and Roles" admin component
Now instead of a top level Users component, the main landing page is "Users and Roles" (with the users page being the pre-selected tab, so the only visual change is a new page header and a new tab component to swap between "Users" and "Roles".
- Loading branch information
1 parent
b766363
commit eb6f734
Showing
4 changed files
with
23 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
admin/app/components/solidus_admin/users_and_roles/component.rb
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,19 @@ | ||
# frozen_string_literal: true | ||
|
||
class SolidusAdmin::UsersAndRoles::Component < SolidusAdmin::UI::Pages::Index::Component | ||
def title | ||
page_header_title safe_join([ | ||
tag.div(t(".title")), | ||
]) | ||
end | ||
|
||
def tabs | ||
[ | ||
{ | ||
text: Spree.user_class.model_name.human(count: 2), | ||
href: solidus_admin.users_path, | ||
current: model_class == Spree.user_class, | ||
}, | ||
] | ||
end | ||
end |
2 changes: 2 additions & 0 deletions
2
admin/app/components/solidus_admin/users_and_roles/component.yml
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,2 @@ | ||
en: | ||
title: "Users and Roles" |
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