mirror of
https://github.com/zulip/zulip.git
synced 2025-11-22 07:21:23 +00:00
settings_org: Convert module to typescript.
This commit is contained in:
@@ -47,7 +47,7 @@ type SettingOptionValue = {
|
||||
description: string;
|
||||
};
|
||||
|
||||
type SettingOptionValueWithKey = SettingOptionValue & {key: string};
|
||||
export type SettingOptionValueWithKey = SettingOptionValue & {key: string};
|
||||
|
||||
export function get_sorted_options_list(
|
||||
option_values_object: Record<string, SettingOptionValue>,
|
||||
@@ -80,10 +80,13 @@ export function get_sorted_options_list(
|
||||
return options_list;
|
||||
}
|
||||
|
||||
type MessageTimeLimitSetting =
|
||||
| "realm_message_content_edit_limit_seconds"
|
||||
| "realm_move_messages_between_streams_limit_seconds"
|
||||
export type MessageMoveTimeLimitSetting =
|
||||
| "realm_move_messages_within_stream_limit_seconds"
|
||||
| "realm_move_messages_between_streams_limit_seconds";
|
||||
|
||||
export type MessageTimeLimitSetting =
|
||||
| MessageMoveTimeLimitSetting
|
||||
| "realm_message_content_edit_limit_seconds"
|
||||
| "realm_message_content_delete_limit_seconds";
|
||||
|
||||
export function get_realm_time_limits_in_minutes(property: MessageTimeLimitSetting): string {
|
||||
@@ -239,7 +242,7 @@ export const simple_dropdown_realm_settings_schema = realm_schema.pick({
|
||||
realm_edit_topic_policy: true,
|
||||
realm_org_type: true,
|
||||
});
|
||||
type SimpleDropdownRealmSettings = z.infer<typeof simple_dropdown_realm_settings_schema>;
|
||||
export type SimpleDropdownRealmSettings = z.infer<typeof simple_dropdown_realm_settings_schema>;
|
||||
|
||||
export function set_property_dropdown_value(
|
||||
property_name: keyof SimpleDropdownRealmSettings,
|
||||
@@ -654,7 +657,7 @@ export function change_save_button_state($element: JQuery, state: string): void
|
||||
});
|
||||
}
|
||||
|
||||
function get_input_type($input_elem: JQuery, input_type?: string): string {
|
||||
export function get_input_type($input_elem: JQuery, input_type?: string): string {
|
||||
if (input_type !== undefined && ["boolean", "string", "number"].includes(input_type)) {
|
||||
return input_type;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user