Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Admin UI fixes

Damian Legawiec1341623f2ae9
diff --git a/admin/app/assets/tailwind/spree/admin/components/_cards.css b/admin/app/assets/tailwind/spree/admin/components/_cards.css
index 4163dde6a7..17f3dac9c8 100644
--- a/admin/app/assets/tailwind/spree/admin/components/_cards.css
+++ b/admin/app/assets/tailwind/spree/admin/components/_cards.css
@@ -5,7 +5,7 @@
@layer components {
.card,
.card-lg {
- @apply relative flex flex-col min-w-0 break-words bg-white border border-gray-200 rounded-2xl;
+ @apply relative flex flex-col min-w-0 break-words bg-white border border-gray-200 rounded-xl;
background-clip: border-box;
}
@@ -14,7 +14,7 @@
}
.card .card {
- @apply rounded-2xl;
+ @apply rounded-xl;
}
/* Card with table */
@@ -87,7 +87,7 @@
}
.card-header {
- @apply flex items-center mb-0 p-5 pr-3 h-14 border-b border-gray-100 rounded-t-[calc(var(--radius-2xl)-1px)];
+ @apply flex items-center mb-0 p-5 pr-3 h-14 border-b border-gray-100 rounded-t-[calc(var(--radius-xl)-1px)];
}
.card-header .card-title {
@@ -111,7 +111,7 @@
}
.card-footer:last-child {
- @apply rounded-b-[calc(var(--radius-2xl)-1px)];
+ @apply rounded-b-[calc(var(--radius-xl)-1px)];
}
.card-footer.border-top,
@@ -135,13 +135,13 @@
}
.card-img-top {
- @apply w-full rounded-t-[calc(var(--radius-2xl)-1px)];
+ @apply w-full rounded-t-[calc(var(--radius-xl)-1px)];
}
/* Collapsable Card */
.collapsable-card {
@apply relative flex flex-col min-w-0 break-words overflow-hidden;
- @apply bg-white border border-gray-200 rounded-2xl;
+ @apply bg-white border border-gray-200 rounded-xl;
background-clip: border-box;
}
diff --git a/admin/app/assets/tailwind/spree/admin/components/_forms.css b/admin/app/assets/tailwind/spree/admin/components/_forms.css
index 70f2555af9..ee52212871 100644
--- a/admin/app/assets/tailwind/spree/admin/components/_forms.css
+++ b/admin/app/assets/tailwind/spree/admin/components/_forms.css
@@ -23,7 +23,7 @@
.select-input,
.form-control-sm,
.custom-select-sm {
- @apply block w-full py-2 pl-3 pr-8 text-base font-normal leading-normal;
+ @apply block w-full py-2 px-3 text-base font-normal leading-normal;
@apply text-gray-950 bg-white border border-gray-200 rounded-lg shadow-xs;
@apply focus:outline-offset-2 focus:outline-blue-500 focus:border-gray-200 focus:ring-0;
@apply transition-all duration-100 ease-in-out;
diff --git a/admin/app/views/spree/admin/exports/new.html.erb b/admin/app/views/spree/admin/exports/new.html.erb
index 1c961fe908..4ebb7b54a2 100644
--- a/admin/app/views/spree/admin/exports/new.html.erb
+++ b/admin/app/views/spree/admin/exports/new.html.erb
@@ -10,23 +10,24 @@
</div>
<div class="dialog-body">
<%= render 'spree/admin/shared/error_messages', target: @export %>
- <div class="custom-control custom-radio">
+ <div class="custom-control custom-radio hover:bg-gray-50 rounded-lg p-3">
<%= f.radio_button :record_selection, 'filtered', class: 'custom-control-input' %>
- <%= f.label :record_selection, for: :export_record_selection_filtered, class: 'custom-control-label' do %>
+ <%= f.label :record_selection, for: :export_record_selection_filtered, class: 'custom-control-label flex-col items-start' do %>
<%= Spree.t(:filtered_records) %>
+ <span class="text-gray-600 font-normal">
+ <%= Spree.t('admin.export_only_filtered_records') %>
+ </span>
<% end %>
- <span class="text-gray-600 font-normal ml-7 mt-2">
- <%= Spree.t('admin.export_only_filtered_records') %>
- </span>
</div>
- <div class="custom-control custom-radio mt-4">
+ <div class="custom-control custom-radio hover:bg-gray-50 rounded-lg p-3">
<%= f.radio_button :record_selection, 'all', class: 'custom-control-input' %>
- <%= f.label :record_selection, for: :export_record_selection_all, class: 'custom-control-label' do %>
+ <%= f.label :record_selection, for: :export_record_selection_all, class: 'custom-control-label flex-col items-start' do %>
<%= Spree.t(:all) %>
- <% end %>
- <span class="text-gray-600 font-normal ml-7 mt-2">
- <%= Spree.t('admin.export_all') %>
+ <span class="text-gray-600 font-normal">
+ <%= Spree.t('admin.export_all') %>
+ </span>
</span>
+ <% end %>
</div>
</div>
<div class="dialog-footer">
diff --git a/admin/app/views/spree/admin/products/form/variants/_variant_template.html.erb b/admin/app/views/spree/admin/products/form/variants/_variant_template.html.erb
index 650c4196e0..b2daf62f83 100644
--- a/admin/app/views/spree/admin/products/form/variants/_variant_template.html.erb
+++ b/admin/app/views/spree/admin/products/form/variants/_variant_template.html.erb
@@ -34,7 +34,7 @@
</div>
<% if can?(:manage, @product.default_variant) %>
<div class="variants-table__body__cell column-actions flex items-center">
- <a href="#" class="btn btn-light invisible ml-2" data-slot="variantEditButton">
+ <a href="#" class="btn btn-sm btn-light invisible ml-2" data-slot="variantEditButton">
<%= icon('edit') %>
<%= Spree.t(:edit)%>
</a>
diff --git a/admin/app/views/spree/admin/promotion_actions/new.html.erb b/admin/app/views/spree/admin/promotion_actions/new.html.erb
index 3288715f7c..f54cf6e572 100644
--- a/admin/app/views/spree/admin/promotion_actions/new.html.erb
+++ b/admin/app/views/spree/admin/promotion_actions/new.html.erb
@@ -10,9 +10,9 @@
<% if @promotion_action.type.nil? %>
<% options_for_promotion_action_types(@promotion).each do |action_type| %>
<% key = action_type.to_s.demodulize.underscore %>
- <%= link_to spree.new_admin_promotion_action_path(@promotion, promotion_action: { type: action_type }), class: 'flex align-items-top w-full py-2 px-4 hover:bg-gray-100 rounded-xl mb-2', data: { turbo_prefetch: false } do %>
- <%= radio_button_tag :type, action_type, checked: @promotion_action.type == action_type %>
- <div class="ml-4">
+ <%= link_to spree.new_admin_promotion_action_path(@promotion, promotion_action: { type: action_type }), class: 'flex align-items-top w-full py-2 px-4 hover:bg-gray-100 rounded-xl mb-2 no-underline', data: { turbo_prefetch: false } do %>
+ <%= radio_button_tag :type, action_type, class: 'hidden',checked: @promotion_action.type == action_type %>
+ <div>
<h6><%= Spree.t("promotion_action_types.#{key}.name") %></h6>
<p class="text-gray-600 mb-0"><%= Spree.t("promotion_action_types.#{key}.description") %></p>
</div>
diff --git a/admin/app/views/spree/admin/promotion_rules/new.html.erb b/admin/app/views/spree/admin/promotion_rules/new.html.erb
index bcbe027b82..f0a4e0dfaa 100644
--- a/admin/app/views/spree/admin/promotion_rules/new.html.erb
+++ b/admin/app/views/spree/admin/promotion_rules/new.html.erb
@@ -12,7 +12,7 @@
<% key = rule_type.demodulize.underscore %>
<%= link_to spree.new_admin_promotion_rule_path(@promotion, promotion_rule: { type: rule_type }), class: 'flex align-items-top w-full py-2 px-4 hover:bg-gray-100 rounded-xl mb-2 no-underline', data: { turbo_prefetch: false } do %>
<%= radio_button_tag :type, rule_type, class: 'hidden' %>
- <div class="">
+ <div>
<h6 class="font-bold mb-1"><%= Spree.t("promotion_rule_types.#{key}.name") %></h6>
<p class="text-gray-600 mb-0"><%= Spree.t("promotion_rule_types.#{key}.description") %></p>
</div>
diff --git a/admin/app/views/spree/admin/promotions/form/_kind.html.erb b/admin/app/views/spree/admin/promotions/form/_kind.html.erb
index 8ec12ff80f..f9e47db129 100644
--- a/admin/app/views/spree/admin/promotions/form/_kind.html.erb
+++ b/admin/app/views/spree/admin/promotions/form/_kind.html.erb
@@ -5,40 +5,40 @@
<div data-reveal-target="item" class="rounded-md p-6 bg-gray-25 mt-6 <% if @promotion.automatic? %>hidden<% end %>">
<div data-controller="reveal" data-reveal-hidden-class="hidden">
- <div class="flex items-start custom-control custom-radio">
+ <div class="custom-control custom-radio">
<%= f.radio_button :multi_codes, false, data: { action: 'change->reveal#toggle' }, class: 'custom-control-input' %>
- <%= f.label :multi_codes_false, class: 'custom-control-label' do %>
+ <%= f.label :multi_codes_false, class: 'custom-control-label flex-col items-start' do %>
One code for all customers
- <span class="form-text font-normal mr-1 mt-2">
+ <span class="form-text font-normal">
You can limit the number of times this code can be used.
</span>
<% end %>
</div>
- <div data-reveal-target="item" class="mb-6 mt-2 ml-6 <% if @promotion.multi_codes? %>hidden<% end %>">
+ <div data-reveal-target="item" class="mt-2 ml-6 <% if @promotion.multi_codes? %>hidden<% end %>">
<%= f.text_field :code, class: 'form-input uppercase', placeholder: 'Your coupon code' %>
</div>
- <div class="mt-2 flex items-start custom-control custom-radio">
+ <div class="mt-6 custom-control custom-radio">
<%= f.radio_button :multi_codes, true, data: { action: 'change->reveal#toggle' }, class: 'custom-control-input' %>
- <%= f.label :multi_codes_true, class: 'custom-control-label' do %>
+ <%= f.label :multi_codes_true, class: 'custom-control-label flex-col items-start' do %>
Generate unique codes
- <span class="form-text font-normal mr-1 mt-2">
+ <span class="form-text font-normal">
These codes are generated automatically and can be downloaded as a CSV file. Codes are unique and can only be used once.
</span>
<% end %>
</div>
- <div data-reveal-target="item" class="ml-6 mt-2 grid grid-cols-12 gap-6 <% unless @promotion.multi_codes? %>hidden<% end %>">
- <div class="col-span-6">
+ <div data-reveal-target="item" class="ml-6 mt-2 grid gap-3 <% unless @promotion.multi_codes? %>hidden<% end %>">
+ <div>
<%= f.text_field :code_prefix, class: 'form-input uppercase', placeholder: 'Coupon Prefix (optional)' %>
- <span class="form-text mt-2">
+ <span class="form-text mt-1">
eg. <strong>ABC</strong>
</span>
</div>
- <div class="col-span-6">
+ <div>
<% minimum_number_of_codes = @promotion.persisted? && @promotion.coupon_codes.count.positive? ? @promotion.coupon_codes.count : 1 %>
<% maximum_number_of_codes = ENV.fetch('PROMOTION_MAX_NUMBER_OF_CODES', 5000) %>
<%= f.number_field :number_of_codes, class: 'form-input', placeholder: 'Number of codes', min: minimum_number_of_codes, max: maximum_number_of_codes, step: 1 %>
- <span class="form-text mt-2">
+ <span class="form-text mt-1">
How many codes you want to generate.
<% if @promotion.persisted? %>
To add more codes just increase this number
@@ -52,10 +52,12 @@
<div class="mt-6 custom-control custom-radio">
<%= f.radio_button :kind, :automatic, data: { action: 'change->reveal#hide' }, class: 'custom-control-input' %>
- <%= f.label :kind_automatic, Spree.t(:automatic_promotion), class: 'custom-control-label' %>
+ <%= f.label :kind_automatic, Spree.t(:automatic_promotion), class: 'custom-control-label flex-col items-start' do %>
+ <%= Spree.t(:automatic_promotion) %>
+ <span class="form-text font-normal">
+ This promotion will be automatically applied to all eligible orders.
+ </span>
+ <% end %>
- <p class="form-text mt-2 mb-0">
- This promotion will be automatically applied to all eligible orders.
- </p>
</div>
</div>
\ No newline at end of file
diff --git a/admin/app/views/spree/admin/stores/new.html.erb b/admin/app/views/spree/admin/stores/new.html.erb
index c97ff06748..198c288793 100644
--- a/admin/app/views/spree/admin/stores/new.html.erb
+++ b/admin/app/views/spree/admin/stores/new.html.erb
@@ -1,5 +1,5 @@
<%= form_for @store, url: spree.admin_stores_path, data: { turbo: false, controller: 'store-form enable-button' } do |f| %>
- <div class="container pt-48">
+ <div class="container mx-auto px-4 pt-8">
<h1 class="mb-6"><%= Spree.t(:new_store) %></h1>
<%= render partial: 'spree/admin/shared/error_messages', locals: { target: @store } %>
@@ -54,12 +54,12 @@
<% end %>
</div>
<div class="col-span-12 lg:col-span-5 lg:col-start-8">
- <h5>What will be shared with this new store:</h5>
+ <h5 class="mb-2">What will be shared with this new store:</h5>
<ul class="list-none p-0">
<li>
<%= icon('check', class: 'text-green-700') %>
<%= Spree.t(:products) %>, <%= Spree.t(:stock_locations) %> & <%= Spree.t(:inventory) %><br />
- <em class="ml-24 text-gray-600 text-sm">you can select which ones will be available for this store</em>
+ <em class="ml-5 text-gray-600 text-sm">you can select which ones will be available for this store</em>
</li>
<li>
<%= icon('check', class: 'text-green-700') %>
@@ -72,7 +72,7 @@
<li>
<%= icon('check', class: 'text-green-700') %>
<%= Spree.t(:payment_methods) %><br />
- <em class="ml-24 text-gray-600 text-sm">you can select which ones will be available for this store</em>
+ <em class="ml-5 text-gray-600 text-sm">you can select which ones will be available for this store</em>
</li>
<li>
<%= icon('check', class: 'text-green-700') %>
@@ -80,7 +80,7 @@
</li>
</ul>
- <h5>What will not be shared with this new store:</h5>
+ <h5 class="mt-6 mb-2">What will not be shared with this new store:</h5>
<ul class="list-none p-0">
<li>
<%= icon('x', class: 'text-danger') %>
diff --git a/admin/app/views/spree/admin/tables/_query_builder.html.erb b/admin/app/views/spree/admin/tables/_query_builder.html.erb
index 434425739c..fe9e54683d 100644
--- a/admin/app/views/spree/admin/tables/_query_builder.html.erb
+++ b/admin/app/views/spree/admin/tables/_query_builder.html.erb
@@ -23,7 +23,7 @@
data-query-builder-operators-value="<%= operators_json %>"
class="grow flex flex-col justify-between">
- <%= form_with url: url_for, method: :get, html: { class: 'grow flex flex-col justify-between' },data: { turbo_frame: '_top', query_builder_target: 'form', action: 'submit->query-builder#submitForm' } do |f| %>
+ <%= form_with url: url_for, method: :get, html: { class: 'grow flex flex-col justify-between' }, data: { turbo_frame: frame_name, turbo_action: 'advance', query_builder_target: 'form', action: 'submit->query-builder#submitForm' } do |f| %>
<div class="drawer-body">
<div class="mb-4 flex items-center gap-2 flex-wrap">
<span class="text-sm text-gray-600">
diff --git a/admin/app/views/spree/admin/variants/form/_inventory.html.erb b/admin/app/views/spree/admin/variants/form/_inventory.html.erb
index 4c3b821cfe..87fa3585e4 100644
--- a/admin/app/views/spree/admin/variants/form/_inventory.html.erb
+++ b/admin/app/views/spree/admin/variants/form/_inventory.html.erb
@@ -9,7 +9,7 @@
<%= f.spree_check_box :track_inventory, data: { action: 'change->reveal#toggle' } %>
</div>
- <table class="table <%= 'hidden!' unless f.object.track_inventory? %>" data-reveal-target="item">
+ <table class="table border-t <%= 'hidden!' unless f.object.track_inventory? %>" data-reveal-target="item">
<thead>
<tr>
<th scope="col"><%= Spree.t(:stock_location) %></th>
diff --git a/admin/app/views/spree/admin/variants/form/_pricing.html.erb b/admin/app/views/spree/admin/variants/form/_pricing.html.erb
index e93a8ec97d..65c75e8960 100644
--- a/admin/app/views/spree/admin/variants/form/_pricing.html.erb
+++ b/admin/app/views/spree/admin/variants/form/_pricing.html.erb
@@ -1,5 +1,5 @@
<div class="card mb-6" data-product-form-target="pricesForm">
- <div class="card-header flex items-center justify-between">
+ <div class="card-header flex items-center justify-between border-b-0">
<h5 class="card-title">
<%= Spree.t(:pricing) %>
</h5>
@@ -9,7 +9,7 @@
<% end %>
</div>
<div class="card-body p-0">
- <table class="table">
+ <table class="table border-t">
<thead>
<tr>
<th scope="col"><%= Spree.t(:currency) %></th>