mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
settings_bots: Make it possible to add new bots from org settings.
Adding an "Add a new bot" button to Organization settings > Bots, which opens a `Add a new bot` form modal from `settings_bots.js`. Fixes #20309.
This commit is contained in:
committed by
Tim Abbott
parent
6db88f0d39
commit
0b3dd4755e
@@ -107,6 +107,7 @@ export function build_page() {
|
||||
realm_avatar_changes_disabled: page_params.realm_avatar_changes_disabled,
|
||||
realm_add_custom_emoji_policy: page_params.realm_add_custom_emoji_policy,
|
||||
can_add_emojis: settings_data.user_can_add_custom_emoji(),
|
||||
can_create_new_bots: settings_bots.can_create_new_bots(),
|
||||
realm_message_content_edit_limit_minutes: settings_org.get_realm_time_limits_in_minutes(
|
||||
"realm_message_content_edit_limit_seconds",
|
||||
),
|
||||
|
||||
@@ -693,4 +693,10 @@ export function set_up_humans() {
|
||||
export function set_up_bots() {
|
||||
section.bots.handle_events();
|
||||
section.bots.create_table();
|
||||
|
||||
$("#admin-bot-list .add-a-new-bot").on("click", (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
settings_bots.add_a_new_bot();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<div id="admin-bot-list" class="settings-section" data-name="bot-list-admin">
|
||||
<div class="tip bot-settings-tip"></div>
|
||||
<div class="clear-float"></div>
|
||||
|
||||
<div>
|
||||
<button class="button rounded sea-green add-a-new-bot {{#unless can_create_new_bots}}hide{{/unless}}">{{t "Add a new bot" }}</button>
|
||||
</div>
|
||||
<div class="settings_panel_list_header">
|
||||
<h3>{{t "Bots"}}</h3>
|
||||
<div class="alert-notification" id="bot-field-status"></div>
|
||||
|
||||
Reference in New Issue
Block a user