From b8bc20e87ca6749f13debfdb20a2d77ec6dcdb8c Mon Sep 17 00:00:00 2001 From: Sahil Batra Date: Wed, 30 Oct 2024 12:20:59 +0530 Subject: [PATCH] settings: Use new pills UI for move message permission settings. --- web/src/settings_components.ts | 10 ++++++---- web/src/settings_org.ts | 14 ++++++++++++-- web/src/state_data.ts | 4 ++-- .../settings/organization_permissions_admin.hbs | 14 ++++++-------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/web/src/settings_components.ts b/web/src/settings_components.ts index 7ed1b1be73..d77a519707 100644 --- a/web/src/settings_components.ts +++ b/web/src/settings_components.ts @@ -481,8 +481,6 @@ const dropdown_widget_map = new Map([ ["realm_can_create_web_public_channel_group", null], ["realm_can_delete_any_message_group", null], ["realm_can_delete_own_message_group", null], - ["realm_can_move_messages_between_channels_group", null], - ["realm_can_move_messages_between_topics_group", null], ]); export function get_widget_for_dropdown_list_settings( @@ -797,8 +795,6 @@ export function check_realm_settings_property_changed(elem: HTMLElement): boolea case "realm_can_create_web_public_channel_group": case "realm_can_delete_any_message_group": case "realm_can_delete_own_message_group": - case "realm_can_move_messages_between_channels_group": - case "realm_can_move_messages_between_topics_group": proposed_val = get_dropdown_list_widget_setting_value($elem); break; case "realm_can_add_custom_emoji_group": @@ -806,6 +802,8 @@ export function check_realm_settings_property_changed(elem: HTMLElement): boolea case "realm_can_create_public_channel_group": case "realm_can_create_private_channel_group": case "realm_can_manage_all_groups": + case "realm_can_move_messages_between_channels_group": + case "realm_can_move_messages_between_topics_group": case "realm_create_multiuse_invite_group": case "realm_direct_message_initiator_group": case "realm_direct_message_permission_group": { @@ -1473,6 +1471,8 @@ export const group_setting_widget_map = new Map settings_save_discard_widget section_name="moving-msgs" }} - {{> ../dropdown_widget_with_label - widget_name="realm_can_move_messages_between_topics_group" - label=(t 'Who can move messages to another topic') - value_type="number" }} + {{> group_setting_value_pill_input + setting_name="realm_can_move_messages_between_topics_group" + label=(t 'Who can move messages to another topic')}}
@@ -196,10 +195,9 @@
- {{> ../dropdown_widget_with_label - widget_name="realm_can_move_messages_between_channels_group" - label=(t 'Who can move messages to another channel') - value_type="number" }} + {{> group_setting_value_pill_input + setting_name="realm_can_move_messages_between_channels_group" + label=(t 'Who can move messages to another channel')}}