Skip to content
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

Moved raw_data_use backwards compat hack #1133

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading