-
-
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.
Use ui/pages/index component tabbed index components
- Loading branch information
Showing
28 changed files
with
246 additions
and
600 deletions.
There are no files selected for viewing
32 changes: 0 additions & 32 deletions
32
admin/app/components/solidus_admin/adjustment_reasons/index/component.html.erb
This file was deleted.
Oops, something went wrong.
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
31 changes: 0 additions & 31 deletions
31
admin/app/components/solidus_admin/refund_reasons/index/component.html.erb
This file was deleted.
Oops, something went wrong.
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
26 changes: 0 additions & 26 deletions
26
admin/app/components/solidus_admin/refunds_and_returns/component.html.erb
This file was deleted.
Oops, something went wrong.
46 changes: 33 additions & 13 deletions
46
admin/app/components/solidus_admin/refunds_and_returns/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 |
---|---|---|
@@ -1,20 +1,40 @@ | ||
# frozen_string_literal: true | ||
|
||
class SolidusAdmin::RefundsAndReturns::Component < SolidusAdmin::BaseComponent | ||
include SolidusAdmin::Layout::PageHelpers | ||
renders_one :actions | ||
|
||
def initialize(current_class:) | ||
@current_class = current_class | ||
class SolidusAdmin::RefundsAndReturns::Component < SolidusAdmin::UI::Pages::Index::Component | ||
def title | ||
page_header_title safe_join([ | ||
tag.div(t(".title")), | ||
tag.div(t(".subtitle"), class: "font-normal text-sm text-gray-500"), | ||
]) | ||
end | ||
|
||
def tabs | ||
{ | ||
Spree::RefundReason => solidus_admin.refund_reasons_path, | ||
Spree::ReimbursementType => solidus_admin.reimbursement_types_path, | ||
Spree::ReturnReason => solidus_admin.return_reasons_path, | ||
Spree::AdjustmentReason => solidus_admin.adjustment_reasons_path, | ||
Spree::StoreCreditReason => solidus_admin.store_credit_reasons_path, | ||
} | ||
[ | ||
{ | ||
text: Spree::RefundReason.model_name.human(count: 2), | ||
href: solidus_admin.refund_reasons_path, | ||
current: model_class == Spree::RefundReason, | ||
}, | ||
{ | ||
text: Spree::ReimbursementType.model_name.human(count: 2), | ||
href: solidus_admin.reimbursement_types_path, | ||
current: model_class == Spree::ReimbursementType, | ||
}, | ||
{ | ||
text: Spree::ReturnReason.model_name.human(count: 2), | ||
href: solidus_admin.return_reasons_path, | ||
current: model_class == Spree::ReturnReason, | ||
}, | ||
{ | ||
text: Spree::AdjustmentReason.model_name.human(count: 2), | ||
href: solidus_admin.adjustment_reasons_path, | ||
current: model_class == Spree::AdjustmentReason, | ||
}, | ||
{ | ||
text: Spree::StoreCreditReason.model_name.human(count: 2), | ||
href: solidus_admin.store_credit_reasons_path, | ||
current: model_class == Spree::StoreCreditReason, | ||
}, | ||
] | ||
end | ||
end |
22 changes: 0 additions & 22 deletions
22
admin/app/components/solidus_admin/reimbursement_types/index/component.html.erb
This file was deleted.
Oops, something went wrong.
32 changes: 7 additions & 25 deletions
32
admin/app/components/solidus_admin/reimbursement_types/index/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
31 changes: 0 additions & 31 deletions
31
admin/app/components/solidus_admin/return_reasons/index/component.html.erb
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.