diff --git a/app/assets/javascripts/shopify_app/itp_polyfill.js b/app/assets/javascripts/shopify_app/itp_polyfill.js index 194348e0f..37a28216a 100644 --- a/app/assets/javascripts/shopify_app/itp_polyfill.js +++ b/app/assets/javascripts/shopify_app/itp_polyfill.js @@ -15,11 +15,12 @@ function setCookieAndRedirect() { } document.addEventListener("DOMContentLoaded", function() { - var continueElement = document.getElementById("continue-button"); + if (document.hasStorageAccess) { + var itpContent = document.querySelector('#CookiePartitionPrompt'); + itpContent.style.display = 'block'; - if (shouldTriggerCookiePartitioning()) { - continueElement.style.display = 'inline'; - continueElement.addEventListener('click', setCookieAndRedirect); + var button = document.querySelector('#AcceptCookies'); + button.addEventListener('click', setCookieAndRedirect); } else { setCookieAndRedirect(); } diff --git a/app/views/shopify_app/sessions/set_top_level_cookie.html.erb b/app/views/shopify_app/sessions/set_top_level_cookie.html.erb index 34b1d7a44..97aadce3d 100644 --- a/app/views/shopify_app/sessions/set_top_level_cookie.html.erb +++ b/app/views/shopify_app/sessions/set_top_level_cookie.html.erb @@ -2,10 +2,18 @@ + Redirecting… @@ -20,6 +28,39 @@ <%= javascript_include_tag('shopify_app/itp_polyfill', crossorigin: 'anonymous', integrity: true) %> - +
+
+
+
+
+
+
+
+
+

<%= I18n.t('enable_cookies_heading', app: ShopifyApp.configuration.application_name) %>

+
+
+

<%= I18n.t('enable_cookies_body', app: ShopifyApp.configuration.application_name) %>

+
+
+

<%= I18n.t('enable_cookies_footer') %>

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
diff --git a/config/locales/de.yml b/config/locales/de.yml index e84f80415..c44c9836a 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,3 +1,7 @@ de: logged_out: 'Erfolgreich ausgelogt' could_not_log_in: 'Shopify Store Login fehlgeschlagen' + enable_cookies_heading: "Enable cookies from %{app}" + enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify." + enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.' + enable_cookies_action: 'Enable cookies' diff --git a/config/locales/en.yml b/config/locales/en.yml index faca6a5b1..81a082fe9 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2,3 +2,7 @@ en: logged_out: 'Successfully logged out' could_not_log_in: 'Could not log in to Shopify store' invalid_shop_url: 'Invalid shop domain' + enable_cookies_heading: "Enable cookies from %{app}" + enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify." + enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.' + enable_cookies_action: 'Enable cookies' diff --git a/config/locales/es.yml b/config/locales/es.yml index cdbeb5a18..6cafd1e46 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1,3 +1,7 @@ es: logged_out: 'Cerrar sesión' could_not_log_in: 'No se pudo iniciar sesión en tu tienda de Shopify' + enable_cookies_heading: "Enable cookies from %{app}" + enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify." + enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.' + enable_cookies_action: 'Enable cookies' diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 17b39ac33..387448a0a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -2,3 +2,7 @@ fr: logged_out: 'Vous êtes déconnecté(e)' could_not_log_in: 'Impossible de se connecter à la boutique Shopify' invalid_shop_url: 'Url invalide' + enable_cookies_heading: "Enable cookies from %{app}" + enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify." + enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.' + enable_cookies_action: 'Enable cookies' diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 50805860a..edfb1512d 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,3 +1,7 @@ ja: logged_out: 'ログインに成功しました' could_not_log_in: 'Shopifyストアにログインできませんでした' + enable_cookies_heading: "Enable cookies from %{app}" + enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify." + enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.' + enable_cookies_action: 'Enable cookies' \ No newline at end of file