Commit Graph

61 Commits

Author SHA1 Message Date
Anders Kaseorg 569b38fe34 js: Fix no-useless-escape errors.
Generated manually, since ESLint doesn’t have a fixer for this.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:30:52 -07:00
Abhishek-Balaji 255fe13151 alert settings: Include the actual alert word in the success message.
The message now says 'Alert word "foo" added successfully!' when
you add "foo" as an alert word.
2020-04-15 17:56:14 -07:00
Anders Kaseorg d17b577d0c js: Purge useless IIFEs.
With webpack, variables declared in each file are already file-local
(Global variables need to be explicitly exported), so these IIFEs are
no longer needed.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2019-10-25 13:51:21 -07:00
Mateusz Mandera d70e1bcdb7 settings: Add FAKE_EMAIL_DOMAIN setting.
Fixes #9401.

This adds a FAKE_EMAIL_DOMAIN setting, which should be used if
EXTERNAL_HOST is not a valid domain, and something else is needed to
form bot and dummy user emails (if email visibility is turned off).
It defaults to EXTERNAL_HOST.

get_fake_email_domain() should be used to get this value. It validates
that it's correctly set - that it can be used to form valid emails.

If it's not set correctly, an exception is raised. This is the right
approach, because it's undesirable to have the server seemingly
peacefully operating with that setting misconfigured, as that could
mask some hidden sneaky bugs due to UserProfiles with invalid emails,
which would blow up the moment some code that does validate the emails
is called.
2019-08-30 14:59:00 -07:00
Thomas Ip cbae51db63 settings: Move API key form into its own modal.
The modal is rendered dynamically to avoid password managers
inserting passwords into the input field too aggressively.

Fixes #12523.
2019-08-14 10:50:45 -07:00
Yashashvi Dave 8e269b4651 models: Rename notification to `enable_stream_audible_notifications`.
Rename notification property `enable_stream_sounds` to
`enable_stream_audible_notifications` to match with other
notification property patterns.

Fixes part of #12304
2019-06-12 16:24:51 -07:00
Tim Abbott bdb3da4504 eslint: Add key-spacing linter rule.
Apparently, we didn't have one of these, and thus had a moderate
number of generally very old violations in the codebase.  Fix this and
clear the ones that exist..
2018-12-18 10:41:06 -08:00
Marco Burstein ba46dc83c6 notifications: Add a setting for changing the notification sound.
Also, add a new notification sound, "ding". It comes from
https://freesound.org, where the original Zulip notification sound comes
from as well. In the future, new sounds can be added by adding audio
files to the `static/audio/notification_sounds` directory.

Tweaked significantly by tabbott:
* Avoided removing static/audio/zulip.ogg, because that file is
  checked for by old versions of the desktop app.
* Added a views check for the sound being valid + tests.
* Added additional tests.
* Restructured the test_events test to be cleaner.
* Removed check_bool_or_string.
* Increased max length of notification_sound.
* Provide available_notification_sounds in events data set if global
  notifications settings are requested.

Fixes #8051.
2018-12-09 21:25:30 -08:00
Tim Abbott b2939cdf19 lint: Fix comma spacing in node tests.
I apparently failed to check the tests codebase before merging the
last linter commit.  Oops.
2018-12-07 13:14:28 -08:00
Robert Hönig 5d9a8cf64f bots: Add token to outgoing webhook zuliprc.
We want the Botserver to not only work with the
botserverrc, but also with a zuliprc of an outgoing
webhook. Because the Botserver uses the outgoing
webhook token for authentication, we need to include
it in the zuliprc for outgoing webhooks.
2018-06-04 08:39:24 -07:00
Robert Hönig 647c63050f botserver: Add outgoing webhook tokens to botserverrc.
The tokens will be used to authorize the server when sending
messages to the Botserver.
2018-05-30 10:00:19 -04:00
Yashashvi Dave 3654d4f92d jquery-form: Remove jquery-form use from get-API-key form in user settings. 2018-05-30 03:14:39 +05:30
Robert Hönig 04d68d2570 code: Rename flaskbotrc to botserverrc. 2018-05-29 10:19:17 +02:00
Robert Hönig 53891a9bed bots: Don't name section headers in flaskbotrc.
The Botserver uses section headers in the flaskbotrc to
determine which bot to run. Silently setting the section
headers to a bot's username is confusing and makes it
harder for Botserver users to figure out how to get the
Botserver to run the bots they want. This commit empties
all flaskbotrc section headers and thus makes the assignment
of bots explicit and mandatory.
2018-05-25 10:33:40 -07:00
Tim Abbott 716a4a967d js: Fix indentation issues in casper tests.
Our casper tests now pass eslint cleanly.
2018-05-06 19:35:18 -07:00
Tim Abbott 682d4f2ea1 casper: Fix expected result for i18n test.
Now that this string is translated into German, the test should expect
it in German.
2018-04-03 11:05:48 -07:00
Balaji2198 5aa7098c81 display_settings: Change success/failure feedback interface.
This replaces the cumbersome system we had for giving users feedback
on settings state changes in the display settings UI.

We expect this new system to be what we will attempt to migrate other
settings widgets to match over the coming weeks and months.  It also
provides the opportunity to significant refactor away a lot of the
code duplication in settings_display.js.

Thanks to Brock Whittaker for redoing the styling and improving the
code simplicity.

Fixes #7622.
2018-03-04 17:47:05 -08:00
Steve Howell 1338b99356 casper: Avoid nesting wait statements to avoid flakes.
This test had flaked before. Nesting waitUntilVisible
statements is generally discouraged in casper tests.
2018-03-01 14:20:22 -08:00
Brock Whittaker ffe3a6c127 settings: Remove password confirmation in modal.
This removes the requirement to confirm your new password.
It isn't necessary and can be fixed easily with an email
reset if messed up.
2018-01-23 14:38:59 -05:00
Umair Khan 2db1cba9cc i18n: Use language code instead of locale.
We have been assigning locale to language code. Mostly code and locale
are same but for languages like zh-Hans, locale is zh_Hans and code is
zh-hans.

After this commit, compilemessages command should be run.
2017-10-20 11:21:26 -07:00
Umair Khan 063268246e 06-settings.js: Disable flaky test.
This commit disables the password change tests. These tests are affected
by the race condition due to which a user's session can be flushed after
a change in password. This happens because in Django 1.7+ session hash
is changed whenever password is changed. Till we can find a better
solution to this problem these tests cannot be enabled.
2017-10-06 12:08:36 -07:00
Tim Abbott 0148338a05 casper: Always use REALMS_HAVE_SUBDOMAINS.
This is preparation for setting REALMS_HAVE_SUBDOMAINS to be
permanently True.
2017-08-24 20:44:37 -07:00
Umair Khan d59e381131 casper: Make sure account-settings-status is invisible. 2017-08-22 23:37:20 -07:00
Tim Abbott 1e5aee054b settings: Migrate main settings-change code to API.
This was one of the few major remaining endpoints that were still on
the old-style legacy API.
2017-07-31 13:08:06 -07:00
Brock Whittaker e5e73f364b settings: Change [Change] button styles. 2017-07-17 16:18:46 -07:00
Brock Whittaker 330a3bd144 setttings: Indent display settings checkboxes and fix header styles.
Aside from the indentation of checkboxes, the headers are added and
changed to become more unified with other page styling.
2017-07-17 16:15:04 -07:00
vaibhav f003a4c916 settings: Move api_key_button click in casper tests.
api_key_button element has been moved from "your-bots" settings page
to "account-settings" page. This click statement was left by mistake.
2017-07-03 11:09:40 -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
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
Harshit Bansal 0e8f1f4e5d alert_words: Fix the UI to not allow users to create duplicate alert words. 2017-06-13 16:37:49 -07:00
Harshit Bansal 947f6e9190 casper_tests: Fix the broken alert words casper tests.
This commit fixes the broken alert word casper tests that were
commented out earlier due to flakes(see issue #1244).

Fixes: #1269.
2017-06-13 16:36:11 -07:00
digi0ps 8fb9d2bff3 settings: Redesign settings/administration panel buttons.
This redesigns all the ugly bold-colored buttons in the settings and
administration pages.
2017-04-25 16:33:59 -07:00
Steve Howell 153c24d071 Remove dead code related to bot/stream settings.
We had never-enabled code to allow users to set default
streams for their bots (for event registration, default sending, etc.).

This commit removes the code.
2017-04-07 15:20:12 -07:00
Tim Abbott 900891b072 settings: Rename settings-status to account-settings-status. 2017-03-10 10:53:06 -08:00
Raghav Jajodia 05f0d1953b account-settings: Removed 'Updated settings' message from admin.
The 'Updated Settings' message we get at the bottom
of admin-page when we change the name is removed.
Fixes #3815.
2017-03-10 10:53:06 -08:00
Rishi Gupta 3797fa657e Change bot domains to string_id.EXTERNAL_HOST.
Change applies to both subdomains and non-subdomains case, though we use
just the EXTERNAL_HOST in the non-subdomains case if there is only 1 realm.

Fixes #3903.
2017-03-08 16:26:13 -08:00
Tim Abbott 532cfab846 casper: Use waitUntilVisible in settings tests. 2017-02-09 23:35:11 -08:00
Brock Whittaker 1143ed7219 redesign: Change /#settings and /#administration to an overlay.
This also adds a box-shadow to the #deactivate_self_modal so that it
looks similar to the old backdrop.
2017-02-09 23:35:10 -08:00
Tim Abbott c4ba971247 casper: Fix test failures in 06-settings due to new translations. 2017-02-03 14:32:05 -08:00
Tim Abbott a889346c9f Remove zh_CN old Django name for Chinese. 2017-02-03 14:29:03 -08:00
Tim Abbott 998dff9e50 lint: Add dangling commas in JavaScript objects. 2017-01-11 15:23:42 -08:00
Tim Abbott 7ca2d21d97 casper: Clean up some line-wrapping.
This feels a bit more readable than the original version; noticed it
while playing with the comma-dangle linter.
2017-01-11 15:23:42 -08:00
Umair Khan ab25cd7401 casper: Redirect to english url. 2016-12-15 13:44:13 -08:00
Tommy Ip fe4a0e72fc Add new button to download ~/.zuliprc from settings page.
Added new option to download .zuliprc file directly from settings
page.  This should help reduce friction when setting up new
bots/integrations. This new feature is available in the bot cards and
the 'show your API key' section. One caveat is that the filename is
automatically set to 'zuliprc' instead of '.zuliprc', since as most
browsers do not allow filenames to start with a dot.

Fixes #2327.
2016-12-07 21:28:41 -08:00
Robert Hönig ce2671c5cf eslint: Apply no-useless-escape rule to casper tests. 2016-12-06 18:06:57 -08:00
AZtheAsian 5e9918135b eslint: change quote-props from off to error and fix violations. 2016-12-02 18:35:53 -08:00
Umair Khan 92869940c6 Fix race conditions in user settings casper tests. 2016-11-26 14:56:15 -08:00
Tim Abbott d5f28abac7 casper: Use zulipdev.com rather than localhost consistently.
This fixes a problem where any absolute redirects in the routes
visited by the Casper tests will cause failures due to switching the
users to a "different" server where the cookies they'd received are no
longer valid.

Now, we at least consistently use the same hostname in the Casper
tests as EXTERNAL_HOST.
2016-10-11 15:54:05 -07:00
Steve Howell 52659ccae4 casper: Improve 06-settings.js.
Use higher level selectors to detect visibility of key components.

Also click through the menu more explicitly.
2016-10-07 13:30:11 -07:00