decidim-admin 0.24.0 → 0.25.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of decidim-admin might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/cells/decidim/admin/content_block/show.erb +2 -2
- data/app/commands/decidim/admin/block_user.rb +6 -0
- data/app/commands/decidim/admin/create_attachment.rb +2 -1
- data/app/commands/decidim/admin/hide_resource.rb +1 -0
- data/app/commands/decidim/admin/process_participatory_space_private_user_import_csv.rb +1 -1
- data/app/commands/decidim/admin/update_attachment.rb +5 -1
- data/app/commands/decidim/admin/update_content_block.rb +1 -1
- data/app/commands/decidim/admin/update_external_domain_whitelist.rb +32 -0
- data/app/commands/decidim/admin/update_organization.rb +2 -1
- data/app/commands/decidim/admin/update_organization_appearance.rb +4 -14
- data/app/controllers/concerns/decidim/admin/filterable.rb +1 -3
- data/app/controllers/concerns/decidim/participatory_space_private_users/admin/filterable.rb +34 -0
- data/app/controllers/decidim/admin/concerns/has_attachments.rb +1 -4
- data/app/controllers/decidim/admin/concerns/has_private_users.rb +6 -3
- data/app/controllers/decidim/admin/imports_controller.rb +1 -0
- data/app/controllers/decidim/admin/moderated_users_controller.rb +6 -2
- data/app/controllers/decidim/admin/organization_controller.rb +11 -1
- data/app/controllers/decidim/admin/organization_external_domain_whitelist_controller.rb +38 -0
- data/app/controllers/decidim/admin/users_controller.rb +7 -1
- data/app/forms/decidim/admin/external_domain_form.rb +19 -0
- data/app/forms/decidim/admin/import_form.rb +1 -0
- data/app/forms/decidim/admin/organization_appearance_form.rb +7 -7
- data/app/forms/decidim/admin/organization_external_domain_whitelist_form.rb +23 -0
- data/app/forms/decidim/admin/organization_form.rb +1 -0
- data/app/forms/decidim/admin/participatory_space_private_user_csv_import_form.rb +2 -0
- data/app/forms/decidim/admin/user_group_csv_verification_form.rb +2 -0
- data/app/helpers/decidim/admin/filterable_helper.rb +1 -1
- data/app/helpers/decidim/admin/menu_helper.rb +7 -7
- data/app/helpers/decidim/admin/uploader_image_dimensions_helper.rb +2 -1
- data/app/jobs/decidim/admin/expire_impersonation_job.rb +1 -2
- data/app/jobs/decidim/admin/import_participatory_space_private_user_csv_job.rb +1 -1
- data/app/packs/entrypoints/decidim_admin.js +43 -0
- data/app/packs/entrypoints/decidim_admin.scss +1 -0
- data/app/packs/src/decidim/admin/application.js +68 -0
- data/app/packs/src/decidim/admin/auto_buttons_by_position.component.js +37 -0
- data/app/packs/src/decidim/admin/auto_label_by_position.component.js +28 -0
- data/app/packs/src/decidim/admin/autocomplete.component.js +146 -0
- data/app/{frontend/components/autocomplete.component.test.tsx → packs/src/decidim/admin/autocomplete.component.test.js} +1 -2
- data/app/packs/src/decidim/admin/budget_rule_toggler.component.js +50 -0
- data/app/{assets/javascripts → packs/src}/decidim/admin/choose_language.js +0 -0
- data/app/packs/src/decidim/admin/draggable-list.js +30 -0
- data/app/packs/src/decidim/admin/dynamic_fields.component.js +230 -0
- data/app/packs/src/decidim/admin/external_domain_whitelist.js +100 -0
- data/app/packs/src/decidim/admin/field_dependent_inputs.component.js +37 -0
- data/app/{assets/javascripts/decidim/admin/form.js.es6 → packs/src/decidim/admin/form.js} +6 -9
- data/app/{assets/javascripts/decidim/admin/import_guidance.js.es6 → packs/src/decidim/admin/import_guidance.js} +2 -3
- data/app/{assets/javascripts/decidim/admin/managed_users.js.es6 → packs/src/decidim/admin/managed_users.js} +4 -4
- data/app/packs/src/decidim/admin/moderations.js +20 -0
- data/app/{assets/javascripts/decidim/admin/newsletters.js.es6 → packs/src/decidim/admin/newsletters.js} +0 -0
- data/app/{assets/javascripts/decidim/admin/officializations.js.es6 → packs/src/decidim/admin/officializations.js} +0 -0
- data/app/{assets/javascripts/decidim/admin/proposal_infinite_edit.js.es6 → packs/src/decidim/admin/proposal_infinite_edit.js} +0 -0
- data/app/{assets/javascripts/decidim/admin/resources_permissions.js.es6 → packs/src/decidim/admin/resources_permissions.js} +3 -5
- data/app/packs/src/decidim/admin/scope_picker_enabler.component.js +12 -0
- data/app/packs/src/decidim/admin/sort_list.component.js +31 -0
- data/app/packs/src/decidim/admin/sortable.js +21 -0
- data/app/packs/src/decidim/admin/subform_multi_toggler.component.js +38 -0
- data/app/packs/src/decidim/admin/subform_toggler.component.js +38 -0
- data/app/{assets/javascripts/decidim/admin/tab_focus.js.es6 → packs/src/decidim/admin/tab_focus.js} +0 -2
- data/app/packs/src/decidim/admin/toggle_nav.js +14 -0
- data/app/{assets/javascripts/decidim/admin/welcome_notification.js.es6 → packs/src/decidim/admin/welcome_notification.js} +2 -2
- data/app/packs/stylesheets/decidim/admin/_decidim.scss +24 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/_variables.scss +0 -0
- data/app/packs/stylesheets/decidim/admin/application.scss +22 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/bundle.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/components/_accordion.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/components/_autocomplete_select.component.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/components/_dropdown-menu.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/components/_sortable.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_action-icon.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_block_user.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_cards.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_categories.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_dropdown_inverted.scss +0 -0
- data/app/packs/stylesheets/decidim/admin/extra/_editor.scss +1 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_email_preview.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_label-required.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_login.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_logs.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_newsletter-templates-gallery.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_organization-appearance.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_quill.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_select_multiple.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_show_email.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_sort.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/extra/_title_bar.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_action-icon.scss +1 -1
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_agenda.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_buttons.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_callouts.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_card-grid.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_cards.scss +1 -1
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_char-counter.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_component-counter.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_draggable-list.scss +2 -2
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_dropdown.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_filters.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_forms.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_icons.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_import_result.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_layout.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_loading-spinner.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_main-nav.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_moderations.scss +0 -0
- data/app/packs/stylesheets/decidim/admin/modules/_modules.scss +43 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_pics.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_process-header.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_reveal.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_secondary-nav.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_table-list.scss +13 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_tabs.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_title-bar.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_typography.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_user-login.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/modules/_users_statistics.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/plugins/_foundation-datepicker.scss +0 -0
- data/{vendor/assets/stylesheets → app/packs/stylesheets/decidim/admin}/plugins/jquery.auto-complete.css +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/user_moderations.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_flex.scss +2 -2
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_helpers.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_keyframes.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_mixins.scss +30 -3
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_settings.scss +11 -3
- data/app/{assets → packs}/stylesheets/decidim/admin/utils/_toggle-expand.scss +0 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/_constants.scss +1 -1
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/_math.scss +0 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_acos.scss +14 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_asin.scss +16 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss +36 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_atan2.scss +46 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_cos.scss +17 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_cot.scss +6 -3
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_csc.scss +6 -3
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_exp.scss +10 -6
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_fact.scss +21 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss +25 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_ldexp.scss +20 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_log.scss +39 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss +34 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_sec.scss +6 -3
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_sin.scss +4 -3
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss +21 -0
- data/app/{assets → packs}/stylesheets/decidim/admin/vendor/mathsass/functions/_tan.scss +6 -3
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/helpers/_deg-to-rad.scss +6 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/helpers/_rad-to-deg.scss +6 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/helpers/_strip-unit.scss +11 -0
- data/app/packs/stylesheets/decidim/admin/vendor/mathsass/helpers/_unitless-rad.scss +19 -0
- data/app/presenters/decidim/admin/simple_menu_presenter.rb +11 -0
- data/app/queries/decidim/admin/newsletter_recipients.rb +3 -1
- data/app/views/decidim/admin/area_types/index.html.erb +2 -2
- data/app/views/decidim/admin/areas/index.html.erb +1 -1
- data/app/views/decidim/admin/attachment_collections/index.html.erb +1 -1
- data/app/views/decidim/admin/categories/index.html.erb +1 -1
- data/app/views/decidim/admin/components/_form.html.erb +0 -2
- data/app/views/decidim/admin/impersonations/_form.html.erb +3 -1
- data/app/views/decidim/admin/imports/new.html.erb +1 -9
- data/app/views/decidim/admin/newsletters/index.html.erb +1 -1
- data/app/views/decidim/admin/newsletters/select_recipients_to_deliver.html.erb +1 -3
- data/app/views/decidim/admin/newsletters/show.html.erb +1 -1
- data/app/views/decidim/admin/officializations/index.html.erb +3 -3
- data/app/views/decidim/admin/organization/_form.html.erb +6 -2
- data/app/views/decidim/admin/organization_appearance/_form.html.erb +0 -2
- data/app/views/decidim/admin/organization_appearance/form/_images.html.erb +20 -4
- data/app/views/decidim/admin/organization_appearance/form/_minimap.html.erb +7 -7
- data/app/views/decidim/admin/organization_external_domain_whitelist/_external_domain.html.erb +31 -0
- data/app/views/decidim/admin/organization_external_domain_whitelist/_form.html.erb +37 -0
- data/app/views/decidim/admin/organization_external_domain_whitelist/edit.html.erb +6 -0
- data/app/views/decidim/admin/participatory_space_private_users/index.html.erb +4 -4
- data/app/views/decidim/admin/resource_permissions/edit.html.erb +0 -2
- data/app/views/decidim/admin/scope_types/index.html.erb +3 -3
- data/app/views/decidim/admin/scopes/index.html.erb +1 -1
- data/app/views/decidim/admin/shared/_gallery.html.erb +1 -1
- data/app/views/decidim/admin/static_pages/_form.html.erb +0 -1
- data/app/views/decidim/admin/static_pages/_topic.html.erb +3 -3
- data/app/views/decidim/admin/user_groups/index.html.erb +2 -2
- data/app/views/decidim/admin/users/index.html.erb +10 -9
- data/app/views/layouts/decidim/admin/_application.html.erb +2 -1
- data/app/views/layouts/decidim/admin/_header.html.erb +2 -3
- data/app/views/layouts/decidim/admin/_js_configuration.html.erb +27 -0
- data/app/views/layouts/decidim/admin/_title_bar.html.erb +1 -1
- data/app/views/layouts/decidim/admin/global_moderations.html.erb +1 -1
- data/app/views/layouts/decidim/admin/newsletters.erb +1 -1
- data/app/views/layouts/decidim/admin/pages.html.erb +2 -2
- data/app/views/layouts/decidim/admin/settings.html.erb +1 -1
- data/app/views/layouts/decidim/admin/users.html.erb +2 -52
- data/config/assets.rb +8 -0
- data/config/locales/ar.yml +0 -4
- data/config/locales/bg.yml +0 -3
- data/config/locales/ca.yml +37 -6
- data/config/locales/cs.yml +52 -9
- data/config/locales/de.yml +18 -6
- data/config/locales/el.yml +0 -4
- data/config/locales/en.yml +59 -16
- data/config/locales/eo.yml +0 -1
- data/config/locales/es-MX.yml +19 -6
- data/config/locales/es-PY.yml +19 -6
- data/config/locales/es.yml +19 -6
- data/config/locales/eu.yml +0 -4
- data/config/locales/fi-plain.yml +49 -6
- data/config/locales/fi.yml +49 -6
- data/config/locales/fr-CA.yml +53 -6
- data/config/locales/fr-LU.yml +1029 -0
- data/config/locales/fr.yml +53 -6
- data/config/locales/gl.yml +77 -6
- data/config/locales/hu.yml +70 -4
- data/config/locales/id-ID.yml +0 -4
- data/config/locales/is-IS.yml +0 -4
- data/config/locales/it.yml +161 -10
- data/config/locales/ja.yml +160 -5
- data/config/locales/lb-LU.yml +1 -0
- data/config/locales/lv.yml +0 -4
- data/config/locales/nl.yml +20 -6
- data/config/locales/no.yml +8 -6
- data/config/locales/pl.yml +45 -24
- data/config/locales/pt-BR.yml +346 -4
- data/config/locales/pt.yml +6 -4
- data/config/locales/ro-RO.yml +325 -121
- data/config/locales/ru.yml +0 -4
- data/config/locales/sk.yml +0 -4
- data/config/locales/sl.yml +0 -4
- data/config/locales/sr-CS.yml +0 -4
- data/config/locales/sv.yml +144 -2
- data/config/locales/tr-TR.yml +0 -4
- data/config/locales/uk.yml +0 -2
- data/config/locales/zh-CN.yml +0 -4
- data/config/routes.rb +2 -0
- data/lib/decidim/admin/engine.rb +210 -137
- data/lib/decidim/admin/import/readers.rb +3 -3
- data/lib/decidim/admin/import/readers/xlsx.rb +25 -0
- data/lib/decidim/admin/test.rb +1 -0
- data/lib/decidim/admin/test/filters_participatory_space_users_examples.rb +73 -0
- data/lib/decidim/admin/test/manage_attachment_collections_examples.rb +1 -1
- data/lib/decidim/admin/test/manage_attachments_examples.rb +1 -1
- data/lib/decidim/admin/version.rb +1 -1
- metadata +143 -181
- data/app/assets/config/decidim_admin_manifest.js +0 -8
- data/app/assets/javascripts/decidim/admin/application.js.es6 +0 -77
- data/app/assets/javascripts/decidim/admin/auto_buttons_by_position.component.js.es6 +0 -42
- data/app/assets/javascripts/decidim/admin/auto_label_by_position.component.js.es6 +0 -33
- data/app/assets/javascripts/decidim/admin/budget_rule_toggler.component.js.es6 +0 -55
- data/app/assets/javascripts/decidim/admin/bundle.js +0 -34
- data/app/assets/javascripts/decidim/admin/bundle.js.map +0 -1
- data/app/assets/javascripts/decidim/admin/draggable-list.js.es6 +0 -30
- data/app/assets/javascripts/decidim/admin/dynamic_fields.component.js.es6 +0 -233
- data/app/assets/javascripts/decidim/admin/field_dependent_inputs.component.js.es6 +0 -39
- data/app/assets/javascripts/decidim/admin/moderations.js.es6 +0 -24
- data/app/assets/javascripts/decidim/admin/scope_picker_enabler.component.js.es6 +0 -14
- data/app/assets/javascripts/decidim/admin/sort_list.component.js.es6 +0 -35
- data/app/assets/javascripts/decidim/admin/sortable.js.es6 +0 -22
- data/app/assets/javascripts/decidim/admin/subform_multi_toggler.component.js.es6 +0 -43
- data/app/assets/javascripts/decidim/admin/subform_toggler.component.js.es6 +0 -42
- data/app/assets/javascripts/decidim/admin/toggle_nav.js.es6 +0 -17
- data/app/assets/javascripts/decidim/admin/user_moderations.js +0 -2
- data/app/assets/stylesheets/decidim/admin/_decidim.scss +0 -20
- data/app/assets/stylesheets/decidim/admin/application.scss.erb +0 -6
- data/app/assets/stylesheets/decidim/admin/extra/_editor.scss +0 -1
- data/app/assets/stylesheets/decidim/admin/modules/_modules.scss +0 -43
- data/app/assets/stylesheets/decidim/admin/utils/_fontface.scss +0 -29
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_acos.scss +0 -12
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_asin.scss +0 -12
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan.scss +0 -28
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_atan2.scss +0 -37
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_cos.scss +0 -13
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_fact.scss +0 -18
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_frexp.scss +0 -21
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_ldexp.scss +0 -17
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_log.scss +0 -34
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_pow.scss +0 -28
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/functions/_sqrt.scss +0 -16
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_deg-to-rad.scss +0 -4
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_rad-to-deg.scss +0 -4
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_strip-unit.scss +0 -8
- data/app/assets/stylesheets/decidim/admin/vendor/mathsass/helpers/_unitless-rad.scss +0 -13
- data/app/frontend/components/autocomplete.component.tsx +0 -198
- data/app/frontend/entry.ts +0 -17
- data/app/frontend/entry_test.ts +0 -4
- data/app/helpers/decidim/admin/sidebar_menu_helper.rb +0 -13
- data/config/locales/ja-JP.yml +0 -855
- data/lib/decidim/admin/import/readers/xls.rb +0 -25
- data/vendor/assets/javascripts/html.sortable.js +0 -691
- data/vendor/assets/javascripts/jquery.auto-complete.js +0 -171
- data/vendor/assets/javascripts/jquery.serializejson.js +0 -344
- data/vendor/assets/javascripts/moment.min.js +0 -1
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Decidim
|
4
|
+
module Admin
|
5
|
+
class OrganizationExternalDomainWhitelistForm < Form
|
6
|
+
attribute :external_domains, Array[Decidim::Admin::ExternalDomainForm]
|
7
|
+
|
8
|
+
validate :external_domains_validator
|
9
|
+
|
10
|
+
def map_model(model)
|
11
|
+
self.external_domains = model.external_domain_whitelist.map do |external_domain|
|
12
|
+
ExternalDomainForm.new(value: external_domain)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def external_domains_validator
|
17
|
+
@external_domains_validator ||= external_domains.reject(&:deleted).each do |domain|
|
18
|
+
errors.add(:external_domains, I18n.t("decidim.admin.domain_whitelist.form.domain_too_short")) if domain.value.length <= 3
|
19
|
+
end.map(&:value).uniq
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -25,6 +25,7 @@ module Decidim
|
|
25
25
|
attribute :rich_text_editor_in_public_views, Boolean
|
26
26
|
attribute :enable_machine_translations, Boolean
|
27
27
|
attribute :machine_translation_display_priority, String
|
28
|
+
attribute :enable_participatory_space_filters, Boolean
|
28
29
|
|
29
30
|
attribute :send_welcome_notification, Boolean
|
30
31
|
attribute :customize_welcome_notification, Boolean
|
@@ -7,6 +7,8 @@ module Decidim
|
|
7
7
|
# A form object used to upload CSV to batch participatory space private users.
|
8
8
|
#
|
9
9
|
class ParticipatorySpacePrivateUserCsvImportForm < Form
|
10
|
+
include Decidim::HasUploadValidations
|
11
|
+
|
10
12
|
attribute :file
|
11
13
|
attribute :user_name, String
|
12
14
|
attribute :email, String
|
@@ -29,7 +29,7 @@ module Decidim
|
|
29
29
|
links = []
|
30
30
|
links += extra_dropdown_submenu_options_items(filter, i18n_scope)
|
31
31
|
links += values.map { |value| filter_link_value(filter, value, i18n_scope) }
|
32
|
-
links.
|
32
|
+
links.index_with { nil }
|
33
33
|
end
|
34
34
|
|
35
35
|
# To be overriden. Useful for adding links that do not match with the filter.
|
@@ -4,23 +4,23 @@ module Decidim
|
|
4
4
|
module Admin
|
5
5
|
# This module includes helpers to manage menus in admin layout
|
6
6
|
module MenuHelper
|
7
|
-
include Decidim::Admin::SidebarMenuHelper
|
8
|
-
|
9
7
|
# Public: Returns the main menu presenter object
|
10
8
|
def main_menu
|
11
9
|
@main_menu ||= ::Decidim::MenuPresenter.new(
|
12
10
|
:admin_menu,
|
13
11
|
self,
|
14
|
-
active_class: "is-active"
|
12
|
+
active_class: "is-active",
|
13
|
+
label: t("layouts.decidim.header.main_menu")
|
15
14
|
)
|
16
15
|
end
|
17
16
|
|
18
|
-
def
|
19
|
-
|
17
|
+
def sidebar_menu(target_menu)
|
18
|
+
::Decidim::Admin::SecondaryMenuPresenter.new(target_menu, self, active_class: "is-active")
|
20
19
|
end
|
21
20
|
|
22
|
-
def
|
23
|
-
|
21
|
+
def simple_menu(target_menu:, options: {})
|
22
|
+
options = { active_class: "is-active" }.merge(options)
|
23
|
+
::Decidim::Admin::SimpleMenuPresenter.new(target_menu, self, options)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -12,7 +12,8 @@ module Decidim
|
|
12
12
|
#
|
13
13
|
# Returns an integer array with [width, height]
|
14
14
|
def image_dimensions(model, image_name)
|
15
|
-
|
15
|
+
uploader = model.attached_uploader(image_name) || model.send(image_name)
|
16
|
+
versions = uploader.dimensions_info
|
16
17
|
[:small, :medium, :default].map { |v| versions.dig(v, :dimensions) }.compact.first
|
17
18
|
end
|
18
19
|
|
@@ -9,8 +9,7 @@ module Decidim
|
|
9
9
|
impersonation_log = Decidim::ImpersonationLog.where(admin: current_user, user: user).active.first
|
10
10
|
return unless impersonation_log
|
11
11
|
|
12
|
-
impersonation_log.
|
13
|
-
impersonation_log.save!
|
12
|
+
impersonation_log.expire!
|
14
13
|
end
|
15
14
|
end
|
16
15
|
end
|
@@ -5,7 +5,7 @@ module Decidim
|
|
5
5
|
# Custom ApplicationJob scoped to the admin panel.
|
6
6
|
#
|
7
7
|
class ImportParticipatorySpacePrivateUserCsvJob < ApplicationJob
|
8
|
-
queue_as :
|
8
|
+
queue_as :exports
|
9
9
|
|
10
10
|
def perform(email, user_name, privatable_to, current_user)
|
11
11
|
return if email.blank? || user_name.blank?
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/* eslint no-unused-vars: 0 */
|
2
|
+
/* eslint id-length: ["error", { "exceptions": ["$"] }] */
|
3
|
+
|
4
|
+
import "core-js/stable";
|
5
|
+
import "regenerator-runtime/runtime";
|
6
|
+
import $ from "jquery"
|
7
|
+
import Quill from "quill"
|
8
|
+
import Rails from "@rails/ujs"
|
9
|
+
|
10
|
+
import "foundation-sites"
|
11
|
+
import "src/decidim/vendor/foundation-datepicker"
|
12
|
+
import "src/decidim/foundation_datepicker_locales"
|
13
|
+
import "jquery.autocomplete"
|
14
|
+
import "jquery-serializejson"
|
15
|
+
|
16
|
+
import "src/decidim/admin/tab_focus"
|
17
|
+
import "src/decidim/admin/choose_language"
|
18
|
+
import "src/decidim/admin/application"
|
19
|
+
import "src/decidim/admin/resources_permissions"
|
20
|
+
import "src/decidim/admin/welcome_notification"
|
21
|
+
import "src/decidim/admin/newsletters"
|
22
|
+
import "src/decidim/admin/form"
|
23
|
+
import "src/decidim/admin/import_guidance"
|
24
|
+
import "src/decidim/admin/external_domain_whitelist"
|
25
|
+
import "src/decidim/confirm"
|
26
|
+
import "src/decidim/admin/draggable-list"
|
27
|
+
import "src/decidim/admin/sortable"
|
28
|
+
import "src/decidim/gallery"
|
29
|
+
import "src/decidim/admin/moderations"
|
30
|
+
import "src/decidim/input_tags"
|
31
|
+
import "src/decidim/input_hashtags"
|
32
|
+
import "src/decidim/input_mentions"
|
33
|
+
import "src/decidim/vizzs"
|
34
|
+
import "src/decidim/ajax_modals"
|
35
|
+
import "src/decidim/admin/officializations"
|
36
|
+
import "src/decidim/session_timeouter"
|
37
|
+
import "src/decidim/slug_form"
|
38
|
+
|
39
|
+
// CSS
|
40
|
+
import "entrypoints/decidim_admin.scss";
|
41
|
+
|
42
|
+
// This needs to be loaded after confirm dialog to bind properly
|
43
|
+
Rails.start()
|
@@ -0,0 +1 @@
|
|
1
|
+
@import "stylesheets/decidim/admin/application.scss"
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/* eslint-disable no-invalid-this */
|
2
|
+
|
3
|
+
import * as React from "react";
|
4
|
+
import * as ReactDOM from "react-dom";
|
5
|
+
import toggleNav from "src/decidim/admin/toggle_nav"
|
6
|
+
import createSortList from "src/decidim/admin/sort_list.component"
|
7
|
+
import createQuillEditor from "src/decidim/editor"
|
8
|
+
import formDatePicker from "src/decidim/form_datepicker"
|
9
|
+
import DataPicker from "src/decidim/data_picker"
|
10
|
+
import Autocomplete from "src/decidim/admin/autocomplete.component";
|
11
|
+
import FormFilterComponent from "src/decidim/form_filter"
|
12
|
+
import Configuration from "src/decidim/configuration"
|
13
|
+
import InputCharacterCounter from "src/decidim/input_character_counter"
|
14
|
+
import managedUsersForm from "src/decidim/admin/managed_users"
|
15
|
+
|
16
|
+
window.Decidim = window.Decidim || {};
|
17
|
+
window.Decidim.managedUsersForm = managedUsersForm
|
18
|
+
window.Decidim.config = new Configuration()
|
19
|
+
window.Decidim.InputCharacterCounter = InputCharacterCounter;
|
20
|
+
|
21
|
+
const renderAutocompleteSelects = (nodeSelector) => {
|
22
|
+
window.$(nodeSelector).each((index, node) => {
|
23
|
+
const props = { ...window.$(node).data("autocomplete") };
|
24
|
+
|
25
|
+
ReactDOM.render(
|
26
|
+
React.createElement(Autocomplete, props),
|
27
|
+
node
|
28
|
+
);
|
29
|
+
});
|
30
|
+
};
|
31
|
+
|
32
|
+
$(() => {
|
33
|
+
window.theDataPicker = new DataPicker($(".data-picker"));
|
34
|
+
|
35
|
+
$(document).foundation();
|
36
|
+
|
37
|
+
toggleNav();
|
38
|
+
|
39
|
+
renderAutocompleteSelects('[data-plugin="autocomplete"]');
|
40
|
+
|
41
|
+
createSortList("#steps tbody", {
|
42
|
+
placeholder: $('<tr style="border-style: dashed; border-color: #000"><td colspan="4"> </td></tr>')[0],
|
43
|
+
onSortUpdate: ($children) => {
|
44
|
+
const sortUrl = $("#steps tbody").data("sort-url")
|
45
|
+
const order = $children.map((index, child) => $(child).data("id")).toArray();
|
46
|
+
|
47
|
+
$.ajax({
|
48
|
+
method: "POST",
|
49
|
+
url: sortUrl,
|
50
|
+
contentType: "application/json",
|
51
|
+
data: JSON.stringify({ items_ids: order }) }, // eslint-disable-line camelcase
|
52
|
+
);
|
53
|
+
}
|
54
|
+
})
|
55
|
+
|
56
|
+
formDatePicker();
|
57
|
+
|
58
|
+
$(".editor-container").each((_idx, container) => {
|
59
|
+
createQuillEditor(container);
|
60
|
+
});
|
61
|
+
|
62
|
+
$("form.new_filter").each(function () {
|
63
|
+
const formFilter = new FormFilterComponent($(this));
|
64
|
+
|
65
|
+
formFilter.mountComponent();
|
66
|
+
})
|
67
|
+
});
|
68
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
export default class AutoButtonsByPositionComponent {
|
2
|
+
constructor(options = {}) {
|
3
|
+
this.listSelector = options.listSelector;
|
4
|
+
this.hideOnFirstSelector = options.hideOnFirstSelector;
|
5
|
+
this.hideOnLastSelector = options.hideOnLastSelector;
|
6
|
+
|
7
|
+
this.run();
|
8
|
+
}
|
9
|
+
|
10
|
+
run() {
|
11
|
+
const $list = $(this.listSelector);
|
12
|
+
const hideOnFirst = this.hideOnFirstSelector;
|
13
|
+
const hideOnLast = this.hideOnLastSelector;
|
14
|
+
|
15
|
+
if ($list.length === 1) {
|
16
|
+
const $item = $list.first();
|
17
|
+
|
18
|
+
$item.find(hideOnFirst).hide();
|
19
|
+
$item.find(hideOnLast).hide();
|
20
|
+
} else {
|
21
|
+
$list.each((idx, el) => {
|
22
|
+
if (el.id === $list.first().attr("id")) {
|
23
|
+
$(el).find(hideOnFirst).hide();
|
24
|
+
$(el).find(hideOnLast).show();
|
25
|
+
}
|
26
|
+
else if (el.id === $list.last().attr("id")) {
|
27
|
+
$(el).find(hideOnLast).hide();
|
28
|
+
$(el).find(hideOnFirst).show();
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
$(el).find(hideOnLast).show();
|
32
|
+
$(el).find(hideOnFirst).show();
|
33
|
+
}
|
34
|
+
});
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
export default class AutoLabelByPositionComponent {
|
2
|
+
constructor(options = {}) {
|
3
|
+
this.listSelector = options.listSelector;
|
4
|
+
this.labelSelector = options.labelSelector;
|
5
|
+
this.onPositionComputed = options.onPositionComputed;
|
6
|
+
|
7
|
+
this.run();
|
8
|
+
}
|
9
|
+
|
10
|
+
run() {
|
11
|
+
const $list = $(this.listSelector);
|
12
|
+
|
13
|
+
$list.each((idx, el) => {
|
14
|
+
const $label = $(el).find(this.labelSelector);
|
15
|
+
const labelContent = $label.html();
|
16
|
+
|
17
|
+
if (labelContent.match(/#(\d+)/)) {
|
18
|
+
$label.html(labelContent.replace(/#(\d+)/, `#${idx + 1}`));
|
19
|
+
} else {
|
20
|
+
$label.html(`${labelContent} #${idx + 1}`);
|
21
|
+
}
|
22
|
+
|
23
|
+
if (this.onPositionComputed) {
|
24
|
+
this.onPositionComputed(el, idx);
|
25
|
+
}
|
26
|
+
});
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,146 @@
|
|
1
|
+
/* eslint no-unused-vars: 0 */
|
2
|
+
/* eslint consistent-return: 0 */
|
3
|
+
|
4
|
+
import axios from "axios";
|
5
|
+
import * as React from "react";
|
6
|
+
import { Async as AsyncSelect } from "react-select";
|
7
|
+
import "react-select/scss/default.scss";
|
8
|
+
import PropTypes from "prop-types";
|
9
|
+
|
10
|
+
export class Autocomplete extends React.Component {
|
11
|
+
constructor(props) {
|
12
|
+
super(props);
|
13
|
+
|
14
|
+
this.minCharactersToSearch = 3;
|
15
|
+
|
16
|
+
this.handleChange = (selectedOption) => {
|
17
|
+
this.setState({ selectedOption });
|
18
|
+
if (this.props.changeURL) {
|
19
|
+
axios.get(this.props.changeURL, {
|
20
|
+
headers: {
|
21
|
+
Accept: "text/javascript"
|
22
|
+
},
|
23
|
+
withCredentials: true,
|
24
|
+
params: {
|
25
|
+
id: selectedOption.value
|
26
|
+
}
|
27
|
+
}).
|
28
|
+
then((response) => {
|
29
|
+
const script = document.createElement("script");
|
30
|
+
script.type = "text/javascript";
|
31
|
+
script.innerHTML = response.data;
|
32
|
+
document.getElementsByTagName("head")[0].appendChild(script);
|
33
|
+
}).
|
34
|
+
catch((error) => {
|
35
|
+
if (axios.isCancel(error)) {
|
36
|
+
// console.log("Request canceled", error.message);
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
//
|
40
|
+
}
|
41
|
+
});
|
42
|
+
}
|
43
|
+
};
|
44
|
+
|
45
|
+
this.filterOptions = (options, filter, excludeOptions) => {
|
46
|
+
// Do no filtering, just return all options because
|
47
|
+
// we return a filtered set from server
|
48
|
+
return options;
|
49
|
+
};
|
50
|
+
|
51
|
+
this.onInputChange = (query) => {
|
52
|
+
if (query.length < this.minCharactersToSearch) {
|
53
|
+
this.setState({ noResultsText: this.props.searchPromptText });
|
54
|
+
}
|
55
|
+
else {
|
56
|
+
this.setState({ noResultsText: this.props.noResultsText });
|
57
|
+
}
|
58
|
+
};
|
59
|
+
|
60
|
+
this.loadOptions = (query, callback) => {
|
61
|
+
const lowerQuery = query.toLowerCase();
|
62
|
+
|
63
|
+
if (this.cancelTokenSource) {
|
64
|
+
this.cancelTokenSource.cancel();
|
65
|
+
}
|
66
|
+
|
67
|
+
if (lowerQuery.length < this.minCharactersToSearch) {
|
68
|
+
return callback(null, { options: [], complete: false });
|
69
|
+
}
|
70
|
+
|
71
|
+
this.cancelTokenSource = axios.CancelToken.source();
|
72
|
+
axios.get(this.props.searchURL, {
|
73
|
+
cancelToken: this.cancelTokenSource.token,
|
74
|
+
headers: {
|
75
|
+
Accept: "application/json"
|
76
|
+
},
|
77
|
+
withCredentials: true,
|
78
|
+
params: {
|
79
|
+
term: lowerQuery
|
80
|
+
}
|
81
|
+
}).
|
82
|
+
then((response) => {
|
83
|
+
// CAREFUL! Only set complete to true when there are no more options,
|
84
|
+
// or more specific queries will not be sent to the server.
|
85
|
+
return callback(null, { options: response.data, complete: true });
|
86
|
+
}).
|
87
|
+
catch((error) => {
|
88
|
+
if (!axios.isCancel(error)) {
|
89
|
+
return callback(error, { options: [], complete: false });
|
90
|
+
}
|
91
|
+
});
|
92
|
+
};
|
93
|
+
|
94
|
+
this.state = {
|
95
|
+
options: props.options,
|
96
|
+
selectedOption: props.selected,
|
97
|
+
searchPromptText: props.searchPromptText,
|
98
|
+
noResultsText: props.noResultsText
|
99
|
+
};
|
100
|
+
}
|
101
|
+
|
102
|
+
render() {
|
103
|
+
const { autoload, name, placeholder } = this.props;
|
104
|
+
const { selectedOption, options, searchPromptText, noResultsText } = this.state;
|
105
|
+
|
106
|
+
return (
|
107
|
+
React.createElement("div", { className: "autocomplete-field" },
|
108
|
+
React.createElement(AsyncSelect, {
|
109
|
+
cache: false,
|
110
|
+
name: name,
|
111
|
+
value: selectedOption,
|
112
|
+
options: options,
|
113
|
+
placeholder: placeholder,
|
114
|
+
searchPromptText: searchPromptText,
|
115
|
+
noResultsText: noResultsText,
|
116
|
+
onChange: this.handleChange,
|
117
|
+
onInputChange: this.onInputChange,
|
118
|
+
loadOptions: this.loadOptions,
|
119
|
+
filterOptions: this.filterOptions,
|
120
|
+
autoload: autoload,
|
121
|
+
removeSelected: true,
|
122
|
+
escapeClearsValue: false,
|
123
|
+
onCloseResetsInput: false
|
124
|
+
})
|
125
|
+
)
|
126
|
+
);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
Autocomplete.defaultProps = {
|
131
|
+
autoload: false
|
132
|
+
};
|
133
|
+
|
134
|
+
Autocomplete.propTypes = {
|
135
|
+
changeURL: PropTypes.string,
|
136
|
+
searchPromptText: PropTypes.string,
|
137
|
+
noResultsText: PropTypes.string,
|
138
|
+
searchURL: PropTypes.string,
|
139
|
+
selected: PropTypes.string,
|
140
|
+
options: PropTypes.array,
|
141
|
+
autoload: PropTypes.bool,
|
142
|
+
name: PropTypes.string,
|
143
|
+
placeholder: PropTypes.string
|
144
|
+
}
|
145
|
+
|
146
|
+
export default Autocomplete;
|