Commit Graph

41107 Commits

Author SHA1 Message Date
Steve Howell 57d79e8fd6 refactor: Extract color_class module.
This breaks some indirect dependencies on subs
and message_view_header.
2021-03-24 12:22:27 -07:00
Steve Howell f3b1e723e0 typeahead: Eliminate render caches.
These were introduced in ff9a929d7a
with no explanation of why they were necessary.

Generally you only render a few things, and it's
important that they're up to date.

We weren't doing a good job of invalidating the cache.

Eliminating the cache will fix bugs (like presence circles
being out of date) and break some dependencies.

I removed some very fragile test code that was relying
on invalid values taken out of the cache.  (We now have
less line coverage, but if we want to test our rendering,
there are much cleaner ways to do it.)

As part of testing this, I renamed Hamlet to "aaron", so
that there are two aarons, and then I logged on as Iago
to see the "secondary" code in action that shows their
emails to distinguish them.
2021-03-24 12:15:36 -07:00
Anders Kaseorg 3b4cb899b6 zanitizer: Reformat with perltidy.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-24 12:12:04 -07:00
Anders Kaseorg 29e4c71ec4 puppet: Reformat custom Ruby modules with Rufo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-24 12:12:04 -07:00
Anders Kaseorg 81ffc4e827 Vagrantfile: Reformat with Rufo.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-24 12:12:04 -07:00
Alex Vandiver 6ee74b3433 puppet: Check health of APT repository. 2021-03-23 19:27:42 -07:00
Alex Vandiver c01345d20c puppet: Add nagios check for long-lived certs that do not auto-renew. 2021-03-23 19:27:27 -07:00
Tim Abbott fea4bac2a5 docs: Identify WSL 2 with normal capitalization. 2021-03-23 17:12:50 -07:00
Yashika Jotwani 7111c46ddb docs: Correct the statement in the development environment docs.
Development environment docs contains an outdated
statement stating that the non-vagrant setup can't
be used on windows, while it can now be used on windows by
using wsl. This commit fixes the statement and points
the link towards the non-vagrant setup process page.

Fixes #17721.
2021-03-23 17:11:23 -07:00
Tim Abbott 11ff59aa5e test_home: Fix missing do_change_plan_type import. 2021-03-23 16:12:04 -07:00
Vishnu KS 61c8dda476 docs: Mention GitHub sponsors in contributing guide. 2021-03-23 15:57:25 -07:00
Vishnu KS 8e34bf4349 readme: Add GitHub sponsors badge in README.
The number is really low, since we haven't told anyone about our
GitHub Sponsors site, so the badge probably isn't actually helpful,
but I suppose that's OK.
2021-03-23 15:56:46 -07:00
Vishnu KS e7528b58c0 readme: Mention GitHub sponsors program. 2021-03-23 15:55:09 -07:00
Vishnu KS 7bf3d6f21f tests: Use do_change_plan_type in test_show_plans. 2021-03-23 15:51:50 -07:00
smit_patel 5ddb5fc534 popovers: Change "Delete all messages in topic" to "Delete topic".
This cleans up the copy a bit to be more readable.

Documentation changes cleaned up by tabbott.

Fixes #16856.
2021-03-23 15:46:00 -07:00
Tim Abbott 5fef101189 docs: Document zulip-archive GSoC idea. 2021-03-23 15:03:48 -07:00
Anders Kaseorg fb688e8e5d server_events_dispatch: Fix Prettier formatting.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-23 14:17:08 -07:00
Vishnu KS 965a71a332 droplets: Remove obvious comments from create.py. 2021-03-23 14:05:34 -07:00
Vishnu KS b1a26c7123 droplets: Rename get_keys to get_ssh_public_keys_from_github. 2021-03-23 14:05:34 -07:00
Vishnu KS 36ba00f65a droplets: Rename fork_exists to assert_user_forked_zulip_server_repo. 2021-03-23 14:05:34 -07:00
Vishnu KS c1d80561a6 droplets: Add support for creating prod droplets. 2021-03-23 14:05:34 -07:00
Vishnu KS fa623dbd62 droplets: Make assert_droplet_does_not_exist take droplet_name as argument. 2021-03-23 14:05:34 -07:00
Vishnu KS 13b9cf200b droplets: Make print_completion take droplet_domain_name instead of username. 2021-03-23 14:05:34 -07:00
Vishnu KS 33f51305eb droplets: Rename username argument to record_name in create_dns_record. 2021-03-23 14:05:34 -07:00
Vishnu KS 3407627c46 droplets: Rename exit_if_droplet_exists to assert_droplet_does_not_exist. 2021-03-23 14:05:34 -07:00
Vishnu KS ca9d82fc06 droplets: Rename user_exists to assert_github_user_exists. 2021-03-23 14:05:34 -07:00
Vishnu KS 656fa15da1 droplets: Make create_droplet take droplet name instead of username. 2021-03-23 14:05:34 -07:00
Vishnu KS 4ba16d6ed9 droplets: Create get_ssh_keys_string_from_github_ssh_key_dicts function. 2021-03-23 14:05:34 -07:00
YashRE42 592eb1a197 server_events_dispatch: Refactor user_group to use switch/case. 2021-03-23 13:56:21 -07:00
YashRE42 8d578c248f server_events_dispatch: Refactor typing event to use switch/case. 2021-03-23 13:56:21 -07:00
YashRE42 60b7211b1f server_events_dispatch: Refactor stream case to use switch/case. 2021-03-23 13:56:21 -07:00
YashRE42 1b4fc178c1 server_events_dispatch: Refactor realm_user to use switch/case.
This should make no functional changes.
2021-03-23 13:56:21 -07:00
YashRE42 33fb78af42 server_events_dispatch: Refactor realm_domain to use switch/case.
This should make no functional changes.
2021-03-23 13:56:21 -07:00
YashRE42 d575517035 server_events_dispatch: Refactor update_dict op of realm case.
This should make no functional changes.
2021-03-23 13:56:21 -07:00
YashRE42 f4afe770e4 server_events_dispatch: Refactor subscription case to use switch/case.
This commit should make no behavioural changes.
2021-03-23 13:53:23 -07:00
shanukun d68a2677d2 event_schema: Add checker for restart event.
Part of #17568.
2021-03-23 12:16:20 -07:00
shanukun cfe0fa3788 event_schema: Add schema check for realm/deactivated event.
This add the schema checker, openapi schema, and also a test for
realm/deactivated event.

With several block comments by tabbott explaining the logic behind our
behavior here.

Part of #17568.
2021-03-23 12:16:16 -07:00
Tim Abbott daa9bbba61 events: Add assertions that all ops are implemented.
We discovered recently that some ops for events were just not
implemented in events.py (specifically, realm/deactivated).

Since our goal is for events.py to be complete, we add this bit of
hardening to ensure that it stays that way.
2021-03-23 11:50:52 -07:00
Steve Howell 65ec8f2000 refactor: Move suspect_offline logic into watchdog.
This breaks some indirect dependencies in presence.js.
2021-03-23 14:08:39 -04:00
YashRE42 5b0db2e7ed templates.js: Remove unused "plural" helper.
This helper was added in eac6463031 and
used by the "message.handlebars" file. This is no current call for
this helper in the codebase, hence it is removed to improve coverage.

This commit also marks template.js to have 100% test coverage.
2021-03-23 10:46:04 -07:00
YashRE42 4988f60a0f template.js: Add test for "numberFormat" helper. 2021-03-23 10:46:04 -07:00
YashRE42 6c0d070b4d template.js: Add test for "rendered_markdown" helper. 2021-03-23 10:46:04 -07:00
YashRE42 2e910842d8 template.js: Add test for "or" helper. 2021-03-23 10:46:04 -07:00
YashRE42 66c12c9022 template.js: Add test for "and" helper. 2021-03-23 10:46:04 -07:00
Anders Kaseorg 9553f11387 eslint: Forbid CommonJS variables in ES6 modules.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-03-23 01:42:43 -07:00
m-e-l-u-h-a-n 830c4acedc markdown: Fix invalid mention bug for stream and stream topic mention.
Modifies `StreamPattern` and `StreamTopicPattern` to inherit
from InlineProcessor instead of Pattern. This change is done
because Pattern stopped checking for matching patterns as soon
as it found a match which was not a valid stream. Due to this
all the subsequent mention failed, even if they were valid.
This bug was only present in backend renderring due to
markdown.inlinepatterns.Pattern.

Due to above changes verbose_compile is no longer used for
precompiling STREAM_LINK_REGEX, STREAM_TOPIC_LINK_REGEX as
adds ^(.*?) and (.*?)$ which cause extra overhead of matching
pattern which is not required. With new InlineProcessor these
extra patterns at beggining and end are not required.
So, StreamPattern and StreamTopicPattern now define their own
__init__ method for precompiling the regex.

Fixes #17535.

These changes were tested locally in dev server and by adding
some new markdown tests to test these.
2021-03-23 01:28:30 -07:00
m-e-l-u-h-a-n dadbba0c25 markdown: Fix invalid mention bug for user group mention.
Modifies `UserGroupMentionPattern` to inherit from InlineProcessor
instead of Pattern. This change is done because Pattern
stopped checking for matching patterns as soon as it found
a match which was not a valid user group. Due to this all
the subsequent user group mention failed, even if they were
valid. This bug was only present in backend renderring due to
markdown.inlinepatterns.Pattern.

This was reported as issue #17535.

These changes were tested locally in dev server and by adding
some new markdown tests to test these.
2021-03-23 01:28:30 -07:00
m-e-l-u-h-a-n c8979a5100 markdown: Fix invalid mention bug for user mention.
Modifies `UserMentionPattern` to inherit from InlineProcessor
instead of Pattern. This change is done because Pattern
stopped checking for matching patterns as soon as it found
a match which was not a valid user. Due to this all the
subsequent user mention failed. This bug was only present in
backend renderring due to markdown.inlinepatterns.Pattern.

This was reported as issue #17535.

These changes were tested locally in dev server and by adding
some new markdown tests to test these.
2021-03-23 01:28:30 -07:00
Abhijeet Prasad Bodas 42aea49784 left sidebar: Add support to unstar all messages in topic.
This adds support for unstarring all (starred)
messages from a particular topic, from the topic
popover.

The earlier implementation of this in #16898
was reverted in bc55aa6a01 (#17429)
because it had two problems-

1. The crash reported in bc55aa6a01
was due to message_store returning undefined. This happens
when the message itself hasn't been fetched from the server
yet, but we know that the message is starred from the ids
in `page_params` in `starred_messages.js`.
This commit handles this case explicitly.
Note that, we simply ignore those messages which
we haven't fetched, and because of this, it may
happen that we don't unstar some messages from that
topic. The correct implementation for this would
be to ask the backend for starred IDs in a topic.

2. The earlier implementation actually unstarred **all**
messages. This was because it grabbed the topic and stream_id
from the topic popover `data` attributes, after the topic
popover had been closed. This passed `undefined`, which
the function then interpreted as an action to unstar all
messages.
With this commit, we use the confirm_dialog widget,
which eliminates the need to store this data in the DOM.
2021-03-23 00:17:15 -07:00
Abhijeet Prasad Bodas f17a52b2f3 refactor: Use confirm_dialog for unstar-all-messages.
This replaces the separate modal shown on clicking
"Unstar all messages" from the left sidebar to use
the confirm_dialog widget instead.
2021-03-23 00:17:15 -07:00