Commit Graph

42443 Commits

Author SHA1 Message Date
sahil839 cf23a09532 giphy: Fix live update of giphy icon when API key is empty.
We fix the code to show giphy icon live update only if the
updated setting is not disabled and API key has been added.
Though the dropdown is disabled,the setting can still be
changed using API, so this change is necessary.

Previously, we were not checking whether API key is there or
not and icon was shown on live update even if API key was
not there and then it went off on reload.
2021-05-19 11:04:32 -07:00
sahil839 cf6fc3456f giphy: Disable giphy settings dropdown if API key is not present. 2021-05-19 11:04:32 -07:00
Steve Howell ef4446204d node tests: Add test wrapper for message_list_view. 2021-05-19 11:20:23 -04:00
Steve Howell 664afd2a1c node tests: Clean up electron_bridge test.
We use with_field to avoid leaks and then
just organize things better.
2021-05-19 11:06:18 -04:00
Tim Abbott 3b181968aa settings: Fix setting JITSI_SERVER_URL to None.
This fixes a bug introduced in
55a23754c3, that resulted in Zulip
crashing on startup if JITSI_SERVER_URL=None.

Fixes #18512.
2021-05-18 19:16:47 -07:00
Tim Abbott 9126ed33c9 puppeteer: Remove failing linkifier tests.
I'm not sure that settings UI is particularly worth having puppeteer
tests for, so it's possible we shouldn't bring these back at all.  But
in any case, it's worth disabling them as they've been failing for
some time.
2021-05-18 19:16:47 -07:00
Riken Shah e4bbfe5eb7 puppeteer_test: Add wait call for linkifier table to get updated.
This commit solves a rare flake, where the `realm
_linkifier.ts` test was failing because there was no
appropriate wait call for the table
(`#admin_linkifiers_table`) to get updated after editing
the pattern.
2021-05-18 18:46:17 -07:00
Riken Shah 2015d55a17 puppeteer_test: Use edit linkifier modal's id to check if it's closed. 2021-05-18 18:46:17 -07:00
Vishnu KS 5ad50b19cb billing: Show billing email in /billing page. 2021-05-18 17:46:38 -07:00
Tim Abbott 80a30c83e5 home: Remove unused root_domain_uri parameter. 2021-05-18 17:36:55 -07:00
Tim Abbott e1c885aeb9 home: Remove unused has_mobile_devices parameter.
This parameter has never been used, and causes an unnecessary database
query.

We keep the num_push_devices_for_user function, since we may have uses
for it down the line.

Fixes part of #14166.
2021-05-18 17:36:55 -07:00
Nikhil Maske 1428310973 muted_user_settings: Add table-sticky-headers class to table header.
table-sticky-headers class is used to make the header of the
table fix at the top.
2021-05-18 17:36:13 -07:00
PIG208 4e8dd43841 devtools: Improve the appearance of dev_panel. 2021-05-18 17:35:29 -07:00
rht aa3cdfa2e9 Fix typos using codespell.
The command:
codespell --skip='./locale,*.svg,./docs/translating,postgresql.conf.template.erb,.*fixtures,./yarn.lock,./docs/THIRDPARTY,./tools/setup/emoji/emoji_names.py,./tools/setup/emoji/emoji_map.json,./zerver/management/data/unified_reactions.json' --ignore-words=codespell_ignore_words.txt .

The content of codespell_ignore_words:
```
te
ans
pullrequest
ist
cros
wit
nwe
circularly
ned
ba
ressemble
ser
sur
hel
fpr
alls
nd
ot
```
2021-05-18 17:33:51 -07:00
Aman Agrawal d1c385f425 docs: Clarify how to set GIPHY API key in settings. 2021-05-18 17:32:55 -07:00
akshatdalton 9e5f2f841f rendered_markdown: Add support for rendering of user group silent mention.
Earlier, the text in silently mentioned user group was rendered
as: `@user-group`

which is fixed by this commit and now it rendered as: `user-group`.
2021-05-18 17:31:25 -07:00
akshatdalton 18203d8af3 markdown: Silence user group mention inside blockquotes. 2021-05-18 17:31:25 -07:00
akshatdalton 0245b590e9 markdown: Add support for user group silent mention.
Prior to this, we only supported direct mention to
the user groups. This commit extends that support
to silent mention for the user groups.
A related test case is also added.

Fixes: #11711.
2021-05-18 17:31:25 -07:00
akshatdalton f56fca308a mention: Refactor `USER_GROUP_MENTIONS_RE` and simplify its related code path.
Earlier, USER_GROUP_MENTIONS_RE was:
r"(?<![^\s\'\"\(,:<])@(\*[^\*]+\*)"

For the syntax: *foo*, this was unnecessarily capturing it as
*foo* and the extraction of `foo` was done using another helper
function: `extract_user_group`.

This is now changed as:
r"(?<![^\s\'\"\(,:<])@(\*(?P<match>[^\*]+)\*)"

and extraction of `foo` can be done just by using the named capture
group `match`.

This change also helps to simplify its related code path.
2021-05-18 17:31:25 -07:00
akshatdalton d5a36ac5e2 mention: Refactor `MENTIONS_RE` and simplify its related code path.
Earlier, MENTIONS_RE was:
r"(?<![^\s\'\"\(,:<])@(?P<silent>_?)(?P<match>\*\*[^\*]+\*\*)"

For the syntax: **foo**, this was unnecessarily capturing it as
**foo** and adding extra operation for the extraction of `foo`.

This is now changed as:
r"(?<![^\s\'\"\(,:<])@(?P<silent>_?)(\*\*(?P<match>[^\*]+)\*\*)"

and extraction of `foo` can be done just by using the named capture
group `match`.

This change also helps to simplify its related code path.
2021-05-18 17:31:25 -07:00
akshatdalton 738a676534 mention: Remove deprecated wildcard mention pattern from `MENTIONS_RE`.
Earlier wildcard mentions were used as: @all, @everyone, @stream.
This syntax is deprecated and we will no longer support
this syntax in future. See the commits:

1. 7a4c3c1a5c
2. b650b6b38c

When we started to use these syntaxes for wildcard mentions.
2021-05-18 17:31:25 -07:00
akshatdalton a9d89b3c56 minor: Convert `unicode_emoji_regex` to uppercase.
Following the convention, we use uppercase for
regex. Also, `unicode_emoji_regex` is given a
conventional name ending with `*_RE`: `UNICODE_EMOJI_RE`.
2021-05-18 17:31:25 -07:00
akshatdalton ffc4724287 minor: Convert `emoticon_regex` to uppercase.
Following the convention, we use uppercase for
regex. Also, `emoticon_regex` is given a
conventional name ending with `*_RE`: `EMOTICON_RE`.
2021-05-18 17:31:25 -07:00
akshatdalton 9f6e6709d3 minor: Convert `user_group_mentions` to uppercase.
Following the convention, we use uppercase for
regex. Also, `user_group_mentions` is given a
conventional name ending with `*_RE`: `USER_GROUP_MENTIONS_RE`.
2021-05-18 17:31:25 -07:00
akshatdalton 0a01b1b28e minor: Convert `find_mentions` to uppercase.
Following the convention, we use uppercase for
regex. Also, `find_mentions` is given a
conventional name ending with `*_RE`: `MENTIONS_RE`.
2021-05-18 17:31:25 -07:00
Steve Howell bdb2fa707c node tests: Use override for insert_or_move. 2021-05-18 18:34:17 -04:00
Steve Howell 1246970c23 node tests: Tweak test for first/prev/next. 2021-05-18 18:34:17 -04:00
Steve Howell eb46ac408d node tests: Add activity.clear_for_testing(). 2021-05-18 18:34:17 -04:00
Steve Howell fb0ba995c3 node tests: Use real version of keydown_util. 2021-05-18 18:34:17 -04:00
Steve Howell 5cbeaf1728 node test: Simplify presence statuses.
The test() wrapper makes a new map every time
with only "mark" as the idle user.
2021-05-18 18:34:17 -04:00
Steve Howell 2d02297f43 node tests: Use test() wrapper consistently.
The diff is slightly noisy due to some lexical
code moves, but otherwise it's search/replace.
2021-05-18 18:34:17 -04:00
Steve Howell 36077774fc node tests: Use override for fill_screen_with_content. 2021-05-18 18:34:17 -04:00
Steve Howell 7a9d0a505d node tests: Avoid rewiring client_is_active. 2021-05-18 18:34:17 -04:00
Steve Howell 7a3ba26c78 zjquery: Support $(...)[i] syntax. 2021-05-18 18:34:17 -04:00
Steve Howell 976374ed04 buddy_list: Localize overrides for buddy_list. 2021-05-18 18:34:17 -04:00
Steve Howell b7a188fde8 node tests: Deepen filter_user_ids test.
We now test that activity.build_user_sidebar
integrates with the user_search code.
2021-05-18 18:34:17 -04:00
Alex Vandiver 670c7e7ba4 settings: Remove now-unnecessary EMAIL_DELIVERER_DISABLED setting. 2021-05-18 12:39:28 -07:00
Alex Vandiver 1e67e0f218 deliver_scheduled_*: SELECT FOR UPDATE the relevant rows.
`deliver_scheduled_emails` and `deliver_scheduled_messages` use their
respective tables like a queue, but do not have guarantees that there
was only one consumer (besides the EMAIL_DELIVERER_DISABLED setting),
and could send duplicate messages if multiple consumers raced in
reading rows.

Use database locking to ensure that the database only feeds a given
ScheduledMessage or ScheduledEmail row to a single consumer.  A second
consumer, if it exists, will block until the first consumer commits
the transaction.
2021-05-18 12:39:28 -07:00
Alex Vandiver 82797dd53c settings: Standardize the name of the deliver_scheduled_messages logs.
This makes it match its command name, and other logfile name.
2021-05-18 12:39:28 -07:00
Alex Vandiver 343a1396af puppet: Rename logfile for deliver_scheduled_messages to be consistent. 2021-05-18 12:39:28 -07:00
Alex Vandiver ef6d0ec5ca puppet: Only run deliver_scheduled_messages and _emails on one server.
`deliver_scheduled_emails` and `deliver_scheduled_messages` use the
`ScheduledEmail` and `ScheduledMessage` tables as a queue,
effectively, pulling values off of them.  As noted in their comments,
this is not safe to run on multiple hosts at once.  As such, split out
the supervisor files for them.
2021-05-18 12:39:28 -07:00
Anders Kaseorg 79c087471c jinja2: Serialize page-params with orjson.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-18 12:36:15 -07:00
Steve Howell 45fb7165b1 node tests: Test list cursor more directly.
This tests the basic mechanics of list_cursor
more directly than the activity node tests.

It also sets the stage to eliminate some
tests from activity.js while maintaining
100% coverage on list_cursor.
2021-05-18 14:16:55 -04:00
Steve Howell dbd60d18fe minor: Tweak list_cursor tests.
We just make the config a bit more explicit in
each test, and we use override to ensure that
stub functions aren't cruft.
2021-05-18 14:16:55 -04:00
Steve Howell cd1510c0ef node tests: Extract user_search tests.
This is mostly moving tests from activity.js
into user_search.js, but it's not a verbatim
code move.

The new module continues to make sure that
the boundary between activity and user_search
is correct, as most of the testing uses
the configuration of UserSearch from
static/js/activity.js.

It does not use a real buddy_list, though,
which simplifies some tests.

I cleaned up some tests by making sure we
were testing both sides of conditions more
rigorously.

After this change we no longer need the
bloated activity.js tests to maintain full
coverage on static/js/user_search.js.
2021-05-18 14:16:55 -04:00
Steve Howell ee066a1a91 node tests: Use per-test overrides for activity tests. 2021-05-18 14:16:55 -04:00
Alex Vandiver 033a96aa5d puppet: Fix check_ssl_certificate check to check named host, not self. 2021-05-17 18:38:30 -07:00
Alex Vandiver a2b7a5ef4b puppet: Clarify 20m keepalive time from the LB is a max; it can be less. 2021-05-17 14:56:51 -07:00
Steve Howell eee8ff40b4 node tests: Fix false positive for muted user.
The test was passing here because we didn't add
selma. We want to make sure it's due to the actual
muting.
2021-05-16 11:48:50 -04:00
Steve Howell 9825be339b node tests: Test buddy_data.get_items_for_users. 2021-05-16 11:48:50 -04:00