solidus_admin 0.5.0 → 0.5.1

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: 83c90da5f877aed4a3dec3b086c73aa24f178c5799a9e4143331f5b5026985ac
4
- data.tar.gz: 8089e31144deb35a7ea927a4998a186317b2ee1afd1ef32887787f38eb35ac6a
3
+ metadata.gz: d9976fca44d3e64ccb4f4dc321ca3ed988f654bec55498f0b1a624abcf7c15cb
4
+ data.tar.gz: 15267cab9e5166d3d8311c741c07d8f0e36d64e4efcaa8170a0860f3b04eac92
5
5
  SHA512:
6
- metadata.gz: b14a7c685fc39d001318fcd5ae6572ab8d0a2784ff30f2fcd5b4efbbff2e9b318d969e76849e3025acbbc6391296455315b446b31166d142c5e1cdd1a773b204
7
- data.tar.gz: 23643ab532fa536b971e1a39db285fcf6c86bbfe99d720b7b7bf3e5fd77fdfbe051107b554ef0d623ce9877855b58cdf82ad44ad85a90b66e3a8614435e496bd
6
+ metadata.gz: 339413880b765aed28876f823195d02527986164c174513665cdb2297ded7091d3d6a773654756e6733784ea8b18a48d9b423e843eb7d3335ae34f3e5796ab24
7
+ data.tar.gz: 1eeef37a4149c99f55a1c142f8aa210f82475da1af680212a04960ca64ad129ebab13179c79780803fe37c11c3c20957d9f1bab9bec0d45bc9ed21bc076c3497
@@ -1522,6 +1522,10 @@ summary{
1522
1522
  white-space: nowrap;
1523
1523
  }
1524
1524
 
1525
+ .whitespace-pre-line{
1526
+ white-space: pre-line;
1527
+ }
1528
+
1525
1529
  .text-wrap{
1526
1530
  text-wrap: wrap;
1527
1531
  }
@@ -18,7 +18,7 @@
18
18
  </div>
19
19
  <div class="flex flex-col px-2 pt-1 gap-3">
20
20
  <p class="font-semibold text-base text-black leading-none"><%= @title %></p>
21
- <p class="font-normal text-sm text-black leading-none"><%= @message.html_safe %></p>
21
+ <p class="font-normal text-sm text-black leading-none whitespace-pre-line"><%= @message %></p>
22
22
  </div>
23
23
  </div>
24
24
  <div>
@@ -10,6 +10,8 @@ module SolidusAdmin
10
10
  search_scope(:low_stock) { _1.where("count_on_hand > 0 AND count_on_hand < ?", SolidusAdmin::Config.low_stock_value) }
11
11
  search_scope(:in_stock) { _1.where("count_on_hand > 0") }
12
12
 
13
+ before_action :authorize_stock_item, only: %i[edit update]
14
+
13
15
  def index
14
16
  respond_to do |format|
15
17
  format.html { render component("stock_items/index").new(page: @page) }
@@ -34,12 +36,16 @@ module SolidusAdmin
34
36
  def resource_class = Spree::StockItem
35
37
 
36
38
  def resources_collection
37
- Spree::StockItem.reorder(nil).includes(
39
+ Spree::StockItem.accessible_by(current_ability, action_name.to_sym).reorder(nil).includes(
38
40
  :stock_location,
39
41
  variant: [:product, :images, {option_values: :option_type}]
40
42
  )
41
43
  end
42
44
 
45
+ def authorize_stock_item
46
+ authorize! action_name.to_sym, @stock_item
47
+ end
48
+
43
49
  def resources_sorting_options
44
50
  {
45
51
  variant_id: :desc,
@@ -28,7 +28,7 @@ module SolidusAdmin
28
28
  t ".error.description",
29
29
  name: record.name,
30
30
  reason: record.errors.full_messages.join(", ")
31
- }.join("<br/>")
31
+ }.join("\n")
32
32
 
33
33
  flash[:alert] = {
34
34
  danger: {title: t(".error.title"), message: failure_summary}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SolidusAdmin
4
- VERSION = "0.5.0"
4
+ VERSION = "0.5.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solidus Team
@@ -682,7 +682,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
682
682
  - !ruby/object:Gem::Version
683
683
  version: 1.8.23
684
684
  requirements: []
685
- rubygems_version: 4.0.20
685
+ rubygems_version: 4.0.10
686
686
  specification_version: 4
687
687
  summary: Admin interface for the Solidus e-commerce framework.
688
688
  test_files: []