mirror of
https://github.com/zulip/zulip.git
synced 2025-11-22 07:21:23 +00:00
user_groups: Allow setting and changing can_join_group setting.
Fixes part of #25938.
This commit is contained in:
@@ -917,6 +917,7 @@ export function check_group_property_changed(elem: HTMLElement, group: UserGroup
|
||||
const current_val = get_group_property_value(property_name, group);
|
||||
let proposed_val;
|
||||
switch (property_name) {
|
||||
case "can_join_group":
|
||||
case "can_manage_group": {
|
||||
const pill_widget = get_group_setting_widget(property_name);
|
||||
assert(pill_widget !== null);
|
||||
@@ -1402,7 +1403,8 @@ export function initialize_disable_btn_hint_popover(
|
||||
tippy.default(util.the($btn_wrapper), tippy_opts);
|
||||
}
|
||||
|
||||
const group_setting_widget_map = new Map<string, GroupSettingPillContainer | null>([
|
||||
export const group_setting_widget_map = new Map<string, GroupSettingPillContainer | null>([
|
||||
["can_join_group", null],
|
||||
["can_manage_group", null],
|
||||
]);
|
||||
|
||||
@@ -1446,7 +1448,7 @@ export function set_group_setting_widget_value(
|
||||
|
||||
export type GroupSettingType = z.output<typeof group_setting_type_schema>;
|
||||
|
||||
type group_setting_name = "can_manage_group";
|
||||
type group_setting_name = "can_manage_group" | "can_join_group";
|
||||
|
||||
export function create_group_setting_widget({
|
||||
$pill_container,
|
||||
|
||||
Reference in New Issue
Block a user