decidim-proposals 0.24.3 → 0.25.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/cells/decidim/proposals/cost_report_cell.rb +1 -1
  3. data/app/cells/decidim/proposals/proposal_m_cell.rb +4 -0
  4. data/app/cells/decidim/proposals/proposals_picker/show.erb +1 -1
  5. data/app/commands/decidim/proposals/admin/import_proposals.rb +21 -4
  6. data/app/controllers/decidim/proposals/admin/proposals_controller.rb +1 -1
  7. data/app/controllers/decidim/proposals/collaborative_drafts_controller.rb +1 -0
  8. data/app/controllers/decidim/proposals/proposals_controller.rb +1 -0
  9. data/app/forms/decidim/proposals/admin/import_participatory_text_form.rb +1 -0
  10. data/app/forms/decidim/proposals/admin/proposals_import_form.rb +6 -0
  11. data/app/forms/decidim/proposals/proposal_form.rb +7 -4
  12. data/app/helpers/decidim/proposals/map_helper.rb +5 -5
  13. data/app/helpers/decidim/proposals/participatory_texts_helper.rb +1 -1
  14. data/app/helpers/decidim/proposals/proposal_wizard_helper.rb +0 -16
  15. data/app/models/decidim/proposals/proposal.rb +11 -1
  16. data/app/{assets → packs}/documents/decidim/proposals/participatory_texts/participatory_text.md +0 -0
  17. data/app/{assets → packs}/documents/decidim/proposals/participatory_texts/participatory_text.odt +0 -0
  18. data/app/packs/entrypoints/decidim_proposals.js +8 -0
  19. data/app/packs/entrypoints/decidim_proposals_admin.js +3 -0
  20. data/app/{assets/images/decidim/gamification/badges/accepted_proposals.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_accepted_proposals.svg} +0 -0
  21. data/app/{assets/images/decidim/gamification/badges/proposal_votes.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_proposal_votes.svg} +0 -0
  22. data/app/{assets/images/decidim/gamification/badges/proposals.svg → packs/images/decidim/gamification/badges/decidim_gamification_badges_proposals.svg} +0 -0
  23. data/app/{assets/images/decidim/proposals/icon.svg → packs/images/decidim/proposals/decidim_proposals.svg} +0 -0
  24. data/app/packs/src/decidim/proposals/add_proposal.js +49 -0
  25. data/app/packs/src/decidim/proposals/admin/proposals.js +143 -0
  26. data/app/{assets/javascripts/decidim/proposals/admin/proposals_form.js.es6 → packs/src/decidim/proposals/admin/proposals_form.js} +2 -2
  27. data/app/{assets/javascripts/decidim/proposals/admin/proposals_picker.js.es6 → packs/src/decidim/proposals/admin/proposals_picker.js} +0 -0
  28. data/app/{assets/javascripts/decidim/proposals/utils.js.es6 → packs/src/decidim/proposals/utils.js} +2 -2
  29. data/app/packs/stylesheets/decidim/proposals/_proposals.scss +1 -0
  30. data/app/{assets/stylesheets/decidim/proposals/proposals/_preview.css.scss → packs/stylesheets/decidim/proposals/proposals/_preview.scss} +0 -0
  31. data/app/queries/decidim/proposals/metrics/accepted_proposals_metric_manage.rb +1 -1
  32. data/app/queries/decidim/proposals/metrics/proposals_metric_manage.rb +1 -1
  33. data/app/queries/decidim/proposals/metrics/votes_metric_manage.rb +1 -1
  34. data/app/queries/decidim/proposals/similar_proposals.rb +1 -0
  35. data/app/services/decidim/proposals/proposal_builder.rb +4 -4
  36. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +1 -1
  37. data/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -1
  38. data/app/views/decidim/proposals/admin/proposals_imports/new.html.erb +6 -0
  39. data/app/views/decidim/proposals/collaborative_drafts/_filters.html.erb +1 -1
  40. data/app/views/decidim/proposals/collaborative_drafts/edit.html.erb +1 -1
  41. data/app/views/decidim/proposals/collaborative_drafts/index.html.erb +0 -2
  42. data/app/views/decidim/proposals/collaborative_drafts/new.html.erb +1 -1
  43. data/app/views/decidim/proposals/proposals/_dynamic_map_instructions.html.erb +2 -1
  44. data/app/views/decidim/proposals/proposals/_edit_form_fields.html.erb +5 -1
  45. data/app/views/decidim/proposals/proposals/_filters.html.erb +1 -1
  46. data/app/views/decidim/proposals/proposals/complete.html.erb +1 -1
  47. data/app/views/decidim/proposals/proposals/edit.html.erb +1 -1
  48. data/app/views/decidim/proposals/proposals/edit_draft.html.erb +1 -1
  49. data/app/views/decidim/proposals/proposals/index.html.erb +4 -6
  50. data/app/views/decidim/proposals/proposals/new.html.erb +1 -1
  51. data/app/views/decidim/proposals/proposals/preview.html.erb +7 -31
  52. data/config/assets.rb +10 -0
  53. data/config/locales/ar.yml +3 -1
  54. data/config/locales/bg.yml +3 -1
  55. data/config/locales/ca.yml +10 -4
  56. data/config/locales/cs.yml +12 -3
  57. data/config/locales/de.yml +10 -4
  58. data/config/locales/el.yml +3 -1
  59. data/config/locales/en.yml +12 -3
  60. data/config/locales/es-MX.yml +10 -4
  61. data/config/locales/es-PY.yml +10 -4
  62. data/config/locales/es.yml +10 -4
  63. data/config/locales/eu.yml +3 -1
  64. data/config/locales/fi-plain.yml +12 -3
  65. data/config/locales/fi.yml +12 -3
  66. data/config/locales/fr-CA.yml +8 -3
  67. data/config/locales/fr-LU.yml +903 -0
  68. data/config/locales/fr.yml +8 -3
  69. data/config/locales/gl.yml +11 -3
  70. data/config/locales/hu.yml +3 -1
  71. data/config/locales/id-ID.yml +3 -1
  72. data/config/locales/it.yml +55 -1
  73. data/config/locales/ja.yml +38 -1
  74. data/config/locales/lb-LU.yml +1 -0
  75. data/config/locales/lv.yml +3 -1
  76. data/config/locales/nl.yml +13 -2
  77. data/config/locales/no.yml +3 -1
  78. data/config/locales/pl.yml +14 -10
  79. data/config/locales/pt-BR.yml +199 -1
  80. data/config/locales/pt.yml +3 -1
  81. data/config/locales/ro-RO.yml +6 -1
  82. data/config/locales/ru.yml +3 -1
  83. data/config/locales/sk.yml +3 -1
  84. data/config/locales/sv.yml +13 -4
  85. data/config/locales/tr-TR.yml +3 -4
  86. data/config/locales/uk.yml +3 -1
  87. data/config/locales/zh-CN.yml +3 -1
  88. data/db/migrate/20201002085508_fix_proposals_data.rb +7 -8
  89. data/db/migrate/20210318082934_fix_counters_for_copied_proposals.rb +6 -5
  90. data/lib/decidim/proposals.rb +0 -1
  91. data/lib/decidim/proposals/admin_engine.rb +0 -4
  92. data/lib/decidim/proposals/commentable_proposal.rb +5 -13
  93. data/lib/decidim/proposals/component.rb +4 -4
  94. data/lib/decidim/proposals/engine.rb +14 -19
  95. data/lib/decidim/proposals/proposal_serializer.rb +1 -0
  96. data/lib/decidim/proposals/test/capybara_proposals_picker.rb +10 -0
  97. data/lib/decidim/proposals/test/factories.rb +3 -0
  98. data/lib/decidim/proposals/version.rb +1 -1
  99. metadata +39 -113
  100. data/app/assets/config/admin/decidim_proposals_manifest.js +0 -2
  101. data/app/assets/config/decidim_proposals_manifest.js +0 -4
  102. data/app/assets/javascripts/decidim/proposals/add_proposal.js.es6 +0 -31
  103. data/app/assets/javascripts/decidim/proposals/admin/proposals.es6 +0 -130
  104. data/app/assets/stylesheets/decidim/proposals/_proposals.css.scss +0 -1
  105. data/config/locales/ja-JP.yml +0 -865
@@ -44,7 +44,9 @@ pt:
44
44
  invalid_document_type: 'Tipo de documento inválido. Os formatos aceites são: %{valid_mime_types}'
45
45
  proposal:
46
46
  attributes:
47
- attachment:
47
+ add_documents:
48
+ needs_to_be_reattached: Necessita de ser recolocado
49
+ add_photos:
48
50
  needs_to_be_reattached: Necessita de ser recolocado
49
51
  body:
50
52
  cant_be_equal_to_template: não pode ser igual ao modelo
@@ -35,6 +35,7 @@ ro:
35
35
  origin_component_id: Componentă pentru a copia propunerile de la
36
36
  proposals_import:
37
37
  import_proposals: Importă propuneri
38
+ keep_answers: Păstrați starea și răspunsurile
38
39
  keep_authors: Păstrează autorii originali
39
40
  valuation_assignment:
40
41
  admin_log:
@@ -47,7 +48,9 @@ ro:
47
48
  invalid_document_type: 'Tip de document invalid. Formatele acceptate sunt: %{valid_mime_types}'
48
49
  proposal:
49
50
  attributes:
50
- attachment:
51
+ add_documents:
52
+ needs_to_be_reattached: Trebuie să fie reatașate
53
+ add_photos:
51
54
  needs_to_be_reattached: Trebuie să fie reatașate
52
55
  body:
53
56
  cant_be_equal_to_template: nu poate fi egal cu șablonul
@@ -117,9 +120,11 @@ ro:
117
120
  proposals:
118
121
  actions:
119
122
  amend: Modifică
123
+ comment: Comentariu
120
124
  create: Crează
121
125
  endorse: Aprobare
122
126
  vote: Suport
127
+ vote_comment: Votează comentariul
123
128
  withdraw: Retragere
124
129
  name: Propuneri
125
130
  settings:
@@ -19,7 +19,9 @@ ru:
19
19
  models:
20
20
  proposal:
21
21
  attributes:
22
- attachment:
22
+ add_documents:
23
+ needs_to_be_reattached: Необходимо заново прикрепить
24
+ add_photos:
23
25
  needs_to_be_reattached: Необходимо заново прикрепить
24
26
  models:
25
27
  decidim/proposals/accepted_proposal_event: Предложение принято
@@ -45,7 +45,9 @@ sk:
45
45
  invalid_document_type: 'Neplatný typ dokumentu. Prijateľné formáty sú: %{valid_mime_types} '
46
46
  proposal:
47
47
  attributes:
48
- attachment:
48
+ add_documents:
49
+ needs_to_be_reattached: Je potrebné priložiť znovu
50
+ add_photos:
49
51
  needs_to_be_reattached: Je potrebné priložiť znovu
50
52
  body:
51
53
  cant_be_equal_to_template: nemôže byť rovnaké, ako šablóna
@@ -10,7 +10,7 @@ sv:
10
10
  scope_id: Omfattning
11
11
  state: Status
12
12
  title: Titel
13
- user_group_id: Skapa gemensamt utkast som
13
+ user_group_id: Skapa samarbetsutkast som
14
14
  proposal:
15
15
  address: Adress
16
16
  answer: Svar
@@ -35,6 +35,7 @@ sv:
35
35
  origin_component_id: Komponent att kopiera förslagen från
36
36
  proposals_import:
37
37
  import_proposals: Importera förslag
38
+ keep_answers: Behåll status och svar
38
39
  keep_authors: Behåll originalförfattare
39
40
  valuation_assignment:
40
41
  admin_log:
@@ -47,7 +48,9 @@ sv:
47
48
  invalid_document_type: 'Ogiltig dokumenttyp. Godkända format är: %{valid_mime_types}'
48
49
  proposal:
49
50
  attributes:
50
- attachment:
51
+ add_documents:
52
+ needs_to_be_reattached: Måste bifogas igen
53
+ add_photos:
51
54
  needs_to_be_reattached: Måste bifogas igen
52
55
  body:
53
56
  cant_be_equal_to_template: kan inte vara detsamma som mallen
@@ -113,9 +116,11 @@ sv:
113
116
  proposals:
114
117
  actions:
115
118
  amend: Ändra
119
+ comment: Kommentera
116
120
  create: Skapa
117
121
  endorse: Instäm
118
122
  vote: Stötta
123
+ vote_comment: Rösta på en kommentar
119
124
  withdraw: Dra tillbaka
120
125
  name: Förslag
121
126
  settings:
@@ -711,7 +716,8 @@ sv:
711
716
  one: "%{count} förslag"
712
717
  other: "%{count} förslag"
713
718
  dynamic_map_instructions:
714
- instructions: <h3>Nu kan du dra markören och flytta den kartan. </h3><p>Glöm inte att klicka på knappen "Uppdatera position" innan du publicerar ditt förslag.</p>
719
+ description: Koordinaterna uppdateras när du klickar på knappen 'Förhandsgranska'. Adressen ändras dock inte.
720
+ instructions: Nu kan du flytta markören på kartan.
715
721
  edit:
716
722
  add_documents: Dokument
717
723
  add_images: Bild
@@ -783,7 +789,6 @@ sv:
783
789
  other: Du kommer att kunna redigera förslaget upp till %{count} minuter efter att förslaget har publicerats. När det tidsfönstret passerat kommer du inte att kunna redigera förslaget.
784
790
  publish: Publicera
785
791
  title: Publicera ditt förslag
786
- update_position: Uppdatera position
787
792
  proposal:
788
793
  creation_date: 'Skapat: %{date}'
789
794
  view_proposal: Visa förslag
@@ -900,3 +905,7 @@ sv:
900
905
  included_proposals:
901
906
  proposal_project: 'Förslag som ingår i dessa projekt:'
902
907
  proposal_result: 'Förslag som ingår i dessa resultat:'
908
+ statistics:
909
+ proposals_accepted: Godkända Förslag
910
+ proposals_count: Förslag
911
+ supports_count: Stöd
@@ -47,7 +47,9 @@ tr:
47
47
  invalid_document_type: 'Geçersiz doküman tipi. Kabul edilen formatlar: %{valid_mime_types}'
48
48
  proposal:
49
49
  attributes:
50
- attachment:
50
+ add_documents:
51
+ needs_to_be_reattached: Yeniden eklenmesi gerekiyor
52
+ add_photos:
51
53
  needs_to_be_reattached: Yeniden eklenmesi gerekiyor
52
54
  body:
53
55
  cant_be_equal_to_template: şablona eşit olamaz
@@ -704,8 +706,6 @@ tr:
704
706
  proposals_count:
705
707
  one: "%{count} teklif"
706
708
  other: "%{count} teklif"
707
- dynamic_map_instructions:
708
- instructions: <h3> Noktayı harita üzerinde hareket ettirebilirsiniz. </h3> <p> Teklifinizi yayınlamadan önce "Pozisyonu Güncelle" düğmesini tıklamayı unutmayın. </p>
709
709
  edit:
710
710
  add_documents: Dokümanlar
711
711
  add_images: Dosya
@@ -775,7 +775,6 @@ tr:
775
775
  other: Bu teklifi, teklif yayınlandıktan sonraki ilk %{count} dakika içinde düzenleyebileceksiniz. Bu zaman aralığı geçtikten sonra teklifi düzenleyemezsiniz.
776
776
  publish: Yayınla
777
777
  title: Teklifinizi yayınlayın
778
- update_position: Konumu güncelle
779
778
  proposal:
780
779
  creation_date: 'Oluşturma: %{date}'
781
780
  view_proposal: Teklifi görüntüle
@@ -19,7 +19,9 @@ uk:
19
19
  models:
20
20
  proposal:
21
21
  attributes:
22
- attachment:
22
+ add_documents:
23
+ needs_to_be_reattached: Необхідно повторно вкласти
24
+ add_photos:
23
25
  needs_to_be_reattached: Необхідно повторно вкласти
24
26
  models:
25
27
  decidim/proposals/accepted_proposal_event: Пропозиція прийнята
@@ -44,7 +44,9 @@ zh-CN:
44
44
  invalid_document_type: '无效的文档类型。接受的格式为: %{valid_mime_types}'
45
45
  proposal:
46
46
  attributes:
47
- attachment:
47
+ add_documents:
48
+ needs_to_be_reattached: 需要重新连接
49
+ add_photos:
48
50
  needs_to_be_reattached: 需要重新连接
49
51
  body:
50
52
  cant_be_equal_to_template: 不能等于模板
@@ -12,14 +12,13 @@ class FixProposalsData < ActiveRecord::Migration[5.2]
12
12
 
13
13
  locale = author.try(:locale).presence || author.try(:default_locale).presence || author.try(:organization).try(:default_locale).presence
14
14
 
15
- proposal.title = {
16
- locale => proposal.title
17
- }
18
- proposal.body = {
19
- locale => proposal.body
20
- }
21
-
22
- proposal.save!
15
+ # rubocop:disable Rails/SkipsModelValidations
16
+ values = {}
17
+ values[:title] = { locale => proposal.title } unless proposal.title.is_a?(Hash)
18
+ values[:body] = { locale => proposal.body } unless proposal.body.is_a?(Hash)
19
+
20
+ proposal.update_columns(values)
21
+ # rubocop:enable Rails/SkipsModelValidations
23
22
  end
24
23
  end
25
24
 
@@ -2,11 +2,12 @@
2
2
 
3
3
  class FixCountersForCopiedProposals < ActiveRecord::Migration[5.2]
4
4
  def up
5
- copies_ids = Decidim::ResourceLink.where(
6
- name: "copied_from_component",
7
- from_type: "Decidim::Proposals::Proposal",
8
- to_type: "Decidim::Proposals::Proposal"
9
- ).pluck(:to_id)
5
+ copies_ids = Decidim::ResourceLink
6
+ .where(
7
+ name: "copied_from_component",
8
+ from_type: "Decidim::Proposals::Proposal",
9
+ to_type: "Decidim::Proposals::Proposal"
10
+ ).pluck(:to_id)
10
11
 
11
12
  Decidim::Proposals::Proposal.where(id: copies_ids).find_each do |record|
12
13
  record.class.reset_counters(record.id, :follows)
@@ -5,7 +5,6 @@ require "decidim/proposals/api"
5
5
  require "decidim/proposals/engine"
6
6
  require "decidim/proposals/admin_engine"
7
7
  require "decidim/proposals/component"
8
- require "acts_as_list"
9
8
 
10
9
  module Decidim
11
10
  # This namespace holds the logic of the `Proposals` component. This component
@@ -38,10 +38,6 @@ module Decidim
38
38
  root to: "proposals#index"
39
39
  end
40
40
 
41
- initializer "decidim_proposals.admin_assets" do |app|
42
- app.config.assets.precompile += %w(admin/decidim_proposals_manifest.js)
43
- end
44
-
45
41
  def load_seed
46
42
  nil
47
43
  end
@@ -5,19 +5,9 @@ module Decidim
5
5
  # The data store for a Proposal in the Decidim::Proposals component.
6
6
  module CommentableProposal
7
7
  extend ActiveSupport::Concern
8
- include Decidim::Comments::Commentable
8
+ include Decidim::Comments::CommentableWithComponent
9
9
 
10
10
  included do
11
- # Public: Overrides the `commentable?` Commentable concern method.
12
- def commentable?
13
- component.settings.comments_enabled?
14
- end
15
-
16
- # Public: Overrides the `accepts_new_comments?` Commentable concern method.
17
- def accepts_new_comments?
18
- commentable? && !component.current_settings.comments_blocked
19
- end
20
-
21
11
  # Public: Overrides the `comments_have_alignment?` Commentable concern method.
22
12
  def comments_have_alignment?
23
13
  true
@@ -35,8 +25,10 @@ module Decidim
35
25
  followers
36
26
  end
37
27
 
38
- def user_allowed_to_comment?(user)
39
- can_participate_in_space?(user)
28
+ def user_allowed_to_vote_comment?(user)
29
+ return unless can_participate_in_space?(user)
30
+
31
+ ActionAuthorizer.new(user, "vote_comment", component, self).authorize.ok?
40
32
  end
41
33
  end
42
34
  end
@@ -6,7 +6,7 @@ Decidim.register_component(:proposals) do |component|
6
6
  component.engine = Decidim::Proposals::Engine
7
7
  component.admin_engine = Decidim::Proposals::AdminEngine
8
8
  component.stylesheet = "decidim/proposals/proposals"
9
- component.icon = "decidim/proposals/icon.svg"
9
+ component.icon = "media/images/decidim_proposals.svg"
10
10
 
11
11
  component.on(:before_destroy) do |instance|
12
12
  raise "Can't destroy this component when there are proposals" if Decidim::Proposals::Proposal.where(component: instance).any?
@@ -16,7 +16,7 @@ Decidim.register_component(:proposals) do |component|
16
16
 
17
17
  component.newsletter_participant_entities = ["Decidim::Proposals::Proposal"]
18
18
 
19
- component.actions = %w(endorse vote create withdraw amend)
19
+ component.actions = %w(endorse vote create withdraw amend comment vote_comment)
20
20
 
21
21
  component.query_type = "Decidim::Proposals::ProposalsType"
22
22
 
@@ -83,7 +83,7 @@ Decidim.register_component(:proposals) do |component|
83
83
  resource.template = "decidim/proposals/proposals/linked_proposals"
84
84
  resource.card = "decidim/proposals/proposal"
85
85
  resource.reported_content_cell = "decidim/proposals/reported_content"
86
- resource.actions = %w(endorse vote amend)
86
+ resource.actions = %w(endorse vote amend comment vote_comment)
87
87
  resource.searchable = true
88
88
  end
89
89
 
@@ -108,7 +108,7 @@ Decidim.register_component(:proposals) do |component|
108
108
 
109
109
  component.register_stat :endorsements_count, priority: Decidim::StatsRegistry::MEDIUM_PRIORITY do |components, start_at, end_at|
110
110
  proposals = Decidim::Proposals::FilteredProposals.for(components, start_at, end_at).not_hidden
111
- Decidim::Endorsement.where(resource_id: proposals.pluck(:id), resource_type: Decidim::Proposals::Proposal.name).count
111
+ proposals.sum(:endorsements_count)
112
112
  end
113
113
 
114
114
  component.register_stat :comments_count, tag: :comments do |components, start_at, end_at|
@@ -1,11 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "kaminari"
4
- require "social-share-button"
5
- require "ransack"
6
- require "cells/rails"
7
- require "cells-erb"
8
- require "cell/partial"
3
+ require "decidim/core"
9
4
 
10
5
  module Decidim
11
6
  module Proposals
@@ -44,10 +39,6 @@ module Decidim
44
39
  root to: "proposals#index"
45
40
  end
46
41
 
47
- initializer "decidim_proposals.assets" do |app|
48
- app.config.assets.precompile += %w(decidim_proposals_manifest.js)
49
- end
50
-
51
42
  initializer "decidim.content_processors" do |_app|
52
43
  Decidim.configure do |config|
53
44
  config.content_processors += [:proposal]
@@ -61,19 +52,23 @@ module Decidim
61
52
  end
62
53
 
63
54
  initializer "decidim_changes" do
64
- Decidim::SettingsChange.subscribe "surveys" do |changes|
65
- Decidim::Proposals::SettingsChangeJob.perform_later(
66
- changes[:component_id],
67
- changes[:previous_settings],
68
- changes[:current_settings]
69
- )
55
+ config.to_prepare do
56
+ Decidim::SettingsChange.subscribe "surveys" do |changes|
57
+ Decidim::Proposals::SettingsChangeJob.perform_later(
58
+ changes[:component_id],
59
+ changes[:previous_settings],
60
+ changes[:current_settings]
61
+ )
62
+ end
70
63
  end
71
64
  end
72
65
 
73
66
  initializer "decidim_proposals.mentions_listener" do
74
- Decidim::Comments::CommentCreation.subscribe do |data|
75
- proposals = data.dig(:metadatas, :proposal).try(:linked_proposals)
76
- Decidim::Proposals::NotifyProposalsMentionedJob.perform_later(data[:comment_id], proposals) if proposals
67
+ config.to_prepare do
68
+ Decidim::Comments::CommentCreation.subscribe do |data|
69
+ proposals = data.dig(:metadatas, :proposal).try(:linked_proposals)
70
+ Decidim::Proposals::NotifyProposalsMentionedJob.perform_later(data[:comment_id], proposals) if proposals
71
+ end
77
72
  end
78
73
  end
79
74
 
@@ -59,6 +59,7 @@ module Decidim
59
59
  private
60
60
 
61
61
  attr_reader :proposal
62
+ alias resource proposal
62
63
 
63
64
  def component
64
65
  proposal.component
@@ -41,6 +41,16 @@ module Capybara
41
41
 
42
42
  expect(proposals_picker).to have_proposals_picked(proposals)
43
43
  end
44
+
45
+ def proposals_remove(proposals_picker, proposals)
46
+ data_picker = proposals_picker.data_picker
47
+
48
+ proposals.each do |proposal|
49
+ data_picker.find("a", text: proposal.title["en"]).find("span").click
50
+ end
51
+
52
+ expect(proposals_picker).to have_proposals_not_picked(proposals)
53
+ end
44
54
  end
45
55
  end
46
56
 
@@ -277,6 +277,9 @@ FactoryBot.define do
277
277
  address { "#{Faker::Address.street_name}, #{Faker::Address.city}" }
278
278
  latitude { Faker::Address.latitude }
279
279
  longitude { Faker::Address.longitude }
280
+ cost { 20_000 }
281
+ cost_report { { en: "My cost report" } }
282
+ execution_period { { en: "My execution period" } }
280
283
 
281
284
  after(:build) do |proposal, evaluator|
282
285
  proposal.title = if evaluator.title.is_a?(String)
@@ -4,7 +4,7 @@ module Decidim
4
4
  # This holds decidim-proposals version.
5
5
  module Proposals
6
6
  def self.version
7
- "0.24.3"
7
+ "0.25.0.rc1"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decidim-proposals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.3
4
+ version: 0.25.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josep Jaume Rey Peroy
@@ -10,78 +10,36 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2021-06-01 00:00:00.000000000 Z
13
+ date: 2021-07-28 00:00:00.000000000 Z
14
14
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: acts_as_list
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "~>"
20
- - !ruby/object:Gem::Version
21
- version: '0.9'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '0.9'
29
- - !ruby/object:Gem::Dependency
30
- name: cells-erb
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - "~>"
34
- - !ruby/object:Gem::Version
35
- version: 0.1.0
36
- type: :runtime
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: 0.1.0
43
- - !ruby/object:Gem::Dependency
44
- name: cells-rails
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: 0.0.9
50
- type: :runtime
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - "~>"
55
- - !ruby/object:Gem::Version
56
- version: 0.0.9
57
15
  - !ruby/object:Gem::Dependency
58
16
  name: decidim-comments
59
17
  requirement: !ruby/object:Gem::Requirement
60
18
  requirements:
61
19
  - - '='
62
20
  - !ruby/object:Gem::Version
63
- version: 0.24.3
21
+ version: 0.25.0.rc1
64
22
  type: :runtime
65
23
  prerelease: false
66
24
  version_requirements: !ruby/object:Gem::Requirement
67
25
  requirements:
68
26
  - - '='
69
27
  - !ruby/object:Gem::Version
70
- version: 0.24.3
28
+ version: 0.25.0.rc1
71
29
  - !ruby/object:Gem::Dependency
72
30
  name: decidim-core
73
31
  requirement: !ruby/object:Gem::Requirement
74
32
  requirements:
75
33
  - - '='
76
34
  - !ruby/object:Gem::Version
77
- version: 0.24.3
35
+ version: 0.25.0.rc1
78
36
  type: :runtime
79
37
  prerelease: false
80
38
  version_requirements: !ruby/object:Gem::Requirement
81
39
  requirements:
82
40
  - - '='
83
41
  - !ruby/object:Gem::Version
84
- version: 0.24.3
42
+ version: 0.25.0.rc1
85
43
  - !ruby/object:Gem::Dependency
86
44
  name: doc2text
87
45
  requirement: !ruby/object:Gem::Requirement
@@ -96,40 +54,6 @@ dependencies:
96
54
  - - "~>"
97
55
  - !ruby/object:Gem::Version
98
56
  version: 0.4.3
99
- - !ruby/object:Gem::Dependency
100
- name: kaminari
101
- requirement: !ruby/object:Gem::Requirement
102
- requirements:
103
- - - "~>"
104
- - !ruby/object:Gem::Version
105
- version: '1.2'
106
- - - ">="
107
- - !ruby/object:Gem::Version
108
- version: 1.2.1
109
- type: :runtime
110
- prerelease: false
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '1.2'
116
- - - ">="
117
- - !ruby/object:Gem::Version
118
- version: 1.2.1
119
- - !ruby/object:Gem::Dependency
120
- name: ransack
121
- requirement: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: 2.1.1
126
- type: :runtime
127
- prerelease: false
128
- version_requirements: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: 2.1.1
133
57
  - !ruby/object:Gem::Dependency
134
58
  name: redcarpet
135
59
  requirement: !ruby/object:Gem::Requirement
@@ -156,84 +80,84 @@ dependencies:
156
80
  requirements:
157
81
  - - '='
158
82
  - !ruby/object:Gem::Version
159
- version: 0.24.3
83
+ version: 0.25.0.rc1
160
84
  type: :development
161
85
  prerelease: false
162
86
  version_requirements: !ruby/object:Gem::Requirement
163
87
  requirements:
164
88
  - - '='
165
89
  - !ruby/object:Gem::Version
166
- version: 0.24.3
90
+ version: 0.25.0.rc1
167
91
  - !ruby/object:Gem::Dependency
168
92
  name: decidim-assemblies
169
93
  requirement: !ruby/object:Gem::Requirement
170
94
  requirements:
171
95
  - - '='
172
96
  - !ruby/object:Gem::Version
173
- version: 0.24.3
97
+ version: 0.25.0.rc1
174
98
  type: :development
175
99
  prerelease: false
176
100
  version_requirements: !ruby/object:Gem::Requirement
177
101
  requirements:
178
102
  - - '='
179
103
  - !ruby/object:Gem::Version
180
- version: 0.24.3
104
+ version: 0.25.0.rc1
181
105
  - !ruby/object:Gem::Dependency
182
106
  name: decidim-budgets
183
107
  requirement: !ruby/object:Gem::Requirement
184
108
  requirements:
185
109
  - - '='
186
110
  - !ruby/object:Gem::Version
187
- version: 0.24.3
111
+ version: 0.25.0.rc1
188
112
  type: :development
189
113
  prerelease: false
190
114
  version_requirements: !ruby/object:Gem::Requirement
191
115
  requirements:
192
116
  - - '='
193
117
  - !ruby/object:Gem::Version
194
- version: 0.24.3
118
+ version: 0.25.0.rc1
195
119
  - !ruby/object:Gem::Dependency
196
120
  name: decidim-dev
197
121
  requirement: !ruby/object:Gem::Requirement
198
122
  requirements:
199
123
  - - '='
200
124
  - !ruby/object:Gem::Version
201
- version: 0.24.3
125
+ version: 0.25.0.rc1
202
126
  type: :development
203
127
  prerelease: false
204
128
  version_requirements: !ruby/object:Gem::Requirement
205
129
  requirements:
206
130
  - - '='
207
131
  - !ruby/object:Gem::Version
208
- version: 0.24.3
132
+ version: 0.25.0.rc1
209
133
  - !ruby/object:Gem::Dependency
210
134
  name: decidim-meetings
211
135
  requirement: !ruby/object:Gem::Requirement
212
136
  requirements:
213
137
  - - '='
214
138
  - !ruby/object:Gem::Version
215
- version: 0.24.3
139
+ version: 0.25.0.rc1
216
140
  type: :development
217
141
  prerelease: false
218
142
  version_requirements: !ruby/object:Gem::Requirement
219
143
  requirements:
220
144
  - - '='
221
145
  - !ruby/object:Gem::Version
222
- version: 0.24.3
146
+ version: 0.25.0.rc1
223
147
  - !ruby/object:Gem::Dependency
224
148
  name: decidim-participatory_processes
225
149
  requirement: !ruby/object:Gem::Requirement
226
150
  requirements:
227
151
  - - '='
228
152
  - !ruby/object:Gem::Version
229
- version: 0.24.3
153
+ version: 0.25.0.rc1
230
154
  type: :development
231
155
  prerelease: false
232
156
  version_requirements: !ruby/object:Gem::Requirement
233
157
  requirements:
234
158
  - - '='
235
159
  - !ruby/object:Gem::Version
236
- version: 0.24.3
160
+ version: 0.25.0.rc1
237
161
  description: A proposals component for decidim's participatory spaces.
238
162
  email:
239
163
  - josepjaume@gmail.com
@@ -245,21 +169,6 @@ extra_rdoc_files: []
245
169
  files:
246
170
  - README.md
247
171
  - Rakefile
248
- - app/assets/config/admin/decidim_proposals_manifest.js
249
- - app/assets/config/decidim_proposals_manifest.js
250
- - app/assets/documents/decidim/proposals/participatory_texts/participatory_text.md
251
- - app/assets/documents/decidim/proposals/participatory_texts/participatory_text.odt
252
- - app/assets/images/decidim/gamification/badges/accepted_proposals.svg
253
- - app/assets/images/decidim/gamification/badges/proposal_votes.svg
254
- - app/assets/images/decidim/gamification/badges/proposals.svg
255
- - app/assets/images/decidim/proposals/icon.svg
256
- - app/assets/javascripts/decidim/proposals/add_proposal.js.es6
257
- - app/assets/javascripts/decidim/proposals/admin/proposals.es6
258
- - app/assets/javascripts/decidim/proposals/admin/proposals_form.js.es6
259
- - app/assets/javascripts/decidim/proposals/admin/proposals_picker.js.es6
260
- - app/assets/javascripts/decidim/proposals/utils.js.es6
261
- - app/assets/stylesheets/decidim/proposals/_proposals.css.scss
262
- - app/assets/stylesheets/decidim/proposals/proposals/_preview.css.scss
263
172
  - app/cells/decidim/proposals/collaborative_draft_cell.rb
264
173
  - app/cells/decidim/proposals/collaborative_draft_link_to_proposal/show.erb
265
174
  - app/cells/decidim/proposals/collaborative_draft_link_to_proposal_cell.rb
@@ -415,6 +324,21 @@ files:
415
324
  - app/models/decidim/proposals/proposal_note.rb
416
325
  - app/models/decidim/proposals/proposal_vote.rb
417
326
  - app/models/decidim/proposals/valuation_assignment.rb
327
+ - app/packs/documents/decidim/proposals/participatory_texts/participatory_text.md
328
+ - app/packs/documents/decidim/proposals/participatory_texts/participatory_text.odt
329
+ - app/packs/entrypoints/decidim_proposals.js
330
+ - app/packs/entrypoints/decidim_proposals_admin.js
331
+ - app/packs/images/decidim/gamification/badges/decidim_gamification_badges_accepted_proposals.svg
332
+ - app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposal_votes.svg
333
+ - app/packs/images/decidim/gamification/badges/decidim_gamification_badges_proposals.svg
334
+ - app/packs/images/decidim/proposals/decidim_proposals.svg
335
+ - app/packs/src/decidim/proposals/add_proposal.js
336
+ - app/packs/src/decidim/proposals/admin/proposals.js
337
+ - app/packs/src/decidim/proposals/admin/proposals_form.js
338
+ - app/packs/src/decidim/proposals/admin/proposals_picker.js
339
+ - app/packs/src/decidim/proposals/utils.js
340
+ - app/packs/stylesheets/decidim/proposals/_proposals.scss
341
+ - app/packs/stylesheets/decidim/proposals/proposals/_preview.scss
418
342
  - app/permissions/decidim/proposals/admin/permissions.rb
419
343
  - app/permissions/decidim/proposals/permissions.rb
420
344
  - app/presenters/decidim/proposals/admin_log/proposal_note_presenter.rb
@@ -519,6 +443,7 @@ files:
519
443
  - app/views/decidim/proposals/proposals/show.html.erb
520
444
  - app/views/decidim/proposals/versions/index.html.erb
521
445
  - app/views/decidim/proposals/versions/show.html.erb
446
+ - config/assets.rb
522
447
  - config/locales/am-ET.yml
523
448
  - config/locales/ar-SA.yml
524
449
  - config/locales/ar.yml
@@ -545,6 +470,7 @@ files:
545
470
  - config/locales/fi-plain.yml
546
471
  - config/locales/fi.yml
547
472
  - config/locales/fr-CA.yml
473
+ - config/locales/fr-LU.yml
548
474
  - config/locales/fr.yml
549
475
  - config/locales/ga-IE.yml
550
476
  - config/locales/gl.yml
@@ -555,10 +481,10 @@ files:
555
481
  - config/locales/is-IS.yml
556
482
  - config/locales/is.yml
557
483
  - config/locales/it.yml
558
- - config/locales/ja-JP.yml
559
484
  - config/locales/ja.yml
560
485
  - config/locales/ko-KR.yml
561
486
  - config/locales/ko.yml
487
+ - config/locales/lb-LU.yml
562
488
  - config/locales/lt-LT.yml
563
489
  - config/locales/lt.yml
564
490
  - config/locales/lv.yml
@@ -681,11 +607,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
681
607
  version: '2.7'
682
608
  required_rubygems_version: !ruby/object:Gem::Requirement
683
609
  requirements:
684
- - - ">="
610
+ - - ">"
685
611
  - !ruby/object:Gem::Version
686
- version: '0'
612
+ version: 1.3.1
687
613
  requirements: []
688
- rubygems_version: 3.1.2
614
+ rubygems_version: 3.1.4
689
615
  signing_key:
690
616
  specification_version: 4
691
617
  summary: Decidim proposals module