From dc1f1c3acc1162f761480dd78186839847b7f86c Mon Sep 17 00:00:00 2001 From: Radomir Butacevic Date: Mon, 7 Oct 2024 15:37:51 +0200 Subject: [PATCH 1/2] Add CookiePermission --- .../storefront/src/js/plugin/nosto-configuration.plugin.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js b/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js index 03dd8bbf..1d439e62 100644 --- a/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js +++ b/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js @@ -3,6 +3,7 @@ import DomAccess from 'src/helper/dom-access.helper'; import Iterator from 'src/helper/iterator.helper'; import CookieStorage from 'src/helper/storage/cookie-storage.helper'; import { COOKIE_CONFIGURATION_UPDATE } from 'src/plugin/cookie/cookie-configuration.plugin'; +import CookiePermissionPlugin from 'src/plugin/cookie/cookie-permission.plugin'; export const NOSTO_COOKIE_KEY = 'nosto-integration-track-allow' @@ -98,6 +99,11 @@ export default class NostoConfiguration extends window.PluginBaseClass { } cookieSubscriber() { + const allPlugins = window.PluginManager.getPluginList(); + const isPluginRegistered = Object.keys(allPlugins).includes('CookiePermission'); + if (!isPluginRegistered) { + PluginManager.register('CookiePermission', CookiePermissionPlugin, '[data-cookie-permission]'); + } const instances = window.PluginManager.getPluginInstances('CookiePermission'); Iterator.iterate(instances, instance => { instance.$emitter.subscribe('onClickDenyButton', () => { From f1df06718047d585e41244df37a7de527e5084a1 Mon Sep 17 00:00:00 2001 From: Radomir Butacevic Date: Mon, 7 Oct 2024 15:50:53 +0200 Subject: [PATCH 2/2] Correct the cnahges --- .../app/storefront/src/js/plugin/nosto-configuration.plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js b/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js index 1d439e62..ea594340 100644 --- a/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js +++ b/src/Resources/app/storefront/src/js/plugin/nosto-configuration.plugin.js @@ -102,7 +102,7 @@ export default class NostoConfiguration extends window.PluginBaseClass { const allPlugins = window.PluginManager.getPluginList(); const isPluginRegistered = Object.keys(allPlugins).includes('CookiePermission'); if (!isPluginRegistered) { - PluginManager.register('CookiePermission', CookiePermissionPlugin, '[data-cookie-permission]'); + window.PluginManager.register('CookiePermission', CookiePermissionPlugin, '[data-cookie-permission]'); } const instances = window.PluginManager.getPluginInstances('CookiePermission'); Iterator.iterate(instances, instance => {