workarea-product_additional_details 2.0.31 → 2.0.36

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26c723178569ce439b259295548cbe20bf4c0c13dea20b058b2132f825d5de92
4
- data.tar.gz: 8ae789c298f92276ae408920e6e5f9ecfedb4778fed861e5a4ff492bc74ab76a
3
+ metadata.gz: 017aa5c9dba4922f3c8b5637cd58308d89e228e16e12a2e25ad1db89a3b6ad11
4
+ data.tar.gz: 541f83fa5e6db2a657779d0c89ff0746ccd2461d1352700cd708cfa980488b98
5
5
  SHA512:
6
- metadata.gz: ef24d87da54b3a63764c4c6703479338c154c08fba6051a382a16389814d89f20eb677dcf81d5b654a1c515c7ecbc7c2c7f37e8e32a54784044e6020437bd561
7
- data.tar.gz: 1e6bbc22dd47e583b5afaf5eabf7a18fe1cac40386e811302c1ba4604a8e8d8cf127cffa5ef117e4c1b6f3c0bbab9ca38f6980633ad8dfd11b3a8f90b193032e
6
+ metadata.gz: 0b4e0c50914027bdc69d0d07331879fb5614a0f05210823819c7458562dcb2281ed6c5e5ab185db6a6be0e7e81c406a2937cbf337f080e4fe9673d3949659f86
7
+ data.tar.gz: 28a0810d9d47546e153a5861fb13ef023bd34032e67d9e518aee3a2aee2038812c0552eed350f05d19a58551a1e7d8fde152c6810edc4a0fd219f5e51f1fa7d2
@@ -17,7 +17,7 @@ module Workarea
17
17
 
18
18
  def set_additional_details
19
19
  @variant.additional_details = HashUpdate.new(
20
- original: @product.additional_details,
20
+ original: @variant.additional_details,
21
21
  adds: params[:new_additional_details],
22
22
  updates: params[:additional_details],
23
23
  removes: params[:additional_details_to_remove]
@@ -0,0 +1,10 @@
1
+ module Workarea
2
+ module Admin
3
+ module DetailsParseHelper
4
+ def parse_details_text(text)
5
+ return text.join(' ') if text.kind_of?(Array)
6
+ JSON.parse(text).join(' ') rescue text
7
+ end
8
+ end
9
+ end
10
+ end
@@ -17,7 +17,7 @@
17
17
  %td
18
18
  .property
19
19
  = hidden_field_tag 'additional_details[]', name, id: nil
20
- = text_area_tag 'additional_details[]', value, class: 'text-box text-box--i18n', id: nil
20
+ = text_area_tag 'additional_details[]', parse_details_text(value), class: 'text-box text-box--i18n', id: nil
21
21
  %td.align-center= check_box_tag 'additional_details_to_remove[]', name, false, id: nil, title: "#{t('workarea.admin.actions.delete')}: #{name} #{value}"
22
22
  %tr{ data: { cloneable_row: '' } }
23
23
  %td
@@ -1,3 +1,4 @@
1
1
  Workarea.configure do |config|
2
2
  # Add custom configuration here
3
+ Workarea::Admin::ApplicationController.helper(Workarea::Admin::DetailsParseHelper)
3
4
  end
@@ -1,5 +1,5 @@
1
1
  module Workarea
2
2
  module ProductAdditionalDetails
3
- VERSION = "2.0.31".freeze
3
+ VERSION = "2.0.36"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-product_additional_details
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.31
4
+ version: 2.0.36
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gunasekaran Raja
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-25 00:00:00.000000000 Z
11
+ date: 2020-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: workarea
@@ -49,6 +49,7 @@ files:
49
49
  - app/controllers/workarea/admin/catalog_variants_controller.decorator
50
50
  - app/controllers/workarea/admin/create_catalog_products_controller.decorator
51
51
  - app/helpers/.keep
52
+ - app/helpers/workarea/admin/details_parse_helper.rb
52
53
  - app/mailers/.keep
53
54
  - app/models/.keep
54
55
  - app/models/workarea/catalog/product.decorator