spree_admin 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d55b4e39523cee4652dddb953445f27d15190d2cff8e40d3f012329c3e3612ec
4
- data.tar.gz: e919c13188d0b35f8c17afaa52fd6e26ea2eae5713e2f5c7d2abb81ea7b7cb9e
3
+ metadata.gz: 1fb2e27934e0ce22324b5a7c032fbeb7d0abf76d3512f726dd0acddc30a217dc
4
+ data.tar.gz: 3caabc53934c4c0bdbd2b70bfea5dcaa9685eb3acb9a2d2bcebcc362c4807e73
5
5
  SHA512:
6
- metadata.gz: f7534f9a249beb83294f14d274920f12d7eb55504951365b0511e1efd980040a4811ffb9261af1aaf8074a60afb564176aa654c321bf771da211f629862e1281
7
- data.tar.gz: 50b9265c84d615cade73af58b1af47ff41c043394ac10f9475d1a5cfdaf1398cf3bd274be2880264d846ad15e0ff9701e7b883cf1839b99eef34e198779db873
6
+ metadata.gz: ffb8d7703b134adf2439b7f035557930448883896f6e4a07daea768de52847d13dc0ed7ca8cb37fc1e38e0df637b7fcbfb54cc3d7e13fdf03adc23493714e33a
7
+ data.tar.gz: 88f4985f3985761932f2e341ed62085658c925a18244718bb14ffc729b3074cc9d726fa8419c70af12a3da77e9a624f39d3bba5841b4d759a03a1cb8abaad994
@@ -31,13 +31,16 @@
31
31
  }
32
32
 
33
33
  .alert-danger {
34
- background-color: #f8d7da;
35
- border-color: rgba($danger, 0.3) !important;
36
-
34
+ background-color: #FEF2F2;
35
+ border-color: #FBE3E3;
36
+ color: #450A09;
37
37
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-exclamation-circle'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M12 9v4' /%3E%3Cpath d='M12 16v.01' /%3E%3C/svg%3E");
38
38
  }
39
39
 
40
40
  .alert-success {
41
+ background-color: #ECFDF5;
42
+ color: #092E26;
43
+ border-color: #D5F9E6;
41
44
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-check-circle'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0' /%3E%3Cpath d='M9 12l2 2l4 -4' /%3E%3C/svg%3E");
42
45
  }
43
46
 
@@ -18,10 +18,10 @@ $light: $gray-50 !default;
18
18
 
19
19
  $primary: #061932 !default;
20
20
  $black: #000000 !default;
21
- $blue: #0077ff !default;
21
+ $blue: #0090FE !default;
22
22
  $white: #FFFFFF !default;
23
23
 
24
- $action: #f1faff !default;
24
+ $action: #F4F9FF !default;
25
25
  $action-border: #e2ecff !default;
26
26
 
27
27
  $theme-colors: (
@@ -104,11 +104,11 @@ $box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),0 2px 4px -1px rgba(0, 0, 0, 0.06
104
104
  $box-shadow-xs: rgba(43, 34, 51, 0.04) 0px 1px 2px !default;
105
105
  $box-shadow-lg: rgba(0, 5, 13, 0.5) 0px 4px 8px 2px;
106
106
 
107
- $tooltip-border-radius: $border-radius-sm !default;
107
+ $tooltip-border-radius: $border-radius !default;
108
108
  $tooltip-opacity: 1 !default;
109
109
  $tooltip-margin: 0.25rem 0 !default;
110
- $tooltip-padding-y: .5rem !default;
111
- $tooltip-padding-x: .75rem !default;
110
+ $tooltip-padding-y: .25rem !default;
111
+ $tooltip-padding-x: .5rem !default;
112
112
  $tooltip-bg: $white !default;
113
113
  $tooltip-color: $body-color !default;
114
114
  $tooltip-arrow-color: transparent !default;
@@ -1,10 +1,7 @@
1
1
  // https://twitter.com/NatalieMarleny/status/1662402066365526016
2
2
  html {
3
3
  min-height: 100%;
4
- font-feature-settings: "kern";
5
- font-optical-sizing: auto;
6
- font-style: normal;
7
- font-variation-settings: "slnt" 0;
4
+ letter-spacing: normal;
8
5
  }
9
6
  body {
10
7
  @extend .h-100;
@@ -670,7 +667,8 @@ div.uppy-Root {
670
667
  }
671
668
 
672
669
  .tooltip-inner {
673
- box-shadow: $dropdown-box-shadow;
670
+ border: 1px solid $gray-100;
671
+ box-shadow: $box-shadow-xs;
674
672
  }
675
673
 
676
674
  .avatar {
@@ -1,6 +1,8 @@
1
1
  module Spree
2
2
  module Admin
3
3
  class PostsController < ResourceController
4
+ before_action :load_post_categories
5
+
4
6
  def select_options
5
7
  render json: current_store.posts.published.to_tom_select_json
6
8
  end
@@ -18,6 +20,10 @@ module Spree
18
20
  @search = @collection.ransack(params[:q])
19
21
  @collection = @search.result.page(params[:page]).per(params[:per_page])
20
22
  end
23
+
24
+ def load_post_categories
25
+ @post_categories = current_store.post_categories.accessible_by(current_ability).order(:title)
26
+ end
21
27
  end
22
28
  end
23
29
  end
@@ -15,6 +15,7 @@ module Spree
15
15
  before_action :prepare_product_params, only: [:create, :update]
16
16
  before_action :strip_stock_items_param, only: [:create, :update]
17
17
  before_action :ensure_session_uploaded_assets_uuid, only: :new
18
+ before_action :check_slug_availability, only: [:create, :update]
18
19
 
19
20
  new_action.before :build_master_prices
20
21
  new_action.before :build_master_stock_items
@@ -354,6 +355,11 @@ module Spree
354
355
  variant_images: [],
355
356
  }
356
357
  end
358
+
359
+ def check_slug_availability
360
+ new_slug = permitted_resource_params[:slug]
361
+ permitted_resource_params[:slug] = @product.ensure_slug_is_unique(new_slug)
362
+ end
357
363
  end
358
364
  end
359
365
  end
@@ -27,7 +27,7 @@ module Spree
27
27
 
28
28
  def update
29
29
  if @user.update(user_params)
30
- flash[:success] = Spree.t(:account_updated)
30
+ flash[:success] = flash_message_for(@user, :successfully_updated)
31
31
  redirect_to spree.admin_user_path(@user)
32
32
  else
33
33
  render :edit, status: :unprocessable_entity
@@ -10,8 +10,5 @@ export default class extends Controller {
10
10
  const name = this.nameTarget.value
11
11
  const url = name.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)+/g, '')
12
12
  this.urlTarget.value = url
13
-
14
- // TODO: do ajax call and check if url is available
15
- // if not, append a number to the end to make it unique
16
13
  }
17
14
  }
@@ -4,11 +4,11 @@ import { lockScroll, unlockScroll } from 'spree/core/helpers/scroll_lock'
4
4
 
5
5
 
6
6
  const initTooltips = () => {
7
- $('.with-tip').each(function() {
7
+ $('.with-tip, .trix-button').each(function() {
8
8
  $(this).tooltip()
9
9
  })
10
10
 
11
- $('.with-tip').on('show.bs.tooltip', function(event) {
11
+ $('.with-tip, .trix-button').on('show.bs.tooltip', function(event) {
12
12
  if (('ontouchstart' in window)) {
13
13
  event.preventDefault()
14
14
  }
@@ -16,7 +16,7 @@ const initTooltips = () => {
16
16
  }
17
17
 
18
18
  const removeTooltips = () => {
19
- $('.with-tip').each(function() {
19
+ $('.with-tip, .trix-button').each(function() {
20
20
  $(this).tooltip('dispose')
21
21
  })
22
22
  }
@@ -0,0 +1,13 @@
1
+ <%= content_for :title do %>
2
+ <%= Spree.t(:forbidden) %>
3
+ <% end %>
4
+
5
+ <%= content_for :page_title do %>
6
+ <%= Spree.t(:forbidden) %>
7
+ <% end %>
8
+
9
+ <p class="text-danger">
10
+ <%= Spree.t(:forbidden_message) %>
11
+ </p>
12
+
13
+ <%= link_to Spree.t('admin.back_to_dashboard'), spree.admin_dashboard_path, class: 'btn btn-primary' %>
@@ -0,0 +1,26 @@
1
+ <tr id="<%= dom_id page %>" data-controller="row-link" class="cursor-pointer">
2
+ <td scope="row" data-action="click->row-link#openLink" class="w-60">
3
+ <%= link_to page.name, spree.edit_admin_theme_path(current_store.default_theme, page_id: page.id), data: { row_link_target: :link } %>
4
+ </td>
5
+ <td data-action="click->row-link#openLink" class="w-15">
6
+ <%= local_time_ago(page.created_at, class: 'with-tip') %>
7
+ </td>
8
+ <td data-action="click->row-link#openLink" class="w-15">
9
+ <%= local_time_ago(page.updated_at, class: 'with-tip') %>
10
+ </td>
11
+ <td class="w-10 text-right">
12
+ <div class="dropdown">
13
+ <button class="btn btn-sm btn-light" type="button" data-toggle="dropdown" aria-expanded="false">
14
+ <%= icon('dots-vertical', class: 'mr-0') %>
15
+ </button>
16
+ <ul class="dropdown-menu">
17
+ <li>
18
+ <%= link_to_with_icon 'edit', Spree.t(:edit), spree.edit_admin_theme_path(current_store.default_theme, page_id: page.id), class: 'dropdown-item' %>
19
+ </li>
20
+ <li>
21
+ <%= link_to_delete(page, class: 'dropdown-item btn-danger', icon: 'trash') %>
22
+ </li>
23
+ </ul>
24
+ </div>
25
+ </td>
26
+ </tr>
@@ -10,10 +10,12 @@
10
10
  <% if @collection.any? %>
11
11
  <div class="table-responsive">
12
12
  <table class="table">
13
- <thead class="text-muted">
13
+ <thead>
14
14
  <tr>
15
- <th><%= Spree.t(:name) %></th>
16
- <th><%= Spree.t(:updated) %></th>
15
+ <th><%= sort_link @search, :name, Spree.t(:name) %></th>
16
+ <th><%= sort_link @search, :created_at, Spree.t(:created_at) %></th>
17
+ <th><%= sort_link @search, :updated_at, Spree.t(:updated_at) %></th>
18
+ <th></th>
17
19
  </tr>
18
20
  </thead>
19
21
  <tbody>
@@ -1,6 +1,9 @@
1
1
  <tr data-controller="row-link" id="<%= dom_id(post_category) %>">
2
- <td><%= link_to post_category.title, spree.edit_admin_post_category_path(post_category), class: 'd-flex', data: { row_link_target: :link } %></td>
3
- <td class="actions cursor-pointer" data-action="click->row-link#openLink">
2
+ <td class="w-60 p-0">
3
+ <%= link_to post_category.title, spree.edit_admin_post_category_path(post_category), class: 'd-block w-100 h-100 px-3 py-2', data: { row_link_target: :link } %>
4
+ </td>
5
+ <td class="w-10 cursor-pointer" data-action="click->row-link#openLink"><%= post_category.posts.count %></td>
6
+ <td class="w-10 cursor-pointer text-right" data-action="click->row-link#openLink">
4
7
  <%= link_to_edit(post_category, class: 'btn btn-light btn-sm') if can? :edit, post_category %>
5
8
  </td>
6
9
  </tr>
@@ -10,7 +10,8 @@
10
10
  <table class="table">
11
11
  <thead class="text-muted">
12
12
  <tr>
13
- <th class="w-90"><%= Spree.t(:title) %></th>
13
+ <th><%= Spree.t(:title) %></th>
14
+ <th><%= Spree.t(:posts) %></th>
14
15
  <th></th>
15
16
  </tr>
16
17
  </thead>
@@ -20,9 +20,9 @@
20
20
  <div class="form-group">
21
21
  <%= f.label :post_category_id_eq, Spree.t(:category) %>
22
22
  <%= f.select :post_category_id_eq,
23
- options_for_select(Spree::PostCategory.all.pluck(:title, :id), params.dig(:q, :post_category_id_eq)),
23
+ options_for_select(@post_categories.pluck(:title, :id), params.dig(:q, :post_category_id_eq)),
24
24
  { include_blank: true },
25
- { class: "custom-select", data: { filters_target: :input } } %>
25
+ { data: { filters_target: :input, controller: 'autocomplete-select' } } %>
26
26
  </div>
27
27
  </div>
28
28
  </div>
@@ -48,12 +48,12 @@
48
48
  <div class="card-body">
49
49
  <div class="form-group">
50
50
  <%= f.label :author_id, Spree.t(:author) %>
51
- <%= f.select :author_id, options_for_select(post_authors_select_options, @post.author_id || try_spree_current_user.id), {}, { class: 'custom-select' } %>
51
+ <%= f.select :author_id, options_for_select(post_authors_select_options, @post.author_id || try_spree_current_user.id), {}, { data: { controller: 'autocomplete-select' } } %>
52
52
  </div>
53
53
 
54
54
  <div class="form-group">
55
55
  <%= f.label :post_category_id, Spree.t(:category) %>
56
- <%= f.select :post_category_id, options_for_select(current_store.post_categories.pluck(:title, :id), @post.post_category_id), { include_blank: true }, { class: 'custom-select' } %>
56
+ <%= f.select :post_category_id, options_for_select(@post_categories.pluck(:title, :id), @post.post_category_id), { include_blank: true }, { data: { controller: 'autocomplete-select' } } %>
57
57
  </div>
58
58
 
59
59
  <div class="form-group">
@@ -13,10 +13,10 @@
13
13
  <table class="table">
14
14
  <thead class="text-muted">
15
15
  <tr>
16
- <th><%= Spree.t(:title) %></th>
16
+ <th><%= sort_link @search, :title, Spree.t(:title) %></th>
17
17
  <th><%= Spree.t(:category) %></th>
18
18
  <th><%= Spree.t(:author) %></th>
19
- <th><%= Spree.t(:published_at) %></th>
19
+ <th><%= sort_link @search, :published_at, Spree.t(:published_at) %></th>
20
20
  <th></th>
21
21
  </tr>
22
22
  </thead>
@@ -14,6 +14,7 @@
14
14
  <%= f.text_field :name, class: 'form-control',
15
15
  placeholder: Spree.t(:store_name),
16
16
  required: true,
17
+ autofocus: true,
17
18
  data: {
18
19
  enable_button_target: 'input',
19
20
  } %>
@@ -43,7 +43,7 @@
43
43
 
44
44
  <div class="col-lg-4">
45
45
  <div class="d-flex justify-content-center flex-column mb-3 mb-lg-0 border-right">
46
- <span class="text-muted"><%= Spree.t('admin.member_since') %></span>
46
+ <span class="text-muted"><%= Spree.t(:created_at) %></span>
47
47
  <span class="font-size-lg text-dark font-weight-bold mt-1 me-3">
48
48
  <%= local_time(@user.created_at) %>
49
49
  </span>
@@ -1,5 +1,5 @@
1
1
  Chartkick.options = {
2
- colors: ["#007bff"],
2
+ colors: ["#0090FE"],
3
3
  zeros: true,
4
4
  points: false
5
5
  }
@@ -19,7 +19,6 @@ en:
19
19
  active: Setting products to active will make those products available on the storefront.
20
20
  archived: Setting products to archived will hide them from storefront.
21
21
  draft: Setting products to draft will hide them from storefront.
22
- ready_for_review: We will notify your partners that these products are ready for review. Your partners will be able to review and publish these products.
23
22
  status_updated: Status updated
24
23
  title:
25
24
  add_tags: Add tags
@@ -80,7 +79,6 @@ en:
80
79
  manage_stock_locations: Manage Stock Locations
81
80
  manage_taxons: Manage Taxons
82
81
  manage_zones: Manage Zones
83
- member_since: Member since
84
82
  name: Name
85
83
  navigation:
86
84
  nested_under: Nested under
@@ -160,7 +158,7 @@ en:
160
158
  by_stock: By stock
161
159
  deleted: Deleted
162
160
  draft: Draft
163
- help_bubble: Draft & Ready for Review statuses mean that the product isn't available for purchase. Active means that the product is live. Vendors can move product from draft to ready for review, but only marketplace operators can move product from ready for review to active
161
+ help_bubble: Draft products aren't available for purchase. Active products are live.
164
162
  in_stock: In Stock
165
163
  inventory:
166
164
  barcode: Barcode (ISBN, UPC, GTIN, etc.)
@@ -175,7 +173,7 @@ en:
175
173
  available_on: Marks when the product will be released, put a future date to indicate that this is a pre-order
176
174
  discontinue_on: Marks when the product should be automatically taken off from your site
177
175
  make_active_at: Marks when the product should be automatically promoted to "active" state
178
- status: Draft - initial status. Ready For Review - inform store owner that product can be checked before activation
176
+ status: Draft products aren't available for purchase. Active products are live.
179
177
  stores:
180
178
  choose_stores: Choose which stores this product should be available in
181
179
  variants:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-09 00:00:00.000000000 Z
11
+ date: 2025-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.1
19
+ version: 5.0.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.1
26
+ version: 5.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: spree_api
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 5.0.1
33
+ version: 5.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 5.0.1
40
+ version: 5.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: active_link_to
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -520,6 +520,7 @@ files:
520
520
  - app/views/spree/admin/digital_assets/index.html.erb
521
521
  - app/views/spree/admin/digital_assets/new.html.erb
522
522
  - app/views/spree/admin/digital_assets/update.turbo_stream.erb
523
+ - app/views/spree/admin/errors/forbidden.html.erb
523
524
  - app/views/spree/admin/exports/_export.html.erb
524
525
  - app/views/spree/admin/exports/create.turbo_stream.erb
525
526
  - app/views/spree/admin/exports/index.html.erb
@@ -687,7 +688,7 @@ files:
687
688
  - app/views/spree/admin/page_sections/update.turbo_stream.erb
688
689
  - app/views/spree/admin/pages/_filters.html.erb
689
690
  - app/views/spree/admin/pages/_form.html.erb
690
- - app/views/spree/admin/pages/_page.erb
691
+ - app/views/spree/admin/pages/_page.html.erb
691
692
  - app/views/spree/admin/pages/edit.html.erb
692
693
  - app/views/spree/admin/pages/index.html.erb
693
694
  - app/views/spree/admin/pages/new.html.erb
@@ -1058,9 +1059,9 @@ licenses:
1058
1059
  - AGPL-3.0-or-later
1059
1060
  metadata:
1060
1061
  bug_tracker_uri: https://github.com/spree/spree/issues
1061
- changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.1
1062
+ changelog_uri: https://github.com/spree/spree/releases/tag/v5.0.2
1062
1063
  documentation_uri: https://docs.spreecommerce.org/
1063
- source_code_uri: https://github.com/spree/spree/tree/v5.0.1
1064
+ source_code_uri: https://github.com/spree/spree/tree/v5.0.2
1064
1065
  post_install_message:
1065
1066
  rdoc_options: []
1066
1067
  require_paths:
@@ -1,8 +0,0 @@
1
- <tr id="<%= dom_id page %>" data-controller="row-link" class="cursor-pointer">
2
- <td scope="row" data-action="click->row-link#openLink">
3
- <%= link_to page.name, spree.edit_admin_theme_path(current_store.default_theme, page_id: page.id), data: { row_link_target: :link } %>
4
- </td>
5
- <td data-action="click->row-link#openLink">
6
- <%= local_time_ago(page.updated_at, class: 'with-tip') %>
7
- </td>
8
- </tr>