decidim 0.0.6 → 0.0.7
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/.babelrc +2 -1
- data/.ruby-version +1 -1
- data/.travis.yml +4 -6
- data/Dockerfile +2 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +48 -48
- data/README.md +6 -1
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_decidim.scss +9 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_variables.scss +7 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/application.scss +2 -19
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_categories.scss +5 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/{_email_preview.scss → extra/_email_preview.scss} +0 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/{_login.scss → extra/_login.scss} +0 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_select_multiple.scss +3 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/extra/_title_bar.scss +5 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_action-icon.scss +13 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_buttons.scss +44 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_callouts.scss +32 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_cards.scss +36 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_char-counter.scss +20 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_component-counter.scss +17 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_forms.scss +80 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_icons.scss +65 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_layout.scss +67 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_main-nav.scss +41 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_modules.scss +24 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_process-header.scss +11 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_secondary-nav.scss +95 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_table-list.scss +78 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_tabs.scss +49 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_title-bar.scss +32 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_typography.scss +15 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/modules/_user-login.scss +23 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_fontface.scss +27 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_helpers.scss +25 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_keyframes.scss +21 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_mixins.scss +20 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_settings.scss +590 -0
- data/decidim-admin/app/assets/stylesheets/decidim/admin/utils/_toggle-expand.scss +8 -0
- data/decidim-admin/app/commands/decidim/admin/create_attachment.rb +13 -4
- data/decidim-admin/app/commands/decidim/admin/update_participatory_process.rb +3 -3
- data/decidim-admin/app/commands/decidim/admin/update_participatory_process_admin.rb +40 -0
- data/decidim-admin/app/controllers/decidim/admin/application_controller.rb +7 -1
- data/decidim-admin/app/controllers/decidim/admin/newsletters_controller.rb +1 -1
- data/decidim-admin/app/controllers/decidim/admin/organization_controller.rb +2 -0
- data/decidim-admin/app/controllers/decidim/admin/participatory_process_user_roles_controller.rb +29 -0
- data/decidim-admin/app/controllers/decidim/admin/participatory_processes_controller.rb +2 -2
- data/decidim-admin/app/controllers/decidim/admin/scopes_controller.rb +2 -0
- data/decidim-admin/app/controllers/decidim/admin/static_pages_controller.rb +2 -0
- data/decidim-admin/app/controllers/decidim/admin/user_groups_controller.rb +3 -1
- data/decidim-admin/app/controllers/decidim/admin/users_controller.rb +1 -1
- data/decidim-admin/app/helpers/decidim/admin/application_helper.rb +8 -0
- data/decidim-admin/app/helpers/decidim/admin/icon_link_helper.rb +30 -0
- data/decidim-admin/app/jobs/decidim/admin/newsletter_job.rb +1 -1
- data/decidim-admin/app/queries/decidim/admin/process_admin_roles_for_process.rb +1 -1
- data/decidim-admin/app/views/decidim/admin/attachments/_form.html.erb +29 -8
- data/decidim-admin/app/views/decidim/admin/attachments/edit.html.erb +3 -5
- data/decidim-admin/app/views/decidim/admin/attachments/index.html.erb +45 -35
- data/decidim-admin/app/views/decidim/admin/attachments/new.html.erb +3 -5
- data/decidim-admin/app/views/decidim/admin/categories/_form.html.erb +18 -10
- data/decidim-admin/app/views/decidim/admin/categories/edit.html.erb +3 -5
- data/decidim-admin/app/views/decidim/admin/categories/index.html.erb +57 -42
- data/decidim-admin/app/views/decidim/admin/categories/new.html.erb +3 -5
- data/decidim-admin/app/views/decidim/admin/dashboard/show.html.erb +6 -3
- data/decidim-admin/app/views/decidim/admin/features/_feature.html.erb +11 -11
- data/decidim-admin/app/views/decidim/admin/features/_form.html.erb +56 -48
- data/decidim-admin/app/views/decidim/admin/features/edit.html.erb +3 -5
- data/decidim-admin/app/views/decidim/admin/features/index.html.erb +21 -19
- data/decidim-admin/app/views/decidim/admin/features/new.html.erb +3 -4
- data/decidim-admin/app/views/decidim/admin/moderations/index.html.erb +71 -61
- data/decidim-admin/app/views/decidim/admin/newsletters/_form.html.erb +7 -1
- data/decidim-admin/app/views/decidim/admin/newsletters/edit.html.erb +10 -8
- data/decidim-admin/app/views/decidim/admin/newsletters/index.html.erb +50 -43
- data/decidim-admin/app/views/decidim/admin/newsletters/new.html.erb +10 -8
- data/decidim-admin/app/views/decidim/admin/newsletters/show.html.erb +20 -12
- data/decidim-admin/app/views/decidim/admin/organization/_form.html.erb +98 -62
- data/decidim-admin/app/views/decidim/admin/organization/edit.html.erb +11 -8
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/_form.html.erb +4 -4
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/edit.html.erb +15 -9
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/index.html.erb +37 -35
- data/decidim-admin/app/views/decidim/admin/participatory_process_groups/new.html.erb +10 -8
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/_form.html.erb +21 -11
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/edit.html.erb +3 -4
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/index.html.erb +60 -51
- data/decidim-admin/app/views/decidim/admin/participatory_process_steps/new.html.erb +4 -5
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/_form.html.erb +23 -0
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/edit.html.erb +7 -0
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/index.html.erb +46 -34
- data/decidim-admin/app/views/decidim/admin/participatory_process_user_roles/new.html.erb +7 -0
- data/decidim-admin/app/views/decidim/admin/participatory_processes/_form.html.erb +103 -72
- data/decidim-admin/app/views/decidim/admin/participatory_processes/edit.html.erb +15 -17
- data/decidim-admin/app/views/decidim/admin/participatory_processes/index.html.erb +52 -43
- data/decidim-admin/app/views/decidim/admin/participatory_processes/new.html.erb +6 -5
- data/decidim-admin/app/views/decidim/admin/scopes/edit.html.erb +9 -7
- data/decidim-admin/app/views/decidim/admin/scopes/index.html.erb +37 -36
- data/decidim-admin/app/views/decidim/admin/scopes/new.html.erb +9 -6
- data/decidim-admin/app/views/decidim/admin/static_pages/_form.html.erb +3 -3
- data/decidim-admin/app/views/decidim/admin/static_pages/edit.html.erb +10 -8
- data/decidim-admin/app/views/decidim/admin/static_pages/index.html.erb +38 -37
- data/decidim-admin/app/views/decidim/admin/static_pages/new.html.erb +10 -8
- data/decidim-admin/app/views/decidim/admin/user_groups/index.html.erb +37 -31
- data/decidim-admin/app/views/decidim/admin/users/_form.html.erb +5 -4
- data/decidim-admin/app/views/decidim/admin/users/index.html.erb +57 -52
- data/decidim-admin/app/views/decidim/admin/users/new.html.erb +10 -7
- data/decidim-admin/app/views/layouts/decidim/admin/_application.html.erb +23 -36
- data/decidim-admin/app/views/layouts/decidim/admin/_callouts_full.html.erb +10 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_language_chooser.html.erb +9 -9
- data/decidim-admin/app/views/layouts/decidim/admin/_main_nav.html.erb +11 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_template_bottom.html.erb +2 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_template_top.html.erb +3 -0
- data/decidim-admin/app/views/layouts/decidim/admin/_title_bar.html.erb +20 -0
- data/decidim-admin/app/views/layouts/decidim/admin/newsletters.erb +14 -0
- data/decidim-admin/app/views/layouts/decidim/admin/pages.html.erb +14 -0
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_process.html.erb +55 -53
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_process_groups.html.erb +14 -0
- data/decidim-admin/app/views/layouts/decidim/admin/participatory_processes.html.erb +14 -0
- data/decidim-admin/app/views/layouts/decidim/admin/settings.html.erb +19 -0
- data/decidim-admin/app/views/layouts/decidim/admin/users.html.erb +21 -0
- data/decidim-admin/config/i18n-tasks.yml +1 -0
- data/decidim-admin/config/locales/ca.yml +77 -22
- data/decidim-admin/config/locales/en.yml +75 -20
- data/decidim-admin/config/locales/es.yml +77 -22
- data/decidim-admin/config/locales/eu.yml +191 -16
- data/decidim-admin/config/locales/fi.yml +0 -29
- data/decidim-admin/config/routes.rb +1 -1
- data/decidim-admin/lib/decidim/admin/test/manage_attachments_examples.rb +11 -11
- data/decidim-admin/spec/commands/deliver_newsletter_spec.rb +4 -1
- data/decidim-admin/spec/commands/update_participatory_process_spec.rb +117 -0
- data/decidim-admin/spec/features/admin_invite_spec.rb +5 -1
- data/decidim-admin/spec/features/admin_manages_feature_permissions_spec.rb +1 -1
- data/decidim-admin/spec/features/admin_manages_features_spec.rb +10 -10
- data/decidim-admin/spec/features/admin_manages_newsletters_spec.rb +11 -9
- data/decidim-admin/spec/features/admin_manages_organization_admins_spec.rb +8 -5
- data/decidim-admin/spec/features/admin_manages_organization_scopes_spec.rb +7 -6
- data/decidim-admin/spec/features/admin_manages_organization_spec.rb +14 -0
- data/decidim-admin/spec/features/admin_manages_participatory_process_groups_spec.rb +6 -6
- data/decidim-admin/spec/features/admin_manages_participatory_processes_spec.rb +27 -5
- data/decidim-admin/spec/features/admin_manages_user_groups_spec.rb +1 -1
- data/decidim-admin/spec/features/participatory_process_admin_manages_participatory_process_admins_spec.rb +2 -2
- data/decidim-admin/spec/features/static_pages_spec.rb +9 -7
- data/decidim-admin/spec/jobs/newsletter_job_spec.rb +2 -0
- data/decidim-admin/spec/queries/process_admin_roles_for_process_spec.rb +4 -3
- data/decidim-admin/spec/shared/manage_process_admins_examples.rb +31 -8
- data/decidim-admin/spec/shared/manage_process_attachments_examples.rb +1 -1
- data/decidim-admin/spec/shared/manage_process_categories_examples.rb +11 -26
- data/decidim-admin/spec/shared/manage_process_steps_examples.rb +8 -23
- data/decidim-admin/spec/shared/manage_processes_examples.rb +5 -33
- data/decidim-admin/spec/support/processes_menu_links_helpers.rb +1 -1
- data/decidim-admin/yarn.lock +4 -0
- data/decidim-api/app/controllers/decidim/api/application_controller.rb +2 -1
- data/decidim-budgets/app/controllers/decidim/budgets/admin/projects_controller.rb +1 -1
- data/decidim-budgets/app/controllers/decidim/budgets/line_items_controller.rb +21 -15
- data/decidim-budgets/app/views/decidim/budgets/admin/projects/_form.html.erb +34 -24
- data/decidim-budgets/app/views/decidim/budgets/admin/projects/edit.html.erb +3 -5
- data/decidim-budgets/app/views/decidim/budgets/admin/projects/index.html.erb +52 -34
- data/decidim-budgets/app/views/decidim/budgets/admin/projects/new.html.erb +4 -5
- data/decidim-budgets/app/views/decidim/budgets/projects/_filters.html.erb +1 -1
- data/decidim-budgets/config/i18n-tasks.yml +1 -0
- data/decidim-budgets/config/locales/ca.yml +5 -0
- data/decidim-budgets/config/locales/en.yml +5 -0
- data/decidim-budgets/config/locales/es.yml +5 -0
- data/decidim-budgets/config/locales/eu.yml +27 -0
- data/decidim-budgets/spec/features/orders_spec.rb +22 -0
- data/decidim-budgets/spec/shared/manage_attachments_examples.rb +1 -1
- data/decidim-budgets/spec/shared/manage_projects_examples.rb +10 -8
- data/decidim-comments/README.md +33 -0
- data/decidim-comments/app/assets/javascripts/decidim/comments/bundle.js +0 -0
- data/decidim-comments/app/assets/javascripts/decidim/comments/comments.js.erb +2 -0
- data/decidim-comments/app/frontend/application/{apollo_client.js → apollo_client.ts} +5 -5
- data/decidim-comments/app/frontend/application/application.component.test.tsx +36 -0
- data/decidim-comments/app/frontend/application/application.component.tsx +37 -0
- data/decidim-comments/app/frontend/application/icon.component.test.tsx +49 -0
- data/decidim-comments/app/frontend/application/icon.component.tsx +35 -0
- data/decidim-comments/app/frontend/comments/{add_comment_form.component.test.jsx → add_comment_form.component.test.tsx} +98 -92
- data/decidim-comments/app/frontend/comments/{add_comment_form.component.jsx → add_comment_form.component.tsx} +152 -153
- data/decidim-comments/app/frontend/comments/{comment.component.test.jsx → comment.component.test.tsx} +59 -71
- data/decidim-comments/app/frontend/comments/{comment.component.jsx → comment.component.tsx} +114 -116
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.test.tsx +21 -0
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.tsx +88 -0
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.tsx +65 -0
- data/decidim-comments/app/frontend/comments/comment_thread.component.tsx +70 -0
- data/decidim-comments/app/frontend/comments/{comments.component.test.jsx → comments.component.test.tsx} +38 -81
- data/decidim-comments/app/frontend/comments/{comments.component.jsx → comments.component.tsx} +49 -63
- data/decidim-comments/app/frontend/comments/down_vote_button.component.test.tsx +39 -0
- data/decidim-comments/app/frontend/comments/down_vote_button.component.tsx +89 -0
- data/decidim-comments/app/frontend/comments/up_vote_button.component.test.tsx +39 -0
- data/decidim-comments/app/frontend/comments/up_vote_button.component.tsx +89 -0
- data/decidim-comments/app/frontend/comments/vote_button.component.tsx +36 -0
- data/decidim-comments/app/frontend/comments/{vote_button_component.test.jsx → vote_button_component.test.tsx} +16 -20
- data/decidim-comments/app/frontend/entry.ts +19 -0
- data/decidim-comments/app/frontend/{comments → fragments}/add_comment_form_commentable.fragment.graphql +1 -1
- data/decidim-comments/app/frontend/{comments → fragments}/add_comment_form_session.fragment.graphql +1 -1
- data/decidim-comments/app/frontend/{comments → fragments}/comment.fragment.graphql +3 -1
- data/decidim-comments/app/frontend/{comments → fragments}/comment_data.fragment.graphql +6 -3
- data/decidim-comments/app/frontend/{comments → fragments}/comment_thread.fragment.graphql +3 -1
- data/decidim-comments/app/frontend/{comments/down_vote.fragment.graphql → fragments/down_vote_button.fragment.graphql} +2 -2
- data/decidim-comments/app/frontend/{comments/up_vote.fragment.graphql → fragments/up_vote_button.fragment.graphql} +2 -2
- data/decidim-comments/app/frontend/{comments/add_comment_form.mutation.graphql → mutations/add_comment.mutation.graphql} +3 -1
- data/decidim-comments/app/frontend/{comments → mutations}/down_vote.mutation.graphql +3 -1
- data/decidim-comments/app/frontend/{comments → mutations}/up_vote.mutation.graphql +3 -1
- data/decidim-comments/app/frontend/{comments → queries}/comments.query.graphql +4 -1
- data/decidim-comments/app/frontend/support/{asset_url.js → asset_url.ts} +1 -1
- data/decidim-comments/app/frontend/support/{generate_comments_data.js → generate_comments_data.ts} +11 -6
- data/decidim-comments/app/frontend/support/{generate_user_data.js → generate_user_data.ts} +2 -2
- data/decidim-comments/app/frontend/support/{generate_user_group_data.js → generate_user_group_data.ts} +2 -2
- data/decidim-comments/app/frontend/support/graphql_transformer.js +32 -0
- data/decidim-comments/app/frontend/support/load_translations.ts +44 -0
- data/decidim-comments/app/frontend/support/{require_all.js → require_all.ts} +1 -1
- data/decidim-comments/app/frontend/support/{resolve_graphql_query.js → resolve_graphql_query.ts} +7 -7
- data/decidim-comments/app/frontend/support/schema.ts +119 -0
- data/decidim-comments/config/locales/eu.yml +29 -5
- data/decidim-dev/Rakefile +2 -0
- data/decidim-dev/config/locales/eu.yml +1 -1
- data/decidim-dev/decidim-dev.gemspec +1 -1
- data/decidim-dev/lib/decidim/dev/test/rspec_support/capybara.rb +1 -4
- data/decidim-dev/lib/decidim/dev/test/rspec_support/feature.rb +1 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/helpers.rb +1 -1
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/phantomjs-shim.js +215 -0
- data/decidim-dev/lib/decidim/dev/test/rspec_support/translation_helpers.rb +1 -1
- data/decidim-dev/lib/generators/decidim/dummy_generator.rb +5 -0
- data/decidim-meetings/app/controllers/decidim/meetings/admin/application_controller.rb +1 -1
- data/decidim-meetings/app/views/decidim/meetings/admin/meeting_closes/_form.html.erb +30 -19
- data/decidim-meetings/app/views/decidim/meetings/admin/meeting_closes/edit.html.erb +3 -5
- data/decidim-meetings/app/views/decidim/meetings/admin/meetings/_form.html.erb +46 -35
- data/decidim-meetings/app/views/decidim/meetings/admin/meetings/edit.html.erb +5 -6
- data/decidim-meetings/app/views/decidim/meetings/admin/meetings/index.html.erb +72 -51
- data/decidim-meetings/app/views/decidim/meetings/admin/meetings/new.html.erb +4 -6
- data/decidim-meetings/app/views/decidim/meetings/meetings/_filters.html.erb +1 -1
- data/decidim-meetings/config/locales/ca.yml +2 -1
- data/decidim-meetings/config/locales/en.yml +2 -1
- data/decidim-meetings/config/locales/es.yml +2 -1
- data/decidim-meetings/config/locales/eu.yml +25 -5
- data/decidim-meetings/config/locales/fi.yml +0 -1
- data/decidim-meetings/spec/shared/manage_attachments_examples.rb +1 -1
- data/decidim-meetings/spec/shared/manage_meetings_examples.rb +18 -16
- data/decidim-pages/app/views/decidim/pages/admin/pages/_form.html.erb +10 -3
- data/decidim-pages/app/views/decidim/pages/admin/pages/edit.html.erb +3 -5
- data/decidim-pages/config/locales/eu.yml +4 -2
- data/decidim-pages/spec/features/admin_spec.rb +1 -1
- data/decidim-proposals/app/controllers/decidim/proposals/admin/proposals_controller.rb +1 -1
- data/decidim-proposals/app/views/decidim/proposals/admin/proposal_answers/edit.html.erb +14 -8
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/_form.html.erb +28 -20
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/index.html.erb +60 -43
- data/decidim-proposals/app/views/decidim/proposals/admin/proposals/new.html.erb +3 -5
- data/decidim-proposals/app/views/decidim/proposals/proposals/_filters.html.erb +1 -1
- data/decidim-proposals/config/locales/ca.yml +3 -0
- data/decidim-proposals/config/locales/en.yml +4 -1
- data/decidim-proposals/config/locales/es.yml +3 -0
- data/decidim-proposals/config/locales/eu.yml +42 -19
- data/decidim-proposals/config/locales/fi.yml +0 -1
- data/decidim-proposals/spec/shared/manage_proposals_examples.rb +15 -13
- data/decidim-results/README.md +1 -1
- data/decidim-results/app/controllers/decidim/results/admin/results_controller.rb +1 -1
- data/decidim-results/app/views/decidim/results/admin/results/_form.html.erb +30 -21
- data/decidim-results/app/views/decidim/results/admin/results/edit.html.erb +4 -5
- data/decidim-results/app/views/decidim/results/admin/results/index.html.erb +40 -25
- data/decidim-results/app/views/decidim/results/admin/results/new.html.erb +4 -5
- data/decidim-results/app/views/decidim/results/results/_filters.html.erb +1 -1
- data/decidim-results/config/locales/ca.yml +2 -0
- data/decidim-results/config/locales/en.yml +2 -0
- data/decidim-results/config/locales/es.yml +2 -0
- data/decidim-results/config/locales/eu.yml +22 -4
- data/decidim-results/spec/shared/manage_results_examples.rb +10 -8
- data/decidim-system/config/locales/eu.yml +60 -2
- data/lib/generators/decidim/app_generator.rb +0 -4
- data/lib/generators/decidim/install_generator.rb +0 -4
- data/lib/generators/decidim/templates/README.md.erb +18 -18
- data/package.json +47 -22
- data/tsconfig.json +17 -0
- data/tslint.json +12 -0
- data/webpack.config.js +8 -6
- data/webpack.d.ts +5 -0
- data/yarn.lock +1461 -781
- metadata +119 -83
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_actions.scss +0 -8
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_forms.scss +0 -10
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_foundation_and_overrides.scss +0 -53
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_icons.scss +0 -9
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_layout.scss +0 -27
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_settings.scss +0 -566
- data/decidim-admin/app/assets/stylesheets/decidim/admin/_tables.scss +0 -21
- data/decidim-admin/app/views/layouts/decidim/admin/_login_items.html.erb +0 -8
- data/decidim-admin/app/views/layouts/decidim/admin/_sidebar.html.erb +0 -22
- data/decidim-comments/app/frontend/application/application.component.jsx +0 -37
- data/decidim-comments/app/frontend/application/application.component.test.jsx +0 -33
- data/decidim-comments/app/frontend/application/icon.component.jsx +0 -26
- data/decidim-comments/app/frontend/application/icon.component.test.jsx +0 -53
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.jsx +0 -72
- data/decidim-comments/app/frontend/comments/comment_order_selector.component.test.jsx +0 -20
- data/decidim-comments/app/frontend/comments/comment_thread.component.jsx +0 -75
- data/decidim-comments/app/frontend/comments/comment_thread.component.test.jsx +0 -83
- data/decidim-comments/app/frontend/comments/down_vote_button.component.jsx +0 -98
- data/decidim-comments/app/frontend/comments/down_vote_button.component.test.jsx +0 -48
- data/decidim-comments/app/frontend/comments/featured_comment.component.jsx +0 -23
- data/decidim-comments/app/frontend/comments/featured_comment.component.test.jsx +0 -15
- data/decidim-comments/app/frontend/comments/up_vote_button.component.jsx +0 -98
- data/decidim-comments/app/frontend/comments/up_vote_button.component.test.jsx +0 -48
- data/decidim-comments/app/frontend/comments/vote_button.component.jsx +0 -32
- data/decidim-comments/app/frontend/entry.js +0 -17
- data/decidim-comments/app/frontend/entry.test.js +0 -31
- data/decidim-comments/app/frontend/support/load_translations.js +0 -23
- data/decidim-comments/app/frontend/support/stub_component.js +0 -29
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/bind-polyfill.js +0 -18
- data/decidim-dev/lib/decidim/dev/test/rspec_support/phantomjs_polyfills/object-assign-polyfill.js +0 -24
- data/karma.conf.js +0 -45
- data/lib/generators/decidim/review_app_generator.rb +0 -53
- data/lib/generators/decidim/templates/app.json.erb +0 -16
@@ -1,98 +0,0 @@
|
|
1
|
-
import { PropTypes } from 'react';
|
2
|
-
import { propType } from 'graphql-anywhere';
|
3
|
-
import { graphql } from 'react-apollo';
|
4
|
-
import gql from 'graphql-tag';
|
5
|
-
|
6
|
-
import VoteButton from './vote_button.component';
|
7
|
-
|
8
|
-
import downVoteMutation from './down_vote.mutation.graphql';
|
9
|
-
|
10
|
-
import commentFragment from './comment.fragment.graphql';
|
11
|
-
import commentDataFragment from './comment_data.fragment.graphql';
|
12
|
-
import upVoteFragment from './up_vote.fragment.graphql';
|
13
|
-
import downVoteFragment from './down_vote.fragment.graphql';
|
14
|
-
|
15
|
-
export const DownVoteButton = ({ comment: { downVotes, upVoted, downVoted }, downVote }) => {
|
16
|
-
let selectedClass = '';
|
17
|
-
|
18
|
-
if (downVoted) {
|
19
|
-
selectedClass = 'is-vote-selected';
|
20
|
-
} else if (upVoted) {
|
21
|
-
selectedClass = 'is-vote-notselected';
|
22
|
-
}
|
23
|
-
|
24
|
-
return (
|
25
|
-
<VoteButton
|
26
|
-
buttonClassName="comment__votes--down"
|
27
|
-
iconName="icon-chevron-bottom"
|
28
|
-
votes={downVotes}
|
29
|
-
voteAction={downVote}
|
30
|
-
disabled={upVoted || downVoted}
|
31
|
-
selectedClass={selectedClass}
|
32
|
-
/>
|
33
|
-
);
|
34
|
-
};
|
35
|
-
|
36
|
-
DownVoteButton.fragments = {
|
37
|
-
comment: gql`
|
38
|
-
${downVoteFragment}
|
39
|
-
`
|
40
|
-
};
|
41
|
-
|
42
|
-
DownVoteButton.propTypes = {
|
43
|
-
comment: propType(DownVoteButton.fragments.comment).isRequired,
|
44
|
-
downVote: PropTypes.func.isRequired
|
45
|
-
};
|
46
|
-
|
47
|
-
const DownVoteButtonWithMutation = graphql(gql`
|
48
|
-
${downVoteMutation}
|
49
|
-
${commentFragment}
|
50
|
-
${commentDataFragment}
|
51
|
-
${upVoteFragment}
|
52
|
-
${downVoteFragment}
|
53
|
-
`, {
|
54
|
-
props: ({ ownProps, mutate }) => ({
|
55
|
-
downVote: () => mutate({
|
56
|
-
variables: {
|
57
|
-
id: ownProps.comment.id
|
58
|
-
},
|
59
|
-
optimisticResponse: {
|
60
|
-
__typename: 'Mutation',
|
61
|
-
comment: {
|
62
|
-
__typename: 'CommentMutation',
|
63
|
-
downVote: {
|
64
|
-
__typename: 'Comment',
|
65
|
-
...ownProps.comment,
|
66
|
-
downVotes: ownProps.comment.downVotes + 1,
|
67
|
-
downVoted: true
|
68
|
-
}
|
69
|
-
}
|
70
|
-
},
|
71
|
-
updateQueries: {
|
72
|
-
GetComments: (prev, { mutationResult: { data } }) => {
|
73
|
-
const commentReducer = (comment) => {
|
74
|
-
const replies = comment.comments || [];
|
75
|
-
|
76
|
-
if (comment.id === ownProps.comment.id) {
|
77
|
-
return data.comment.downVote;
|
78
|
-
}
|
79
|
-
return {
|
80
|
-
...comment,
|
81
|
-
comments: replies.map(commentReducer)
|
82
|
-
};
|
83
|
-
};
|
84
|
-
|
85
|
-
return {
|
86
|
-
...prev,
|
87
|
-
commentable: {
|
88
|
-
...prev.commentable,
|
89
|
-
comments: prev.commentable.comments.map(commentReducer)
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
94
|
-
})
|
95
|
-
})
|
96
|
-
})(DownVoteButton);
|
97
|
-
|
98
|
-
export default DownVoteButtonWithMutation;
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import { shallow } from 'enzyme';
|
2
|
-
import { filter } from 'graphql-anywhere';
|
3
|
-
import gql from 'graphql-tag';
|
4
|
-
|
5
|
-
import { DownVoteButton } from './down_vote_button.component';
|
6
|
-
|
7
|
-
import VoteButton from './vote_button.component';
|
8
|
-
|
9
|
-
import downVoteFragment from './down_vote.fragment.graphql';
|
10
|
-
|
11
|
-
import stubComponent from '../support/stub_component';
|
12
|
-
import generateCommentsData from '../support/generate_comments_data';
|
13
|
-
|
14
|
-
describe("<DownVoteButton />", () => {
|
15
|
-
let comment = {};
|
16
|
-
const downVote = () => {};
|
17
|
-
|
18
|
-
stubComponent(VoteButton);
|
19
|
-
|
20
|
-
beforeEach(() => {
|
21
|
-
let commentsData = generateCommentsData(1);
|
22
|
-
|
23
|
-
const fragment = gql`
|
24
|
-
${downVoteFragment}
|
25
|
-
`;
|
26
|
-
|
27
|
-
comment = filter(fragment, commentsData[0]);
|
28
|
-
});
|
29
|
-
|
30
|
-
it("should render a VoteButton component with the correct props", () => {
|
31
|
-
const wrapper = shallow(<DownVoteButton comment={comment} downVote={downVote} />);
|
32
|
-
expect(wrapper.find(VoteButton)).to.have.prop("buttonClassName").equal("comment__votes--down");
|
33
|
-
expect(wrapper.find(VoteButton)).to.have.prop("iconName").equal("icon-chevron-bottom");
|
34
|
-
expect(wrapper.find(VoteButton)).to.have.prop("votes").equal(comment.downVotes);
|
35
|
-
});
|
36
|
-
|
37
|
-
it("should pass disabled prop as true if comment downVoted is true", () => {
|
38
|
-
comment.downVoted = true;
|
39
|
-
const wrapper = shallow(<DownVoteButton comment={comment} downVote={downVote} />);
|
40
|
-
expect(wrapper.find(VoteButton)).to.have.prop("disabled").equal(true);
|
41
|
-
});
|
42
|
-
|
43
|
-
it("should pass disabled prop as true if comment downVoted is true", () => {
|
44
|
-
comment.downVoted = true;
|
45
|
-
const wrapper = shallow(<DownVoteButton comment={comment} downVote={downVote} />);
|
46
|
-
expect(wrapper.find(VoteButton)).to.have.prop("disabled").equal(true);
|
47
|
-
});
|
48
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { Component } from 'react';
|
2
|
-
import { I18n } from 'react-i18nify';
|
3
|
-
|
4
|
-
import Comment from './comment.component';
|
5
|
-
|
6
|
-
/**
|
7
|
-
* A wrapper component for a highlighted component.
|
8
|
-
* @class
|
9
|
-
* @augments Component
|
10
|
-
* @todo It's not used right now
|
11
|
-
*/
|
12
|
-
export default class FeaturedComment extends Component {
|
13
|
-
render() {
|
14
|
-
return (
|
15
|
-
<section className="comments">
|
16
|
-
<h4 className="section-heading">{ I18n.t("components.featured_comment.title") }</h4>
|
17
|
-
<div className="comment-thread comment--pinned">
|
18
|
-
<Comment />
|
19
|
-
</div>
|
20
|
-
</section>
|
21
|
-
);
|
22
|
-
}
|
23
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { shallow } from 'enzyme';
|
2
|
-
|
3
|
-
import FeaturedComment from './featured_comment.component';
|
4
|
-
import Comment from './comment.component';
|
5
|
-
|
6
|
-
import stubComponent from '../support/stub_component';
|
7
|
-
|
8
|
-
describe('<FeaturedComment />', () => {
|
9
|
-
stubComponent(Comment);
|
10
|
-
|
11
|
-
it("should render a section of class comments", () => {
|
12
|
-
const wrapper = shallow(<FeaturedComment />);
|
13
|
-
expect(wrapper.find('section.comments')).to.be.present();
|
14
|
-
});
|
15
|
-
});
|
@@ -1,98 +0,0 @@
|
|
1
|
-
import { PropTypes } from 'react';
|
2
|
-
import { propType } from 'graphql-anywhere';
|
3
|
-
import { graphql } from 'react-apollo';
|
4
|
-
import gql from 'graphql-tag';
|
5
|
-
|
6
|
-
import VoteButton from './vote_button.component';
|
7
|
-
|
8
|
-
import upVoteMutation from './up_vote.mutation.graphql';
|
9
|
-
|
10
|
-
import commentFragment from './comment.fragment.graphql';
|
11
|
-
import commentDataFragment from './comment_data.fragment.graphql';
|
12
|
-
import upVoteFragment from './up_vote.fragment.graphql';
|
13
|
-
import downVoteFragment from './down_vote.fragment.graphql';
|
14
|
-
|
15
|
-
export const UpVoteButton = ({ comment: { upVotes, upVoted, downVoted }, upVote }) => {
|
16
|
-
let selectedClass = '';
|
17
|
-
|
18
|
-
if (upVoted) {
|
19
|
-
selectedClass = 'is-vote-selected';
|
20
|
-
} else if (downVoted) {
|
21
|
-
selectedClass = 'is-vote-notselected';
|
22
|
-
}
|
23
|
-
|
24
|
-
return (
|
25
|
-
<VoteButton
|
26
|
-
buttonClassName="comment__votes--up"
|
27
|
-
iconName="icon-chevron-top"
|
28
|
-
votes={upVotes}
|
29
|
-
voteAction={upVote}
|
30
|
-
disabled={upVoted || downVoted}
|
31
|
-
selectedClass={selectedClass}
|
32
|
-
/>
|
33
|
-
);
|
34
|
-
}
|
35
|
-
|
36
|
-
UpVoteButton.fragments = {
|
37
|
-
comment: gql`
|
38
|
-
${upVoteFragment}
|
39
|
-
`
|
40
|
-
};
|
41
|
-
|
42
|
-
UpVoteButton.propTypes = {
|
43
|
-
comment: propType(UpVoteButton.fragments.comment).isRequired,
|
44
|
-
upVote: PropTypes.func.isRequired
|
45
|
-
};
|
46
|
-
|
47
|
-
const UpVoteButtonWithMutation = graphql(gql`
|
48
|
-
${upVoteMutation}
|
49
|
-
${commentFragment}
|
50
|
-
${commentDataFragment}
|
51
|
-
${upVoteFragment}
|
52
|
-
${downVoteFragment}
|
53
|
-
`, {
|
54
|
-
props: ({ ownProps, mutate }) => ({
|
55
|
-
upVote: () => mutate({
|
56
|
-
variables: {
|
57
|
-
id: ownProps.comment.id
|
58
|
-
},
|
59
|
-
optimisticResponse: {
|
60
|
-
__typename: 'Mutation',
|
61
|
-
comment: {
|
62
|
-
__typename: 'CommentMutation',
|
63
|
-
upVote: {
|
64
|
-
__typename: 'Comment',
|
65
|
-
...ownProps.comment,
|
66
|
-
upVotes: ownProps.comment.upVotes + 1,
|
67
|
-
upVoted: true
|
68
|
-
}
|
69
|
-
}
|
70
|
-
},
|
71
|
-
updateQueries: {
|
72
|
-
GetComments: (prev, { mutationResult: { data } }) => {
|
73
|
-
const commentReducer = (comment) => {
|
74
|
-
const replies = comment.comments || [];
|
75
|
-
|
76
|
-
if (comment.id === ownProps.comment.id) {
|
77
|
-
return data.comment.upVote;
|
78
|
-
}
|
79
|
-
return {
|
80
|
-
...comment,
|
81
|
-
comments: replies.map(commentReducer)
|
82
|
-
};
|
83
|
-
};
|
84
|
-
|
85
|
-
return {
|
86
|
-
...prev,
|
87
|
-
commentable: {
|
88
|
-
...prev.commentable,
|
89
|
-
comments: prev.commentable.comments.map(commentReducer)
|
90
|
-
}
|
91
|
-
}
|
92
|
-
}
|
93
|
-
}
|
94
|
-
})
|
95
|
-
})
|
96
|
-
})(UpVoteButton);
|
97
|
-
|
98
|
-
export default UpVoteButtonWithMutation;
|
@@ -1,48 +0,0 @@
|
|
1
|
-
import { shallow } from 'enzyme';
|
2
|
-
import { filter } from 'graphql-anywhere';
|
3
|
-
import gql from 'graphql-tag';
|
4
|
-
|
5
|
-
import { UpVoteButton } from './up_vote_button.component';
|
6
|
-
|
7
|
-
import VoteButton from './vote_button.component';
|
8
|
-
|
9
|
-
import upVoteFragment from './up_vote.fragment.graphql';
|
10
|
-
|
11
|
-
import stubComponent from '../support/stub_component';
|
12
|
-
import generateCommentsData from '../support/generate_comments_data';
|
13
|
-
|
14
|
-
describe("<UpVoteButton />", () => {
|
15
|
-
let comment = {};
|
16
|
-
const upVote = () => {};
|
17
|
-
|
18
|
-
stubComponent(VoteButton);
|
19
|
-
|
20
|
-
beforeEach(() => {
|
21
|
-
let commentsData = generateCommentsData(1);
|
22
|
-
|
23
|
-
const fragment = gql`
|
24
|
-
${upVoteFragment}
|
25
|
-
`;
|
26
|
-
|
27
|
-
comment = filter(fragment, commentsData[0]);
|
28
|
-
});
|
29
|
-
|
30
|
-
it("should render a VoteButton component with the correct props", () => {
|
31
|
-
const wrapper = shallow(<UpVoteButton comment={comment} upVote={upVote} />);
|
32
|
-
expect(wrapper.find(VoteButton)).to.have.prop("buttonClassName").equal("comment__votes--up");
|
33
|
-
expect(wrapper.find(VoteButton)).to.have.prop("iconName").equal("icon-chevron-top");
|
34
|
-
expect(wrapper.find(VoteButton)).to.have.prop("votes").equal(comment.upVotes);
|
35
|
-
});
|
36
|
-
|
37
|
-
it("should pass disabled prop as true if comment upVoted is true", () => {
|
38
|
-
comment.upVoted = true;
|
39
|
-
const wrapper = shallow(<UpVoteButton comment={comment} upVote={upVote} />);
|
40
|
-
expect(wrapper.find(VoteButton)).to.have.prop("disabled").equal(true);
|
41
|
-
});
|
42
|
-
|
43
|
-
it("should pass disabled prop as true if comment downVoted is true", () => {
|
44
|
-
comment.downVoted = true;
|
45
|
-
const wrapper = shallow(<UpVoteButton comment={comment} upVote={upVote} />);
|
46
|
-
expect(wrapper.find(VoteButton)).to.have.prop("disabled").equal(true);
|
47
|
-
});
|
48
|
-
});
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import { Component, PropTypes } from 'react';
|
2
|
-
import Icon from '../application/icon.component';
|
3
|
-
|
4
|
-
class VoteButton extends Component {
|
5
|
-
render() {
|
6
|
-
const { buttonClassName, iconName, votes, voteAction, disabled, selectedClass } = this.props;
|
7
|
-
let voteClasses = `${buttonClassName} ${selectedClass}`;
|
8
|
-
|
9
|
-
return (
|
10
|
-
<button className={voteClasses} onClick={() => voteAction()} disabled={disabled}>
|
11
|
-
<Icon name={iconName} iconExtraClassName="icon--small" />
|
12
|
-
{ ` ${votes}` }
|
13
|
-
</button>
|
14
|
-
);
|
15
|
-
}
|
16
|
-
}
|
17
|
-
|
18
|
-
VoteButton.propTypes = {
|
19
|
-
buttonClassName: PropTypes.string.isRequired,
|
20
|
-
iconName: PropTypes.string.isRequired,
|
21
|
-
votes: PropTypes.number.isRequired,
|
22
|
-
voteAction: PropTypes.func.isRequired,
|
23
|
-
selectedClass: PropTypes.string,
|
24
|
-
disabled: PropTypes.bool
|
25
|
-
};
|
26
|
-
|
27
|
-
VoteButton.defaultProps = {
|
28
|
-
selectedClass: "selected",
|
29
|
-
disabled: false
|
30
|
-
};
|
31
|
-
|
32
|
-
export default VoteButton;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import ReactDOM from 'react-dom';
|
2
|
-
|
3
|
-
import loadTranslations from './support/load_translations';
|
4
|
-
import Comments from './comments/comments.component';
|
5
|
-
|
6
|
-
// Expose global components
|
7
|
-
window.DecidimComments.renderCommentsComponent = (nodeId, props) => {
|
8
|
-
var node = $(`#${nodeId}`)[0];
|
9
|
-
|
10
|
-
ReactDOM.render(
|
11
|
-
React.createElement(Comments, props),
|
12
|
-
node
|
13
|
-
);
|
14
|
-
};
|
15
|
-
|
16
|
-
// Load component locales from yaml files
|
17
|
-
loadTranslations();
|
@@ -1,31 +0,0 @@
|
|
1
|
-
// ---------------------------------------
|
2
|
-
// Test Environment Setup
|
3
|
-
// ---------------------------------------
|
4
|
-
import sinon from 'sinon/pkg/sinon';
|
5
|
-
import chai from 'chai';
|
6
|
-
import sinonChai from 'sinon-chai';
|
7
|
-
import chaiAsPromised from 'chai-as-promised';
|
8
|
-
import chaiEnzyme from 'chai-enzyme';
|
9
|
-
import loadTranslations from './support/load_translations';
|
10
|
-
import requireAll from './support/require_all';
|
11
|
-
|
12
|
-
require('jquery');
|
13
|
-
|
14
|
-
//
|
15
|
-
chai.use(sinonChai)
|
16
|
-
chai.use(chaiAsPromised)
|
17
|
-
chai.use(chaiEnzyme())
|
18
|
-
//
|
19
|
-
window.chai = chai
|
20
|
-
window.sinon = sinon
|
21
|
-
window.expect = chai.expect
|
22
|
-
window.should = chai.should()
|
23
|
-
|
24
|
-
// ---------------------------------------
|
25
|
-
// Require Tests
|
26
|
-
// ---------------------------------------
|
27
|
-
requireAll(require.context('./application/', true, /\.test\.jsx?$/));
|
28
|
-
requireAll(require.context('./comments/', true, /\.test\.jsx?$/));
|
29
|
-
|
30
|
-
// Load component locales from yaml files
|
31
|
-
loadTranslations();
|
@@ -1,23 +0,0 @@
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
2
|
-
import { I18n } from 'react-i18nify';
|
3
|
-
import requireAll from './require_all';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* Load components translations from yaml files and import them into
|
7
|
-
* react-i18ify system so they can be used via `I18n.t` method.
|
8
|
-
* @returns {Void} - Nothing
|
9
|
-
*/
|
10
|
-
const loadTranslations = () => {
|
11
|
-
const translationsContext = require.context('../../../config/locales/', true, /\.yml$/);
|
12
|
-
const translationFiles = requireAll(translationsContext);
|
13
|
-
|
14
|
-
const translations = translationsContext.keys().reduce((acc, key, index) => {
|
15
|
-
const locale = key.match(/\.\/(.*)\.yml/)[1];
|
16
|
-
acc[locale] = translationFiles[index][locale].decidim;
|
17
|
-
return acc;
|
18
|
-
}, {});
|
19
|
-
|
20
|
-
I18n.setTranslations(translations);
|
21
|
-
};
|
22
|
-
|
23
|
-
export default loadTranslations;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
/* eslint-disable no-param-reassign */
|
2
|
-
|
3
|
-
/**
|
4
|
-
* A helper function to stub the `propTypes` and `fragments` of a component.
|
5
|
-
* Useful for testing isolated components so the children propTypes are not
|
6
|
-
* evaluated.
|
7
|
-
* @param {ReactComponent} componentClass - A component constructor function or class
|
8
|
-
* @param {Object} options - An object which properties are used to stub component properties.
|
9
|
-
* @returns {ReactComponent} - A component with some properties stubbed
|
10
|
-
*/
|
11
|
-
const stubComponent = function(componentClass, options = {}) {
|
12
|
-
let originalPropTypes = {};
|
13
|
-
let originalFragments = {};
|
14
|
-
|
15
|
-
beforeEach(function() {
|
16
|
-
originalPropTypes = componentClass.propTypes;
|
17
|
-
originalFragments = componentClass.fragments;
|
18
|
-
|
19
|
-
componentClass.propTypes = options.propTypes || {};
|
20
|
-
componentClass.fragments = options.fragments || {};
|
21
|
-
});
|
22
|
-
|
23
|
-
afterEach(function() {
|
24
|
-
componentClass.propTypes = originalPropTypes;
|
25
|
-
componentClass.fragments = originalFragments;
|
26
|
-
});
|
27
|
-
};
|
28
|
-
|
29
|
-
export default stubComponent;
|