decidim-decidim_awesome 0.8.3 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of decidim-decidim_awesome might be problematic. Click here for more details.

Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +54 -45
  4. data/Rakefile +1 -1
  5. data/app/commands/decidim/decidim_awesome/admin/create_constraint.rb +1 -1
  6. data/app/commands/decidim/decidim_awesome/admin/create_custom_redirect.rb +1 -1
  7. data/app/commands/decidim/decidim_awesome/admin/create_menu_hack.rb +1 -1
  8. data/app/commands/decidim/decidim_awesome/admin/create_proposal_custom_field.rb +1 -1
  9. data/app/commands/decidim/decidim_awesome/admin/create_scoped_admin.rb +1 -1
  10. data/app/commands/decidim/decidim_awesome/admin/create_scoped_style.rb +1 -1
  11. data/app/commands/decidim/decidim_awesome/admin/destroy_constraint.rb +1 -1
  12. data/app/commands/decidim/decidim_awesome/admin/destroy_custom_redirect.rb +1 -1
  13. data/app/commands/decidim/decidim_awesome/admin/destroy_menu_hack.rb +1 -1
  14. data/app/commands/decidim/decidim_awesome/admin/destroy_proposal_custom_field.rb +1 -1
  15. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_admin.rb +1 -1
  16. data/app/commands/decidim/decidim_awesome/admin/destroy_scoped_style.rb +1 -1
  17. data/app/commands/decidim/decidim_awesome/admin/rename_scope_label.rb +1 -1
  18. data/app/commands/decidim/decidim_awesome/admin/update_config.rb +2 -3
  19. data/app/commands/decidim/decidim_awesome/admin/update_constraint.rb +2 -2
  20. data/app/commands/decidim/decidim_awesome/admin/update_custom_redirect.rb +1 -1
  21. data/app/commands/decidim/decidim_awesome/admin/update_menu_hack.rb +1 -1
  22. data/app/commands/decidim/decidim_awesome/command.rb +14 -0
  23. data/app/commands/decidim/decidim_awesome/create_editor_image.rb +1 -1
  24. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable.rb +67 -0
  25. data/app/controllers/concerns/decidim/decidim_awesome/admin_accountability/admin/filterable_helper.rb +37 -0
  26. data/app/controllers/decidim/decidim_awesome/admin/admin_accountability_controller.rb +51 -0
  27. data/app/controllers/decidim/decidim_awesome/admin/checks_controller.rb +6 -3
  28. data/app/controllers/decidim/decidim_awesome/admin/config_controller.rb +2 -0
  29. data/app/controllers/decidim/decidim_awesome/admin/custom_redirects_controller.rb +2 -0
  30. data/app/controllers/decidim/decidim_awesome/admin/menu_hacks_controller.rb +2 -0
  31. data/app/controllers/decidim/decidim_awesome/editor_images_controller.rb +0 -2
  32. data/app/forms/decidim/decidim_awesome/admin/config_form.rb +14 -0
  33. data/app/forms/decidim/decidim_awesome/admin/menu_form.rb +1 -1
  34. data/app/forms/decidim/decidim_awesome/proposals/proposal_wizard_create_step_form_override.rb +26 -8
  35. data/app/helpers/decidim/decidim_awesome/admin/config_constraints_helpers.rb +12 -8
  36. data/app/helpers/decidim/decidim_awesome/map_helper.rb +14 -11
  37. data/app/jobs/decidim/decidim_awesome/export_admin_actions_job.rb +28 -0
  38. data/app/middleware/decidim/decidim_awesome/current_config.rb +4 -0
  39. data/app/models/decidim/decidim_awesome/awesome_config.rb +0 -1
  40. data/app/models/decidim/decidim_awesome/config_constraint.rb +0 -2
  41. data/app/models/decidim/decidim_awesome/editor_image.rb +0 -3
  42. data/app/models/decidim/decidim_awesome/paper_trail_version.rb +99 -0
  43. data/app/packs/entrypoints/decidim_admin_decidim_awesome.js +3 -2
  44. data/app/packs/images/decidim/decidim_awesome/pokecode-logo.png +0 -0
  45. data/app/packs/src/decidim/decidim_awesome/admin/auto_edit.js +7 -7
  46. data/app/packs/src/decidim/decidim_awesome/admin/check_redirections.js +2 -2
  47. data/app/packs/src/decidim/decidim_awesome/admin/constraints.js +5 -5
  48. data/app/packs/src/decidim/decidim_awesome/admin/custom_fields_builder.js +11 -10
  49. data/app/packs/src/decidim/decidim_awesome/admin/form_exit_warn.js +1 -0
  50. data/app/packs/src/decidim/decidim_awesome/admin/user_picker.js +1 -0
  51. data/app/packs/src/decidim/decidim_awesome/awesome_map/api/fetcher.js +13 -13
  52. data/app/packs/src/decidim/decidim_awesome/awesome_map/awesome_map.js +14 -12
  53. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/controller.js +16 -12
  54. data/app/packs/src/decidim/decidim_awesome/awesome_map/controllers/proposals_controller.js +3 -3
  55. data/app/packs/src/decidim/decidim_awesome/awesome_map/controls_ui.js +25 -26
  56. data/app/packs/src/decidim/decidim_awesome/awesome_map/load_map.js +1 -0
  57. data/app/packs/src/decidim/decidim_awesome/editors/editor.js +33 -12
  58. data/app/packs/src/decidim/decidim_awesome/forms/autosave.js +8 -12
  59. data/app/packs/src/decidim/decidim_awesome/forms/custom_fields_renderer.js +36 -27
  60. data/app/packs/src/decidim/decidim_awesome/forms/rich_text_plugin.js +6 -4
  61. data/app/packs/src/decidim/decidim_awesome/proposals/custom_fields.js +7 -7
  62. data/app/packs/src/decidim/decidim_awesome/proposals/images.js +2 -2
  63. data/app/packs/stylesheets/decidim/decidim_awesome/awesome_admin.scss +8 -5
  64. data/app/permissions/decidim/decidim_awesome/admin/permissions.rb +15 -1
  65. data/app/permissions/decidim/decidim_awesome/permissions.rb +4 -6
  66. data/app/presenters/decidim/decidim_awesome/paper_trail_base_presenter.rb +28 -0
  67. data/app/presenters/decidim/decidim_awesome/participatory_space_role_presenter.rb +45 -0
  68. data/app/presenters/decidim/decidim_awesome/role_base_presenter.rb +102 -0
  69. data/app/presenters/decidim/decidim_awesome/user_entity_presenter.rb +50 -0
  70. data/app/serializers/decidim/decidim_awesome/paper_trail_version_serializer.rb +37 -0
  71. data/app/validators/concerns/decidim/decidim_awesome/etiquette_validator_override.rb +41 -0
  72. data/app/views/decidim/decidim_awesome/admin/admin_accountability/index.html.erb +59 -0
  73. data/app/views/decidim/decidim_awesome/admin/checks/_assets_tester.html.erb +2 -0
  74. data/app/views/decidim/decidim_awesome/admin/config/_form_proposals.html.erb +82 -2
  75. data/app/views/decidim/decidim_awesome/admin/shared/_filters_with_date.html.erb +56 -0
  76. data/app/views/decidim/proposals/admin/proposals/_form.html.erb +1 -1
  77. data/app/views/decidim/proposals/collaborative_drafts/_edit_form_fields.html.erb +9 -17
  78. data/app/views/layouts/decidim/admin/decidim_awesome.html.erb +1 -1
  79. data/app/views/{v0.25 → v0.27}/layouts/decidim/_head.html.erb +12 -4
  80. data/config/i18n-tasks.yml +4 -0
  81. data/config/locales/ca.yml +22 -2
  82. data/config/locales/cs.yml +7 -2
  83. data/config/locales/de.yml +20 -1
  84. data/config/locales/en.yml +90 -1
  85. data/config/locales/es.yml +2 -2
  86. data/config/locales/fr.yml +22 -2
  87. data/config/locales/it.yml +2 -2
  88. data/config/locales/ja.yml +3 -2
  89. data/config/locales/nl.yml +1 -1
  90. data/config/locales/pt-BR.yml +2 -2
  91. data/db/seeds.rb +1 -1
  92. data/lib/decidim/decidim_awesome/admin_engine.rb +15 -1
  93. data/lib/decidim/decidim_awesome/awesome.rb +55 -1
  94. data/lib/decidim/decidim_awesome/checksums.yml +13 -3
  95. data/lib/decidim/decidim_awesome/config.rb +14 -14
  96. data/lib/decidim/decidim_awesome/context_analyzers/request_analyzer.rb +1 -1
  97. data/lib/decidim/decidim_awesome/engine.rb +36 -9
  98. data/lib/decidim/decidim_awesome/iframe_component/component.rb +2 -1
  99. data/lib/decidim/decidim_awesome/menu_hacker.rb +6 -0
  100. data/lib/decidim/decidim_awesome/system_checker.rb +2 -0
  101. data/lib/decidim/decidim_awesome/test/factories.rb +7 -0
  102. data/lib/decidim/decidim_awesome/test/initializer.rb +10 -2
  103. data/lib/decidim/decidim_awesome/test/shared_examples/action_log_presenter_examples.rb +61 -0
  104. data/lib/decidim/decidim_awesome/test/shared_examples/scoped_admins_examples.rb +7 -4
  105. data/lib/decidim/decidim_awesome/test/shared_examples/summary_examples.rb +2 -2
  106. data/lib/decidim/decidim_awesome/version.rb +2 -2
  107. data/lib/tasks/decidim_awesome_active_storage_migrations_tasks.rake +1 -3
  108. data/package.json +21 -164
  109. metadata +39 -39
  110. data/app/packs/images/decidim/decidim_awesome/platoniq-logo.png +0 -0
  111. data/app/packs/src/vendor/image-resize.min.js +0 -1
  112. data/app/packs/src/vendor/image-upload.min.js +0 -6
  113. data/app/packs/src/vendor/leaflet.featuregroup.subgroup.js +0 -184
  114. /data/app/views/{v0.25 → v0.27}/decidim/proposals/collaborative_drafts/_show.html.erb +0 -0
  115. /data/app/views/{v0.25 → v0.27}/layouts/decidim/admin/_header.html.erb +0 -0
@@ -53,18 +53,18 @@ module Decidim
53
53
 
54
54
  # config processed for the organization config, without context
55
55
  def organization_config
56
- @organization_config ||= unfiltered_config.map do |key, value|
56
+ @organization_config ||= unfiltered_config.to_h do |key, value|
57
57
  value = defaults[key] unless enabled_for_organization? key
58
58
  [key, value]
59
- end.to_h
59
+ end
60
60
  end
61
61
 
62
62
  # config normalized according default values, without context, without organization config
63
63
  def unfiltered_config
64
- valid = @vars.map { |v| [v.var.to_sym, v.value] }.to_h
64
+ valid = @vars.to_h { |v| [v.var.to_sym, v.value] }
65
65
 
66
- map_defaults do |key|
67
- valid[key].presence
66
+ map_defaults do |key, val|
67
+ valid.has_key?(key) ? valid[key] : val
68
68
  end
69
69
  end
70
70
 
@@ -135,31 +135,31 @@ module Decidim
135
135
  plural_key = singular_key.pluralize.to_sym
136
136
  return {} unless config[plural_key]
137
137
 
138
- @sub_configs[singular_key] = config[plural_key].map do |key, _value|
138
+ @sub_configs[singular_key] = config[plural_key].to_h do |key, _value|
139
139
  [key, AwesomeConfig.find_by(var: "#{singular_key}_#{key}", organization: @organization)]
140
- end.to_h
140
+ end
141
141
  end
142
142
 
143
143
  private
144
144
 
145
145
  def map_defaults
146
- defaults.map do |key, val|
146
+ defaults.to_h do |key, val|
147
147
  value = false
148
148
  unless val == :disabled
149
- value = yield(key) || val
150
- value = val.merge(value.transform_keys(&:to_sym)) if val.is_a? Hash
149
+ value = yield(key, val)
150
+ value = val.merge(value.transform_keys(&:to_sym)) if val.is_a?(Hash) && value.is_a?(Hash)
151
151
  end
152
152
  [key, value]
153
- end.to_h
153
+ end
154
154
  end
155
155
 
156
156
  def calculate_config
157
157
  # filter vars compliant with current context
158
158
  valid = @vars.filter { |item| enabled_for_organization?(item.var) && valid_in_context?(item.all_constraints) }
159
- .map { |v| [v.var.to_sym, v.value] }.to_h
159
+ .to_h { |v| [v.var.to_sym, v.value] }
160
160
 
161
- map_defaults do |key|
162
- valid[key].presence
161
+ map_defaults do |key, val|
162
+ valid.has_key?(key) ? valid[key] : val
163
163
  end
164
164
  end
165
165
 
@@ -16,7 +16,7 @@ module Decidim
16
16
  def participatory_spaces_routes
17
17
  spaces = Decidim.participatory_space_manifests \
18
18
  .filter { |space| !DecidimAwesome.config.participatory_spaces_routes_context.has_key?(space.name) } \
19
- .map { |space| [space.name.to_s, space.name.to_s] }.to_h
19
+ .to_h { |space| [space.name.to_s, space.name.to_s] }
20
20
  DecidimAwesome.config.participatory_spaces_routes_context.each do |manifest, routes|
21
21
  routes.each do |route|
22
22
  spaces[route.to_s] = manifest.to_s
@@ -27,25 +27,52 @@ module Decidim
27
27
  # Include additional helpers globally
28
28
  ActionView::Base.include(Decidim::DecidimAwesome::AwesomeHelpers)
29
29
 
30
- # override user's admin property
31
- Decidim::User.include(Decidim::DecidimAwesome::UserOverride) if DecidimAwesome.enabled?(:scoped_admins)
32
-
33
- # redirect unauthorized scoped admins to allowed places or custom redirects if configured
34
- Decidim::ErrorsController.include(Decidim::DecidimAwesome::NotFoundRedirect) if DecidimAwesome.enabled?([:scoped_admins, :custom_redirects])
30
+ # Override EtiquetteValidator
31
+ EtiquetteValidator.include(Decidim::DecidimAwesome::EtiquetteValidatorOverride) if DecidimAwesome.enabled?([:validate_title_max_caps_percent,
32
+ :validate_title_max_marks_together,
33
+ :validate_title_start_with_caps,
34
+ :validate_body_max_caps_percent,
35
+ :validate_body_max_marks_together,
36
+ :validate_body_start_with_caps])
35
37
 
36
38
  # Custom fields need to deal with several places
37
- if DecidimAwesome.enabled?(:proposal_custom_fields)
38
- Decidim::Proposals::ApplicationHelper.include(Decidim::DecidimAwesome::Proposals::ApplicationHelperOverride)
39
+ if DecidimAwesome.enabled?([:proposal_custom_fields,
40
+ :validate_title_min_length,
41
+ :validate_title_max_caps_percent,
42
+ :validate_title_max_marks_together,
43
+ :validate_title_start_with_caps,
44
+ :validate_body_min_length,
45
+ :validate_body_max_caps_percent,
46
+ :validate_body_max_marks_together,
47
+ :validate_body_start_with_caps])
39
48
  Decidim::Proposals::ProposalWizardCreateStepForm.include(Decidim::DecidimAwesome::Proposals::ProposalWizardCreateStepFormOverride)
40
- Decidim::AmendmentsHelper.include(Decidim::DecidimAwesome::AmendmentsHelperOverride)
41
49
  end
42
50
 
51
+ # override user's admin property
52
+ Decidim::User.include(Decidim::DecidimAwesome::UserOverride) if DecidimAwesome.enabled?(:scoped_admins)
53
+
43
54
  Decidim::MenuPresenter.include(Decidim::DecidimAwesome::MenuPresenterOverride)
44
55
  Decidim::MenuItemPresenter.include(Decidim::DecidimAwesome::MenuItemPresenterOverride)
45
56
 
46
57
  # Late registering of components to take into account initializer values
47
58
  DecidimAwesome.registered_components.each do |manifest, block|
48
- Decidim.register_component(manifest, &block) unless DecidimAwesome.disabled_components.include?(manifest)
59
+ next if DecidimAwesome.disabled_components.include?(manifest)
60
+ next if Decidim.find_component_manifest(manifest)
61
+
62
+ Decidim.register_component(manifest, &block)
63
+ end
64
+ end
65
+
66
+ initializer "decidim_decidim_awesome.overrides", after: "decidim.action_controller" do
67
+ config.to_prepare do
68
+ # redirect unauthorized scoped admins to allowed places or custom redirects if configured
69
+ Decidim::ErrorsController.include(Decidim::DecidimAwesome::NotFoundRedirect) if DecidimAwesome.enabled?([:scoped_admins, :custom_redirects])
70
+
71
+ # Custom fields need to deal with several places
72
+ if DecidimAwesome.enabled?(:proposal_custom_fields)
73
+ Decidim::Proposals::ApplicationHelper.include(Decidim::DecidimAwesome::Proposals::ApplicationHelperOverride)
74
+ Decidim::AmendmentsHelper.include(Decidim::DecidimAwesome::AmendmentsHelperOverride)
75
+ end
49
76
  end
50
77
  end
51
78
 
@@ -43,7 +43,8 @@ Decidim::DecidimAwesome.register_component(:awesome_iframe) do |component|
43
43
  published_at: Time.current,
44
44
  participatory_space: participatory_space,
45
45
  settings: {
46
- announcement: { en: Faker::Lorem.paragraphs(number: 2).join("\n") }
46
+ announcement: { en: Faker::Lorem.paragraphs(number: 2).join("\n") },
47
+ iframe: '<iframe src="https://picsum.photos/800/600" width="100%" height="700" frameborder="0"></iframe>'
47
48
  }
48
49
  }
49
50
 
@@ -48,6 +48,7 @@ module Decidim
48
48
  menu
49
49
  end
50
50
 
51
+ # rubocop:disable Style/OpenStructUse
51
52
  def menu_overrides
52
53
  @menu_overrides ||= current_config.map do |item|
53
54
  OpenStruct.new(
@@ -64,6 +65,7 @@ module Decidim
64
65
  )
65
66
  end
66
67
  end
68
+ # rubocop:enable Style/OpenStructUse
67
69
 
68
70
  def activate?(url, view)
69
71
  urls = @items.map(&:url).sort_by(&:length).reverse
@@ -78,6 +80,10 @@ module Decidim
78
80
  user.present?
79
81
  when "non_logged"
80
82
  user.blank?
83
+ when "verified_user"
84
+ # the cleaner version should be user.authorizations.any?
85
+ # but there is not relationship between users and authorizations
86
+ Decidim::Authorization.where(user: user).any? { |auth| auth.granted? && !auth.expired? }
81
87
  else
82
88
  true
83
89
  end
@@ -54,9 +54,11 @@ module Decidim
54
54
  Digest::MD5.hexdigest(File.read(file))
55
55
  end
56
56
 
57
+ # rubocop:disable Style/OpenStructUse
57
58
  def to_struct(obj)
58
59
  OpenStruct.new obj
59
60
  end
61
+ # rubocop:enable Style/OpenStructUse
60
62
  end
61
63
  end
62
64
  end
@@ -23,6 +23,13 @@ FactoryBot.define do
23
23
  organization { create :organization }
24
24
  end
25
25
 
26
+ factory :paper_trail_version, class: Decidim::DecidimAwesome::PaperTrailVersion do
27
+ item_id { user.id }
28
+ item_type { "Decidim::ParticipatoryProcessUserRole" }
29
+ event { "create" }
30
+ created_at { 1.hour.ago }
31
+ end
32
+
26
33
  factory :map_component, parent: :component do
27
34
  name { Decidim::Components::Namer.new(participatory_space.organization.available_locales, :proposals).i18n_name }
28
35
  manifest_name { :awesome_map }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Decidim::DecidimAwesome.configure do |config|
4
- if ENV["FEATURES"] == "disabled"
4
+ if ENV.fetch("FEATURES", nil) == "disabled"
5
5
  [
6
6
  :allow_images_in_full_editor,
7
7
  :allow_images_in_small_editor,
@@ -15,7 +15,15 @@ Decidim::DecidimAwesome.configure do |config|
15
15
  :proposal_custom_fields,
16
16
  :menu,
17
17
  :scoped_admins,
18
- :custom_redirects
18
+ :custom_redirects,
19
+ :validate_title_min_length,
20
+ :validate_title_max_caps_percent,
21
+ :validate_title_max_marks_together,
22
+ :validate_title_start_with_caps,
23
+ :validate_body_min_length,
24
+ :validate_body_max_caps_percent,
25
+ :validate_body_max_marks_together,
26
+ :validate_body_start_with_caps
19
27
  ].each do |conf|
20
28
  config.send("#{conf}=", :disabled)
21
29
  end
@@ -0,0 +1,61 @@
1
+ # frozen_string_literal: true
2
+
3
+ shared_examples "a user presenter" do
4
+ describe "#last_sign_in_date" do
5
+ it "returns never logged in yet" do
6
+ expect(subject.last_sign_in_date).to eq("<span class=\"muted\">Never logged yet</span>")
7
+ end
8
+
9
+ context "when no html" do
10
+ let(:html) { false }
11
+
12
+ it "returns never logged in yet" do
13
+ expect(subject.last_sign_in_date).to eq("Never logged yet")
14
+ end
15
+ end
16
+
17
+ context "when user has logged before" do
18
+ let(:last_sign_in_at) { 1.day.ago }
19
+
20
+ it "returns the last sign in date" do
21
+ expect(subject.last_sign_in_date).to eq(1.day.ago.strftime("%d/%m/%Y %H:%M"))
22
+ end
23
+ end
24
+ end
25
+
26
+ describe "#user" do
27
+ it "returns the user" do
28
+ expect(subject.user).to eq(user)
29
+ end
30
+
31
+ it "returns email" do
32
+ expect(subject.user_email).to eq(user.email)
33
+ end
34
+
35
+ it "returns user name" do
36
+ expect(subject.user_name).to eq(user.name)
37
+ end
38
+ end
39
+
40
+ describe "#removal_date" do
41
+ it "returns currently active" do
42
+ expect(subject.removal_date).to eq("<span class=\"text-success\">Currently active</span>")
43
+ end
44
+
45
+ context "when html is disabled" do
46
+ let(:html) { false }
47
+
48
+ it "returns currently active" do
49
+ expect(subject.removal_date).to eq("Currently active")
50
+ end
51
+ end
52
+
53
+ context "when the role was removed" do
54
+ include_context "with role destroyed"
55
+
56
+ it "returns the removal date" do
57
+ expect(subject.removal_date).to eq(destroyed_at.strftime("%d/%m/%Y %H:%M"))
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,9 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ welcome_text = "Welcome to the Admin Panel."
4
+ welcome_text = "Welcome to the Decidim Admin Panel." if legacy_version?
5
+
3
6
  shared_examples "redirects to index" do |_link|
4
7
  it "display index page" do
5
8
  expect(page).to have_content("You are not authorized to perform this action")
6
- expect(page).to have_content("Welcome to the Decidim Admin Panel.")
9
+ expect(page).to have_content(welcome_text)
7
10
  expect(page).to have_current_path(decidim_admin.root_path, ignore_query: true)
8
11
  end
9
12
  end
@@ -85,7 +88,7 @@ shared_examples "allows external accesses" do
85
88
 
86
89
  it "shows participants access" do
87
90
  visit decidim_admin.users_path
88
- expect(page).to have_content("New user")
91
+ expect(page).to have_content(legacy_version? ? "New user" : "New admin")
89
92
  end
90
93
 
91
94
  it "shows pages access" do
@@ -110,7 +113,7 @@ shared_examples "allows all admin routes" do
110
113
  end
111
114
 
112
115
  it "allows the admin root page" do
113
- expect(page).to have_content("Welcome to the Decidim Admin Panel.")
116
+ expect(page).to have_content(welcome_text)
114
117
  end
115
118
 
116
119
  it "allows the assemblies page" do
@@ -132,7 +135,7 @@ shared_examples "allows scoped admin routes" do
132
135
  end
133
136
 
134
137
  it "allows the admin root page" do
135
- expect(page).to have_content("Welcome to the Decidim Admin Panel.")
138
+ expect(page).to have_content(welcome_text)
136
139
  end
137
140
 
138
141
  it "allows the assemblies page" do
@@ -36,6 +36,7 @@ shared_examples "activated concerns" do |enabled|
36
36
  expect(Decidim::Proposals::ApplicationHelper.included_modules).to include(Decidim::DecidimAwesome::Proposals::ApplicationHelperOverride)
37
37
  expect(Decidim::Proposals::ProposalWizardCreateStepForm.included_modules).to include(Decidim::DecidimAwesome::Proposals::ProposalWizardCreateStepFormOverride)
38
38
  expect(Decidim::AmendmentsHelper.included_modules).to include(Decidim::DecidimAwesome::AmendmentsHelperOverride)
39
+ expect(EtiquetteValidator.included_modules).to include(Decidim::DecidimAwesome::EtiquetteValidatorOverride)
39
40
  end
40
41
  else
41
42
  it "concerns are not registered" do
@@ -44,12 +45,12 @@ shared_examples "activated concerns" do |enabled|
44
45
  expect(Decidim::Proposals::ApplicationHelper.included_modules).not_to include(Decidim::DecidimAwesome::Proposals::ApplicationHelperOverride)
45
46
  expect(Decidim::Proposals::ProposalWizardCreateStepForm.included_modules).not_to include(Decidim::DecidimAwesome::Proposals::ProposalWizardCreateStepFormOverride)
46
47
  expect(Decidim::AmendmentsHelper.included_modules).not_to include(Decidim::DecidimAwesome::AmendmentsHelperOverride)
48
+ expect(EtiquetteValidator.included_modules).not_to include(Decidim::DecidimAwesome::EtiquetteValidatorOverride)
47
49
  end
48
50
  end
49
51
  end
50
52
 
51
53
  shared_examples "custom menus" do |enabled|
52
- # rubocop:disable RSpec/EmptyExampleGroup
53
54
  describe Decidim::MenuPresenter, type: :helper do
54
55
  before do
55
56
  allow(view).to receive(:current_organization).and_return(organization)
@@ -66,7 +67,6 @@ shared_examples "custom menus" do |enabled|
66
67
  end
67
68
  end
68
69
  end
69
- # rubocop:enable RSpec/EmptyExampleGroup
70
70
  end
71
71
 
72
72
  shared_examples "basic rendering" do |enabled|
@@ -3,7 +3,7 @@
3
3
  module Decidim
4
4
  # This holds the decidim-decidim_awesome version.
5
5
  module DecidimAwesome
6
- VERSION = "0.8.3"
7
- COMPAT_DECIDIM_VERSION = [">= 0.25.0", "< 0.27"].freeze
6
+ VERSION = "0.9.1"
7
+ COMPAT_DECIDIM_VERSION = [">= 0.26.0", "< 0.28"].freeze
8
8
  end
9
9
  end
@@ -15,9 +15,7 @@ namespace :decidim_awesome do
15
15
  path = Rails.root.join("tmp/decidim_awesome_editor_images_mappings.csv")
16
16
  dirname = File.dirname(path)
17
17
  FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
18
- File.open(path, "wb") do |file|
19
- file.write(Decidim::Exporters::CSV.new(routes_mappings).export.read)
20
- end
18
+ File.binwrite(path, Decidim::Exporters::CSV.new(routes_mappings).export.read)
21
19
  end
22
20
  end
23
21
 
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "decidim-module-decidim_awesome",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Mods and tweaks for Decidim",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/Platoniq/decidim-module-decidim_awesome.git"
19
+ "url": "git+https://github.com/decidim-ice/decidim-module-decidim_awesome.git"
20
20
  },
21
21
  "keywords": [
22
22
  "decidim"
@@ -24,176 +24,33 @@
24
24
  "author": "ivan@platoniq.net",
25
25
  "license": "AGPL-3.0-or-later",
26
26
  "bugs": {
27
- "url": "https://github.com/Platoniq/decidim-module-decidim_awesome/issues"
27
+ "url": "https://github.com/decidim-ice/decidim-module-decidim_awesome/issues"
28
28
  },
29
- "homepage": "https://github.com/Platoniq/decidim-module-decidim_awesome#readme",
29
+ "homepage": "https://github.com/decidim-ice/decidim-module-decidim_awesome#readme",
30
30
  "stylelint": {
31
- "rules": {
32
- "at-rule-empty-line-before": [
33
- "always",
34
- {
35
- "except": [
36
- "blockless-after-same-name-blockless",
37
- "first-nested"
38
- ],
39
- "ignore": [
40
- "after-comment"
41
- ],
42
- "ignoreAtRules": [
43
- "else"
44
- ]
45
- }
46
- ],
47
- "at-rule-name-case": "lower",
48
- "at-rule-semicolon-newline-after": "always",
49
- "block-closing-brace-empty-line-before": "never",
50
- "block-closing-brace-newline-after": "always",
51
- "block-closing-brace-newline-before": "always-multi-line",
52
- "block-closing-brace-space-before": "always-single-line",
53
- "block-no-empty": true,
54
- "block-opening-brace-newline-after": "always-multi-line",
55
- "block-opening-brace-space-after": "always-single-line",
56
- "block-opening-brace-space-before": "always",
57
- "color-hex-case": "lower",
58
- "color-hex-length": "short",
59
- "color-no-invalid-hex": true,
60
- "comment-empty-line-before": [
61
- "always",
62
- {
63
- "except": [
64
- "first-nested"
65
- ],
66
- "ignore": [
67
- "stylelint-commands"
68
- ]
69
- }
70
- ],
71
- "comment-no-empty": true,
72
- "comment-whitespace-inside": "always",
73
- "custom-property-empty-line-before": [
74
- "always",
75
- {
76
- "except": [
77
- "after-custom-property",
78
- "first-nested"
79
- ],
80
- "ignore": [
81
- "after-comment",
82
- "inside-single-line-block"
83
- ]
84
- }
85
- ],
86
- "declaration-bang-space-after": "never",
87
- "declaration-bang-space-before": "always",
88
- "declaration-block-no-duplicate-properties": [
89
- true,
90
- {
91
- "ignore": [
92
- "consecutive-duplicates-with-different-values"
93
- ]
94
- }
95
- ],
96
- "declaration-block-no-redundant-longhand-properties": true,
97
- "declaration-block-no-shorthand-property-overrides": true,
98
- "declaration-block-semicolon-newline-after": "always-multi-line",
99
- "declaration-block-semicolon-space-after": "always-single-line",
100
- "declaration-block-semicolon-space-before": "never",
101
- "declaration-block-single-line-max-declarations": 1,
102
- "declaration-block-trailing-semicolon": "always",
103
- "declaration-colon-newline-after": "always-multi-line",
104
- "declaration-colon-space-after": "always-single-line",
105
- "declaration-colon-space-before": "never",
106
- "declaration-empty-line-before": [
107
- "always",
108
- {
109
- "except": [
110
- "after-declaration",
111
- "first-nested"
112
- ],
113
- "ignore": [
114
- "after-comment",
115
- "inside-single-line-block"
116
- ]
117
- }
118
- ],
119
- "function-calc-no-unspaced-operator": true,
120
- "function-comma-newline-after": "always-multi-line",
121
- "function-comma-space-after": "always-single-line",
122
- "function-comma-space-before": "never",
123
- "function-linear-gradient-no-nonstandard-direction": true,
124
- "function-max-empty-lines": 0,
125
- "function-name-case": "lower",
126
- "function-parentheses-newline-inside": "always-multi-line",
127
- "function-parentheses-space-inside": "never-single-line",
128
- "function-whitespace-after": "always",
129
- "indentation": 2,
130
- "keyframe-declaration-no-important": true,
131
- "length-zero-no-unit": true,
132
- "max-empty-lines": 1,
133
- "media-feature-colon-space-after": "always",
134
- "media-feature-colon-space-before": "never",
135
- "media-feature-name-case": "lower",
136
- "media-feature-name-no-unknown": true,
137
- "media-feature-parentheses-space-inside": "never",
138
- "media-feature-range-operator-space-after": "always",
139
- "media-feature-range-operator-space-before": "always",
140
- "media-query-list-comma-newline-after": "always-multi-line",
141
- "media-query-list-comma-space-after": "always-single-line",
142
- "media-query-list-comma-space-before": "never",
143
- "no-empty-source": true,
144
- "no-eol-whitespace": true,
145
- "no-extra-semicolons": true,
146
- "no-invalid-double-slash-comments": true,
147
- "no-missing-end-of-source-newline": true,
148
- "number-leading-zero": "never",
149
- "number-no-trailing-zeros": true,
150
- "property-case": "lower",
151
- "property-no-unknown": true,
152
- "rule-empty-line-before": [
153
- "always-multi-line",
154
- {
155
- "except": [
156
- "first-nested"
157
- ],
158
- "ignore": [
159
- "after-comment"
160
- ]
161
- }
162
- ],
163
- "selector-attribute-brackets-space-inside": "never",
164
- "selector-attribute-operator-space-after": "never",
165
- "selector-attribute-operator-space-before": "never",
166
- "selector-combinator-space-after": "always",
167
- "selector-combinator-space-before": "always",
168
- "selector-descendant-combinator-no-non-space": true,
169
- "selector-list-comma-newline-after": "always",
170
- "selector-list-comma-space-before": "never",
171
- "selector-max-empty-lines": 0,
172
- "selector-pseudo-class-case": "lower",
173
- "selector-pseudo-class-no-unknown": true,
174
- "selector-pseudo-class-parentheses-space-inside": "never",
175
- "selector-pseudo-element-case": "lower",
176
- "selector-pseudo-element-colon-notation": "double",
177
- "selector-pseudo-element-no-unknown": true,
178
- "selector-type-case": "lower",
179
- "selector-type-no-unknown": true,
180
- "shorthand-property-no-redundant-values": true,
181
- "string-no-newline": true,
182
- "unit-case": "lower",
183
- "unit-no-unknown": true,
184
- "value-list-comma-newline-after": "always-multi-line",
185
- "value-list-comma-space-after": "always-single-line",
186
- "value-list-comma-space-before": "never",
187
- "value-list-max-empty-lines": 0
31
+ "extends": "@decidim/stylelint-config",
32
+ "rules" : {
33
+ "block-opening-brace-space-before": "always"
188
34
  }
189
35
  },
190
36
  "devDependencies": {
191
- "eslint": "^7.32.0",
192
- "eslint": "^7.25.0",
37
+ "@babel/eslint-parser": "^7.19.1",
38
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
39
+ "@babel/plugin-proposal-private-methods": "^7.18.6",
40
+ "@babel/plugin-proposal-private-property-in-object": "^7.20.5",
41
+ "@babel/plugin-transform-classes": "^7.20.7",
42
+ "@babel/plugin-transform-regenerator": "^7.20.5",
43
+ "@babel/plugin-transform-runtime": "^7.19.6",
44
+ "@babel/preset-env": "^7.20.2",
45
+ "@babel/preset-react": "^7.18.6",
46
+ "@decidim/dev": "0.27.1",
47
+ "@decidim/eslint-config": "0.27.1",
48
+ "@decidim/stylelint-config": "0.27.1",
193
49
  "eslint-config-prettier": "^8.2.0",
194
50
  "eslint-config-standard": "^11.0.0",
195
51
  "eslint-plugin-import": "^2.22.0",
196
- "stylelint": "13.11.0"
52
+ "eslint-plugin-standard": "^3.1.0",
53
+ "sass-embedded": "~1.57.1"
197
54
  },
198
55
  "dependencies": {
199
56
  "codemirror": "^5.65.0",