mirror of
https://github.com/zulip/zulip.git
synced 2025-11-22 07:21:23 +00:00
user_group_pill: Accept setting_type as parameter in typeahead_source.
We currently use the pills UI only for can_manage_group setting so it is fine to pass setting type as "group" directly to get_realm_user_groups_for_setting, but it would be better to just accept setting_type as parameter in typeahead_source and pass that to get_realm_user_groups_for_setting as other settings will also use the pills UI in future.
This commit is contained in:
@@ -1444,15 +1444,18 @@ type group_setting_name = "can_manage_group";
|
||||
export function create_group_setting_widget({
|
||||
$pill_container,
|
||||
setting_name,
|
||||
setting_type,
|
||||
group,
|
||||
}: {
|
||||
$pill_container: JQuery;
|
||||
setting_name: group_setting_name;
|
||||
setting_type: "realm" | "stream" | "group";
|
||||
group?: UserGroup;
|
||||
}): void {
|
||||
const pill_widget = group_setting_pill.create_pills($pill_container, setting_name);
|
||||
const opts = {
|
||||
setting_name,
|
||||
setting_type,
|
||||
group,
|
||||
};
|
||||
group_setting_pill.set_up_pill_typeahead({pill_widget, $pill_container, opts});
|
||||
|
||||
Reference in New Issue
Block a user