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 "searchlight", "~> 4.1.0"
|
20
|
-
s.add_dependency "kaminari", "~> 1.0.
|
20
|
+
s.add_dependency "kaminari", "~> 1.0.1"
|
21
21
|
|
22
22
|
s.add_development_dependency "decidim-dev", Decidim.version
|
23
23
|
s.add_development_dependency "decidim-proposals", Decidim.version
|
@@ -19,6 +19,15 @@ Decidim.register_feature(:budgets) do |feature|
|
|
19
19
|
resource.template = "decidim/budgets/projects/linked_projects"
|
20
20
|
end
|
21
21
|
|
22
|
+
feature.register_stat :projects_count, primary: true do |features, start_at, end_at|
|
23
|
+
Decidim::Budgets::FilteredProjects.for(features, start_at, end_at).count
|
24
|
+
end
|
25
|
+
|
26
|
+
feature.register_stat :comments_count, tag: :comments do |features, start_at, end_at|
|
27
|
+
projects = Decidim::Budgets::FilteredProjects.for(features, start_at, end_at)
|
28
|
+
Decidim::Comments::Comment.where(root_commentable: projects).count
|
29
|
+
end
|
30
|
+
|
22
31
|
feature.settings(:global) do |settings|
|
23
32
|
settings.attribute :total_budget, type: :integer, default: 100_000_000
|
24
33
|
settings.attribute :vote_threshold_percent, type: :integer, default: 70
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::AddLineItem do
|
@@ -5,7 +6,7 @@ describe Decidim::Budgets::AddLineItem do
|
|
5
6
|
let(:participatory_process) { create :participatory_process, :with_steps, organization: user.organization }
|
6
7
|
let(:feature) { create(:budget_feature, participatory_process: participatory_process, settings: settings) }
|
7
8
|
let(:project) { create(:project, feature: feature, budget: 60_000) }
|
8
|
-
let(:settings) { { "total_budget" => 100_000, vote_threshold_percent: 50 }}
|
9
|
+
let(:settings) { { "total_budget" => 100_000, vote_threshold_percent: 50 } }
|
9
10
|
let(:order) { nil }
|
10
11
|
|
11
12
|
subject { described_class.new(order, project, user) }
|
@@ -19,17 +20,13 @@ describe Decidim::Budgets::AddLineItem do
|
|
19
20
|
let!(:order) { create(:order, user: user, feature: feature) }
|
20
21
|
|
21
22
|
it "doesn't create a new order" do
|
22
|
-
expect {
|
23
|
-
subject.call
|
24
|
-
}.not_to change { Decidim::Budgets::Order.count }
|
23
|
+
expect { subject.call }.not_to change { Decidim::Budgets::Order.count }
|
25
24
|
end
|
26
25
|
end
|
27
26
|
|
28
27
|
context "when a order for the current user doesn't exist" do
|
29
28
|
it "creates an order" do
|
30
|
-
expect {
|
31
|
-
subject.call
|
32
|
-
}.to change { Decidim::Budgets::Order.count }.by(1)
|
29
|
+
expect { subject.call }.to change { Decidim::Budgets::Order.count }.by(1)
|
33
30
|
end
|
34
31
|
end
|
35
32
|
|
@@ -47,8 +44,8 @@ describe Decidim::Budgets::AddLineItem do
|
|
47
44
|
|
48
45
|
let!(:order) do
|
49
46
|
order = create(:order,
|
50
|
-
|
51
|
-
|
47
|
+
user: user,
|
48
|
+
feature: feature)
|
52
49
|
order.projects << projects
|
53
50
|
order.checked_out_at = Time.current
|
54
51
|
order.save!
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::CancelOrder do
|
4
5
|
let(:user) { create(:user) }
|
5
6
|
let(:feature) do
|
6
|
-
create(
|
7
|
+
create(
|
8
|
+
:budget_feature,
|
7
9
|
:with_total_budget_and_vote_threshold_percent,
|
8
10
|
organization: user.organization
|
9
11
|
)
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::Checkout do
|
4
5
|
let(:user) { create(:user) }
|
5
6
|
let(:feature) do
|
6
|
-
create(
|
7
|
+
create(
|
8
|
+
:budget_feature,
|
7
9
|
:with_total_budget_and_vote_threshold_percent,
|
8
10
|
organization: user.organization
|
9
11
|
)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::Admin::CreateProject do
|
@@ -18,9 +19,9 @@ describe Decidim::Budgets::Admin::CreateProject do
|
|
18
19
|
end
|
19
20
|
let(:form) do
|
20
21
|
double(
|
21
|
-
|
22
|
-
title: {en: "title"},
|
23
|
-
description: {en: "description"},
|
22
|
+
invalid?: invalid,
|
23
|
+
title: { en: "title" },
|
24
|
+
description: { en: "description" },
|
24
25
|
budget: 10_000_000,
|
25
26
|
proposal_ids: proposals.map(&:id),
|
26
27
|
scope: scope,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::RemoveLineItem do
|
@@ -5,7 +6,7 @@ describe Decidim::Budgets::RemoveLineItem do
|
|
5
6
|
let(:feature) do
|
6
7
|
create(:budget_feature,
|
7
8
|
organization: user.organization,
|
8
|
-
settings: { "total_budget" => 100_000, "vote_threshold_percent": 50})
|
9
|
+
settings: { "total_budget" => 100_000, "vote_threshold_percent": 50 })
|
9
10
|
end
|
10
11
|
let(:project) { create(:project, feature: feature, budget: 100) }
|
11
12
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::Admin::UpdateProject do
|
@@ -18,9 +19,9 @@ describe Decidim::Budgets::Admin::UpdateProject do
|
|
18
19
|
end
|
19
20
|
let(:form) do
|
20
21
|
double(
|
21
|
-
|
22
|
-
title: {en: "title"},
|
23
|
-
description: {en: "description"},
|
22
|
+
invalid?: invalid,
|
23
|
+
title: { en: "title" },
|
24
|
+
description: { en: "description" },
|
24
25
|
budget: 10_000_000,
|
25
26
|
proposal_ids: proposals.map(&:id),
|
26
27
|
scope: scope,
|
@@ -22,10 +22,10 @@ describe "Orders", type: :feature do
|
|
22
22
|
visit_feature
|
23
23
|
|
24
24
|
within "#project-#{project.id}-item" do
|
25
|
-
page.find(
|
25
|
+
page.find(".budget--list__action").click
|
26
26
|
end
|
27
27
|
|
28
|
-
expect(page).to have_css(
|
28
|
+
expect(page).to have_css("#loginModal", visible: true)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -39,10 +39,10 @@ describe "Orders", type: :feature do
|
|
39
39
|
visit_feature
|
40
40
|
|
41
41
|
within "#project-#{project.id}-item" do
|
42
|
-
page.find(
|
42
|
+
page.find(".budget--list__action").click
|
43
43
|
end
|
44
44
|
|
45
|
-
expect(page).to have_selector
|
45
|
+
expect(page).to have_selector ".budget-list__data--added", count: 1
|
46
46
|
|
47
47
|
expect(page).to have_content "ASSIGNED: €25,000,000"
|
48
48
|
expect(page).to have_content "1 project selected"
|
@@ -69,7 +69,7 @@ describe "Orders", type: :feature do
|
|
69
69
|
visit_feature
|
70
70
|
|
71
71
|
within "#project-#{project.id}-item" do
|
72
|
-
page.find(
|
72
|
+
page.find(".budget--list__action").click
|
73
73
|
end
|
74
74
|
|
75
75
|
expect(page).to have_content("Authorization required")
|
@@ -86,7 +86,7 @@ describe "Orders", type: :feature do
|
|
86
86
|
expect(page).to have_content "ASSIGNED: €25,000,000"
|
87
87
|
|
88
88
|
within "#project-#{project.id}-item" do
|
89
|
-
page.find(
|
89
|
+
page.find(".budget--list__action").click
|
90
90
|
end
|
91
91
|
|
92
92
|
expect(page).to have_content "ASSIGNED: €0"
|
@@ -97,7 +97,7 @@ describe "Orders", type: :feature do
|
|
97
97
|
expect(page).to have_content "0%"
|
98
98
|
end
|
99
99
|
|
100
|
-
expect(page).not_to have_selector
|
100
|
+
expect(page).not_to have_selector ".budget-list__data--added"
|
101
101
|
end
|
102
102
|
|
103
103
|
context "and try to vote a project that exceed the total budget" do
|
@@ -107,10 +107,10 @@ describe "Orders", type: :feature do
|
|
107
107
|
visit_feature
|
108
108
|
|
109
109
|
within "#project-#{expensive_project.id}-item" do
|
110
|
-
page.find(
|
110
|
+
page.find(".budget--list__action").click
|
111
111
|
end
|
112
112
|
|
113
|
-
expect(page).to have_css(
|
113
|
+
expect(page).to have_css("#budget-excess", visible: true)
|
114
114
|
end
|
115
115
|
end
|
116
116
|
|
@@ -121,19 +121,19 @@ describe "Orders", type: :feature do
|
|
121
121
|
visit_feature
|
122
122
|
|
123
123
|
within "#project-#{other_project.id}-item" do
|
124
|
-
page.find(
|
124
|
+
page.find(".budget--list__action").click
|
125
125
|
end
|
126
126
|
|
127
|
-
expect(page).to have_selector
|
127
|
+
expect(page).to have_selector ".budget-list__data--added", count: 2
|
128
128
|
|
129
129
|
within "#order-progress .budget-summary__progressbox:not(.budget-summary__progressbox--fixed)" do
|
130
|
-
page.find(
|
130
|
+
page.find(".button.small").click
|
131
131
|
end
|
132
132
|
|
133
|
-
expect(page).to have_css(
|
133
|
+
expect(page).to have_css("#budget-confirm", visible: true)
|
134
134
|
|
135
135
|
within "#budget-confirm" do
|
136
|
-
page.find(
|
136
|
+
page.find(".button.expanded").click
|
137
137
|
end
|
138
138
|
|
139
139
|
expect(page).to have_content("successfully")
|
@@ -158,7 +158,7 @@ describe "Orders", type: :feature do
|
|
158
158
|
visit_feature
|
159
159
|
|
160
160
|
within ".budget-summary" do
|
161
|
-
page.find(
|
161
|
+
page.find(".cancel-order").click
|
162
162
|
end
|
163
163
|
|
164
164
|
expect(page).to have_content("successfully")
|
@@ -168,7 +168,7 @@ describe "Orders", type: :feature do
|
|
168
168
|
end
|
169
169
|
|
170
170
|
within ".budget-summary" do
|
171
|
-
expect(page).not_to have_selector(
|
171
|
+
expect(page).not_to have_selector(".cancel-order")
|
172
172
|
end
|
173
173
|
end
|
174
174
|
end
|
@@ -176,25 +176,25 @@ describe "Orders", type: :feature do
|
|
176
176
|
context "and votes are disabled" do
|
177
177
|
let!(:feature) do
|
178
178
|
create(:budget_feature,
|
179
|
-
|
180
|
-
|
181
|
-
|
179
|
+
:with_votes_disabled,
|
180
|
+
manifest: manifest,
|
181
|
+
participatory_process: participatory_process)
|
182
182
|
end
|
183
183
|
|
184
184
|
it "cannot create new orders" do
|
185
185
|
visit_feature
|
186
186
|
|
187
|
-
expect(page).to have_selector(
|
188
|
-
expect(page).to have_no_selector(
|
187
|
+
expect(page).to have_selector("button.budget--list__action[disabled]", count: 3)
|
188
|
+
expect(page).to have_no_selector(".budget-summary")
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
192
192
|
context "and show votes are enabled" do
|
193
193
|
let!(:feature) do
|
194
194
|
create(:budget_feature,
|
195
|
-
|
196
|
-
|
197
|
-
|
195
|
+
:with_show_votes_enabled,
|
196
|
+
manifest: manifest,
|
197
|
+
participatory_process: participatory_process)
|
198
198
|
end
|
199
199
|
|
200
200
|
let!(:order) do
|
@@ -35,7 +35,7 @@ describe Decidim::Budgets::Project do
|
|
35
35
|
let(:order) { create :order, feature: project.feature }
|
36
36
|
let(:unfinished_order) { create :order, feature: project.feature }
|
37
37
|
let!(:line_item) { create :line_item, project: project, order: order }
|
38
|
-
let!(:line_item_1) { create :line_item, project: project
|
38
|
+
let!(:line_item_1) { create :line_item, project: project, order: unfinished_order }
|
39
39
|
|
40
40
|
it "return number of finished orders for this project" do
|
41
41
|
order.reload.update_attributes!(checked_out_at: Time.current)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Decidim::Budgets::FilteredProjects do
|
5
|
+
let(:organization) { create(:organization) }
|
6
|
+
let(:participatory_process) { create(:participatory_process, organization: organization) }
|
7
|
+
let(:feature) { create(:budget_feature, participatory_process: participatory_process) }
|
8
|
+
let(:another_feature) { create(:budget_feature, participatory_process: participatory_process) }
|
9
|
+
|
10
|
+
let(:projects) { create_list(:project, 3, feature: feature) }
|
11
|
+
let(:old_projects) { create_list(:project, 3, feature: feature, created_at: 10.days.ago) }
|
12
|
+
let(:another_projects) { create_list(:project, 3, feature: another_feature) }
|
13
|
+
|
14
|
+
it "returns projects included in a collection of features" do
|
15
|
+
expect(Decidim::Budgets::FilteredProjects.for([feature, another_feature])).to match_array projects.concat(old_projects, another_projects)
|
16
|
+
end
|
17
|
+
|
18
|
+
it "returns projects created in a date range" do
|
19
|
+
expect(Decidim::Budgets::FilteredProjects.for([feature, another_feature], 2.weeks.ago, 1.week.ago)).to match_array old_projects
|
20
|
+
end
|
21
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Decidim::Budgets::ProjectSearch do
|
@@ -35,7 +36,7 @@ describe Decidim::Budgets::ProjectSearch do
|
|
35
36
|
let(:default_params) { { feature: nil } }
|
36
37
|
|
37
38
|
it "raises an error" do
|
38
|
-
expect{ subject.results }.to raise_error(StandardError, "Missing feature")
|
39
|
+
expect { subject.results }.to raise_error(StandardError, "Missing feature")
|
39
40
|
end
|
40
41
|
end
|
41
42
|
end
|
@@ -62,12 +63,12 @@ describe Decidim::Budgets::ProjectSearch do
|
|
62
63
|
let(:params) { default_params.merge(scope_id: [scope2.id, scope1.id]) }
|
63
64
|
|
64
65
|
it "filters projects by scope" do
|
65
|
-
expect(subject.results).to match_array [project1,project2]
|
66
|
+
expect(subject.results).to match_array [project1, project2]
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
69
70
|
context "when `global` is being sent" do
|
70
|
-
let!(:resource_without_scope) { create(:project, feature: current_feature, scope: nil)}
|
71
|
+
let!(:resource_without_scope) { create(:project, feature: current_feature, scope: nil) }
|
71
72
|
let(:params) { default_params.merge(scope_id: ["global"]) }
|
72
73
|
|
73
74
|
it "returns resources without a scope" do
|
Binary file
|
@@ -34,15 +34,16 @@ module Decidim
|
|
34
34
|
def create_comment
|
35
35
|
@comment = Comment.create!(author: @author,
|
36
36
|
commentable: @commentable,
|
37
|
+
root_commentable: root_commentable(@commentable),
|
37
38
|
body: form.body,
|
38
39
|
alignment: form.alignment,
|
39
40
|
decidim_user_group_id: form.user_group_id)
|
40
41
|
end
|
41
42
|
|
42
43
|
def send_notification_to_author
|
43
|
-
if @comment.depth
|
44
|
+
if @comment.depth.positive? && @commentable.author.replies_notifications?
|
44
45
|
CommentNotificationMailer.reply_created(@author, @comment, @commentable, @comment.root_commentable).deliver_later
|
45
|
-
elsif @comment.depth
|
46
|
+
elsif @comment.depth.zero? && @commentable.author.comments_notifications?
|
46
47
|
CommentNotificationMailer.comment_created(@author, @comment, @commentable).deliver_later
|
47
48
|
end
|
48
49
|
end
|
@@ -54,6 +55,11 @@ module Decidim
|
|
54
55
|
def same_author?
|
55
56
|
@author == @commentable.author
|
56
57
|
end
|
58
|
+
|
59
|
+
def root_commentable(commentable)
|
60
|
+
return commentable.root_commentable if commentable.is_a? Decidim::Comments::Comment
|
61
|
+
commentable
|
62
|
+
end
|
57
63
|
end
|
58
64
|
end
|
59
65
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import * as moment
|
2
|
-
import * as React
|
1
|
+
import * as moment from "moment";
|
2
|
+
import * as React from "react";
|
3
3
|
import { ApolloProvider } from "react-apollo";
|
4
4
|
|
5
|
-
import apolloClient
|
5
|
+
import apolloClient from "./apollo_client";
|
6
6
|
|
7
7
|
const { I18n } = require("react-i18nify");
|
8
8
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/* eslint-disable no-return-assign, react/no-unused-prop-types, max-lines */
|
2
|
-
import * as classnames
|
3
|
-
import * as React
|
4
|
-
import { graphql }
|
5
|
-
import * as uuid
|
2
|
+
import * as classnames from "classnames";
|
3
|
+
import * as React from "react";
|
4
|
+
import { graphql } from "react-apollo";
|
5
|
+
import * as uuid from "uuid";
|
6
6
|
|
7
|
-
import Icon
|
7
|
+
import Icon from "../application/icon.component";
|
8
8
|
|
9
9
|
const { I18n, Translate } = require("react-i18nify");
|
10
10
|
|
@@ -159,7 +159,7 @@ export class AddCommentForm extends React.Component<AddCommentFormProps, AddComm
|
|
159
159
|
const { error } = this.state;
|
160
160
|
const className = classnames({ "is-invalid-input": error });
|
161
161
|
|
162
|
-
|
162
|
+
const textAreaProps: any = {
|
163
163
|
ref: (textarea: HTMLTextAreaElement) => {this.bodyTextArea = textarea; },
|
164
164
|
id: `add-comment-${type}-${id}`,
|
165
165
|
className,
|
@@ -312,7 +312,7 @@ export class AddCommentForm extends React.Component<AddCommentFormProps, AddComm
|
|
312
312
|
private addComment = (evt: React.FormEvent<HTMLFormElement>) => {
|
313
313
|
const { alignment } = this.state;
|
314
314
|
const { addComment, onCommentAdded } = this.props;
|
315
|
-
|
315
|
+
const addCommentParams: { body: string, alignment: number, userGroupId?: string } = { body: this.bodyTextArea.value, alignment };
|
316
316
|
|
317
317
|
evt.preventDefault();
|
318
318
|
|