decidim-core 0.28.0 → 0.28.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/cells/decidim/activity_cell.rb +2 -2
- data/app/cells/decidim/address/online.erb +27 -9
- data/app/cells/decidim/address/show.erb +27 -12
- data/app/cells/decidim/address_cell.rb +29 -0
- data/app/cells/decidim/authorization_modal/show.erb +8 -4
- data/app/cells/decidim/authorization_modal_cell.rb +1 -0
- data/app/cells/decidim/card_metadata_cell.rb +3 -3
- data/app/cells/decidim/coauthorships_cell.rb +1 -1
- data/app/cells/decidim/content_blocks/menu_breadcrumb_last_activity_cell.rb +6 -0
- data/app/cells/decidim/content_blocks/participatory_space_hero_cell.rb +20 -4
- data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form/show.erb +8 -0
- data/app/cells/decidim/content_blocks/participatory_space_hero_settings_form_cell.rb +13 -0
- data/app/cells/decidim/content_blocks/participatory_space_metadata_cell.rb +1 -1
- data/app/cells/decidim/footer_pages_cell.rb +3 -3
- data/app/cells/decidim/profile/tabs.erb +3 -2
- data/app/cells/decidim/tags_cell.rb +3 -1
- data/app/cells/decidim/upload_modal/modal.erb +2 -2
- data/app/commands/decidim/create_omniauth_registration.rb +1 -3
- data/app/commands/decidim/messaging/reply_to_conversation.rb +3 -0
- data/app/commands/decidim/messaging/start_conversation.rb +3 -0
- data/app/controllers/concerns/decidim/devise_authentication_methods.rb +36 -0
- data/app/controllers/concerns/decidim/paginable.rb +1 -1
- data/app/controllers/decidim/devise/omniauth_registrations_controller.rb +1 -22
- data/app/controllers/decidim/devise/sessions_controller.rb +1 -24
- data/app/events/decidim/welcome_notification_event.rb +6 -9
- data/app/helpers/decidim/application_helper.rb +0 -18
- data/app/helpers/decidim/cells_paginate_helper.rb +1 -1
- data/app/helpers/decidim/check_boxes_tree_helper.rb +6 -6
- data/app/helpers/decidim/layout_helper.rb +1 -1
- data/app/helpers/decidim/map_helper.rb +1 -1
- data/app/helpers/decidim/menu_helper.rb +2 -0
- data/app/helpers/decidim/newsletters_helper.rb +83 -16
- data/app/helpers/decidim/paginate_helper.rb +1 -1
- data/app/helpers/decidim/sanitize_helper.rb +9 -0
- data/app/helpers/decidim/social_share_button_helper.rb +1 -1
- data/app/helpers/decidim/user_profile_helper.rb +7 -2
- data/app/mailers/decidim/messaging/conversation_mailer.rb +3 -72
- data/app/models/decidim/push_notification_message.rb +38 -0
- data/app/packs/entrypoints/decidim_overrides.scss +2 -0
- data/app/packs/images/decidim/.keep +0 -0
- data/app/packs/src/decidim/a11y.js +1 -1
- data/app/packs/src/decidim/account_form.js +1 -1
- data/app/packs/src/decidim/data_consent/consent_manager.test.js +1 -1
- data/app/packs/src/decidim/data_consent/index.js +1 -1
- data/app/packs/src/decidim/direct_uploads/upload_field.js +1 -1
- data/app/packs/src/decidim/direct_uploads/upload_modal.js +10 -6
- data/app/packs/src/decidim/editor/extensions/hashtag/index.js +1 -1
- data/app/packs/src/decidim/editor/extensions/mention/index.js +1 -1
- data/app/packs/src/decidim/editor/extensions/video_embed/index.js +3 -0
- data/app/packs/src/decidim/editor/test/editor/create.test.js +1 -1
- data/app/packs/src/decidim/editor/test/extensions/bold.test.js +2 -3
- data/app/packs/src/decidim/editor/test/extensions/character_count.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/decidim_kit.test.js +2 -3
- data/app/packs/src/decidim/editor/test/extensions/dialog.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/emoji.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/hashtag.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/heading.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/image.test.js +4 -4
- data/app/packs/src/decidim/editor/test/extensions/indent.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/link.test.js +3 -3
- data/app/packs/src/decidim/editor/test/extensions/mention.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/ordered_list.test.js +2 -2
- data/app/packs/src/decidim/editor/test/extensions/video_embed.test.js +3 -3
- data/app/packs/src/decidim/editor/test/helpers.js +5 -4
- data/app/packs/src/decidim/editor/test/toolbar/basic.test.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/content.test.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/full.test.js +3 -3
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic.js +6 -6
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_block.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting.js +1 -1
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_link.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_list.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content.js +7 -7
- data/app/packs/src/decidim/editor/test/toolbar/shared/behaves_like_content_styling.js +2 -2
- data/app/packs/src/decidim/editor/test/toolbar/shared/context.js +1 -1
- data/app/packs/src/decidim/editor/test/utilities/paste_transform.test.js +2 -2
- data/app/packs/src/decidim/external_domain_warning.js +13 -0
- data/app/packs/src/decidim/external_domain_warning.test.js +1 -1
- data/app/packs/src/decidim/external_link.js +48 -9
- data/app/packs/src/decidim/external_link.test.js +1 -1
- data/app/packs/src/decidim/focus_guard.js +8 -20
- data/app/packs/src/decidim/form_filter.component_for_testing.js +1 -1
- data/app/packs/src/decidim/form_filter.js +3 -3
- data/app/packs/src/decidim/geocoding/attach_input.js +1 -1
- data/app/packs/src/decidim/i18n.test.js +1 -1
- data/app/packs/src/decidim/index.js +4 -1
- data/app/packs/src/decidim/input_hashtags.js +1 -1
- data/app/packs/src/decidim/input_mentions.js +1 -1
- data/app/packs/src/decidim/input_multiple_mentions.js +1 -1
- data/app/packs/src/decidim/sw/index.js +3 -3
- data/app/packs/src/decidim/user_registrations.js +1 -1
- data/app/packs/src/decidim/vizzs/index.js +1 -1
- data/app/packs/stylesheets/decidim/_cards.scss +2 -2
- data/app/packs/stylesheets/decidim/_dropdown.scss +2 -2
- data/app/packs/stylesheets/decidim/_layout.scss +4 -4
- data/app/packs/stylesheets/decidim/application.scss +0 -3
- data/app/packs/stylesheets/decidim/decidim_application.scss +4 -0
- data/app/packs/stylesheets/decidim/legacy/leaflet.scss +88 -107
- data/app/presenters/decidim/admin_log/oauth_application_resource_presenter.rb +1 -1
- data/app/presenters/decidim/log/diff_presenter.rb +1 -1
- data/app/presenters/decidim/notification_to_mailer_presenter.rb +9 -0
- data/app/services/decidim/events_manager.rb +6 -0
- data/app/services/decidim/iframe_disabler.rb +4 -0
- data/app/services/decidim/push_notification_message_sender.rb +40 -0
- data/app/services/decidim/send_push_notification.rb +22 -8
- data/app/uploaders/decidim/background_image_uploader.rb +11 -0
- data/app/views/decidim/application/_collection.html.erb +2 -2
- data/app/views/decidim/application/_document.html.erb +1 -1
- data/app/views/decidim/devise/registrations/new.html.erb +2 -2
- data/app/views/decidim/notifications_digest_mailer/_email_content.html.erb +7 -0
- data/app/views/decidim/offline/show.html.erb +15 -9
- data/app/views/layouts/decidim/_head.html.erb +1 -0
- data/app/views/layouts/decidim/_js_configuration.html.erb +3 -1
- data/app/views/layouts/decidim/footer/_main_social_media_links.html.erb +5 -5
- data/app/views/layouts/decidim/footer/_mini.html.erb +2 -2
- data/app/views/layouts/decidim/header/_menu_breadcrumb_mobile_tablet.html.erb +1 -1
- data/config/assets.rb +1 -0
- data/config/locales/ar.yml +63 -7
- data/config/locales/bg.yml +32 -2
- data/config/locales/ca.yml +29 -24
- data/config/locales/cs.yml +6 -2
- data/config/locales/de.yml +34 -29
- data/config/locales/el.yml +3 -6
- data/config/locales/en.yml +7 -2
- data/config/locales/es-MX.yml +9 -4
- data/config/locales/es-PY.yml +9 -4
- data/config/locales/es.yml +27 -22
- data/config/locales/eu.yml +22 -8
- data/config/locales/fi-plain.yml +8 -3
- data/config/locales/fi.yml +10 -5
- data/config/locales/fr-CA.yml +12 -7
- data/config/locales/fr.yml +12 -7
- data/config/locales/ga-IE.yml +1 -0
- data/config/locales/gl.yml +4 -2
- data/config/locales/he-IL.yml +1 -0
- data/config/locales/hu.yml +264 -7
- data/config/locales/id-ID.yml +0 -2
- data/config/locales/it.yml +2 -5
- data/config/locales/ja.yml +11 -6
- data/config/locales/lb.yml +2 -5
- data/config/locales/lt.yml +0 -10
- data/config/locales/lv.yml +0 -2
- data/config/locales/nl.yml +1 -2
- data/config/locales/no.yml +2 -5
- data/config/locales/pl.yml +581 -2
- data/config/locales/pt-BR.yml +202 -18
- data/config/locales/pt.yml +2 -5
- data/config/locales/ro-RO.yml +2 -5
- data/config/locales/ru.yml +7 -2
- data/config/locales/sk.yml +0 -2
- data/config/locales/sv.yml +24 -5
- data/config/locales/tr-TR.yml +3 -5
- data/config/locales/uk.yml +12 -2
- data/config/locales/zh-CN.yml +0 -5
- data/config/locales/zh-TW.yml +2 -10
- data/decidim-core.gemspec +90 -0
- data/lib/decidim/asset_router/storage.rb +2 -0
- data/lib/decidim/attribute_encryptor.rb +6 -4
- data/lib/decidim/attributes/time_with_zone.rb +1 -1
- data/lib/decidim/core/engine.rb +7 -6
- data/lib/decidim/core/seeds.rb +36 -32
- data/lib/decidim/core/test/factories.rb +296 -89
- data/lib/decidim/core/test/shared_examples/amendable/amendment_created_event_examples.rb +6 -26
- data/lib/decidim/core/test/shared_examples/amendable/amendment_promoted_event_examples.rb +8 -26
- data/lib/decidim/core/test/shared_examples/has_attachment_collections.rb +8 -6
- data/lib/decidim/core/test/shared_examples/has_attachments.rb +8 -8
- data/lib/decidim/core/test/shared_examples/has_category.rb +27 -0
- data/lib/decidim/core/test/shared_examples/has_reference.rb +1 -1
- data/lib/decidim/core/test/shared_examples/has_space_in_mcell_examples.rb +1 -1
- data/lib/decidim/core/test/shared_examples/map_examples.rb +3 -0
- data/lib/decidim/core/test/shared_examples/resource_endorsed_event_examples.rb +5 -2
- data/lib/decidim/core/test/shared_examples/resource_locator_presenter_examples.rb +134 -0
- data/lib/decidim/core/test/shared_examples/simple_event.rb +18 -2
- data/lib/decidim/core/test.rb +1 -0
- data/lib/decidim/core/version.rb +1 -1
- data/lib/decidim/core.rb +1 -0
- data/lib/decidim/engine_router.rb +17 -4
- data/lib/decidim/events/base_event.rb +3 -3
- data/lib/decidim/events/simple_event.rb +3 -17
- data/lib/decidim/form_builder.rb +8 -2
- data/lib/decidim/has_category.rb +1 -1
- data/lib/decidim/has_conversations.rb +91 -0
- data/lib/decidim/participable.rb +17 -0
- data/lib/decidim/upgrade/wysiwyg_migrator.rb +7 -0
- data/lib/decidim/view_model.rb +1 -0
- data/lib/decidim/webpacker/webpack/.modernizrrc +9 -0
- data/lib/premailer/adapter/decidim.rb +5 -4
- data/lib/tasks/decidim_reminders_tasks.rake +1 -0
- data/lib/tasks/upgrade/decidim_fix_categorization.rake +15 -0
- metadata +27 -30
- data/app/views/decidim/searches/index.js.erb +0 -7
- data/config/brakeman.ignore +0 -37
- data/config/environment.rb +0 -3
@@ -21,12 +21,13 @@ import OrderedList from "@tiptap/extension-ordered-list";
|
|
21
21
|
import ListItem from "@tiptap/extension-list-item";
|
22
22
|
import Text from "@tiptap/extension-text";
|
23
23
|
|
24
|
-
import createEditor from "
|
24
|
+
import createEditor from "src/decidim/editor/index";
|
25
25
|
|
26
|
-
import editorMessages from "
|
27
|
-
import uploadTemplates from "
|
26
|
+
import editorMessages from "src/decidim/editor/test/fixtures/editor_messages";
|
27
|
+
import uploadTemplates from "src/decidim/editor/test/fixtures/upload_templates";
|
28
28
|
|
29
|
-
|
29
|
+
// eslint-disable-next-line camelcase
|
30
|
+
const config = { api_path: "/api", messages: { editor: editorMessages } };
|
30
31
|
window.Decidim = { config: { get: (key) => config[key] } };
|
31
32
|
window.ClipboardEvent = class ClipboardEvent extends Event {};
|
32
33
|
window.DragEvent = class DragEvent extends Event {};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { createEditorContainer } from "
|
2
|
-
import itBehavesLikeBasicToolbar from "
|
1
|
+
import { createEditorContainer } from "src/decidim/editor/test/helpers";
|
2
|
+
import itBehavesLikeBasicToolbar from "src/decidim/editor/test/toolbar/shared/behaves_like_basic";
|
3
3
|
|
4
4
|
describe("basic toolbar", () => {
|
5
5
|
const ctx = {
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { createEditorContainer } from "
|
2
|
-
import itBehavesLikeContentToolbar from "
|
1
|
+
import { createEditorContainer } from "src/decidim/editor/test/helpers";
|
2
|
+
import itBehavesLikeContentToolbar from "src/decidim/editor/test/toolbar/shared/behaves_like_content";
|
3
3
|
|
4
4
|
describe("content toolbar", () => {
|
5
5
|
const ctx = {
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
import Dialog from "a11y-dialog-component";
|
4
4
|
|
5
|
-
import { createEditorContainer, sleep, updateContent, selectContent, dropFixtureFile } from "
|
6
|
-
import contextHelpers from "
|
7
|
-
import itBehavesLikeContentToolbar from "
|
5
|
+
import { createEditorContainer, sleep, updateContent, selectContent, dropFixtureFile } from "src/decidim/editor/test/helpers";
|
6
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
7
|
+
import itBehavesLikeContentToolbar from "src/decidim/editor/test/toolbar/shared/behaves_like_content";
|
8
8
|
|
9
9
|
describe("full toolbar", () => {
|
10
10
|
const ctx = {
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import itBehavesLikeBasicToolbarStyling from "
|
2
|
-
import itBehavesLikeBasicToolbarFormatting from "
|
3
|
-
import itBehavesLikeBasicToolbarList from "
|
4
|
-
import itBehavesLikeBasicToolbarBlock from "
|
5
|
-
import itBehavesLikeBasicToolbarLink from "
|
6
|
-
import itBehavesLikeBasicToolbarIndent from "
|
1
|
+
import itBehavesLikeBasicToolbarStyling from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling";
|
2
|
+
import itBehavesLikeBasicToolbarFormatting from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting";
|
3
|
+
import itBehavesLikeBasicToolbarList from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_list";
|
4
|
+
import itBehavesLikeBasicToolbarBlock from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_block";
|
5
|
+
import itBehavesLikeBasicToolbarLink from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_link";
|
6
|
+
import itBehavesLikeBasicToolbarIndent from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent";
|
7
7
|
|
8
8
|
export default (ctx) => {
|
9
9
|
ctx.prosemirror = null;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { selectContent } from "
|
1
|
+
import { selectContent } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { selectContent, selectRange } from "
|
1
|
+
import { selectContent, selectRange } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { sleep, selectRange } from "
|
1
|
+
import { sleep, selectRange } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { selectContent } from "
|
1
|
+
import { selectContent } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { selectContent } from "
|
1
|
+
import { selectContent } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import itBehavesLikeBasicToolbarStyling from "
|
2
|
-
import itBehavesLikeContentToolbarStyling from "
|
3
|
-
import itBehavesLikeBasicToolbarFormatting from "
|
4
|
-
import itBehavesLikeBasicToolbarList from "
|
5
|
-
import itBehavesLikeBasicToolbarBlock from "
|
6
|
-
import itBehavesLikeBasicToolbarLink from "
|
7
|
-
import itBehavesLikeBasicToolbarIndent from "
|
1
|
+
import itBehavesLikeBasicToolbarStyling from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_styling";
|
2
|
+
import itBehavesLikeContentToolbarStyling from "src/decidim/editor/test/toolbar/shared/behaves_like_content_styling";
|
3
|
+
import itBehavesLikeBasicToolbarFormatting from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_formatting";
|
4
|
+
import itBehavesLikeBasicToolbarList from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_list";
|
5
|
+
import itBehavesLikeBasicToolbarBlock from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_block";
|
6
|
+
import itBehavesLikeBasicToolbarLink from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_link";
|
7
|
+
import itBehavesLikeBasicToolbarIndent from "src/decidim/editor/test/toolbar/shared/behaves_like_basic_indent";
|
8
8
|
|
9
9
|
export default (ctx) => {
|
10
10
|
ctx.prosemirror = null;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { selectContent } from "
|
1
|
+
import { selectContent } from "src/decidim/editor/test/helpers";
|
2
2
|
|
3
|
-
import contextHelpers from "
|
3
|
+
import contextHelpers from "src/decidim/editor/test/toolbar/shared/context";
|
4
4
|
|
5
5
|
export default (ctx) => {
|
6
6
|
const { getControl, setContent } = contextHelpers(ctx);
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { transformMsDesktop, transformMsCould } from "
|
1
|
+
import { transformMsDesktop, transformMsCould } from "src/decidim/editor/utilities/paste_transform";
|
2
2
|
|
3
|
-
import "
|
3
|
+
import "src/decidim/editor/test/helpers";
|
4
4
|
|
5
5
|
const uglifyHtml = (html) => html.replace(/[\r\n]+\s+/g, " ").replace(/>\s+</g, "><").trim();
|
6
6
|
|
@@ -1,5 +1,14 @@
|
|
1
1
|
/* eslint-disable require-jsdoc */
|
2
2
|
|
3
|
+
/**
|
4
|
+
* If you want to disable the warning but indicate that the link is an external
|
5
|
+
* link, please define the `data-external-link-warning="false"` attribute for
|
6
|
+
* the link,
|
7
|
+
* e.g. <a href="https://..." target="_blank" data-external-link="text-only" data-external-domain-link="false">...</a>
|
8
|
+
*
|
9
|
+
* @param {HTMLElement} element The element for which to replace the link href for.
|
10
|
+
* @returns {void} Nothing
|
11
|
+
*/
|
3
12
|
export default function updateExternalDomainLinks(element) {
|
4
13
|
if (window.location.pathname === "/link") {
|
5
14
|
return;
|
@@ -9,6 +18,10 @@ export default function updateExternalDomainLinks(element) {
|
|
9
18
|
return;
|
10
19
|
}
|
11
20
|
|
21
|
+
if (element.dataset.externalDomainLink === "false") {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
|
12
25
|
const parts = element.href.match(/^(([a-z]+):)?\/\/([^/:]+)(:[0-9]*)?(\/.*)?$/) || null;
|
13
26
|
if (!parts) {
|
14
27
|
return;
|
@@ -1,28 +1,43 @@
|
|
1
1
|
import icon from "src/decidim/icon"
|
2
2
|
|
3
|
+
const DEFAULT_MESSAGES = {
|
4
|
+
externalLink: "External link",
|
5
|
+
opensInNewTab: "Opens in new tab"
|
6
|
+
};
|
7
|
+
let MESSAGES = DEFAULT_MESSAGES;
|
8
|
+
|
3
9
|
/**
|
4
10
|
* Appends an icon to distinguish those links pointing out of decidim.
|
5
11
|
* It will apply to all a[target="_blank"] found in the document
|
6
12
|
*
|
7
13
|
* This behaviour can be omitted adding data-external-link="false" attribute to the anchor tag
|
8
14
|
* e.g. <a href="https://..." target="_blank" data-external-link="false">...</a>
|
15
|
+
*
|
16
|
+
* If you do not want to display the external link indicator, you still need to indicate that
|
17
|
+
* the link opens in a new tab to the screen readers. This can be done by adding
|
18
|
+
* data-external-link="text-only" attribute to the anchor tag,
|
19
|
+
* e.g. <a href="https://..." target="_blank" data-external-link="text-only">...</a>
|
20
|
+
*
|
21
|
+
* In addition, if you want to disable the external link warning for the link, you can add the
|
22
|
+
* data-external-domain-link="false" attribute to the anchor tag,
|
23
|
+
* e.g. <a href="https://..." target="_blank" data-external-link="text-only" data-external-domain-link="false">...</a>
|
9
24
|
*/
|
10
25
|
export default class ExternalLink {
|
11
26
|
static configureMessages(messages) {
|
12
|
-
|
27
|
+
MESSAGES = { ...DEFAULT_MESSAGES, ...messages };
|
13
28
|
}
|
14
29
|
|
15
30
|
constructor(node) {
|
16
|
-
this.MESSAGES = {
|
17
|
-
externalLink: "External link"
|
18
|
-
};
|
19
|
-
|
20
31
|
if (node.closest(".editor-container")) {
|
21
32
|
return;
|
22
33
|
}
|
23
34
|
|
24
35
|
if (!node.querySelector("span[data-external-link]")) {
|
25
|
-
|
36
|
+
if (node.dataset.externalLink === "text-only") {
|
37
|
+
this.setupTextOnly(node);
|
38
|
+
} else {
|
39
|
+
this.setup(node);
|
40
|
+
}
|
26
41
|
}
|
27
42
|
}
|
28
43
|
|
@@ -30,17 +45,41 @@ export default class ExternalLink {
|
|
30
45
|
const span = document.createElement("span");
|
31
46
|
|
32
47
|
span.dataset.externalLink = true;
|
33
|
-
span.innerHTML = `${this.generateIcon()}${this.generateScreenReaderLabel()}`
|
48
|
+
span.innerHTML = `${this.generateIcon()}${this.generateScreenReaderLabel(node)}`
|
34
49
|
span.classList.add("inline-block", "mx-0.5");
|
35
50
|
|
36
51
|
return node.appendChild(span);
|
37
52
|
}
|
38
53
|
|
54
|
+
setupTextOnly(node) {
|
55
|
+
const dummy = document.createElement("span");
|
56
|
+
dummy.innerHTML = this.generateScreenReaderLabel(node);
|
57
|
+
|
58
|
+
return node.appendChild(dummy.firstChild);
|
59
|
+
}
|
60
|
+
|
39
61
|
generateIcon() {
|
40
62
|
return icon("external-link-line", { class: "fill-current" });
|
41
63
|
}
|
42
64
|
|
43
|
-
generateScreenReaderLabel() {
|
44
|
-
|
65
|
+
generateScreenReaderLabel(node) {
|
66
|
+
let text = MESSAGES.opensInNewTab;
|
67
|
+
if (this._isExternalLink(node)) {
|
68
|
+
text = MESSAGES.externalLink;
|
69
|
+
}
|
70
|
+
|
71
|
+
return `<span class="sr-only">(${text})</span>`;
|
72
|
+
}
|
73
|
+
|
74
|
+
_isExternalLink(node) {
|
75
|
+
const externalMatches = [
|
76
|
+
// Links to the internal link page /link?external_url=https%3A%2F%2Fdecidim.org
|
77
|
+
new RegExp("^/link\\?external_url="),
|
78
|
+
// Links starting with http/s and not to the current host
|
79
|
+
new RegExp(`^https?://((?!${location.host}).)+`)
|
80
|
+
];
|
81
|
+
|
82
|
+
const href = node.getAttribute("href") || "";
|
83
|
+
return externalMatches.some(((regexp) => href.match(regexp)));
|
45
84
|
}
|
46
85
|
}
|
@@ -1,5 +1,3 @@
|
|
1
|
-
import { Keyboard } from "foundation-sites"
|
2
|
-
|
3
1
|
const focusGuardClass = "focusguard";
|
4
2
|
const focusableNodes = ["A", "IFRAME", "OBJECT", "EMBED"];
|
5
3
|
const focusableDisableableNodes = ["BUTTON", "INPUT", "TEXTAREA", "SELECT"];
|
@@ -8,21 +6,13 @@ export default class FocusGuard {
|
|
8
6
|
constructor(container) {
|
9
7
|
this.container = container;
|
10
8
|
this.guardedElement = null;
|
9
|
+
this.triggerElement = null;
|
11
10
|
}
|
12
11
|
|
13
|
-
trap(element) {
|
14
|
-
if (this.guardedElement) {
|
15
|
-
Keyboard.releaseFocus($(this.guardedElement));
|
16
|
-
}
|
17
|
-
|
12
|
+
trap(element, trigger) {
|
18
13
|
this.enable();
|
19
14
|
this.guardedElement = element;
|
20
|
-
|
21
|
-
// Call the release focus first so that we do not accidentally add the
|
22
|
-
// keyboard trap twice. Note that the Foundation methods expect the elements
|
23
|
-
// to be jQuery elements which is why we pass them through jQuery.
|
24
|
-
Keyboard.releaseFocus($(element));
|
25
|
-
Keyboard.trapFocus($(element));
|
15
|
+
this.triggerElement = trigger;
|
26
16
|
}
|
27
17
|
|
28
18
|
enable() {
|
@@ -58,12 +48,11 @@ export default class FocusGuard {
|
|
58
48
|
const guards = this.container.querySelectorAll(`:scope > .${focusGuardClass}`);
|
59
49
|
guards.forEach((guard) => guard.remove());
|
60
50
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
this.
|
66
|
-
this.guardedElement = null;
|
51
|
+
this.guardedElement = null;
|
52
|
+
|
53
|
+
if (this.triggerElement) {
|
54
|
+
this.triggerElement.focus();
|
55
|
+
this.triggerElement = null;
|
67
56
|
}
|
68
57
|
}
|
69
58
|
|
@@ -89,7 +78,6 @@ export default class FocusGuard {
|
|
89
78
|
|
90
79
|
let target = null;
|
91
80
|
if (guard.dataset.position === "start") {
|
92
|
-
|
93
81
|
// Focus at the start guard, so focus the first focusable element after that
|
94
82
|
for (let ind = 0; ind < visibleNodes.length; ind += 1) {
|
95
83
|
if (!this.isFocusGuard(visibleNodes[ind]) && this.isFocusable(visibleNodes[ind])) {
|
@@ -7,9 +7,9 @@
|
|
7
7
|
* @augments Component
|
8
8
|
*/
|
9
9
|
|
10
|
-
import delayed from "
|
11
|
-
import CheckBoxesTree from "
|
12
|
-
import { registerCallback, unregisterCallback, pushState, replaceState, state } from "
|
10
|
+
import delayed from "src/decidim/delayed"
|
11
|
+
import CheckBoxesTree from "src/decidim/check_boxes_tree"
|
12
|
+
import { registerCallback, unregisterCallback, pushState, replaceState, state } from "src/decidim/history"
|
13
13
|
|
14
14
|
export default class FormFilterComponent {
|
15
15
|
constructor($form) {
|
@@ -9,13 +9,16 @@ import "core-js/stable";
|
|
9
9
|
import "regenerator-runtime/runtime";
|
10
10
|
import "jquery"
|
11
11
|
|
12
|
+
// REDESIGN_PENDING: deprecated
|
13
|
+
import "foundation-sites";
|
14
|
+
|
12
15
|
// external deps that require initialization
|
13
16
|
import Rails from "@rails/ujs"
|
14
17
|
import svg4everybody from "svg4everybody"
|
15
18
|
import morphdom from "morphdom"
|
16
19
|
|
17
20
|
// vendor customizated scripts (bad practice: these ones should be removed eventually)
|
18
|
-
import "
|
21
|
+
import "src/decidim/vendor/modernizr"
|
19
22
|
|
20
23
|
/**
|
21
24
|
* Local dependencies
|
@@ -18,7 +18,7 @@ $(() => {
|
|
18
18
|
|
19
19
|
/* eslint no-use-before-define: ["error", { "variables": false }]*/
|
20
20
|
let remoteSearch = function(text, cb) {
|
21
|
-
$.post("
|
21
|
+
$.post(window.Decidim.config.get("api_path"), {query: `{hashtags(name:"${text}") {name}}`}).
|
22
22
|
|
23
23
|
then((response) => {
|
24
24
|
let data = response.data.hashtags || {};
|
@@ -34,7 +34,7 @@ const mentionsInitializer = () => {
|
|
34
34
|
/* eslint no-use-before-define: ["error", { "variables": false }]*/
|
35
35
|
let remoteSearch = function(text, cb) {
|
36
36
|
let query = `{users(filter:{wildcard:"${text}"}){nickname,name,avatarUrl,__typename,...on UserGroup{membersCount}}}`;
|
37
|
-
$.post("
|
37
|
+
$.post(window.Decidim.config.get("api_path"), {query: query}).
|
38
38
|
then((response) => {
|
39
39
|
let data = response.data.users || {};
|
40
40
|
cb(data)
|
@@ -42,7 +42,7 @@ $(() => {
|
|
42
42
|
const autoComplete = new AutoComplete($searchInput[0], {
|
43
43
|
dataMatchKeys: ["name", "nickname"],
|
44
44
|
dataSource: (query, callback) => {
|
45
|
-
$.post("
|
45
|
+
$.post(window.Decidim.config.get("api_path"), {
|
46
46
|
"query": `
|
47
47
|
{
|
48
48
|
users(filter:{wildcard:"${query}",excludeIds:[]})
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import "
|
2
|
-
import "
|
3
|
-
import "
|
1
|
+
import "src/decidim/sw/loader"
|
2
|
+
import "src/decidim/sw/a2hs"
|
3
|
+
import "src/decidim/sw/push-permissions"
|
@@ -19,7 +19,7 @@ $(() => {
|
|
19
19
|
metricsParams.spaceId = $("#metrics #metrics-space_id").val() || null;
|
20
20
|
}
|
21
21
|
|
22
|
-
const fetch = (metrics) => $.post("
|
22
|
+
const fetch = (metrics) => $.post(window.Decidim.config.get("api_path"), query(metrics));
|
23
23
|
|
24
24
|
const downloadMetricData = (event) => {
|
25
25
|
event.preventDefault();
|
@@ -127,13 +127,13 @@
|
|
127
127
|
@apply text-black text-2xl font-bold;
|
128
128
|
}
|
129
129
|
|
130
|
-
&-
|
130
|
+
&-year {
|
131
131
|
@apply text-black text-xs;
|
132
132
|
}
|
133
133
|
|
134
134
|
&-month,
|
135
135
|
&-day,
|
136
|
-
&-
|
136
|
+
&-year {
|
137
137
|
@apply inline-flex items-center justify-evenly empty:[&>span]:hidden;
|
138
138
|
}
|
139
139
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
[id*="dropdown-menu"] {
|
2
|
-
@apply flex flex-col py-
|
2
|
+
@apply flex flex-col py-0 mx-3.5 md:mx-0 border-t-0 border-gray-3 cursor-pointer;
|
3
3
|
|
4
4
|
&[aria-hidden="true"] {
|
5
5
|
@apply hidden md:flex;
|
@@ -34,7 +34,7 @@
|
|
34
34
|
}
|
35
35
|
|
36
36
|
.dropdown {
|
37
|
-
@apply absolute
|
37
|
+
@apply absolute border-2 border-gray-3 rounded min-w-max p-4 drop-shadow-md text-left z-10;
|
38
38
|
|
39
39
|
& > * {
|
40
40
|
@apply relative z-10 p-3.5 first:pt-1.5 last:pb-1.5;
|
@@ -51,18 +51,18 @@
|
|
51
51
|
}
|
52
52
|
|
53
53
|
.layout-item {
|
54
|
-
@apply container grid grid-cols-1
|
54
|
+
@apply container grid grid-cols-1 lg:grid-cols-12 py-4 lg:py-24 gap-12 lg:gap-x-0;
|
55
55
|
|
56
56
|
&__main {
|
57
|
-
@apply
|
57
|
+
@apply xl:col-start-2 lg:col-span-8 xl:col-span-7 relative;
|
58
58
|
}
|
59
59
|
|
60
60
|
&__aside {
|
61
|
-
@apply
|
61
|
+
@apply lg:col-start-10 xl:col-start-10 lg:col-span-3 xl:col-span-2;
|
62
62
|
}
|
63
63
|
|
64
64
|
&__back {
|
65
|
-
@apply mb-4
|
65
|
+
@apply mb-4 lg:mb-0 lg:absolute lg:-left-[1em] lg:-top-8 lg:-translate-y-full;
|
66
66
|
}
|
67
67
|
|
68
68
|
&__arrow {
|
@@ -78,6 +78,3 @@
|
|
78
78
|
// This imports all the Decidim module stylesheet imports registered at
|
79
79
|
// `config/assets.rb` of the module for the "app" group.
|
80
80
|
@import "!decidim-style-imports[app]";
|
81
|
-
|
82
|
-
// Application specific styles: https://docs.decidim.org/en/customize/styles/#_webpacker
|
83
|
-
@import "stylesheets/decidim/decidim_application";
|
@@ -2,4 +2,8 @@
|
|
2
2
|
// Notice that this file is included at the very end of the stylesheets packs to have
|
3
3
|
// more priority
|
4
4
|
//
|
5
|
+
// Please note this file is only targeting the end user interface and not the admin interface.
|
6
|
+
// To change the Tailwind CSS configuration, or to override the admin, system or design interface
|
7
|
+
// styles follow the instructions in https://docs.decidim.org/en/customize/styles/
|
8
|
+
//
|
5
9
|
// By default this is empty.
|