eco-helpers 1.3.17 → 1.4.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: e957c3c78a92c3cb18bed8c512ed087dd21551799a3dfa54e9cd3821045826ee
4
- data.tar.gz: 853c05d5dd2191611b74b7e0b64037d2ad223721a8bff9e615560d13a057c2cc
3
+ metadata.gz: 2248f088b428a4d94bc0a28fe735e680b179a64f138113206057c853e358e0f0
4
+ data.tar.gz: 1284ede3bcbfc33df6281ab456247850d918cc98eb8318c7327c8047be8dcab0
5
5
  SHA512:
6
- metadata.gz: c5f83c3d8bef201c208c18116544d125633e3633abc33c519d841b766bb49777c562676591b3fe5e5037d805f43ece0233ab0af0ae8236a64a0823a55e88c9fd
7
- data.tar.gz: 0cc7d6d8d7e3fb6e58a04e55e0f6dcfe84916c41b2d067828698e92255eb7004503be731ff46ba8d6d30ba6e9dcd1d9b6faf3df2ac6c80cf5ccf6fb48abb23f6
6
+ metadata.gz: fcc3c790f2c4a6c044f11da966ac97149eb652e503c91bce108d58fa12348c1be0be1a056518798c4121110bf9146ce2271bcafa87bc938a8d35058449949838
7
+ data.tar.gz: 3f6a6888a1907419fceaa3ad25f0c997e133715a467cd3c3704ef1f43ec24f09528460069b3e7ceefb9bf612ca2e6d034d6d3beef5fac0487b88e0ecf5952b66
@@ -1,7 +1,46 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [1.3.17] - 2020-07-xx
4
+ ## [1.4.3] - 2020-07-xx
5
+
6
+ ### Added
7
+ ### Changed
8
+ ### Fixed
9
+
10
+
11
+ ## [1.4.2] - 2020-07-23
12
+
13
+ ### Added
14
+ ### Changed
15
+ ### Fixed
16
+ - preserve backtrace on logging
17
+
18
+ ## [1.4.0] - 2020-07-14
19
+
20
+ ### Added
21
+ ### Changed
22
+ - change abilities to align with ecoPortal release `1.5.0`
23
+ - remove some patches on `ecoportal-api`
24
+ - removed patch method `Ecoportal::API::V1::Person#sync`
25
+ ### Fixed
26
+ - `Eco::CSV#parse` and `Eco::CSV#read` should use the proper `:encoding` when it's `bom`
27
+
28
+ ## [1.3.19] - 2020-07-23
29
+
30
+ ### Added
31
+ ### Changed
32
+ ### Fixed
33
+ - preserve backtrace on logging
34
+
35
+ ## [1.3.18] - 2020-07-08
36
+
37
+ ### Added
38
+ ### Changed
39
+ ### Fixed
40
+ - the `update` case was missing the code to use the `default_usergroup`
41
+
42
+
43
+ ## [1.3.17] - 2020-07-06
5
44
 
6
45
  ### Added
7
46
  ### Changed
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency "yard", "~> 0.9", ">= 0.9.18"
29
29
  s.add_development_dependency "redcarpet", "~> 3.5", ">= 3.5.0"
30
30
 
31
- s.add_dependency 'ecoportal-api', '~> 0.5', '>= 0.5.8'
31
+ s.add_dependency 'ecoportal-api', '~> 0.5', '>= 0.5.9'
32
32
  s.add_dependency 'aws-sdk-s3', '~> 1', '>= 1.64.0'
33
33
  s.add_dependency 'aws-sdk-ses', '~> 1', '>= 1.29.0'
34
34
  s.add_dependency 'dotenv', '~> 2.7', '>= 2.7.0'
@@ -1,4 +1,2 @@
1
- require_relative 'ecoportal_api/base_model'
2
1
  require_relative 'ecoportal_api/external_person'
3
2
  require_relative 'ecoportal_api/internal_person'
4
- require_relative 'ecoportal_api/account_preferences'
@@ -3,10 +3,6 @@ module Ecoportal
3
3
  class V1
4
4
  class Person
5
5
 
6
- def sync
7
- consolidate!
8
- end
9
-
10
6
  def reset_details!
11
7
  doc["details"] = JSON.parse(original_doc["details"])
12
8
  end
@@ -1,8 +1,8 @@
1
1
  class ::Exception
2
2
  def patch_full_message
3
3
  msg = []
4
- msg << "#{backtrace.shift} #{message} (#{self.class.to_s})"
5
- backtrace.each {|bt| msg << "#{" "*8}from #{bt}"}
4
+ msg << "\n#{backtrace.first} \n#{message} (#{self.class.to_s})"
5
+ backtrace[1..-1].each_with_index {|bt, i| msg << "#{" "*8}#{i+1}: from #{bt}"}
6
6
  msg.join("\n")
7
7
  end
8
8
  end
@@ -5,6 +5,9 @@
5
5
  "reports": "view",
6
6
  "organization": null,
7
7
  "people": null,
8
+ "person_core": null,
9
+ "person_account": null,
10
+ "person_details": null,
8
11
  "pages": "view",
9
12
  "page_editor": null,
10
13
  "registers": "view"
@@ -14,7 +17,9 @@
14
17
  "data": "view",
15
18
  "reports": "view",
16
19
  "organization": null,
17
- "people": "attach",
20
+ "person_core": "attach",
21
+ "person_account": null,
22
+ "person_details": "view",
18
23
  "pages": "create",
19
24
  "page_editor": "basic",
20
25
  "registers": "view"
@@ -24,7 +29,9 @@
24
29
  "data": "update",
25
30
  "reports": "edit",
26
31
  "organization": "view",
27
- "people": "view",
32
+ "person_core": "view_people_manager",
33
+ "person_account": "view",
34
+ "person_details": "view",
28
35
  "pages": "create",
29
36
  "page_editor": "intermediate",
30
37
  "registers": "view"
@@ -34,7 +41,9 @@
34
41
  "data": "administrate",
35
42
  "reports": "administrate",
36
43
  "organization": "administrate",
37
- "people": "edit",
44
+ "person_core": "edit",
45
+ "person_account": "edit",
46
+ "person_details": "edit_private",
38
47
  "pages": "administrate",
39
48
  "page_editor": "advanced",
40
49
  "registers": "dashboard"
@@ -3,7 +3,9 @@
3
3
  "data": [null, "view", "update", "administrate", "implement"],
4
4
  "reports": [null, "view", "edit", "administrate"],
5
5
  "organization": [null, "view", "administrate", "implement"],
6
- "people": [null, "attach", "view", "view_private", "edit", "dashboard"],
6
+ "person_core": [null, "attach", "view_people_manager", "create", "edit", "dashboard"],
7
+ "person_account": [null, "view", "create", "edit"],
8
+ "person_details": [null, "view", "edit_public", "view_private", "edit_private"],
7
9
  "pages": [null, "view", "update", "create", "administrate"],
8
10
  "page_editor": [null, "basic", "intermediate", "advanced", "implement"],
9
11
  "registers": [null, "view", "dashboard", "administrate", "implement"]
@@ -12,6 +12,10 @@ module Eco
12
12
  strict_search = session.config.people.strict_search? && (!options[:search]&.key?(:strict) || options.dig(:search, :strict))
13
13
  pgs = session.policy_groups
14
14
 
15
+ if session.config.people.default_usergroup?
16
+ def_id = pgs.to_id(session.config.people.default_usergroup)
17
+ end
18
+
15
19
  entries.each.with_index do |entry, i|
16
20
  if person = people.find(entry, strict: strict_search)
17
21
 
@@ -37,6 +41,7 @@ module Eco
37
41
  entry.set_details(person) unless options.dig(:exclude, :details)
38
42
 
39
43
  unless options.dig(:exclude, :account)
44
+ add_account = !person.account
40
45
  ini_pg_ids = person.account&.policy_group_ids || []
41
46
 
42
47
  account_excluded = []
@@ -71,7 +71,7 @@ module Eco
71
71
  end
72
72
 
73
73
  def encoding(path)
74
- has_bom?(path) ? "bom|utf-8" : "utf-8"
74
+ has_bom?(path) ? "bom" : "utf-8"
75
75
  end
76
76
 
77
77
  def script_subfolder
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "1.3.17"
2
+ VERSION = "1.4.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.17
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura
@@ -113,7 +113,7 @@ dependencies:
113
113
  version: '0.5'
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: 0.5.8
116
+ version: 0.5.9
117
117
  type: :runtime
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ dependencies:
123
123
  version: '0.5'
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- version: 0.5.8
126
+ version: 0.5.9
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: aws-sdk-s3
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -253,8 +253,6 @@ files:
253
253
  - lib/eco/api/common/session/sftp.rb
254
254
  - lib/eco/api/common/version_patches.rb
255
255
  - lib/eco/api/common/version_patches/ecoportal_api.rb
256
- - lib/eco/api/common/version_patches/ecoportal_api/account_preferences.rb
257
- - lib/eco/api/common/version_patches/ecoportal_api/base_model.rb
258
256
  - lib/eco/api/common/version_patches/ecoportal_api/external_person.rb
259
257
  - lib/eco/api/common/version_patches/ecoportal_api/internal_person.rb
260
258
  - lib/eco/api/common/version_patches/exception.rb
@@ -1,32 +0,0 @@
1
- module Ecoportal
2
- module API
3
- class Internal
4
- class Preferences < Common::BaseModel
5
- passthrough :kiosk_enabled, :kiosk_workflow_message, :kiosk_create_button_label,
6
- :kiosk_create_button_help, :kiosk_return_button_label, :kiosk_return_button_help,
7
- :kiosk_dashboard_button_label, :kiosk_dashboard_button_help
8
-
9
- [
10
- :show_sidebar,
11
- :show_shortcuts,
12
- :show_coming_soon,
13
- :show_recently_visited_forms,
14
- :show_tasks,
15
- :show_task_bubbles
16
- ].map(&:to_s).each do |field|
17
- define_method(field) do
18
- if doc.key?(field)
19
- doc[field]
20
- else
21
- true
22
- end
23
- end
24
- define_method("#{field}=") do |value|
25
- doc[field] = !!value
26
- end
27
- end
28
-
29
- end
30
- end
31
- end
32
- end
@@ -1,27 +0,0 @@
1
- module Ecoportal
2
- module API
3
- module Common
4
- class BaseModel
5
-
6
- attr_reader :initial_doc
7
-
8
- def initialize(doc = {}, parent: self, key: nil)
9
- @_parent = parent
10
- @_key = key
11
- if !_parent || !_key
12
- @doc = doc
13
- @original_doc = JSON.parse(@doc.to_json)
14
- @initial_doc = JSON.parse(@doc.to_json)
15
- end
16
- end
17
-
18
- def initial_doc
19
- raise UnlinkedModel.new unless linked?
20
- return @initial_doc if is_root?
21
- _parent.initial_doc.dig(*[_key].flatten)
22
- end
23
-
24
- end
25
- end
26
- end
27
- end