Skip to content

Commit

Permalink
Moved raw_data_use backwards compat hack
Browse files Browse the repository at this point in the history
Moved backwards compat hack to fill in the raw_data_use for programs that don't have it to PrivacyPolicy.tsx, from ProfileSettings.tsx so that the privacy policy is updated for the login screen, and it carries over to the Profile settings screen.
  • Loading branch information
sebastianbarry committed Feb 29, 2024
1 parent 034bee2 commit 0848131
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 0 additions & 9 deletions www/js/control/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ const ProfileSettings = () => {
function whenReady(newAppConfig: AppConfig) {
const tempUiConfig = newAppConfig;

// backwards compat hack to fill in the raw_data_use for programs that don't have it
const default_raw_data_use = {
en: `to monitor the ${tempUiConfig.intro.program_or_study}, send personalized surveys or provide recommendations to participants`,
es: `para monitorear el ${tempUiConfig.intro.program_or_study}, enviar encuestas personalizadas o proporcionar recomendaciones a los participantes`,
};
Object.entries(tempUiConfig.intro.translated_text).forEach(([lang, val]) => {
val.raw_data_use = val.raw_data_use || default_raw_data_use[lang];
});

// Backwards compat hack to fill in the `app_required` based on the
// old-style "program_or_study"
// remove this at the end of 2023 when all programs have been migrated over
Expand Down
11 changes: 11 additions & 0 deletions www/js/onboarding/PrivacyPolicy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ const PrivacyPolicy = () => {
);
}

// backwards compat hack to fill in the raw_data_use for programs that don't have it
if (appConfig?.intro) {
const default_raw_data_use = {
en: `monitor the ${appConfig?.intro?.program_or_study}, send personalized surveys or provide recommendations to participants`,
es: `monitorear el ${appConfig?.intro?.program_or_study}, enviar encuestas personalizadas o proporcionar recomendaciones a los participantes`,
};
Object.entries(appConfig?.intro?.translated_text).forEach(([lang, val]: [string, any]) => {
val.raw_data_use = val.raw_data_use || default_raw_data_use[lang];
});
}

const templateText = useMemo(() => getTemplateText(appConfig, i18n.language), [appConfig]);

return (
Expand Down

0 comments on commit 0848131

Please sign in to comment.