Commit Graph

38095 Commits

Author SHA1 Message Date
Anders Kaseorg ed183fb95f lint: Use Prettier for JavaScript files.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg b65d2e063d js: Reformat with Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg bd45216c21 eslint: Disable syntax rules handled by Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg 8046b6477a js: Remove extra consecutive spaces.
Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg 883e2fd325 js: Remove inner spacing from object literals.
We’re configuring Prettier with bracketSpacing: false.  Generated by
ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg a20c12366f js: Use inside variant of IIFE wrappers.
Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg 6924d501bc js: Indent case clauses in switch statements.
Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:25 -07:00
Anders Kaseorg f3726db89a js: Normalize strings to double quotes.
Prettier would do this anyway, but it’s separated out for a more
reviewable diff.  Generated by ESLint.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:31:24 -07:00
Anders Kaseorg 06691e1e45 prettier: Disable bracketSpacing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:30:52 -07:00
Anders Kaseorg facd860a6c lint: Exclude i18n string concatenation exposed by Prettier.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:30:52 -07:00
Anders Kaseorg 67773bc834 support: Move eslint-disable comment to Prettier-compatible position.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:30:52 -07:00
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
Anders Kaseorg ac64d03988 frontend_tests: Fix incorrect backslash escaping.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-17 14:30:52 -07:00
Rohitt Vashishtha fb2946aaf6 Revert "markdown: Remove paragraphs that only contain a tweet link."
This reverts commit d3770153a6.

We do not show a link to the tweet in our preview, so we should revert
to our previous behavior for now.
2020-07-17 14:30:22 -07:00
Alex Vandiver 50289d809c docs: Fix link in 3.0 upgrade docs.
Noticed by neiljp (Neil Pilgrim) <github@kepier.clara.net>.
2020-07-17 12:09:32 -07:00
Tim Abbott 6be3fca037 auth: Remove short_name from LDAP API.
As best I can tell, we fetched this field and then ignored it, so
unlike the last few commits, this is more a code cleanup than a
functional change.
2020-07-17 11:28:08 -07:00
Steve Howell c44500175d database: Remove short_name from UserProfile.
A few major themes here:

    - We remove short_name from UserProfile
      and add the appropriate migration.

    - We remove short_name from various
      cache-related lists of fields.

    - We allow import tools to continue to
      write short_name to their export files,
      and then we simply ignore the field
      at import time.

    - We change functions like do_create_user,
      create_user_profile, etc.

    - We keep short_name in the /json/bots
      API.  (It actually gets turned into
      an email.)

    - We don't modify our LDAP code much
      here.
2020-07-17 11:15:15 -07:00
Steve Howell c60f4236a9 api: Do not require short_name to create user.
When you post to /json/users, we no longer
require or look at the short_name parameter,
since we don't use it in any meaningful way.

An upcoming commit will eliminate it from the
database.
2020-07-17 11:15:15 -07:00
Steve Howell b375581f58 api: Remove (sender_)short_name from message APIs. 2020-07-17 11:15:14 -07:00
Steve Howell e6974d3013 reaction tests: Clean up optional parameters.
This fixes up some complex helpers that may
have had some value before f-strings come along,
but they mostly obscured the logic for
people reading the tests.

We still keep really simple helpers for the
common cases, but there are no optional
parameters for them.

One goal of this fix is to remove the
short_name concept, and we just explicitly
set senders everywhere we need them.

We also now have each test just explicitly set
its reaction_type.

For cases where we have custom message ids
or senders, we just inline the simple call
to api_post.
2020-07-17 11:04:54 -07:00
Steve Howell 3b2c881ce6 tests: Decouple test_retention and test_reactions.
We generally want to avoid having two sibling test
suites depend on each other, unless there's a real
compelling reason to share code.  (And if there is
code to share, we can usually promote it to either
test_helpers or ZulipTestCase, as I did here.)

This commit is also prep for the next commit, where
I try to simplify all of the helpers in EmojiReactionBase.

Especially now that we have f-strings, it is usually
better to just call api_post explicitly than to
obscure the mechanism with thin wrappers around
api_post.  Our url schemes are pretty stable, so it's
unlikely that the helpers are actually gonna prevent
future busywork.
2020-07-17 11:04:54 -07:00
Steve Howell f13327223d tests: Extract get_user_id helper for import tests.
The new helper sets us up to drop short_name.
2020-07-17 11:04:54 -07:00
Steve Howell 0a88202763 webhooks: Ignore short_name to guess user.
The short_name field isn't super reliable, and
we are about to eliminate it.
2020-07-17 11:04:54 -07:00
Steve Howell 7d9f24c58c mypy: Fix Realm types in test_import_export.
It's not clear to me why these passed mypy
before, given this:

    def assert_realm_values(f: Callable[[Realm], Any], ...

But this is clearly more accurate.
2020-07-17 11:04:54 -07:00
Steve Howell 2a9cb4c8cf dead code: Remove legacy reaction actions. 2020-07-17 04:40:01 -04:00
Steve Howell 2374e25b94 import: Import AlertWord table. 2020-07-16 08:50:31 -07:00
Steve Howell 318c55e030 export: Export AlertWord table. 2020-07-16 08:50:31 -07:00
Tim Abbott 23e0ea5e32 version: Update version following 3.0 release. 2020-07-16 02:25:45 -07:00
Tim Abbott d74664a603 Release Zulip Server 3.0. 2020-07-16 02:13:43 -07:00
Tim Abbott ba55bc624f i18n: Update translation data from Transifex. 2020-07-16 01:59:19 -07:00
Gittenburg e15189b20c click_handlers: Don't focus links on middle / right click. 2020-07-16 10:50:40 +02:00
Anders Kaseorg ffdbf1afec favicon: Replace favicon PM indicator with red dot.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-16 01:37:08 -07:00
Anders Kaseorg c2f9db4602 logo: Update Zulip logo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-16 01:37:08 -07:00
Gittenburg c42c2a9a22 click_handlers: Don't focus elements on dragstart.
Chrome focuses elements when you start dragging them,
which can confuse users because of our focus outline.
2020-07-16 01:32:26 -07:00
Tim Abbott 289819fb70 push_notifications: Reduce log level for weird warning.
This issue isn't something a system administrator needs to take action
on -- it's a likely minor logic bug around organization
administrators moving topics between streams.

As a result, it shouldn't send error emails to administrators.
2020-07-16 01:22:03 -07:00
Tim Abbott 4f9f6b18e7 css: Fix recipient bar stream hover text color in night theme.
It's unclear what the purpose of this logic was, but testing confirms
that the text color is as expected without this in the day theme (so
it's likely a relic of an old design) and removing it fixes the hover
text being overridden to white in the night theme.
2020-07-16 01:14:03 -07:00
Tim Abbott 1379d28d5a i18n: Update translation data from Transifex. 2020-07-16 01:05:12 -07:00
Alex Vandiver 161fecc7dc mailmap: Add mailmap entry for Alex Vandiver. 2020-07-16 00:08:41 -07:00
Aman Agrawal ddef014eea recent_topics: Patch colors.
Don't allow bootstrap to override row hover colors.
Show unread topics in same color as others.
2020-07-15 23:57:58 -07:00
Rohitt Vashishtha b64ba98e90 markdown: Use unicode ellipses for collapsing spoilers.
We had initially implemented this feature using `(...)` but `(…)` is the
better variation.
2020-07-15 23:30:28 -07:00
Rohitt Vashishtha 7d5d90b484 markdown: Format spoilers for emails.
This is a hacky fix to avoid spoiler content leaking in emails. The
general idea here is to tell people to open Zulip to view the actual
message in full.

We create a mini-markdown parser here that strips away the fence content
that has the 'spoiler' tag for the text emails.

Our handling of html emails is much better in comparison where we can
use lxml to parse the spoiler blocks.
2020-07-15 23:30:28 -07:00
Rohitt Vashishtha ea1c178305 markdown: Format spoilers for desktop notifications.
We hide the spoiler content in browser/desktop notifications.

Note: its not worth adding zjquery tests for this bit of code because
the tests do not operate on the actual data and are likely to get stale
if we change the syntax for spoilers.
2020-07-15 23:30:28 -07:00
Tim Abbott 2f66c825a2 push_notifications: Disable badge counts.
We include tests for the new implementation to avoid churning the
codebase too much so this can be easily reverted when we are able to
re-enable the feature.
2020-07-15 22:19:53 -07:00
Tim Abbott 5a1243db3c puppet: Use correct scope for zulip_ops::munin_plugin. 2020-07-15 21:49:45 -07:00
Anders Kaseorg e60ae89caa logo: Delete unused old logos and screenshots.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-15 20:56:58 -07:00
Anders Kaseorg c080b4da06 favicon: Remove ancient browser workarounds.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-15 20:56:58 -07:00
Tim Abbott 163dfb1552 i18n: Disable nb_NO for now.
We need to figure out how to encode this properly as the current name
breaks ./manage.py compilemessages.
2020-07-15 20:37:25 -07:00
Tim Abbott beb42f17f6 i18n: Update translation data from Transifex. 2020-07-15 20:30:57 -07:00
YashRE42 78d511fd03 navbar: Clean up implementation of tab_bar.narrow_description hover.
This handler adds a neat little effect whereby hovering over the
clickable region to open the navbar triggers the search_icon hover
effect and is a neat little visual cue about what happens onClick.

The previous implementation was slightly messy because it fetched the
color and applied it via ".css(". This commit cleans it up by creating
and using the class "search_icon_hover_highlight" instead. We also
make the selectors more specific, ensuring they target children of
"#tab_bar", this was so because it was reasonable to expect someone to
define eg `search_closed` elsewhere and we wanted to prevent bugs when
that happened.
2020-07-15 18:56:06 -07:00
YashRE42 b554333421 night_mode: Fix search_icon hover regression.
In 9046fc1032 we updated the navbar.html
file so that our css selectors did not override each other and cause
annoying problems.

Unfortunately this caused a regression in night mode where the
search_icon didn't have the correct hover effect.

This fixes the regression by adding the selectors.
2020-07-15 18:56:06 -07:00