decidim 0.0.8.1 → 0.1.0
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.
- checksums.yaml +4 -4
- data/.circleci/config.yml +21 -21
- data/.codeclimate.yml +10 -6
- data/.eslintignore +1 -0
- data/.gitignore +1 -1
- data/.rubocop.yml +38 -20
- data/.travis.yml +0 -1
- data/Gemfile +6 -9
- data/Gemfile.lock +165 -205
- data/Rakefile +1 -1
- data/codecov.yml +5 -71
- data/crowdin.yaml +1 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_decidim.scss +9 -2
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_action-icon.scss +7 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_cards.scss +6 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_editor.scss +1 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/{_sidebar.scss → extra/_sidebar.scss} +0 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_action-icon.scss +23 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_cards.scss +0 -7
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_icons.scss +4 -2
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_modules.scss +0 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/{modules/_datepicker.scss → plugins/_foundation-datepicker.scss} +1 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/_constants.scss +5 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/_math.scss +45 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_acos.scss +12 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_asin.scss +12 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss +28 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan2.scss +37 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cos.scss +13 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cot.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_csc.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_exp.scss +12 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_fact.scss +18 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss +21 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_ldexp.scss +17 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_log.scss +34 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss +28 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sec.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sin.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss +16 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_tan.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_deg-to-rad.scss +4 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_rad-to-deg.scss +4 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_strip-unit.scss +8 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_unitless-rad.scss +13 -0
- data/decidim-admin/app/commands/decidim/admin/create_participatory_process.rb +23 -17
- data/decidim-admin/app/commands/decidim/admin/create_participatory_process_group.rb +1 -1
- data/decidim-admin/app/controllers/decidim/admin/moderations_controller.rb +4 -4
- data/decidim-admin/app/controllers/decidim/admin/participatory_processes_controller.rb +1 -1
- data/decidim-admin/app/forms/decidim/admin/organization_form.rb +6 -2
- data/decidim-admin/app/forms/decidim/admin/participatory_process_form.rb +5 -0
- data/decidim-admin/app/helpers/decidim/admin/application_helper.rb +1 -1
- data/decidim-admin/app/helpers/decidim/admin/attributes_display_helper.rb +1 -1
- data/decidim-admin/app/views/decidim/admin/features/_feature.html.erb +5 -1
- data/decidim-admin/app/views/decidim/admin/moderations/_report.html.erb +11 -0
- data/decidim-admin/app/views/decidim/admin/moderations/index.html.erb +22 -24
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_process.html.erb +3 -0
- data/decidim-admin/config/i18n-tasks.yml +1 -0
- data/decidim-admin/config/locales/ca.yml +7 -3
- data/decidim-admin/config/locales/en.yml +6 -2
- data/decidim-admin/config/locales/es.yml +7 -3
- data/decidim-admin/config/locales/eu.yml +4 -3
- data/decidim-admin/config/locales/fi.yml +4 -3
- data/decidim-admin/config/locales/fr.yml +389 -2
- data/decidim-admin/config/locales/nl.yml +4 -1
- data/decidim-admin/decidim-admin.gemspec +3 -3
- data/decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb +2 -2
- data/decidim-admin/spec/commands/activate_participatory_process_step_spec.rb +1 -0
- data/decidim-admin/spec/commands/create_category_spec.rb +1 -1
- data/decidim-admin/spec/commands/create_feature_spec.rb +7 -5
- data/decidim-admin/spec/commands/create_participatory_process_admin_spec.rb +2 -1
- data/decidim-admin/spec/commands/create_participatory_process_spec.rb +14 -6
- data/decidim-admin/spec/commands/create_scope_spec.rb +3 -2
- data/decidim-admin/spec/commands/deactivate_participatory_process_step_spec.rb +1 -0
- data/decidim-admin/spec/commands/destroy_feature_spec.rb +1 -0
- data/decidim-admin/spec/commands/destroy_participatory_process_step_spec.rb +1 -0
- data/decidim-admin/spec/commands/publish_participatory_process_spec.rb +1 -0
- data/decidim-admin/spec/commands/reorder_participatory_process_steps_spec.rb +1 -0
- data/decidim-admin/spec/commands/unpublish_participatory_process_spec.rb +1 -0
- data/decidim-admin/spec/commands/update_feature_spec.rb +7 -5
- data/decidim-admin/spec/commands/update_participatory_process_spec.rb +5 -5
- data/decidim-admin/spec/commands/update_scope_spec.rb +3 -2
- data/decidim-admin/spec/factories.rb +1 -0
- data/decidim-admin/spec/features/admin_invite_spec.rb +5 -5
- data/decidim-admin/spec/features/admin_manages_newsletters_spec.rb +5 -5
- data/decidim-admin/spec/features/admin_manages_organization_admins_spec.rb +2 -2
- data/decidim-admin/spec/features/admin_manages_organization_scopes_spec.rb +3 -3
- data/decidim-admin/spec/features/admin_manages_organization_spec.rb +7 -11
- data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +2 -2
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +3 -3
- data/decidim-admin/spec/features/static_pages_spec.rb +8 -7
- data/decidim-admin/spec/forms/newsletter_form_spec.rb +2 -2
- data/decidim-admin/spec/forms/organization_form_spec.rb +3 -3
- data/decidim-admin/spec/forms/participatory_process_form_spec.rb +4 -4
- data/decidim-admin/spec/forms/participatory_process_step_form_spec.rb +1 -1
- data/decidim-admin/spec/forms/participatory_process_user_role_form_spec.rb +1 -1
- data/decidim-admin/spec/forms/scope_form_spec.rb +1 -1
- data/decidim-admin/spec/helpers/aria_selected_link_to_helper_spec.rb +1 -0
- data/decidim-admin/spec/helpers/feature_settings_helper_spec.rb +1 -0
- data/decidim-admin/spec/jobs/newsletter_delivery_job_spec.rb +2 -2
- data/decidim-admin/spec/queries/process_admins_spec.rb +1 -1
- data/decidim-admin/spec/shared/manage_process_admins_examples.rb +2 -2
- data/decidim-admin/spec/shared/manage_process_categories_examples.rb +3 -3
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +5 -5
- data/decidim-admin/spec/shared/manage_processes_examples.rb +4 -4
- data/decidim-admin/spec/shared/participatory_admin_shared_context.rb +1 -0
- data/decidim-admin/spec/spec_helper.rb +1 -0
- data/decidim-admin/spec/views/decidim/static_pages/_form.html.erb_spec.rb +1 -0
- data/decidim-api/app/controllers/decidim/api/application_controller.rb +1 -1
- data/decidim-api/decidim-api.gemspec +1 -1
- data/decidim-api/spec/factories.rb +1 -0
- data/decidim-api/spec/spec_helper.rb +1 -0
- data/decidim-budgets/app/queries/decidim/budgets/filtered_projects.rb +36 -0
- data/decidim-budgets/config/locales/ca.yml +1 -0
- data/decidim-budgets/config/locales/en.yml +1 -0
- data/decidim-budgets/config/locales/es.yml +1 -0
- data/decidim-budgets/config/locales/fr.yml +35 -3
- data/decidim-budgets/decidim-budgets.gemspec +2 -2
- data/decidim-budgets/lib/decidim/budgets/feature.rb +9 -0
- data/decidim-budgets/spec/commands/add_line_item_spec.rb +6 -9
- data/decidim-budgets/spec/commands/cancel_order_spec.rb +3 -1
- data/decidim-budgets/spec/commands/checkout_spec.rb +3 -1
- data/decidim-budgets/spec/commands/create_project_spec.rb +4 -3
- data/decidim-budgets/spec/commands/remove_line_item_spec.rb +2 -1
- data/decidim-budgets/spec/commands/update_project_spec.rb +4 -3
- data/decidim-budgets/spec/factories.rb +1 -0
- data/decidim-budgets/spec/features/orders_spec.rb +24 -24
- data/decidim-budgets/spec/forms/project_form_spec.rb +1 -0
- data/decidim-budgets/spec/models/project_spec.rb +1 -1
- data/decidim-budgets/spec/queries/decidim/budgets/filtered_projects_spec.rb +21 -0
- data/decidim-budgets/spec/services/project_search_spec.rb +4 -3
- data/decidim-budgets/spec/shared/admin_shared_context.rb +1 -0
- data/decidim-budgets/spec/shared/manage_attachments_examples.rb +1 -0
- data/decidim-budgets/spec/spec_helper.rb +1 -0
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/commands/decidim/comments/create_comment.rb +8 -2
- data/decidim-comments/app/frontend/application/application.component.tsx +3 -3
- data/decidim-comments/app/frontend/application/icon.component.tsx +1 -1
- data/decidim-comments/app/frontend/comments/add_comment_form.component.tsx +7 -7
- data/decidim-comments/app/frontend/comments/comment.component.test.tsx +7 -7
- data/decidim-comments/app/frontend/comments/comment.component.tsx +6 -6
- data/decidim-comments/app/frontend/comments/comment_thread.component.tsx +2 -2
- data/decidim-comments/app/frontend/comments/comments.component.test.tsx +5 -5
- data/decidim-comments/app/frontend/comments/comments.component.tsx +6 -6
- data/decidim-comments/app/frontend/comments/down_vote_button.component.test.tsx +4 -4
- data/decidim-comments/app/frontend/comments/down_vote_button.component.tsx +3 -3
- data/decidim-comments/app/frontend/comments/up_vote_button.component.test.tsx +4 -4
- data/decidim-comments/app/frontend/comments/up_vote_button.component.tsx +3 -3
- data/decidim-comments/app/frontend/comments/vote_button.component.tsx +1 -1
- data/decidim-comments/app/frontend/comments/vote_button_component.test.tsx +2 -2
- data/decidim-comments/app/frontend/entry.ts +2 -2
- data/decidim-comments/app/frontend/support/generate_comments_data.ts +2 -2
- data/decidim-comments/app/frontend/support/load_translations.ts +2 -2
- data/decidim-comments/app/frontend/support/resolve_graphql_query.ts +1 -1
- data/decidim-comments/app/mailers/decidim/comments/comment_notification_mailer.rb +1 -1
- data/decidim-comments/app/models/decidim/comments/comment.rb +3 -8
- data/decidim-comments/app/models/decidim/comments/seed.rb +1 -0
- data/decidim-comments/config/locales/fr.yml +62 -1
- data/decidim-comments/db/migrate/20170504085413_add_root_commentable_to_comments.rb +7 -0
- data/decidim-comments/db/migrate/20170510091348_update_root_commentable_for_comments.rb +22 -0
- data/decidim-comments/db/migrate/20170510091409_set_root_commentable_null_constraints.rb +6 -0
- data/decidim-comments/db/seeds.rb +4 -2
- data/decidim-comments/lib/decidim/comments/engine.rb +8 -0
- data/decidim-comments/lib/decidim/comments/test/factories.rb +1 -0
- data/decidim-comments/spec/commands/create_comment_spec.rb +13 -6
- data/decidim-comments/spec/commands/vote_comment_spec.rb +2 -6
- data/decidim-comments/spec/factories.rb +1 -0
- data/decidim-comments/spec/features/notifications_spec.rb +4 -4
- data/decidim-comments/spec/features/process_admin_manages_comments_spec.rb +1 -1
- data/decidim-comments/spec/features/report_comment_spec.rb +4 -2
- data/decidim-comments/spec/helpers/comments_helper_spec.rb +3 -3
- data/decidim-comments/spec/mailers/comment_notification_mailer_spec.rb +2 -1
- data/decidim-comments/spec/models/comment_spec.rb +5 -9
- data/decidim-comments/spec/models/comment_vote_spec.rb +3 -3
- data/decidim-comments/spec/models/seed_spec.rb +1 -1
- data/decidim-comments/spec/queries/sorted_comments_spec.rb +5 -5
- data/decidim-comments/spec/shared/admin_shared_context.rb +1 -0
- data/decidim-comments/spec/spec_helper.rb +1 -0
- data/decidim-comments/spec/types/comment_mutation_type_spec.rb +4 -12
- data/decidim-comments/spec/types/comment_type_spec.rb +4 -5
- data/decidim-comments/spec/types/commentable_mutation_type_spec.rb +2 -2
- data/decidim-comments/spec/types/mutation_type_spec.rb +4 -6
- data/decidim-comments/spec/types/query_type_spec.rb +1 -1
- data/decidim-dev/decidim-dev.gemspec +6 -6
- data/decidim-dev/lib/decidim/dev/common_rake.rb +5 -1
- data/decidim-dev/lib/decidim/dev/railtie.rb +1 -0
- data/decidim-dev/lib/decidim/dev/test/base_spec_helper.rb +0 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/geocoder.rb +4 -3
- data/decidim-dev/lib/decidim/dev/test/rspec_support/i18n.rb +2 -2
- data/decidim-dev/lib/decidim/dev/test/rspec_support/webmock.rb +1 -0
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +1 -1
- data/decidim-dev/lib/generators/decidim/templates/autoprefixer_initializer.rb +4 -3
- data/decidim-dev/lib/tasks/test_app.rake +1 -0
- data/decidim-meetings/app/controllers/decidim/meetings/meeting_widgets_controller.rb +1 -0
- data/decidim-meetings/app/controllers/decidim/meetings/meetings_controller.rb +8 -8
- data/decidim-meetings/app/helpers/decidim/meetings/map_helper.rb +9 -9
- data/decidim-meetings/app/models/decidim/meetings/meeting.rb +1 -1
- data/decidim-meetings/app/views/decidim/meetings/meeting_widgets/show.html.erb +8 -17
- data/decidim-meetings/config/locales/fr.yml +95 -1
- data/decidim-meetings/lib/decidim/meetings/feature.rb +7 -0
- data/decidim-meetings/spec/commands/close_meeting_spec.rb +2 -1
- data/decidim-meetings/spec/commands/create_meeting_spec.rb +6 -5
- data/decidim-meetings/spec/commands/update_meeting_spec.rb +6 -5
- data/decidim-meetings/spec/factories.rb +1 -0
- data/decidim-meetings/spec/features/explore_meetings_spec.rb +2 -1
- data/decidim-meetings/spec/forms/close_meeting_form_spec.rb +1 -0
- data/decidim-meetings/spec/forms/meeting_form_spec.rb +5 -3
- data/decidim-meetings/spec/services/meeting_search_spec.rb +3 -2
- data/decidim-meetings/spec/shared/admin_shared_context.rb +1 -0
- data/decidim-meetings/spec/shared/manage_attachments_examples.rb +1 -1
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +21 -20
- data/decidim-meetings/spec/spec_helper.rb +1 -0
- data/decidim-pages/config/locales/fr.yml +18 -1
- data/decidim-pages/decidim-pages.gemspec +1 -1
- data/decidim-pages/lib/decidim/pages/feature.rb +7 -0
- data/decidim-pages/spec/commands/create_page_spec.rb +1 -3
- data/decidim-pages/spec/factories.rb +1 -0
- data/decidim-pages/spec/spec_helper.rb +1 -0
- data/decidim-proposals/app/commands/decidim/proposals/create_proposal_export.rb +36 -0
- data/decidim-proposals/app/controllers/decidim/proposals/admin/exports_controller.rb +24 -0
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_votes_controller.rb +3 -1
- data/decidim-proposals/app/controllers/decidim/proposals/proposal_widgets_controller.rb +0 -5
- data/decidim-proposals/app/controllers/decidim/proposals/proposals_controller.rb +0 -1
- data/decidim-proposals/app/jobs/decidim/proposals/export_job.rb +21 -0
- data/decidim-proposals/app/models/decidim/proposals/proposal.rb +1 -1
- data/decidim-proposals/app/queries/decidim/proposals/filtered_proposals.rb +36 -0
- data/decidim-proposals/app/services/decidim/proposals/proposal_serializer.rb +72 -0
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +15 -3
- data/decidim-proposals/app/views/decidim/proposals/proposal_widgets/show.html.erb +4 -25
- data/decidim-proposals/config/locales/ca.yml +4 -0
- data/decidim-proposals/config/locales/en.yml +6 -1
- data/decidim-proposals/config/locales/es.yml +4 -0
- data/decidim-proposals/config/locales/fr.yml +146 -1
- data/decidim-proposals/decidim-proposals.gemspec +2 -2
- data/decidim-proposals/lib/decidim/proposals/admin_engine.rb +5 -0
- data/decidim-proposals/lib/decidim/proposals/feature.rb +14 -0
- data/decidim-proposals/spec/factories.rb +1 -0
- data/decidim-proposals/spec/features/admin_manages_proposals_spec.rb +1 -0
- data/decidim-proposals/spec/features/process_admin_manages_proposals_spec.rb +1 -0
- data/decidim-proposals/spec/features/proposals_spec.rb +29 -28
- data/decidim-proposals/spec/features/report_proposal_spec.rb +2 -2
- data/decidim-proposals/spec/features/vote_proposal_spec.rb +36 -32
- data/decidim-proposals/spec/helpers/proposal_order_helper_spec.rb +3 -3
- data/decidim-proposals/spec/jobs/export_job_spec.rb +57 -0
- data/decidim-proposals/spec/lib/decidim/proposals/feature_spec.rb +1 -0
- data/decidim-proposals/spec/models/decidim/proposals/proposal_vote_spec.rb +3 -3
- data/decidim-proposals/spec/queries/decidim/proposals/filtered_proposals_spec.rb +21 -0
- data/decidim-proposals/spec/services/decidim/proposals/proposal_search_spec.rb +12 -12
- data/decidim-proposals/spec/services/decidim/proposals/proposal_serializer_spec.rb +71 -0
- data/decidim-proposals/spec/shared/admin_shared_context.rb +1 -0
- data/decidim-proposals/spec/shared/create_proposal_examples.rb +4 -3
- data/decidim-proposals/spec/shared/export_proposals_examples.rb +37 -0
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +12 -11
- data/decidim-proposals/spec/shared/proposal_form_examples.rb +9 -8
- data/decidim-proposals/spec/spec_helper.rb +1 -0
- data/decidim-results/app/controllers/decidim/results/result_widgets_controller.rb +1 -0
- data/decidim-results/app/controllers/decidim/results/results_controller.rb +1 -1
- data/decidim-results/app/queries/decidim/results/filtered_results.rb +36 -0
- data/decidim-results/app/services/decidim/results/result_stats_calculator.rb +1 -1
- data/decidim-results/app/views/decidim/results/result_widgets/show.html.erb +2 -10
- data/decidim-results/config/locales/fr.yml +75 -1
- data/decidim-results/decidim-results.gemspec +2 -2
- data/decidim-results/lib/decidim/results/feature.rb +9 -0
- data/decidim-results/spec/commands/create_result_spec.rb +4 -3
- data/decidim-results/spec/commands/update_result_spec.rb +5 -4
- data/decidim-results/spec/controllers/results_controller_spec.rb +31 -0
- data/decidim-results/spec/factories.rb +1 -0
- data/decidim-results/spec/features/explore_results_spec.rb +75 -74
- data/decidim-results/spec/forms/result_form_spec.rb +2 -1
- data/decidim-results/spec/queries/decidim/results/filtered_results_spec.rb +21 -0
- data/decidim-results/spec/services/result_search_spec.rb +4 -3
- data/decidim-results/spec/services/result_stats_calculator_spec.rb +1 -0
- data/decidim-results/spec/shared/admin_shared_context.rb +1 -0
- data/decidim-results/spec/spec_helper.rb +1 -0
- data/decidim-system/config/locales/fr.yml +64 -1
- data/decidim-system/decidim-system.gemspec +3 -3
- data/decidim-system/spec/factories.rb +1 -0
- data/decidim-system/spec/spec_helper.rb +1 -0
- data/docs/how_to_create_a_plugin.md +117 -139
- data/lib/generators/decidim/install_generator.rb +1 -1
- data/package.json +30 -31
- data/tslint.json +1 -2
- data/webpack.config.js +2 -3
- data/yarn.lock +976 -1326
- metadata +68 -31
- data/decidim-admin/yarn.lock +0 -4
- data/decidim-api/.gitignore +0 -7
- data/decidim-budgets/.gitignore +0 -7
- data/decidim-meetings/.gitignore +0 -7
- data/decidim-pages/.gitignore +0 -3
- data/decidim-proposals/.gitignore +0 -3
- data/decidim-results/.gitignore +0 -7
@@ -15,9 +15,9 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.add_dependency "decidim-core", Decidim.version
|
17
17
|
s.add_dependency "decidim-comments", Decidim.version
|
18
|
-
s.add_dependency "rectify", "~> 0.
|
18
|
+
s.add_dependency "rectify", "~> 0.9.1"
|
19
19
|
s.add_dependency "kaminari", "~> 1.0.1"
|
20
|
-
s.add_dependency 'social-share-button', "~> 0.
|
20
|
+
s.add_dependency 'social-share-button', "~> 0.10.0"
|
21
21
|
|
22
22
|
s.add_development_dependency "decidim-dev", Decidim.version
|
23
23
|
s.add_development_dependency "decidim-meetings", Decidim.version
|
@@ -10,7 +10,12 @@ module Decidim
|
|
10
10
|
routes do
|
11
11
|
resources :proposals, only: [:index, :new, :create] do
|
12
12
|
resources :proposal_answers, only: [:edit, :update]
|
13
|
+
|
14
|
+
collection do
|
15
|
+
resources :exports, only: [:create]
|
16
|
+
end
|
13
17
|
end
|
18
|
+
|
14
19
|
root to: "proposals#index"
|
15
20
|
end
|
16
21
|
|
@@ -37,6 +37,20 @@ Decidim.register_feature(:proposals) do |feature|
|
|
37
37
|
resource.template = "decidim/proposals/proposals/linked_proposals"
|
38
38
|
end
|
39
39
|
|
40
|
+
feature.register_stat :proposals_count, primary: true, priority: Decidim::StatsRegistry::HIGH_PRIORITY do |features, start_at, end_at|
|
41
|
+
Decidim::Proposals::FilteredProposals.for(features, start_at, end_at).count
|
42
|
+
end
|
43
|
+
|
44
|
+
feature.register_stat :votes_count, priority: Decidim::StatsRegistry::MEDIUM_PRIORITY do |features, start_at, end_at|
|
45
|
+
proposals = Decidim::Proposals::FilteredProposals.for(features, start_at, end_at)
|
46
|
+
Decidim::Proposals::ProposalVote.where(proposal: proposals).count
|
47
|
+
end
|
48
|
+
|
49
|
+
feature.register_stat :comments_count, tag: :comments do |features, start_at, end_at|
|
50
|
+
proposals = Decidim::Proposals::FilteredProposals.for(features, start_at, end_at)
|
51
|
+
Decidim::Comments::Comment.where(root_commentable: proposals).count
|
52
|
+
end
|
53
|
+
|
40
54
|
feature.seeds do
|
41
55
|
Decidim::ParticipatoryProcess.all.each do |process|
|
42
56
|
next unless process.steps.any?
|
@@ -7,6 +7,7 @@ describe "Process admin manages proposals", type: :feature do
|
|
7
7
|
let(:user) { process_admin }
|
8
8
|
it_behaves_like "manage proposals"
|
9
9
|
it_behaves_like "manage moderations"
|
10
|
+
it_behaves_like "export proposals"
|
10
11
|
include_context "feature"
|
11
12
|
let(:manifest_name) { "proposals" }
|
12
13
|
|
@@ -5,8 +5,8 @@ describe "Proposals", type: :feature do
|
|
5
5
|
include_context "feature"
|
6
6
|
let!(:feature) do
|
7
7
|
create(:proposal_feature,
|
8
|
-
|
9
|
-
|
8
|
+
manifest: manifest,
|
9
|
+
participatory_process: participatory_process)
|
10
10
|
end
|
11
11
|
let(:manifest_name) { "proposals" }
|
12
12
|
|
@@ -20,9 +20,10 @@ describe "Proposals", type: :feature do
|
|
20
20
|
let(:longitude) { 2.1234 }
|
21
21
|
|
22
22
|
before do
|
23
|
-
Geocoder::Lookup::Test.add_stub(
|
24
|
-
|
25
|
-
|
23
|
+
Geocoder::Lookup::Test.add_stub(
|
24
|
+
address,
|
25
|
+
[{ "latitude" => latitude, "longitude" => longitude }]
|
26
|
+
)
|
26
27
|
end
|
27
28
|
|
28
29
|
context "creating a new proposal" do
|
@@ -94,10 +95,10 @@ describe "Proposals", type: :feature do
|
|
94
95
|
context "when geocoding is enabled" do
|
95
96
|
let!(:feature) do
|
96
97
|
create(:proposal_feature,
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
:with_creation_enabled,
|
99
|
+
:with_geocoding_enabled,
|
100
|
+
manifest: manifest,
|
101
|
+
participatory_process: participatory_process)
|
101
102
|
end
|
102
103
|
|
103
104
|
it "creates a new proposal" do
|
@@ -156,10 +157,10 @@ describe "Proposals", type: :feature do
|
|
156
157
|
context "when geocoding is enabled" do
|
157
158
|
let!(:feature) do
|
158
159
|
create(:proposal_feature,
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
160
|
+
:with_creation_enabled,
|
161
|
+
:with_geocoding_enabled,
|
162
|
+
manifest: manifest,
|
163
|
+
participatory_process: participatory_process)
|
163
164
|
end
|
164
165
|
|
165
166
|
it "creates a new proposal as a user group" do
|
@@ -353,7 +354,7 @@ describe "Proposals", type: :feature do
|
|
353
354
|
end
|
354
355
|
|
355
356
|
context "when a proposal has been linked in a project" do
|
356
|
-
let(:proposal) { create(:proposal, feature: feature)}
|
357
|
+
let(:proposal) { create(:proposal, feature: feature) }
|
357
358
|
let(:budget_feature) do
|
358
359
|
create(:feature, manifest_name: :budgets, participatory_process: proposal.feature.participatory_process)
|
359
360
|
end
|
@@ -398,7 +399,7 @@ describe "Proposals", type: :feature do
|
|
398
399
|
context "when filtering" do
|
399
400
|
context "when official_proposals setting is enabled" do
|
400
401
|
before do
|
401
|
-
feature.update_attributes(settings: { official_proposals_enabled: true})
|
402
|
+
feature.update_attributes(settings: { official_proposals_enabled: true })
|
402
403
|
end
|
403
404
|
|
404
405
|
it "can be filtered by origin" do
|
@@ -439,7 +440,7 @@ describe "Proposals", type: :feature do
|
|
439
440
|
|
440
441
|
context "when official_proposals setting is not enabled" do
|
441
442
|
before do
|
442
|
-
feature.update_attributes(settings: { official_proposals_enabled: false }
|
443
|
+
feature.update_attributes(settings: { official_proposals_enabled: false })
|
443
444
|
end
|
444
445
|
|
445
446
|
it "cannot be filtered by origin" do
|
@@ -453,7 +454,7 @@ describe "Proposals", type: :feature do
|
|
453
454
|
|
454
455
|
context "when scoped_proposals setting is enabled" do
|
455
456
|
before do
|
456
|
-
feature.update_attributes(settings: { scoped_proposals_enabled: true }
|
457
|
+
feature.update_attributes(settings: { scoped_proposals_enabled: true })
|
457
458
|
end
|
458
459
|
|
459
460
|
it "cannot be filtered by scope" do
|
@@ -481,7 +482,7 @@ describe "Proposals", type: :feature do
|
|
481
482
|
|
482
483
|
context "when proposal_answering feature setting is enabled" do
|
483
484
|
before do
|
484
|
-
feature.update_attributes(settings: { proposal_answering_enabled: true }
|
485
|
+
feature.update_attributes(settings: { proposal_answering_enabled: true })
|
485
486
|
end
|
486
487
|
|
487
488
|
context "when proposal_answering step setting is enabled" do
|
@@ -563,7 +564,7 @@ describe "Proposals", type: :feature do
|
|
563
564
|
|
564
565
|
context "when proposal_answering feature setting is not enabled" do
|
565
566
|
before do
|
566
|
-
feature.update_attributes(settings: { proposal_answering_enabled: false }
|
567
|
+
feature.update_attributes(settings: { proposal_answering_enabled: false })
|
567
568
|
end
|
568
569
|
|
569
570
|
it "cannot be filtered by state" do
|
@@ -580,9 +581,9 @@ describe "Proposals", type: :feature do
|
|
580
581
|
context "by 'most_support'" do
|
581
582
|
let!(:feature) do
|
582
583
|
create(:proposal_feature,
|
583
|
-
|
584
|
-
|
585
|
-
|
584
|
+
:with_votes_enabled,
|
585
|
+
manifest: manifest,
|
586
|
+
participatory_process: participatory_process)
|
586
587
|
end
|
587
588
|
|
588
589
|
before do
|
@@ -599,13 +600,13 @@ describe "Proposals", type: :feature do
|
|
599
600
|
visit_feature
|
600
601
|
|
601
602
|
within ".order-by" do
|
602
|
-
page.find(
|
603
|
+
page.find(".dropdown.menu .is-dropdown-submenu-parent").hover
|
603
604
|
end
|
604
605
|
|
605
606
|
click_link "Most voted"
|
606
607
|
|
607
|
-
expect(page.find(
|
608
|
-
expect(page.find(
|
608
|
+
expect(page.find("#proposals .card-grid .column:first-child", text: most_voted_proposal.title)).to be
|
609
|
+
expect(page.find("#proposals .card-grid .column:last-child", text: less_voted_proposal.title)).to be
|
609
610
|
end
|
610
611
|
end
|
611
612
|
|
@@ -617,13 +618,13 @@ describe "Proposals", type: :feature do
|
|
617
618
|
visit_feature
|
618
619
|
|
619
620
|
within ".order-by" do
|
620
|
-
page.find(
|
621
|
+
page.find(".dropdown.menu .is-dropdown-submenu-parent").hover
|
621
622
|
end
|
622
623
|
|
623
624
|
click_link "Recent"
|
624
625
|
|
625
|
-
expect(page.find(
|
626
|
-
expect(page.find(
|
626
|
+
expect(page.find("#proposals .card-grid .column:first-child", text: recent_proposal.title)).to be
|
627
|
+
expect(page.find("#proposals .card-grid .column:last-child", text: older_proposal.title)).to be
|
627
628
|
end
|
628
629
|
end
|
629
630
|
end
|
@@ -11,28 +11,28 @@ describe "Vote Proposal", type: :feature do
|
|
11
11
|
|
12
12
|
let!(:feature) do
|
13
13
|
create(:proposal_feature,
|
14
|
-
|
15
|
-
|
14
|
+
manifest: manifest,
|
15
|
+
participatory_process: participatory_process)
|
16
16
|
end
|
17
17
|
|
18
18
|
context "when votes are not enabled" do
|
19
19
|
it "doesn't show the vote proposal button and counts" do
|
20
|
-
expect(page).not_to have_css(
|
21
|
-
expect(page).not_to have_css(
|
20
|
+
expect(page).not_to have_css(".card__button", text: "Vote")
|
21
|
+
expect(page).not_to have_css(".card__support__data span", text: "0 VOTES")
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
25
|
context "when votes are blocked" do
|
26
26
|
let!(:feature) do
|
27
27
|
create(:proposal_feature,
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
:with_votes_blocked,
|
29
|
+
manifest: manifest,
|
30
|
+
participatory_process: participatory_process)
|
31
31
|
end
|
32
32
|
|
33
33
|
it "shows the vote count and the vote button is disabled" do
|
34
34
|
visit_feature
|
35
|
-
expect(page).to have_css(
|
35
|
+
expect(page).to have_css(".card__support__data", text: "0 VOTES")
|
36
36
|
expect(page).to have_content("Voting disabled")
|
37
37
|
end
|
38
38
|
end
|
@@ -40,9 +40,9 @@ describe "Vote Proposal", type: :feature do
|
|
40
40
|
context "when votes are enabled" do
|
41
41
|
let!(:feature) do
|
42
42
|
create(:proposal_feature,
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
:with_votes_enabled,
|
44
|
+
manifest: manifest,
|
45
|
+
participatory_process: participatory_process)
|
46
46
|
end
|
47
47
|
|
48
48
|
context "when the user is not logged in" do
|
@@ -50,10 +50,10 @@ describe "Vote Proposal", type: :feature do
|
|
50
50
|
visit_feature
|
51
51
|
|
52
52
|
within ".card__support", match: :first do
|
53
|
-
page.find(
|
53
|
+
page.find(".card__button").click
|
54
54
|
end
|
55
55
|
|
56
|
-
expect(page).to have_css(
|
56
|
+
expect(page).to have_css("#loginModal", visible: true)
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
@@ -66,8 +66,8 @@ describe "Vote Proposal", type: :feature do
|
|
66
66
|
context "when the proposal is not voted yet" do
|
67
67
|
it "should be able to vote the proposal" do
|
68
68
|
within "#proposal-#{proposal.id}-vote-button" do
|
69
|
-
page.find(
|
70
|
-
expect(page).to have_css(
|
69
|
+
page.find(".card__button").click
|
70
|
+
expect(page).to have_css(".card__button.success", text: "Already voted")
|
71
71
|
end
|
72
72
|
|
73
73
|
within "#proposal-#{proposal.id}-votes-count" do
|
@@ -84,8 +84,8 @@ describe "Vote Proposal", type: :feature do
|
|
84
84
|
|
85
85
|
it "should not be able to vote it again" do
|
86
86
|
within "#proposal-#{proposal.id}-vote-button" do
|
87
|
-
expect(page).to have_css(
|
88
|
-
page.find(
|
87
|
+
expect(page).to have_css(".card__button.success", text: "Already voted")
|
88
|
+
page.find(".card__button").click
|
89
89
|
end
|
90
90
|
|
91
91
|
within "#proposal-#{proposal.id}-votes-count" do
|
@@ -99,18 +99,18 @@ describe "Vote Proposal", type: :feature do
|
|
99
99
|
|
100
100
|
let!(:feature) do
|
101
101
|
create(:proposal_feature,
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
102
|
+
:with_votes_enabled,
|
103
|
+
:with_vote_limit,
|
104
|
+
vote_limit: vote_limit,
|
105
|
+
manifest: manifest,
|
106
|
+
participatory_process: participatory_process)
|
107
107
|
end
|
108
108
|
|
109
109
|
context "when the proposal is not voted yet" do
|
110
110
|
it "should update the remaining votes counter" do
|
111
111
|
within "#proposal-#{proposal.id}-vote-button" do
|
112
|
-
page.find(
|
113
|
-
expect(page).to have_css(
|
112
|
+
page.find(".card__button").click
|
113
|
+
expect(page).to have_css(".card__button.success")
|
114
114
|
end
|
115
115
|
|
116
116
|
expect(page).to have_content("REMAINING 9 VOTES")
|
@@ -125,7 +125,7 @@ describe "Vote Proposal", type: :feature do
|
|
125
125
|
|
126
126
|
it "should show a modal dialog" do
|
127
127
|
within "#proposal-#{proposal.id}-vote-button" do
|
128
|
-
page.find(
|
128
|
+
page.find(".card__button").click
|
129
129
|
end
|
130
130
|
|
131
131
|
expect(page).to have_content("Authorization required")
|
@@ -140,8 +140,12 @@ describe "Vote Proposal", type: :feature do
|
|
140
140
|
|
141
141
|
it "should be able to undo the vote" do
|
142
142
|
within "#proposal-#{proposal.id}-vote-button" do
|
143
|
-
expect(page).to have_css(
|
144
|
-
page.find(
|
143
|
+
expect(page).to have_css(".card__button.success")
|
144
|
+
page.find(".card__button").click
|
145
|
+
end
|
146
|
+
|
147
|
+
within "#proposal-#{proposal.id}-votes-count" do
|
148
|
+
expect(page).to have_content("0 VOTES")
|
145
149
|
end
|
146
150
|
|
147
151
|
expect(page).to have_content("REMAINING 10 VOTES")
|
@@ -157,19 +161,19 @@ describe "Vote Proposal", type: :feature do
|
|
157
161
|
end
|
158
162
|
|
159
163
|
it "should not be able to vote other proposals" do
|
160
|
-
expect(page).to have_css(
|
164
|
+
expect(page).to have_css(".card__button[disabled]", count: 2)
|
161
165
|
end
|
162
166
|
|
163
167
|
context "when votes are blocked" do
|
164
168
|
let!(:feature) do
|
165
169
|
create(:proposal_feature,
|
166
|
-
|
167
|
-
|
168
|
-
|
170
|
+
:with_votes_blocked,
|
171
|
+
manifest: manifest,
|
172
|
+
participatory_process: participatory_process)
|
169
173
|
end
|
170
174
|
|
171
175
|
it "shows the vote count but not the vote button" do
|
172
|
-
expect(page).to have_css(
|
176
|
+
expect(page).to have_css(".card__support__data", text: "1 VOTE")
|
173
177
|
expect(page).to have_content("Voting disabled")
|
174
178
|
end
|
175
179
|
end
|
@@ -11,7 +11,7 @@ module Decidim
|
|
11
11
|
describe "#order_fields" do
|
12
12
|
context "with votes enabled" do
|
13
13
|
context "with votes hidden" do
|
14
|
-
let(:current_settings) { double(:current_settings,
|
14
|
+
let(:current_settings) { double(:current_settings, votes_enabled?: true, votes_hidden?: true) }
|
15
15
|
|
16
16
|
it "does not show most_voted option to sort" do
|
17
17
|
expect(helper.order_fields).not_to include(:most_voted)
|
@@ -19,7 +19,7 @@ module Decidim
|
|
19
19
|
end
|
20
20
|
|
21
21
|
context "with votes not hidden" do
|
22
|
-
let(:current_settings) { double(:current_settings,
|
22
|
+
let(:current_settings) { double(:current_settings, votes_enabled?: true, votes_hidden?: false) }
|
23
23
|
|
24
24
|
it "shows most_voted option to sort" do
|
25
25
|
expect(helper.order_fields).to include(:most_voted)
|
@@ -28,7 +28,7 @@ module Decidim
|
|
28
28
|
end
|
29
29
|
|
30
30
|
context "with votes disabled" do
|
31
|
-
let(:current_settings) { double(:current_settings,
|
31
|
+
let(:current_settings) { double(:current_settings, votes_enabled?: false) }
|
32
32
|
|
33
33
|
it "doesn't show most_voted option to sort" do
|
34
34
|
expect(helper.order_fields).not_to include(:most_voted)
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
module Decidim
|
5
|
+
module Proposals
|
6
|
+
describe ExportJob do
|
7
|
+
let!(:feature) { create(:feature, manifest_name: "proposals") }
|
8
|
+
let!(:proposals) { create_list(:proposal, 3, feature: feature) }
|
9
|
+
let(:organization) { feature.organization }
|
10
|
+
let!(:user) { create(:user, organization: organization) }
|
11
|
+
|
12
|
+
it "sends an email with the result of the export" do
|
13
|
+
ExportJob.perform_now(user, feature, "csv")
|
14
|
+
|
15
|
+
email = last_email
|
16
|
+
expect(email.subject).to include("proposals")
|
17
|
+
attachment = email.attachments.first
|
18
|
+
|
19
|
+
expect(attachment.read.length).to be_positive
|
20
|
+
expect(attachment.mime_type).to eq("application/zip")
|
21
|
+
expect(attachment.filename).to match(/^proposals-[0-9]+-[0-9]+-[0-9]+-[0-9]+\.zip$/)
|
22
|
+
end
|
23
|
+
|
24
|
+
describe "CSV" do
|
25
|
+
it "uses the CSV exporter" do
|
26
|
+
export_data = double
|
27
|
+
|
28
|
+
expect(Decidim::Exporters::CSV)
|
29
|
+
.to(receive(:new).with(anything, ProposalSerializer))
|
30
|
+
.and_return(double(export: export_data))
|
31
|
+
|
32
|
+
expect(ExportMailer)
|
33
|
+
.to(receive(:export).with(user, anything, export_data))
|
34
|
+
.and_return(double(deliver_now: true))
|
35
|
+
|
36
|
+
ExportJob.perform_now(user, feature, "csv")
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe "JSON" do
|
41
|
+
it "uses the JSON exporter" do
|
42
|
+
export_data = double
|
43
|
+
|
44
|
+
expect(Decidim::Exporters::JSON)
|
45
|
+
.to(receive(:new).with(anything, ProposalSerializer))
|
46
|
+
.and_return(double(export: export_data))
|
47
|
+
|
48
|
+
expect(ExportMailer)
|
49
|
+
.to(receive(:export).with(user, anything, export_data))
|
50
|
+
.and_return(double(deliver_now: true))
|
51
|
+
|
52
|
+
ExportJob.perform_now(user, feature, "json")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|