From 735c2acf1ee98e7aded27834d30dbae0970f2dcb Mon Sep 17 00:00:00 2001 From: Tim Fischbach Date: Wed, 20 Sep 2023 16:57:45 +0200 Subject: [PATCH] Allow displaying third part opt in/opt out info for iframeEmbed REDMINE-20438 --- .../config/locales/new/iframe_consent.de.yml | 16 ++++++++++++ .../config/locales/new/iframe_consent.en.yml | 15 +++++++++++ .../iframeEmbed/IframeEmbed.js | 25 +++++++++++++++---- .../src/contentElements/iframeEmbed/editor.js | 16 ++++++++++-- .../contentElements/iframeEmbed/stories.js | 23 +++++++++++++++++ 5 files changed, 88 insertions(+), 7 deletions(-) create mode 100644 entry_types/scrolled/config/locales/new/iframe_consent.de.yml create mode 100644 entry_types/scrolled/config/locales/new/iframe_consent.en.yml create mode 100644 entry_types/scrolled/package/src/contentElements/iframeEmbed/stories.js diff --git a/entry_types/scrolled/config/locales/new/iframe_consent.de.yml b/entry_types/scrolled/config/locales/new/iframe_consent.de.yml new file mode 100644 index 000000000..852935403 --- /dev/null +++ b/entry_types/scrolled/config/locales/new/iframe_consent.de.yml @@ -0,0 +1,16 @@ +de: + pageflow_scrolled: + editor: + content_elements: + iframeEmbed: + attributes: + requireConsent: + label: "Datenschutz-Einwilligung aktivieren" + inline_help: |- + iframe erst laden, nachdem Besucher der + Datenverarbeitung durch die eingebettete Seite + zugestimmt hat. + help_texts: + missingConsentVendor: |- + Für den Anbieter der angegeben URL stehen keine + Datenschutzangaben zur Verfügung. diff --git a/entry_types/scrolled/config/locales/new/iframe_consent.en.yml b/entry_types/scrolled/config/locales/new/iframe_consent.en.yml new file mode 100644 index 000000000..1fa8082a1 --- /dev/null +++ b/entry_types/scrolled/config/locales/new/iframe_consent.en.yml @@ -0,0 +1,15 @@ +en: + pageflow_scrolled: + editor: + content_elements: + iframeEmbed: + attributes: + requireConsent: + label: "Display privacy opt-in" + inline_help: | + Only load iframe after the visitor has given + consent to the data processing by the embedded page. + help_texts: + missingConsentVendor: |- + No privacy policy information available for the provider + of the given URL. diff --git a/entry_types/scrolled/package/src/contentElements/iframeEmbed/IframeEmbed.js b/entry_types/scrolled/package/src/contentElements/iframeEmbed/IframeEmbed.js index 3f69b30da..296bde6e4 100644 --- a/entry_types/scrolled/package/src/contentElements/iframeEmbed/IframeEmbed.js +++ b/entry_types/scrolled/package/src/contentElements/iframeEmbed/IframeEmbed.js @@ -5,6 +5,8 @@ import { ContentElementBox, ContentElementFigure, FitViewport, + ThirdPartyOptIn, + ThirdPartyOptOutInfo, useContentElementEditorState, useContentElementLifecycle, usePortraitOrientation, @@ -37,15 +39,28 @@ export function IframeEmbed({configuration}) { - {shouldLoad && -