user_groups: Refactor get_realm_user_groups_for_dropdown_list_widget.

This commit refactors get_realm_user_groups_for_dropdown_list_widget
function to use "group_permission_settings" module instead of
passing variables like "allow_internet_group", etc. individually
for each settings.

We lose some test coverage due to this commit, but that would be
fixed when we add some more group-based settings and allow groups
other than system groups in the group based settings.
This commit is contained in:
Sahil Batra
2023-04-10 16:26:36 +05:30
committed by Tim Abbott
parent a5cbf95c12
commit 9278a219ea
5 changed files with 33 additions and 69 deletions

View File

@@ -210,7 +210,9 @@ export function show_settings_for(node) {
const opts = {
widget_name: "can_remove_subscribers_group_id",
data: user_groups.get_realm_user_groups_for_dropdown_list_widget(true, true, true),
data: user_groups.get_realm_user_groups_for_dropdown_list_widget(
"can_remove_subscribers_group",
),
default_text: $t({defaultMessage: "No user groups"}),
include_current_item: false,
value: sub.can_remove_subscribers_group_id,