decidim 0.4.3 → 0.4.4

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

Potentially problematic release.


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

Files changed (156) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +11 -0
  3. data/CHANGELOG.md +16 -2
  4. data/Gemfile.lock +41 -42
  5. data/README.md +1 -1
  6. data/Rakefile +1 -1
  7. data/decidim-admin/app/commands/decidim/admin/publish_participatory_process.rb +1 -5
  8. data/decidim-admin/app/commands/decidim/admin/unpublish_participatory_process.rb +1 -5
  9. data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +1 -1
  10. data/decidim-admin/app/controllers/decidim/admin/exports_controller.rb +2 -9
  11. data/decidim-admin/app/controllers/decidim/admin/feature_permissions_controller.rb +1 -1
  12. data/decidim-admin/app/controllers/decidim/admin/features/base_controller.rb +3 -2
  13. data/decidim-admin/app/controllers/decidim/admin/features_controller.rb +2 -2
  14. data/decidim-admin/app/controllers/decidim/admin/participatory_process_groups_controller.rb +2 -1
  15. data/decidim-admin/app/controllers/decidim/admin/participatory_processes_controller.rb +6 -2
  16. data/decidim-admin/app/forms/decidim/admin/participatory_process_copy_form.rb +1 -1
  17. data/decidim-admin/app/forms/decidim/admin/participatory_process_form.rb +1 -1
  18. data/decidim-admin/app/helpers/decidim/admin/process_groups_for_select_helper.rb +1 -1
  19. data/decidim-admin/app/helpers/decidim/admin/processes_for_select_helper.rb +1 -1
  20. data/decidim-admin/app/helpers/decidim/admin/{feature_settings_helper.rb → settings_helper.rb} +2 -2
  21. data/decidim-admin/app/models/decidim/admin/abilities/participatory_process_admin_ability.rb +2 -2
  22. data/decidim-admin/app/views/decidim/admin/attachments/index.html.erb +1 -1
  23. data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +1 -1
  24. data/decidim-admin/app/views/decidim/admin/exports/_dropdown.html.erb +1 -1
  25. data/decidim-admin/app/views/decidim/admin/features/_feature.html.erb +2 -2
  26. data/decidim-admin/app/views/decidim/admin/features/edit.html.erb +1 -1
  27. data/decidim-admin/app/views/decidim/admin/features/index.html.erb +1 -1
  28. data/decidim-admin/app/views/decidim/admin/features/new.html.erb +1 -1
  29. data/decidim-admin/app/views/decidim/admin/participatory_process_groups/show.html.erb +1 -1
  30. data/decidim-admin/app/views/decidim/admin/participatory_process_steps/index.html.erb +2 -2
  31. data/decidim-admin/app/views/decidim/admin/participatory_process_steps/new.html.erb +0 -1
  32. data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +1 -1
  33. data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/new.html.erb +6 -6
  34. data/decidim-admin/app/views/decidim/admin/participatory_processes/new.html.erb +0 -1
  35. data/decidim-admin/app/views/layouts/decidim/admin/participatory_process.html.erb +2 -2
  36. data/decidim-admin/config/locales/ca.yml +7 -14
  37. data/decidim-admin/config/locales/en.yml +7 -14
  38. data/decidim-admin/config/locales/es.yml +7 -14
  39. data/decidim-admin/config/locales/eu.yml +9 -15
  40. data/decidim-admin/config/locales/fi.yml +7 -12
  41. data/decidim-admin/config/locales/fr.yml +9 -15
  42. data/decidim-admin/config/locales/it.yml +9 -15
  43. data/decidim-admin/config/routes.rb +9 -7
  44. data/decidim-admin/spec/commands/copy_participatory_process_spec.rb +4 -4
  45. data/decidim-admin/spec/controllers/exports_controller_spec.rb +2 -0
  46. data/decidim-admin/spec/controllers/participatory_processes_controller_spec.rb +2 -0
  47. data/decidim-admin/spec/controllers/static_pages_controller_spec.rb +2 -0
  48. data/decidim-admin/spec/features/admin_copy_participatory_process_spec.rb +3 -2
  49. data/decidim-admin/spec/features/admin_manages_feature_permissions_spec.rb +1 -1
  50. data/decidim-admin/spec/features/admin_manages_features_spec.rb +4 -4
  51. data/decidim-admin/spec/features/admin_manages_participatory_process_admins_spec.rb +2 -1
  52. data/decidim-admin/spec/features/admin_manages_participatory_process_attachments_spec.rb +2 -1
  53. data/decidim-admin/spec/features/admin_manages_participatory_process_categories_spec.rb +1 -1
  54. data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +2 -2
  55. data/decidim-admin/spec/features/admin_manages_participatory_process_steps_spec.rb +2 -1
  56. data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +3 -3
  57. data/decidim-admin/spec/features/admin_manages_user_groups_spec.rb +3 -2
  58. data/decidim-admin/spec/features/participatory_process_admin_manages_participatory_process_admins_spec.rb +1 -2
  59. data/decidim-admin/spec/features/participatory_process_admin_manages_participatory_process_attachments_spec.rb +1 -3
  60. data/decidim-admin/spec/features/{process_admin_manages_participatory_process_categories_spec.rb → participatory_process_admin_manages_participatory_process_categories_spec.rb} +2 -4
  61. data/decidim-admin/spec/features/participatory_process_admin_manages_participatory_process_steps_spec.rb +1 -2
  62. data/decidim-admin/spec/features/participatory_process_admin_manages_participatory_processes_spec.rb +2 -2
  63. data/decidim-admin/spec/helpers/{feature_settings_helper_spec.rb → settings_helper_spec.rb} +1 -1
  64. data/decidim-admin/spec/shared/manage_process_admins_examples.rb +9 -1
  65. data/decidim-admin/spec/shared/participatory_process_administration_by_admin_shared_context.rb +9 -0
  66. data/decidim-admin/spec/shared/participatory_process_administration_by_process_admin_shared_context.rb +13 -0
  67. data/decidim-admin/spec/shared/{participatory_admin_shared_context.rb → participatory_process_administration_shared_context.rb} +2 -4
  68. data/decidim-api/decidim-api.gemspec +2 -0
  69. data/decidim-api/lib/decidim/api/schema.rb +1 -1
  70. data/decidim-api/lib/decidim/api/test/type_context.rb +1 -1
  71. data/decidim-api/spec/controllers/queries_controller_spec.rb +2 -0
  72. data/decidim-budgets/app/forms/decidim/budgets/admin/project_form.rb +4 -0
  73. data/decidim-budgets/app/views/decidim/budgets/admin/projects/index.html.erb +1 -1
  74. data/decidim-budgets/app/views/decidim/budgets/projects/_tags.html.erb +2 -2
  75. data/decidim-budgets/decidim-budgets.gemspec +1 -1
  76. data/decidim-budgets/lib/decidim/budgets/feature.rb +30 -34
  77. data/decidim-budgets/spec/commands/remove_line_item_spec.rb +2 -0
  78. data/decidim-budgets/spec/features/comments_spec.rb +1 -1
  79. data/decidim-budgets/spec/features/orders_spec.rb +1 -5
  80. data/decidim-budgets/spec/forms/project_form_spec.rb +6 -0
  81. data/decidim-budgets/spec/shared/manage_projects_examples.rb +1 -1
  82. data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
  83. data/decidim-comments/app/frontend/comments/add_comment_form.component.tsx +3 -3
  84. data/decidim-comments/app/frontend/support/schema.ts +1379 -94
  85. data/decidim-comments/app/types/decidim/comments/commentable_interface.rb +1 -1
  86. data/decidim-comments/decidim-comments.gemspec +1 -0
  87. data/decidim-comments/lib/decidim/comments/api/comment_mutation_type.rb +2 -2
  88. data/decidim-comments/spec/features/comments_spec.rb +1 -1
  89. data/decidim-comments/spec/features/notifications_spec.rb +1 -1
  90. data/decidim-comments/spec/features/report_comment_spec.rb +1 -1
  91. data/decidim-comments/spec/models/comment_spec.rb +1 -1
  92. data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +2 -1
  93. data/decidim-dev/lib/decidim/dev/test/rspec_support/feature_context.rb +1 -3
  94. data/decidim-dev/lib/decidim/dev/test/rspec_support/i18n.rb +0 -7
  95. data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/promise.js +2 -2
  96. data/decidim-dev/lib/decidim/dev/test/rspec_support/route_helpers.rb +6 -0
  97. data/decidim-dev/lib/generators/decidim/dummy_generator.rb +0 -2
  98. data/decidim-meetings/app/forms/decidim/meetings/admin/meeting_form.rb +6 -0
  99. data/decidim-meetings/app/helpers/decidim/meetings/meetings_helper.rb +2 -1
  100. data/decidim-meetings/app/services/decidim/meetings/meeting_search.rb +2 -2
  101. data/decidim-meetings/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +2 -2
  102. data/decidim-meetings/app/views/decidim/meetings/admin/meetings/index.html.erb +1 -1
  103. data/decidim-meetings/app/views/decidim/meetings/meetings/_tags.html.erb +2 -2
  104. data/decidim-meetings/decidim-meetings.gemspec +1 -1
  105. data/decidim-meetings/lib/decidim/meetings/feature.rb +35 -39
  106. data/decidim-meetings/spec/features/explore_meetings_spec.rb +1 -1
  107. data/decidim-meetings/spec/forms/meeting_form_spec.rb +6 -0
  108. data/decidim-meetings/spec/shared/manage_meetings_examples.rb +1 -1
  109. data/decidim-pages/lib/decidim/pages/feature.rb +14 -18
  110. data/decidim-pages/spec/features/comments_spec.rb +1 -1
  111. data/decidim-proposals/app/forms/decidim/proposals/admin/proposal_form.rb +6 -0
  112. data/decidim-proposals/app/forms/decidim/proposals/proposal_form.rb +6 -0
  113. data/decidim-proposals/app/models/decidim/proposals/proposal.rb +9 -1
  114. data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +1 -1
  115. data/decidim-proposals/app/views/decidim/proposals/proposals/_tags.html.erb +2 -2
  116. data/decidim-proposals/decidim-proposals.gemspec +1 -0
  117. data/decidim-proposals/lib/decidim/proposals/feature.rb +59 -65
  118. data/decidim-proposals/lib/decidim/proposals/proposal_serializer.rb +1 -15
  119. data/decidim-proposals/spec/controllers/decidim/admin/proposal_answers_controller_spec.rb +2 -4
  120. data/decidim-proposals/spec/controllers/decidim/proposal_votes_controller_spec.rb +2 -4
  121. data/decidim-proposals/spec/controllers/decidim/proposals_controller_spec.rb +2 -4
  122. data/decidim-proposals/spec/features/comments_spec.rb +1 -1
  123. data/decidim-proposals/spec/features/report_proposal_spec.rb +1 -1
  124. data/decidim-proposals/spec/models/decidim/proposals/proposal_spec.rb +18 -0
  125. data/decidim-proposals/spec/shared/manage_proposals_examples.rb +1 -1
  126. data/decidim-proposals/spec/shared/proposal_form_examples.rb +6 -0
  127. data/decidim-results/app/controllers/decidim/results/result_widgets_controller.rb +0 -2
  128. data/decidim-results/app/forms/decidim/results/admin/result_form.rb +4 -0
  129. data/decidim-results/app/views/decidim/results/admin/results/index.html.erb +1 -1
  130. data/decidim-results/app/views/decidim/results/results/_tags.html.erb +2 -2
  131. data/decidim-results/decidim-results.gemspec +2 -1
  132. data/decidim-results/lib/decidim/results/feature.rb +18 -22
  133. data/decidim-results/spec/controllers/results_controller_spec.rb +2 -0
  134. data/decidim-results/spec/features/comments_spec.rb +1 -1
  135. data/decidim-results/spec/features/explore_results_spec.rb +1 -1
  136. data/decidim-results/spec/forms/result_form_spec.rb +6 -0
  137. data/decidim-results/spec/shared/manage_results_examples.rb +1 -1
  138. data/decidim-surveys/decidim-surveys.gemspec +1 -0
  139. data/decidim-surveys/lib/decidim/surveys/feature.rb +23 -27
  140. data/decidim-system/db/seeds.rb +1 -2
  141. data/decidim-system/spec/commands/decidim/system/create_default_pages_spec.rb +1 -1
  142. data/docs/features_and_components.md +6 -6
  143. data/docs/getting_started.md +1 -1
  144. data/docs/how_to_create_a_plugin.md +2 -2
  145. data/docs/social_providers.md +2 -2
  146. data/lib/generators/decidim/app_generator.rb +0 -6
  147. data/lib/generators/decidim/docker_generator.rb +1 -1
  148. data/lib/generators/decidim/install_generator.rb +5 -5
  149. data/lib/generators/decidim/templates/README.md.erb +1 -1
  150. data/lib/generators/decidim/templates/database.yml.erb +1 -1
  151. data/lib/generators/decidim/templates/initializer.rb +4 -1
  152. data/package-lock.json +46 -134
  153. data/package.json +9 -9
  154. metadata +31 -30
  155. data/decidim-dev/lib/decidim/dev/test/rspec_support/engine_routes.rb +0 -35
  156. data/decidim-dev/lib/generators/decidim/templates/decidim_dev.rb +0 -3
@@ -85,7 +85,7 @@ describe "Explore results", type: :feature do
85
85
  end
86
86
 
87
87
  context "show" do
88
- let(:path) { decidim_results.result_path(id: result.id, participatory_process_id: participatory_process.id, feature_id: feature.id) }
88
+ let(:path) { resource_locator(result).path }
89
89
  let(:results_count) { 1 }
90
90
  let(:result) { results.first }
91
91
 
@@ -61,6 +61,12 @@ describe Decidim::Results::Admin::ResultForm do
61
61
  it { is_expected.not_to be_valid }
62
62
  end
63
63
 
64
+ it "properly maps category id from model" do
65
+ result = create(:result, feature: current_feature, category: category)
66
+
67
+ expect(described_class.from_model(result).decidim_category_id).to eq(category_id)
68
+ end
69
+
64
70
  context "with proposals" do
65
71
  let(:proposals_feature) { create :feature, manifest_name: :proposals, participatory_process: participatory_process }
66
72
  let!(:proposal) { create :proposal, feature: proposals_feature }
@@ -35,7 +35,7 @@ RSpec.shared_examples "manage results" do
35
35
  end
36
36
 
37
37
  within_window @new_window do
38
- expect(current_path).to eq decidim_results.result_path(id: result.id, participatory_process_id: participatory_process.id, feature_id: current_feature.id)
38
+ expect(current_path).to eq resource_locator(result).path
39
39
  expect(page).to have_content(translated(result.title))
40
40
  end
41
41
  end
@@ -19,4 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.add_dependency "jquery-tmpl-rails", "~> 1.1.0"
20
20
 
21
21
  s.add_development_dependency "decidim-dev", Decidim.version
22
+ s.add_development_dependency "decidim-admin", Decidim.version
22
23
  end
@@ -67,35 +67,31 @@ Decidim.register_feature(:surveys) do |feature|
67
67
  exports.serializer Decidim::Surveys::SurveyUserAnswersSerializer
68
68
  end
69
69
 
70
- feature.seeds do
71
- Decidim::ParticipatoryProcess.find_each do |process|
72
- next unless process.steps.any?
73
-
74
- feature = Decidim::Feature.create!(
75
- name: Decidim::Features::Namer.new(process.organization.available_locales, :surveys).i18n_name,
76
- manifest_name: :surveys,
77
- published_at: Time.current,
78
- participatory_process: process
79
- )
70
+ feature.seeds do |process|
71
+ feature = Decidim::Feature.create!(
72
+ name: Decidim::Features::Namer.new(process.organization.available_locales, :surveys).i18n_name,
73
+ manifest_name: :surveys,
74
+ published_at: Time.current,
75
+ participatory_process: process
76
+ )
77
+
78
+ survey = Decidim::Surveys::Survey.create!(
79
+ feature: feature,
80
+ title: Decidim::Faker::Localized.paragraph,
81
+ description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
82
+ Decidim::Faker::Localized.paragraph(3)
83
+ end,
84
+ tos: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
85
+ Decidim::Faker::Localized.paragraph(2)
86
+ end
87
+ )
80
88
 
81
- survey = Decidim::Surveys::Survey.create!(
82
- feature: feature,
83
- title: Decidim::Faker::Localized.paragraph,
84
- description: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
85
- Decidim::Faker::Localized.paragraph(3)
86
- end,
87
- tos: Decidim::Faker::Localized.wrapped("<p>", "</p>") do
88
- Decidim::Faker::Localized.paragraph(2)
89
- end
89
+ 3.times do
90
+ Decidim::Surveys::SurveyQuestion.create!(
91
+ survey: survey,
92
+ body: Decidim::Faker::Localized.paragraph,
93
+ question_type: "short_answer"
90
94
  )
91
-
92
- 3.times do
93
- Decidim::Surveys::SurveyQuestion.create!(
94
- survey: survey,
95
- body: Decidim::Faker::Localized.paragraph,
96
- question_type: "short_answer"
97
- )
98
- end
99
95
  end
100
96
  end
101
97
  end
@@ -1,8 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  if !Rails.env.production? || ENV["SEED"]
4
- Decidim::System::Admin.create!(
5
- email: "system@example.org",
4
+ Decidim::System::Admin.find_or_initialize_by(email: "system@example.org").update!(
6
5
  password: "decidim123456",
7
6
  password_confirmation: "decidim123456"
8
7
  )
@@ -15,7 +15,7 @@ module Decidim
15
15
  end
16
16
 
17
17
  it "sets the content with each locale" do
18
- I18n.available_locales = [:en, :ca]
18
+ allow(Decidim).to receive(:available_locales).and_return [:en, :ca]
19
19
 
20
20
  subject
21
21
 
@@ -18,17 +18,17 @@ There's a DSL available to describe all this:
18
18
  # :my_feature is the unique name of the feature that will be globally registered.
19
19
  Decidim.register_feature(:my_feature) do |feature|
20
20
  # The user will be redirected to the feature's engine when accessing it through
21
- # the public page of a participatory process. A feature's engine is isolated
22
- # from the outside so it can deal with its own dependencies without having to
21
+ # the public page of a participatory process. A feature's engine is isolated
22
+ # from the outside so it can deal with its own dependencies without having to
23
23
  # know its render path or its parent resources.
24
24
  feature.engine = MyFeature::Engine
25
25
 
26
26
  # A component's admin engine will get rendered on the admin panel and follows
27
- # the same principles as the engine. It's isolated from the outside and
27
+ # the same principles as the engine. It's isolated from the outside and
28
28
  # doesn't care about external dependencies. It only needs to care about its
29
29
  # underlying `feature`.
30
30
  feature.admin_engine = MyFeature::AdminEngine
31
-
31
+
32
32
  # Feature hooks get called whenever relevant lifecycle events happen, like
33
33
  # adding a new feature o destroying it. You always get passed the instance
34
34
  # so you can act on it. Creating or destroying a comoponent is transactional
@@ -41,7 +41,7 @@ Decidim.register_feature(:my_feature) do |feature|
41
41
  end
42
42
 
43
43
  # Export definitions allow features to declare any number of exportable files.
44
- #
44
+ #
45
45
  # An export definition needs a unique name, a collection, and a Serializer. If
46
46
  # no serializer is provided, a default, naive one will be used.
47
47
  #
@@ -57,4 +57,4 @@ Decidim.register_feature(:my_feature) do |feature|
57
57
  end
58
58
  ```
59
59
 
60
- Every model in a feature doesn't have to (and should not) know about its parent participatory process, but instead should be scoped to the features.
60
+ Every model in a feature doesn't have to (and should not) know about its parent participatory process, but instead should be scoped to the features.
@@ -142,4 +142,4 @@ $ bin/rails decidim:check_locales
142
142
  ```
143
143
 
144
144
  Be aware that this task might not be able to detect everything, so make sure you
145
- also manually check your application before uprading.
145
+ also manually check your application before upgrading.
@@ -125,8 +125,8 @@
125
125
  # Register some stat number to the application
126
126
  end
127
127
 
128
- feature.seeds do
129
- # Add some seeds for this feature
128
+ feature.seeds do |process|
129
+ # Define seeds for a specific participatory process
130
130
  end
131
131
  end
132
132
  ```
@@ -19,7 +19,7 @@ If you want to enable sign up through social providers like Facebook you will ne
19
19
  1. Navigate to [Twitter Developers Page](https://dev.twitter.com/)
20
20
  2. Follow the "My apps" link.
21
21
  3. Click the "Create New App" button.
22
- 4. Fill in the `Name`, `Description` fields.
22
+ 4. Fill in the `Name`, `Description` fields.
23
23
  5. Fill in the `Website` and `Callback URL` fields with the same value. If you are working on a development app you need to use `http://127.0.0.1:3000/` instead of `http://localhost:3000/`.
24
24
  5. Check the 'Developer Agreement' checkbox and click the 'Create your Twitter application' button.
25
25
  6. Navigate to the "Keys and Access Tokens" tab and copy the API_KEY and API_SECRET.
@@ -38,4 +38,4 @@ If you want to enable sign up through social providers like Facebook you will ne
38
38
  8. Click on `Credentials` tab and click on "Create credentials" button. Select `OAuth client ID`.
39
39
  9. Select `Web applications`. Fill in the `Authorized Javascript origins` with your url. Then fill in the `Authorized redirect URIs` with your url and append the path `/users/auth/google_oauth2/callback`.
40
40
  10. Copy the CLIENT_ID AND CLIENT_SECRET
41
- 11. Paste credentials in `config/secrets.yml`. Ensure the `enabled` attribute is `true`.
41
+ 11. Paste credentials in `config/secrets.yml`. Ensure the `enabled` attribute is `true`.
@@ -90,12 +90,6 @@ module Decidim
90
90
  end
91
91
  end
92
92
 
93
- def set_locales
94
- inject_into_file "config/application.rb", after: "class Application < Rails::Application" do
95
- "\n config.i18n.available_locales = Decidim.available_locales\n config.i18n.default_locale = Decidim.default_locale"
96
- end
97
- end
98
-
99
93
  def remove_default_error_pages
100
94
  remove_file "public/404.html"
101
95
  remove_file "public/500.html"
@@ -38,7 +38,7 @@ module Decidim
38
38
 
39
39
  run "rails generate decidim:demo"
40
40
  run "docker-compose build"
41
- run "docker-compose run --rm app rake db:drop db:create db:migrate db:setup"
41
+ run "docker-compose run --rm app rails db:drop db:create db:migrate db:setup"
42
42
  end
43
43
  end
44
44
 
@@ -24,7 +24,7 @@ module Decidim
24
24
  end
25
25
 
26
26
  def copy_migrations
27
- rake "railties:install:migrations"
27
+ rails_command "railties:install:migrations"
28
28
  recreate_db if options[:recreate_db]
29
29
  end
30
30
 
@@ -111,10 +111,10 @@ module Decidim
111
111
  private
112
112
 
113
113
  def recreate_db
114
- rake "db:environment:set db:drop" unless ENV["CI"]
115
- rake "db:create"
116
- rake "db:migrate"
117
- rake "db:test:prepare"
114
+ rails_command "db:environment:set db:drop" unless ENV["CI"]
115
+ rails_command "db:create"
116
+ rails_command "db:migrate"
117
+ rails_command "db:test:prepare"
118
118
  end
119
119
 
120
120
  def scss_variables
@@ -13,7 +13,7 @@ An opinionated guide to deploy this app to Heroku can be found at [https://githu
13
13
  You will need to do some steps before having the app working properly once you've deployed it:
14
14
 
15
15
  1. Open a Rails console in the server: `bundle exec rails console`
16
- 2. Create a System Admin user:
16
+ 2. Create a System Admin user:
17
17
  ```ruby
18
18
  user = Decidim::System::Admin.new(email: <email>, password: <password>, password_confirmation: <password>)
19
19
  user.save!
@@ -23,7 +23,7 @@ default: &default
23
23
  host: <%%= ENV.fetch("DATABASE_HOST") { "localhost" } %>
24
24
  username: <%%= ENV.fetch("DATABASE_USERNAME") { "" } %>
25
25
  password: <%%= ENV.fetch("DATABASE_PASSWORD") { "" } %>
26
-
26
+
27
27
  development:
28
28
  <<: *default
29
29
  database: <%%= ENV.fetch("DATABASE_NAME") { "<%= app_name %>_development" } %>
@@ -7,7 +7,7 @@ Decidim.configure do |config|
7
7
  config.authorization_handlers = [ExampleAuthorizationHandler]
8
8
 
9
9
  # Uncomment this lines to set your preferred locales
10
- # config.available_locales = %i{en ca es}
10
+ # config.available_locales = [:en, :ca, :es]
11
11
 
12
12
  # Geocoder configuration
13
13
  # config.geocoder = {
@@ -28,3 +28,6 @@ Decidim.configure do |config|
28
28
  # The number of reports which an object can receive before hiding it
29
29
  # config.max_reports_before_hiding = 3
30
30
  end
31
+
32
+ Rails.application.config.i18n.available_locales = Decidim.available_locales
33
+ Rails.application.config.i18n.default_locale = Decidim.default_locale
data/package-lock.json CHANGED
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "name": "decidim",
3
+ "version": "0.4.4",
3
4
  "lockfileVersion": 1,
4
5
  "dependencies": {
5
6
  "@types/async": {
@@ -81,15 +82,15 @@
81
82
  "optional": true
82
83
  },
83
84
  "@types/jest": {
84
- "version": "20.0.4",
85
- "resolved": "https://registry.npmjs.org/@types/jest/-/jest-20.0.4.tgz",
86
- "integrity": "sha512-peWdNw8LgPMFTvTOX+VZN0R45HXnVObxdd/CkhHjXZwrjfIn/B6utU6jLwYTYf+AwWIprxzrKLEDKzSEgl09Rw==",
85
+ "version": "20.0.5",
86
+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-20.0.5.tgz",
87
+ "integrity": "sha512-/cqO0q7Eq+lzmnE/7dHParw2kYQj0uCvcKAdk/aF5Z2VZpxNSKS+FhKcCkgr/3IhEpl9BN32Hmd6gEI7VwdEsg==",
87
88
  "dev": true
88
89
  },
89
90
  "@types/jquery": {
90
- "version": "3.2.9",
91
- "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.2.9.tgz",
92
- "integrity": "sha512-AmYGadmTv+Xh6re2CH5ruyvV3znvtJbhxyT00JQAGFP2U+xgqhf+C2xfjdP/GgK5d9YmSif/UYs2ssMl4gW6fw==",
91
+ "version": "3.2.10",
92
+ "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.2.10.tgz",
93
+ "integrity": "sha512-VtD/+VgsQMY+rmibce1HhXeF47eFkbv/D+7BmQdl8yu0Wo2LW1yV69cAPKhFHdW2kmTi9W8nl2GNBz2WQoGFag==",
93
94
  "dev": true
94
95
  },
95
96
  "@types/node": {
@@ -99,9 +100,9 @@
99
100
  "dev": true
100
101
  },
101
102
  "@types/react": {
102
- "version": "15.0.38",
103
- "resolved": "https://registry.npmjs.org/@types/react/-/react-15.0.38.tgz",
104
- "integrity": "sha512-CkRB27L/kMDu7K20U0V7BwYK9/kPd9Im6Jlxv2vAEolYBvQy6JrSpPJsbZXtOk4MoDUomkct8Q7PNBUSLd0fmg==",
103
+ "version": "16.0.0",
104
+ "resolved": "https://registry.npmjs.org/@types/react/-/react-16.0.0.tgz",
105
+ "integrity": "sha512-lmu8zYXNhkZrIAgFgJK2/tGNXfdL//tKbtDEeph+doEAsBm+C2vnD+mAkR17bumu9K8ivYufySkkX4vrq9L8Sw==",
105
106
  "dev": true
106
107
  },
107
108
  "@types/react-dom": {
@@ -116,12 +117,6 @@
116
117
  "integrity": "sha512-Vd+WmnrQKrrfVJ+9LWyOWqlBQJFsfi8rhKRm3ag3ZrOjY5SmzZkGmxbkgRIk9jpZt4dpvE21cmbBSp1dCV7/fw==",
117
118
  "dev": true
118
119
  },
119
- "@types/zen-observable": {
120
- "version": "0.5.1",
121
- "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.5.1.tgz",
122
- "integrity": "sha1-wOq5QrTVKTTzlt4M2OLmP8kqMwc=",
123
- "optional": true
124
- },
125
120
  "abab": {
126
121
  "version": "1.0.3",
127
122
  "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.3.tgz",
@@ -288,24 +283,14 @@
288
283
  }
289
284
  },
290
285
  "apollo-client": {
291
- "version": "1.9.0-1",
292
- "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-1.9.0-1.tgz",
293
- "integrity": "sha512-8uf5wO+cTdMnKAvIkPev2+3h7Hn41d9uW8Heyza1jVy4HCzLxgNhd+ZMLc+Q9OUc7R+NyZhwcINJSQgpco3Auw=="
286
+ "version": "1.8.1",
287
+ "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-1.8.1.tgz",
288
+ "integrity": "sha512-rOvN+5Ei4CnPCH3XBlvY7ZkJOgXcWLglovIGWcDiyyVFWhaHTKTboluKcGrjqVznfnBXdaaApRUccJbePwJHEw=="
294
289
  },
295
290
  "apollo-codegen": {
296
- "version": "0.15.2",
297
- "resolved": "https://registry.npmjs.org/apollo-codegen/-/apollo-codegen-0.15.2.tgz",
298
- "integrity": "sha1-4kRKdyxm2Lu1tyqQ1vQ3GcfauFM="
299
- },
300
- "apollo-fetch": {
301
- "version": "0.3.0",
302
- "resolved": "https://registry.npmjs.org/apollo-fetch/-/apollo-fetch-0.3.0.tgz",
303
- "integrity": "sha512-ttmz1aT0zYlyGPnEl8v1GQmUV2sAvfK/wQU7XOpqHhNcW/rYWOn5CLqVLqMHJJqZfCGsCA9pB4ypgaPbm727Ig=="
304
- },
305
- "apollo-link": {
306
- "version": "0.0.3",
307
- "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-0.0.3.tgz",
308
- "integrity": "sha1-mwLbje95JojhT4vosw9xb3eJrLk="
291
+ "version": "0.16.2",
292
+ "resolved": "https://registry.npmjs.org/apollo-codegen/-/apollo-codegen-0.16.2.tgz",
293
+ "integrity": "sha512-2xQ/D4MYfgFd93csYfu8FfxavYTCxCvwp16kgRrk7hYg+SyTnbvR8dt6XtQ4HrgparOiWrUDxYHUvx2Wu1Hrsg=="
309
294
  },
310
295
  "app-root-path": {
311
296
  "version": "2.0.1",
@@ -451,9 +436,9 @@
451
436
  "dev": true
452
437
  },
453
438
  "awesome-typescript-loader": {
454
- "version": "3.2.1",
455
- "resolved": "https://registry.npmjs.org/awesome-typescript-loader/-/awesome-typescript-loader-3.2.1.tgz",
456
- "integrity": "sha512-/4abhqe5+wX/hQrquLT95o3QkaUCkzOfC6XQZcbk5sxI5V4rxcA3az7DQRHoHL2EWn7mnP3orzNfkjZAA/TVzA==",
439
+ "version": "3.2.2",
440
+ "resolved": "https://registry.npmjs.org/awesome-typescript-loader/-/awesome-typescript-loader-3.2.2.tgz",
441
+ "integrity": "sha512-8F8rFsOIT4HQDKXt+5Dz66qhiC2pOAbfhsbOj3DeW0LATxxBPQPx0vxCxmecfEroTyKDYBiBMod2cXrChcQa4w==",
457
442
  "dev": true
458
443
  },
459
444
  "aws-sign2": {
@@ -3440,9 +3425,9 @@
3440
3425
  "dev": true
3441
3426
  },
3442
3427
  "hoist-non-react-statics": {
3443
- "version": "2.2.0",
3444
- "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.2.0.tgz",
3445
- "integrity": "sha1-sJnKgvNkCxJEMJyKUmor1grZ19k="
3428
+ "version": "2.2.1",
3429
+ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.2.1.tgz",
3430
+ "integrity": "sha1-p+QcdgEh0Kv8eiM5szHSmiY4nlI="
3446
3431
  },
3447
3432
  "home-or-tmp": {
3448
3433
  "version": "2.0.0",
@@ -5502,9 +5487,9 @@
5502
5487
  "integrity": "sha1-Z/jVo9PYrHzPpFJWWoMQBlF450g="
5503
5488
  },
5504
5489
  "react-apollo": {
5505
- "version": "1.4.8",
5506
- "resolved": "https://registry.npmjs.org/react-apollo/-/react-apollo-1.4.8.tgz",
5507
- "integrity": "sha512-WolzbKOK11BBckiLcPkAP8bMVyDIV1r+KlAKwW2ivU+3C49uBl/up0jqns6munqCy6EdqpHxOEj/g6ssW3zP3Q=="
5490
+ "version": "1.4.10",
5491
+ "resolved": "https://registry.npmjs.org/react-apollo/-/react-apollo-1.4.10.tgz",
5492
+ "integrity": "sha512-vkAvPrA92lVB/q9a0jA4gJAPQ8xy6WrjtAFBNjn7NlWiIl/Wtk7djE0r2o5C+eLRu8Es+ECMcreI9sy+iWjpeQ=="
5508
5493
  },
5509
5494
  "react-dom": {
5510
5495
  "version": "15.6.1",
@@ -6407,10 +6392,18 @@
6407
6392
  "dev": true
6408
6393
  },
6409
6394
  "tslint-react": {
6410
- "version": "3.0.0",
6411
- "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.0.0.tgz",
6412
- "integrity": "sha1-AMSKt/IukVM7Yr3vLBYrSUR68Ao=",
6413
- "dev": true
6395
+ "version": "3.2.0",
6396
+ "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-3.2.0.tgz",
6397
+ "integrity": "sha1-hR+1BSAcY9A0PFFybmNk9+mtLpk=",
6398
+ "dev": true,
6399
+ "dependencies": {
6400
+ "tsutils": {
6401
+ "version": "2.8.0",
6402
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.8.0.tgz",
6403
+ "integrity": "sha1-AWAXNymzvxOGKN0UoVN+AIUdgUo=",
6404
+ "dev": true
6405
+ }
6406
+ }
6414
6407
  },
6415
6408
  "tsutils": {
6416
6409
  "version": "2.7.1",
@@ -6682,9 +6675,9 @@
6682
6675
  "dev": true
6683
6676
  },
6684
6677
  "webpack": {
6685
- "version": "3.3.0",
6686
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.3.0.tgz",
6687
- "integrity": "sha1-zi+eB2Vmq6kfdIhxM6iD/X2hh7w=",
6678
+ "version": "3.4.1",
6679
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.4.1.tgz",
6680
+ "integrity": "sha1-TD9PP7MYFVpNsMtqNv8FxWl0GPQ=",
6688
6681
  "dev": true,
6689
6682
  "dependencies": {
6690
6683
  "ajv-keywords": {
@@ -6693,94 +6686,16 @@
6693
6686
  "integrity": "sha1-opbhf3v658HOT34N5T0pyzIWLfA=",
6694
6687
  "dev": true
6695
6688
  },
6696
- "camelcase": {
6697
- "version": "3.0.0",
6698
- "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
6699
- "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=",
6700
- "dev": true
6701
- },
6702
- "find-up": {
6703
- "version": "1.1.2",
6704
- "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
6705
- "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
6706
- "dev": true
6707
- },
6708
- "has-flag": {
6709
- "version": "1.0.0",
6710
- "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
6711
- "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
6712
- "dev": true
6713
- },
6714
- "load-json-file": {
6715
- "version": "1.1.0",
6716
- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
6717
- "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
6718
- "dev": true
6719
- },
6720
- "os-locale": {
6721
- "version": "1.4.0",
6722
- "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
6723
- "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
6724
- "dev": true
6725
- },
6726
- "path-exists": {
6727
- "version": "2.1.0",
6728
- "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
6729
- "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
6730
- "dev": true
6731
- },
6732
- "path-type": {
6733
- "version": "1.1.0",
6734
- "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
6735
- "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
6736
- "dev": true
6737
- },
6738
- "read-pkg": {
6739
- "version": "1.1.0",
6740
- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
6741
- "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
6742
- "dev": true
6743
- },
6744
- "read-pkg-up": {
6745
- "version": "1.0.1",
6746
- "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
6747
- "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
6748
- "dev": true
6749
- },
6750
- "string-width": {
6751
- "version": "1.0.2",
6752
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
6753
- "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
6754
- "dev": true
6755
- },
6756
- "strip-bom": {
6757
- "version": "2.0.0",
6758
- "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
6759
- "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
6689
+ "enhanced-resolve": {
6690
+ "version": "3.4.1",
6691
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-3.4.1.tgz",
6692
+ "integrity": "sha1-BCHjOf1xQZs9oT0Smzl5BAIwR24=",
6760
6693
  "dev": true
6761
6694
  },
6762
6695
  "supports-color": {
6763
- "version": "3.2.3",
6764
- "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz",
6765
- "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=",
6766
- "dev": true
6767
- },
6768
- "which-module": {
6769
- "version": "1.0.0",
6770
- "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
6771
- "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=",
6772
- "dev": true
6773
- },
6774
- "yargs": {
6775
- "version": "6.6.0",
6776
- "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz",
6777
- "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=",
6778
- "dev": true
6779
- },
6780
- "yargs-parser": {
6781
6696
  "version": "4.2.1",
6782
- "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz",
6783
- "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=",
6697
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.2.1.tgz",
6698
+ "integrity": "sha512-qxzYsob3yv6U+xMzPrv170y8AwGP7i74g+pbixCfD6rgso8BscLT2qXIuz6TpOaiJZ3mFgT5O9lyT9nMU4LfaA==",
6784
6699
  "dev": true
6785
6700
  }
6786
6701
  }
@@ -6957,9 +6872,6 @@
6957
6872
  "version": "7.0.0",
6958
6873
  "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-7.0.0.tgz",
6959
6874
  "integrity": "sha1-jQrELxbqVd69MyyvTEA4s+P139k="
6960
- },
6961
- "zen-observable": {
6962
- "version": "git+https://github.com/evanshauser/zen-observable.git#a11ee4bd848f381898b6cd93c769eb1dcc0febf6"
6963
6875
  }
6964
6876
  }
6965
6877
  }