diff --git a/web/src/admin.js b/web/src/admin.js index 24b3eb06f0..94cf938a2c 100644 --- a/web/src/admin.js +++ b/web/src/admin.js @@ -199,6 +199,7 @@ export function build_page() { settings_object: realm_user_settings_defaults, display_settings: settings_config.get_all_preferences(), information_density_settings: settings_config.get_information_density_preferences(), + settings_render_only: settings_config.get_settings_render_only(), settings_label: settings_config.realm_user_settings_defaults_labels, desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values, enable_sound_select: diff --git a/web/src/settings.js b/web/src/settings.js index a4456be908..5fa2cf26d2 100644 --- a/web/src/settings.js +++ b/web/src/settings.js @@ -121,6 +121,7 @@ export function build_page() { settings_config.all_notifications(user_settings).show_push_notifications_tooltip, display_settings: settings_config.get_all_preferences(), information_density_settings: settings_config.get_information_density_preferences(), + settings_render_only: settings_config.get_settings_render_only(), user_can_change_name: settings_data.user_can_change_name(), user_can_change_avatar: settings_data.user_can_change_avatar(), user_can_change_email: settings_data.user_can_change_email(), diff --git a/web/src/settings_config.ts b/web/src/settings_config.ts index 9e73f79dbd..bc8b7547a4 100644 --- a/web/src/settings_config.ts +++ b/web/src/settings_config.ts @@ -145,12 +145,6 @@ export type DisplaySettings = { user_display_settings: string[]; }; render_group?: boolean; - render_only: { - dense_mode?: boolean; - high_contrast_mode?: boolean; - web_font_size_px?: boolean; - web_line_height_percent?: boolean; - }; }; /* istanbul ignore next */ @@ -164,24 +158,31 @@ export const get_all_preferences = (): DisplaySettings => ({ "fluid_layout_width", ], }, - render_only: { - dense_mode: page_params.development_environment, - high_contrast_mode: page_params.development_environment, - }, }); /* istanbul ignore next */ export const get_information_density_preferences = (): DisplaySettings => ({ render_group: page_params.development_environment, - render_only: { - web_font_size_px: page_params.development_environment, - web_line_height_percent: page_params.development_environment, - }, settings: { user_display_settings: ["web_font_size_px", "web_line_height_percent"], }, }); +type SettingsRenderOnly = { + dense_mode: boolean; + high_contrast_mode: boolean; + web_font_size_px: boolean; + web_line_height_percent: boolean; +}; + +/* istanbul ignore next */ +export const get_settings_render_only = (): SettingsRenderOnly => ({ + dense_mode: page_params.development_environment, + high_contrast_mode: page_params.development_environment, + web_font_size_px: page_params.development_environment, + web_line_height_percent: page_params.development_environment, +}); + export const email_address_visibility_values = { everyone: { code: 1, diff --git a/web/templates/settings/display_settings.hbs b/web/templates/settings/display_settings.hbs index f6492e4cce..f7f8bd249e 100644 --- a/web/templates/settings/display_settings.hbs +++ b/web/templates/settings/display_settings.hbs @@ -176,7 +176,7 @@ setting_name=this setting_value=(lookup ../settings_object this) label=(lookup ../settings_label this) - render_only=(lookup ../information_density_settings.render_only this) + render_only=(lookup ../settings_render_only.render_only this) prefix=../prefix}} {{/each}} @@ -187,7 +187,7 @@ setting_name=this is_checked=(lookup ../settings_object this) label=(lookup ../settings_label this) - render_only=(lookup ../display_settings.render_only this) + render_only=(lookup ../settings_render_only.render_only this) prefix=../prefix}} {{/each}}