-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide the modal link label function on Fides object #4766
Provide the modal link label function on Fides object #4766
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
Passing run #7033 ↗︎
Details:
Review all test suite changes for PR #4766 ↗︎ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start on this! Just a couple things to address before we can merge.
@@ -40,6 +40,7 @@ existence of Fides *or* subscribe to the global `FidesInitialized` event (see | |||
- [fides\_string](Fides.md#fides_string) | |||
- [initialized](Fides.md#initialized) | |||
- [showModal](Fides.md#showmodal) | |||
- [getModalLinkLabel](Fides.md#getmodallinklabel) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@@ -36,6 +48,12 @@ | |||
<h1>fides.js demo page</h1> | |||
<p>This page exists to demonstrate the fides.js script.</p> | |||
|
|||
<div> | |||
<button type="button" onclick="deleteCookie()"> | |||
delete cookie and reload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for adding this here too!
@@ -45,6 +47,37 @@ describe("i18n-utils", () => { | |||
{ locale: "en", label_en: "English", label_original: "English" }, | |||
{ locale: "es", label_en: "Spanish", label_original: "Español" }, | |||
]; | |||
const mockI18nCatalogLoad = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for extracting these out 💯
@@ -906,6 +865,42 @@ describe("i18n-utils", () => { | |||
}); | |||
}); | |||
|
|||
describe("localizeModalLinkText", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
super easy to read, nice work!
Closes #PROD-1710
Description Of Changes
Provide the modal link label function to the client based on the current locale unless specified via props to return default locale's language.
Assumes translation string will be returned along with other strings from the server as
modal_link_label
(WIP. Not hooked up to BE yet)Code Changes
DEFAULT_MODAL_LINK_LABEL
window.Fides
object.getModalLinkLabel()
instructions.Steps to Confirm
1. Go to
/consent/privacy-experience
2. Click US Modal to open its configuration settings
3. Click English (Default) language
4. Add some English text in the "Trigger link label" field and Save. (eg. "Privacy Options").
5. Click Save again to also save it to the experience.
6. Click US Modal to open its configuration settings again.
7. Open the Spanish language
8. Add some spanish text in the "Trigger link label" field and Save. (eg. "Opciones de privacidad")
9. Click Save again to also save it to the experience.
?fides_locale
set for desired language, and make sure the geolocation used in demo page supports US Modal experience we just configured:*
/fides-js-demo.html?geolocation=us-ut&fides_locale=en
*
/fides-js-demo.html?geolocation=us-ut&fides_locale=es
Fides.getModalLinkLabel()
Pre-Merge Checklist
CHANGELOG.md