decidim-plans 0.15.1 → 0.16.0

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: 0bb5cf37b415f9c5db47541f2f0b578cbfa39c5d1faca7f9a5662ed42fb87644
4
- data.tar.gz: 252ae73f002014e3c22fe3658475dee84ccd8cc5468378a93fd2b7bc34f7887a
3
+ metadata.gz: 8f496c0cd1c6ee3f73085fc296508701d44434eb5a1c9dc3375c33ac99ea3a45
4
+ data.tar.gz: 2893280cdc00ae08eb9096e94da371496e43a2d993ea49ef6345def50a767176
5
5
  SHA512:
6
- metadata.gz: a650628a11c3dffd10f1036cd522bc45aa966fd3dc03488eb98ca6dc0da87f4ebb1808d8cd204e954bf4cd00bb11dd27f194894022119397577c853c9fcaaf8d
7
- data.tar.gz: f90fa030b8070a3f5107cfffe4cfb95afa8739a07591284b4627b1a81a651373ef60946491228122e0e857ad037ddd7c58170a084ec82391d70d657d92193c49
6
+ metadata.gz: 2751ff4b10252cf2b3bbf59deccb36692b7866dcd9ec90d649b3ca0cb640812601c2fa4ab938228a5425b8a4c96adfd9cd6ca71b147bcaa9834a2df4a815ccd3
7
+ data.tar.gz: f2db56458ab76aade2d06b91e67061b6bdd857e33a848ae720579fe851e18b3007e4f89847cb51aa71daf8c50947ba0d926b33aac09b4315f7d35788869a4ebf
@@ -29,8 +29,8 @@ module Decidim
29
29
  broadcast(:ok, @requester_user)
30
30
  end
31
31
 
32
- def recipient_ids
33
- @plan.authors.pluck(:id) - [@requester_user.id]
32
+ def recipients
33
+ @plan.authors - [@requester_user]
34
34
  end
35
35
 
36
36
  def authors_event
@@ -73,7 +73,8 @@ module Decidim
73
73
  event: event,
74
74
  event_class: event_class,
75
75
  resource: plan,
76
- recipient_ids: plan.followers.pluck(:id)
76
+ affected_users: plan.notifiable_identities,
77
+ followers: plan.followers - plan.notifiable_identities
77
78
  )
78
79
  end
79
80
  end
@@ -90,7 +90,7 @@ module Decidim
90
90
  event: "decidim.events.plans.plan_published",
91
91
  event_class: Decidim::Plans::PublishPlanEvent,
92
92
  resource: plan,
93
- recipient_ids: @plan.participatory_space.followers.pluck(:id),
93
+ followers: plan.participatory_space.followers,
94
94
  extra: {
95
95
  participatory_space: true
96
96
  }
@@ -51,7 +51,7 @@ module Decidim
51
51
  event: "decidim.events.plans.plan_published",
52
52
  event_class: Decidim::Plans::PublishPlanEvent,
53
53
  resource: @plan,
54
- recipient_ids: coauthors_followers
54
+ followers: coauthors_followers
55
55
  )
56
56
  end
57
57
 
@@ -60,7 +60,7 @@ module Decidim
60
60
  event: "decidim.events.plans.plan_published",
61
61
  event_class: Decidim::Plans::PublishPlanEvent,
62
62
  resource: @plan,
63
- recipient_ids: @plan.participatory_space.followers.pluck(:id) - coauthors_followers,
63
+ followers: @plan.participatory_space.followers - coauthors_followers,
64
64
  extra: {
65
65
  participatory_space: true
66
66
  }
@@ -68,11 +68,7 @@ module Decidim
68
68
  end
69
69
 
70
70
  def coauthors_followers
71
- followers_ids = []
72
- @plan.authors.each do |author|
73
- followers_ids += author.followers.pluck(:id)
74
- end
75
- followers_ids
71
+ @coauthors_followers ||= @plan.authors.flat_map(&:followers)
76
72
  end
77
73
  end
78
74
  end
@@ -22,8 +22,8 @@ module Decidim
22
22
  broadcast(:ok, @requester_user)
23
23
  end
24
24
 
25
- def recipient_ids
26
- @plan.authors.pluck(:id)
25
+ def recipients
26
+ @plan.authors
27
27
  end
28
28
 
29
29
  def authors_event
@@ -34,12 +34,11 @@ module Decidim
34
34
  private
35
35
 
36
36
  def notify_plan_authors
37
- recipient_ids = @plan.authors.pluck(:id)
38
37
  Decidim::EventsManager.publish(
39
38
  event: "decidim.events.plans.plan_access_requested",
40
39
  event_class: Decidim::Plans::PlanAccessRequestedEvent,
41
40
  resource: @plan,
42
- recipient_ids: recipient_ids.uniq,
41
+ followers: @plan.authors,
43
42
  extra: {
44
43
  requester_id: @current_user.id
45
44
  }
@@ -46,7 +46,7 @@ module Decidim
46
46
  event: authors_event,
47
47
  event_class: authors_event_class,
48
48
  resource: @plan,
49
- recipient_ids: recipient_ids.uniq,
49
+ followers: recipients.uniq,
50
50
  extra: {
51
51
  requester_id: @requester_user.id
52
52
  }
@@ -58,11 +58,11 @@ module Decidim
58
58
  event: requester_event,
59
59
  event_class: requester_event_class,
60
60
  resource: @plan,
61
- recipient_ids: [@requester_user.id]
61
+ affected_users: [@requester_user]
62
62
  )
63
63
  end
64
64
 
65
- def recipient_ids; end
65
+ def recipients; end
66
66
 
67
67
  def authors_event; end
68
68
 
@@ -42,6 +42,8 @@ module Decidim
42
42
  Decidim::Plans::DiffRenderer::Content
43
43
  when "Decidim::Categorization"
44
44
  Decidim::Plans::DiffRenderer::Categorization
45
+ when "Decidim::Component"
46
+ Decidim::Plans::DiffRenderer::Component
45
47
  end
46
48
 
47
49
  renderer_klass.new(version, locale)
@@ -33,6 +33,10 @@ module Decidim
33
33
  def can_be_contacted?
34
34
  false
35
35
  end
36
+
37
+ def has_tooltip?
38
+ false
39
+ end
36
40
  end
37
41
  end
38
42
  end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Decidim
4
+ module Plans
5
+ module DiffRenderer
6
+ class Component < Base
7
+ protected
8
+
9
+ def i18n_scope
10
+ "activemodel.attributes.plan"
11
+ end
12
+
13
+ # Lists which attributes will be diffable and how
14
+ # they should be rendered.
15
+ def attribute_types
16
+ {
17
+ decidim_component_id: :component
18
+ }
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Decidim
4
4
  module Plans
5
- VERSION = "0.15.1"
6
- DECIDIM_VERSION = "~> 0.15.0"
5
+ VERSION = "0.16.0"
6
+ DECIDIM_VERSION = "~> 0.16.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-plans
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.1
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antti Hukkanen
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.15.0
19
+ version: 0.16.0
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: 0.15.0
26
+ version: 0.16.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: decidim-proposals
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.15.0
33
+ version: 0.16.0
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: 0.15.0
40
+ version: 0.16.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: decidim-admin
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.15.0
47
+ version: 0.16.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.15.0
54
+ version: 0.16.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: decidim-assemblies
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.15.0
61
+ version: 0.16.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.15.0
68
+ version: 0.16.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: decidim-budgets
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.15.0
75
+ version: 0.16.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.15.0
82
+ version: 0.16.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: decidim-dev
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.15.0
89
+ version: 0.16.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.15.0
96
+ version: 0.16.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: decidim-participatory_processes
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.15.0
103
+ version: 0.16.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.15.0
110
+ version: 0.16.0
111
111
  description: Plans component allows people to author plans based on the proposals
112
112
  that can be converted into budgeting projects.
113
113
  email:
@@ -220,6 +220,7 @@ files:
220
220
  - app/queries/decidim/plans/filtered_plans.rb
221
221
  - app/services/decidim/plans/diff_renderer/base.rb
222
222
  - app/services/decidim/plans/diff_renderer/categorization.rb
223
+ - app/services/decidim/plans/diff_renderer/component.rb
223
224
  - app/services/decidim/plans/diff_renderer/content.rb
224
225
  - app/services/decidim/plans/diff_renderer/plan.rb
225
226
  - app/services/decidim/plans/loggability.rb