From b44fd5365cb20700d6e89c8f3c5df5898f4c8f81 Mon Sep 17 00:00:00 2001 From: Shubham Padia Date: Thu, 11 Jul 2024 06:39:46 +0000 Subject: [PATCH] display_settings: Rename `get_all_preferences`. We've renamed `get_all_preferences` to `information_section_checkbox_group`. We've also converted it from a function into a dictionary since it doesn't contain any page_params variables anymore. This is a preparatory commit for adding a new `Information section` as part of a layout change for this page. --- web/src/admin.js | 2 +- web/src/settings.js | 2 +- web/src/settings_config.ts | 4 ++-- web/templates/settings/display_settings.hbs | 2 +- web/tests/i18n.test.js | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/admin.js b/web/src/admin.js index 94cf938a2c..dc875f2ec1 100644 --- a/web/src/admin.js +++ b/web/src/admin.js @@ -197,7 +197,7 @@ export function build_page() { color_scheme_values: settings_config.color_scheme_values, web_home_view_values: settings_config.web_home_view_values, settings_object: realm_user_settings_defaults, - display_settings: settings_config.get_all_preferences(), + information_section_checkbox_group: settings_config.information_section_checkbox_group, 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, diff --git a/web/src/settings.js b/web/src/settings.js index 5fa2cf26d2..187d3093db 100644 --- a/web/src/settings.js +++ b/web/src/settings.js @@ -119,7 +119,7 @@ export function build_page() { desktop_icon_count_display_values: settings_config.desktop_icon_count_display_values, show_push_notifications_tooltip: settings_config.all_notifications(user_settings).show_push_notifications_tooltip, - display_settings: settings_config.get_all_preferences(), + information_section_checkbox_group: settings_config.information_section_checkbox_group, 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(), diff --git a/web/src/settings_config.ts b/web/src/settings_config.ts index c402b41af8..1fed9e2148 100644 --- a/web/src/settings_config.ts +++ b/web/src/settings_config.ts @@ -148,7 +148,7 @@ export type DisplaySettings = { }; /* istanbul ignore next */ -export const get_all_preferences = (): DisplaySettings => ({ +export const information_section_checkbox_group: DisplaySettings = { settings: { user_display_settings: [ "starred_message_counts", @@ -156,7 +156,7 @@ export const get_all_preferences = (): DisplaySettings => ({ "fluid_layout_width", ], }, -}); +}; /* istanbul ignore next */ export const get_information_density_preferences = (): DisplaySettings => ({ diff --git a/web/templates/settings/display_settings.hbs b/web/templates/settings/display_settings.hbs index 663a13589e..54e9d23646 100644 --- a/web/templates/settings/display_settings.hbs +++ b/web/templates/settings/display_settings.hbs @@ -189,7 +189,7 @@ - {{#each display_settings.settings.user_display_settings}} + {{#each information_section_checkbox_group.settings.user_display_settings}} {{> settings_checkbox setting_name=this is_checked=(lookup ../settings_object this) diff --git a/web/tests/i18n.test.js b/web/tests/i18n.test.js index 880540027a..2cfabce611 100644 --- a/web/tests/i18n.test.js +++ b/web/tests/i18n.test.js @@ -92,7 +92,7 @@ run_test("tr_tag", ({mock_template}) => { information_density_settings: { settings: {}, }, - display_settings: { + information_section_checkbox_group: { settings: {}, }, notification_settings: {},