Skip to content

Commit

Permalink
Merge pull request #1133 from sebastianbarry/raw_data_use_bugfix
Browse files Browse the repository at this point in the history
Moved raw_data_use backwards compat hack
  • Loading branch information
shankari authored Mar 4, 2024
2 parents a89247b + 0848131 commit 3fbc6b5
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 3fbc6b5

Please sign in to comment.