-
-
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.
enable editing of product property using UI components
- Loading branch information
1 parent
3be1cc8
commit f52b0cf
Showing
10 changed files
with
109 additions
and
11 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
admin/app/components/solidus_admin/properties/edit/component.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<%= turbo_frame_tag :edit_property_modal do %> | ||
<%= render component("ui/modal").new(title: t(".title")) do |modal| %> | ||
<%= form_for @property, url: solidus_admin.property_path(@property), html: { id: form_id } do |f| %> | ||
<div class="flex flex-col gap-6 pb-4"> | ||
<%= render component("ui/forms/field").text_field(f, :name, class: "required") %> | ||
<%= render component("ui/forms/field").text_field(f, :presentation, class: "required") %> | ||
</div> | ||
<% modal.with_actions do %> | ||
<form method="dialog"> | ||
<%= render component("ui/button").new(scheme: :secondary, text: t('.cancel')) %> | ||
</form> | ||
<%= render component("ui/button").new(form: form_id, type: :submit, text: t('.submit')) %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
<%= render component("properties/index").new(page: @page) %> |
12 changes: 12 additions & 0 deletions
12
admin/app/components/solidus_admin/properties/edit/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,12 @@ | ||
# frozen_string_literal: true | ||
|
||
class SolidusAdmin::Properties::Edit::Component < SolidusAdmin::BaseComponent | ||
def initialize(page:, property:) | ||
@page = page | ||
@property = property | ||
end | ||
|
||
def form_id | ||
dom_id(@property, "#{stimulus_id}_edit_property_form") | ||
end | ||
end |
4 changes: 4 additions & 0 deletions
4
admin/app/components/solidus_admin/properties/edit/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,4 @@ | ||
en: | ||
title: "Edit Property" | ||
cancel: "Cancel" | ||
submit: "Update Property" |
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
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