user_group_components: Convert module to TypeScript.

This commit is contained in:
afeefuddin 2024-04-02 02:25:55 +05:30 committed by Tim Abbott
parent ab14b2e04a
commit fd970e0520
2 changed files with 6 additions and 5 deletions

View File

@ -267,7 +267,7 @@ EXEMPT_FILES = make_set(
"web/src/user_card_popover.js", "web/src/user_card_popover.js",
"web/src/user_deactivation_ui.ts", "web/src/user_deactivation_ui.ts",
"web/src/user_events.js", "web/src/user_events.js",
"web/src/user_group_components.js", "web/src/user_group_components.ts",
"web/src/user_group_create.js", "web/src/user_group_create.js",
"web/src/user_group_create_members.js", "web/src/user_group_create_members.js",
"web/src/user_group_create_members_data.ts", "web/src/user_group_create_members_data.ts",

View File

@ -3,13 +3,14 @@ import $ from "jquery";
import * as dropdown_widget from "./dropdown_widget"; import * as dropdown_widget from "./dropdown_widget";
import * as settings_components from "./settings_components"; import * as settings_components from "./settings_components";
import * as user_groups from "./user_groups"; import * as user_groups from "./user_groups";
import type {UserGroup} from "./user_groups";
export function setup_permissions_dropdown(group, for_group_creation) { export function setup_permissions_dropdown(group: UserGroup, for_group_creation: boolean): void {
let widget_name; let widget_name: string;
let default_id; let default_id: number;
if (for_group_creation) { if (for_group_creation) {
widget_name = "new_group_can_mention_group"; widget_name = "new_group_can_mention_group";
default_id = user_groups.get_user_group_from_name("role:everyone").id; default_id = user_groups.get_user_group_from_name("role:everyone")!.id;
} else { } else {
widget_name = "can_mention_group"; widget_name = "can_mention_group";
default_id = group.can_mention_group; default_id = group.can_mention_group;