Commit Graph

38 Commits

Author SHA1 Message Date
Shubham Dhama efeee28b12 settings: Remove obsolete lines of code.
There don't exist any element with this classes and it seems they
are accidentally added during addition of `bot_creation_policy`.
2018-03-30 16:07:53 +05:30
Shubham Dhama aca2364455 settings: Focus "Add a new bot" tab when there is no active bot.
Fixes: #8872.
2018-03-30 16:07:01 +05:30
Shubham Dhama 0ef195ecc2 settings: Refactor code for focussing bot tabs. 2018-03-30 16:07:01 +05:30
Yago González 1237f819bb settings: Fix typo. 2018-03-29 08:04:51 -07:00
Shubham Dhama 777b6de689 org settings: Add setting to prevent users from adding bots.
Fixes: #7908.
2018-03-09 13:21:55 -08:00
Robert Hönig 35c7428490 frontend: Add create-bot loading indicator.
The former "the-bot-is-being-created" indicator was useless,
since it only edited the value attribute of the "create-bot" button;
that attribute only sets the text of a button when it is initially created.

This commit replaces the old code with a spinning loading indicator,
like the one used for editing bots.
2018-03-08 15:05:00 -08:00
Robert Hönig 695b3e48e8 frontend: Add embedded bot config data editing. 2018-03-01 08:25:43 -08:00
Robert Hönig 7b7f4cc62d bot settings: Generate embedded bot selector in handlebars.
It's better to do stuff like this in HTML templates like
handlebars instead of JS.
2018-03-01 08:25:43 -08:00
Robert Hönig 3e1b817376 bot settings: Move config item generation from js to handlebars. 2018-02-09 12:30:24 -08:00
Robert Hönig 33322fed51 bot_settings.js: Narrow config item selector.
Needed to avoid selector conflicts with the future
config items in the edit sidebar.
2018-02-09 12:30:24 -08:00
Robert Hönig 7539512af8 settings-bots.js: Restructure bot edit event handler.
Shift and unify some variables to make the code more
logical and concise.
2018-02-09 12:30:03 -08:00
Robert Hönig f371c79c22 settings-bots.js: Fully generate bot owner list in handlebars. 2018-02-09 12:30:03 -08:00
Robert Hönig 273f62f8cd settings-bots.js: Remove redundant sidebar close event handler.
All the event handler did was resetting some entries in the edit
bot form. This is unnecessary, because the whole form gets
destroyed anyway when closed.
2018-02-09 12:30:03 -08:00
Robert Hönig 338bba7a0f edit_bot.handlebars: Extract outgoing webhook form.
This removes ugly .show() .hide() constructions that
were previously used to dynamically display the form.
2018-02-09 12:30:03 -08:00
Robert Hönig 1ec9932aec settings_bots.js: Clean up bot edit event handler.
This is done by rewriting JS manipulations of the DOM tree
in the bot-settings.handlebars template. Dead code involving
the affected JS variables is removed.
2018-02-09 12:30:03 -08:00
Robert Hönig 032cc8497f settings sidebar: Extract bot edit form.
This is the first step in cleaning up the bot edit code.
Since the bot edit form appears dynamically, we remove
it from the static HTML scaffold, of which settings_sidebar
is a part of.
2018-02-09 12:30:03 -08:00
Robert Hönig 31a1c3e5d6 Efficiently clear typeahead when renaming a bot.
There's no reason to clear every user from the typeahead to handle a
single bot being renamed.

This amends 1df3e04.
2018-02-05 10:19:21 -08:00
Robert Hönig 4cc8c74aaa frontend: Internally refer to bots by ID.
This is done by using a bot's ID instead of email in
the handler methods for bot_data.bots and bot_data.services,
and updating all code paths involved.
2018-01-23 07:29:00 -05:00
Robert Hönig bd6fa385a5 frontend: Add outgoing webhook config entries to the "edit bot" menu.
This allows users to edit an outgoing webhook's endpoint URL
and interface type after it has been created.

Fixes #7411.
2018-01-23 07:29:00 -05:00
Robert Hönig 3accf7b935 embedded bots UI: Fix wrong _.each argument order. 2018-01-11 06:30:54 -05:00
Robert Hönig d1d8365a6b embedded bots: Add config data UI.
This adds UI fields in the bot settings for specifying
configuration values like API keys for a bot. The names
and placeholder values for each bot's config fields are
fetched from the bot's <bot>.conf template file in the
zulip_bots package. This also adds giphy and followup
as embedded bots.
2018-01-09 11:50:54 -05:00
Robert Hönig 82db9a211e bot settings: Set converter as default in embedded bot list.
The previous value 'xkcd' is not yet an embedded bot.
2018-01-07 18:52:04 +01:00
derAnfaenger f84a49cee6 bot settings: Fetch embedded bots list from page_params. 2017-12-26 08:50:00 -05:00
Abhijeet Kaur 28b0ebd739 Embedded bots: Add UI for adding embedded bots.
Adds type "embedded bot" to bot creation menu. Lets
users select a bot to run from a list of bots.
Currently, this list is hard-coded into the backend.
2017-12-26 08:50:00 -05:00
Aastha Gupta 1df3e04cd7 bot settings: Clear typeahead when renaming a bot
Fixes #7534
When bot is renamed, the old name persists in mention typehead.
This commit clears the typeahead, whenever bot details are modified.
2017-12-13 14:39:53 -06:00
Alena Volkova 3be8e95d13 settings: Send bot types from the backend instead of hardcoding them. 2017-11-30 15:28:53 -08:00
Robert Hönig 910f04af29 bot settings: Properly hide bot_table_error. 2017-09-06 13:44:02 -07:00
vaibhav 691aff55a3 bots: Add UI to select Slack compatible interface for webhooks.
interface_type select menu will be used to choose the interface
for outgoing webhooks. It will be displayed only when the selected
bot type is OUTGOING WEBHOOK type. The default value is GENERIC
interface type (1).
2017-07-28 16:22:55 -07:00
Abhijeet Kaur 6869e6a1ec bots UI: Create a new bot switches tab to "Active bots".
Creating a new bot (by filling out the bots related fields and clicking
"Create bot" button) changes tab from "Add a new bot" to "Active bots".
This is done to make users know/confirm that the bot has been created and
the user can view it in this tab.

Fixes: #5731
2017-07-08 14:30:45 -07:00
Abhijeet Kaur 343cb20d57 bots: Move "Add a new bot" to its own tab in settings UI.
"Add a new bot" UI used to be common in "Active bots" and
"Inactive bots". "Add a new bot" UI was below the list of all
active/inactive bots.

If there were more than a few bots was more than four, then the user
had to scroll down the entire list of bots to "Add a new bot", which
was annoying.  This new model makes the UI look cleaner as well.
2017-07-06 09:24:28 -07:00
Abhijeet Kaur 14fdc2aea6 bots: Add 'Bot type' column to bots list in organization settings. 2017-06-20 23:04:46 -04:00
vaibhav d9bc3932ec settings: Move "download personal API key" from "your-bots" to "your account"
Fixes: #5355.
2017-06-20 15:46:23 -04:00
vaibhav 9a6e326305 Add support for generating and downloading flaskbotrc.
Flaskbotrc is a file containing config of all active
outgoing webhook bots. It is used to provide configuration
of all active outgoing webhook bots to zulip-bot-server.
2017-06-20 09:43:45 -04:00
vaibhav 33c0c00cd6 Outgoing webhook System: first Iteration of outgoing webhook UI. 2017-06-19 16:05:54 -04:00
Abhijeet Kaur af7e08acb0 bots: Add UI to view bot types of existing bots in "Your bots".
Tweaked by tabbott for more standard internationalization.
2017-06-15 10:08:31 -07:00
Abhijeet Kaur 60ff82ed7c bots: Add UI for creating different types of bot.
Add 'Type of bot' option for bots by adding dropdown option in
settings->"Your bots".  For now, this allows creating incoming webhook
bots in addition to default bots.

This will enable users to add a bot as an incoming webhook
(in addition to add full-featured bots).

With various minor tweaks and cleanups by tabbott.

Fixes #2186.
2017-06-06 21:11:22 -07:00
fionabunny b7c6d46bf9 home.py: move password_auth_enabled as realm_password_auth_enabled.
Part of #3853.
2017-04-28 21:23:48 -07:00
Steve Howell 7f17fc020f Extract settings_bots.js. 2017-04-07 15:20:12 -07:00