Commit Graph

40754 Commits

Author SHA1 Message Date
Steve Howell fe28303376 node tests: Clean up narrow tests.
I do the following:
    - hoist some imports
    - split big test into three
    - use some of actual compose_state implementation
2021-02-24 11:56:40 -05:00
Steve Howell 70fff472c3 node tests: Use zjquery text() method for input_pill test. 2021-02-24 11:56:40 -05:00
Steve Howell aa21ccf61f node tests: Avoid silly stub in filter test. 2021-02-24 11:56:40 -05:00
Steve Howell dd2552e5f5 node tests: Split up echo test. 2021-02-24 11:56:40 -05:00
Wesley Aptekar-Cassels d644562b40
composebox_typeahead: Increase max typeahead box size.
On realms with large numbers of custom emoji, the typeahead emoji picker
often isn't useful. This is exacerbated by the fact the picker prefers
longer matches, so if there are five emoji that share a prefix, and an
emoji that is just the prefix, the only-prefix emoji will never show in
the typeahead emoji picker. This means that if someone thinks that there
is an emoji that shares a prefix with many other emoji, but they don't
remember for sure, they cannot use the typeahead emoji picker to check
that the emoji that they are entering exists.

There are two "real" fixes to this, neither of which this commit
addresses:

First, we should adjust the emoji ranking code such that exact string
matches for existing emojis are always shown in the picker. This would
be an improvement overall (the current behaviour is surprising and
frustrating), but it doesn't fundamentally solve the problem - if there
are many matching emoji, some of them will be pushed off the list.

Second, we should allow scrolling through the entire list of matching
entries in a typeahead, instead of only looping through the top N
matches. This will completely fix the problem (although there is some
UI/UX consideration in how to make it clear that the box is scrollable),
but seems like significantly more work to implement.

However, increasing the typeahead box size should improve the user
experience here independently of either of those changes.

I've chosen 8 as the max size for no particularly principled reason -
the fact that it's larger than 5 makes it more useful, but it's not so
large that it covers an obnoxious amount of the screen. Possibly it
would make sense to make it a bit bigger, but 8 seems like a good place
to start.

I've tested this on my laptop, which has a Intel i5-7200U CPU (~4.5 years
old, middle of the line when it was released) on a test instance with
5000 users, as well as on chat.zulip.org, and didn't see any noticeable
performance regression in completing @-mentions or emoji on either.
2021-02-24 08:29:54 -08:00
nikhilmaske-2001 77194de136
docs: Correct typos in GSoC ideas doc. 2021-02-23 20:51:59 -08:00
Anders Kaseorg 6ff28577cc js: Convert static/js/message_list_data.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 20:36:01 -08:00
Anders Kaseorg f9c4b5438e js: Convert static/js/localstorage.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 20:36:01 -08:00
Anders Kaseorg 901a1e16cf js: Convert static/js/list_cursor.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 20:36:01 -08:00
Anders Kaseorg 8add2ffc4e js: Convert static/js/fetch_status.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 20:36:01 -08:00
Alex Vandiver 0663b23d54 puppet: Only prompt to apply if there are changes to apply.
Since `yaml` is not a module in the standard library, this requires
makings `zulip-puppet-apply` use the venv.
2021-02-23 18:16:02 -08:00
Alex Vandiver d15e6990e5 puppet: Only execute setup-apt-repo if necessary.
This means that in steady-state, `zulip-puppet-apply` is expected to
produce no changes or commands to execute.  The verification step of
`setup-apt-repo` is quite fast, so this cleans up the output for very
little cost.
2021-02-23 18:16:02 -08:00
Anders Kaseorg 5a22e73cc6 ui: Remove warning for unsupported old Zulip desktop app.
This warning was added in #6551.  It’s not for any version of the
current Electron app, which we warn about on the server side with
DESKTOP_WARNING_VERSION, but rather some pre-Electron app so ancient I
don’t even know what it is.  Apparently it communicated using the
window.bridge global, so eradicate that too.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 18:14:12 -08:00
Wesley Aptekar-Cassels 1073adfb08 reactions: Fix double-escaping usernames in tooltip.
Appling i18 to reaction tooltips (#16585) caused usernames to be
double-escaped, for instance, if there is a single-quote in a username.
This disables escaping of usernames by i18next, since they're escaped
again later by the rendering code.

Fixes: #16785
2021-02-23 17:48:57 -08:00
aryanshridhar 5aa1205d23 docs: Added reactivate_realm management command. 2021-02-23 16:25:52 -08:00
aryanshridhar 42c49e4fb1 docs: Added missing semicolon in export_single_user management command. 2021-02-23 16:25:52 -08:00
Megamind d001916b78
right sidebar: Increase hover opacity of "filter users".
Usually we increase the opacity of an interactable icon on hover, but the search-icon at the top of the 
right sidebar was missing the behavior.

Co-authored-by: ritik <ritikcn05@gmail.com>
2021-02-23 15:30:45 -08:00
Mateusz Mandera 1d4badf6ad tests: Test internal_send_private_message can send to cross-realm bots. 2021-02-23 15:26:47 -08:00
Mateusz Mandera 51d7f24d20 actions: Remove realm argument to internal_send_stream_message.
The argument is redundant.
2021-02-23 15:26:47 -08:00
Mateusz Mandera 09fc79f911 actions: Remove realm argument to internal_send_private_message.
The argument is redundant.
2021-02-23 15:26:47 -08:00
Mateusz Mandera a652573169 tests: Fix tests causing internal_send_private_message with wrong realm.
test_signup: This test was wrong, because the inviter UserProfile was
from a different realm. Such a PreregistrationUser shouldn't be
considered valid.

test_tutorial: The direct call to internal_send_private_message was
using sender's realm as the realm argument which is not valid. It
doesn't lead to any error because the codepath seems to mostly not care
about the realm arg if the sender is a cross-realm bot. From my reading
of the code I think that wrong realm arg here would break user mentions,
because it makes its way to check_message() and then to
build_message_send_dict - but overall the message gets sent without
errors. Either way, this was a bug in the test and should be fixed.
2021-02-23 15:26:47 -08:00
Suyash Vardhan Mathur dd8964a31f api docs: Fix id and type fields of events and display them.
Currently, the ID and Type fields didn't have a description,
and weren't being displayed. Added a schema component to add
descriptions, and display on the api page. Fixes part of #15967.
2021-02-23 15:22:53 -08:00
Ganesh Pawar 4118279c1a stream-ui: Fix oddly spaced elements in streams tab.
This reverts most of the changes made in commit a5f0379.
2021-02-23 15:17:33 -08:00
Ganesh Pawar 34ada11448 stream-ui: Change view from 2-column to 1-column at width 992px.
This prevents the elements to go on a newline on iPad sized devices.
2021-02-23 15:17:33 -08:00
sahil839 d71afc5a26 actions: Include ROLE_MODERATOR in realm_user_count_by_role.
This commmit includes ROLE_MODERATOR in realm_user_count_by_role.

We also update test_change_role in test_audit_log.py to include
changes for moderator role as well.
2021-02-23 15:01:14 -08:00
sahil839 6b5cf231a1 users: Add new user 'shiva' as realm moderator.
Note that at this point, it's not possible to create moderator users;
this just will make it easier to write tests for logic involving them
as we develop the feature.
2021-02-23 15:00:49 -08:00
sahil839 af64ca388a models: Add realm moderator role.
Have not included "ROLE_MODERATOR" in UserProfile.ROLE_TYPES
in this commit because did not want to update the openapi
docs at this stage as it will be a user-facing change and
not updating the openapi docs with moderator role included in
UserProfile.ROLE_TYPES gives error in ./tools/check-schemas.
2021-02-23 15:00:09 -08:00
Anders Kaseorg ba0ee6ddfa dependencies: Upgrade Source Sans Pro font to Source Sans 3.
https://blog.adobe.com/en/2020/11/30/whats-new-in-source-sans-3.html

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 14:55:33 -08:00
Alex Vandiver 289b5bc100 lint: Re-enable imperative-mood checking.
This was mistakenly disabled in e1f943913a.  Re-enable it.
2021-02-23 14:54:07 -08:00
Alex Vandiver 12ade4c49d lint: Rely on core gitlint skipping of revert commits.
gitlint 0.13.0 and above skip revert commits[1].  This obviates the
need for a custom rule.

[1] https://jorisroovers.com/gitlint/configuration/#ignore-revert-commits
2021-02-23 14:28:09 -08:00
Anders Kaseorg 174fa0a331 node_tests: Revert wrong conversion of some functions to arrows.
‘function’ and ‘=>’ are not equivalent because they bind ‘this’
differently.  For these functions, the ‘function’ semantics are
intentional.

This reverts part of commit 1a241cef88
(#17388).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-23 11:35:55 -08:00
Mateusz Mandera e43e0cb9bb docs: Fix Markdown for links in the authentication in development doc.
These were rendering as just plaintext instead of clickable links.
2021-02-23 08:59:11 -08:00
LoopThrough-i-j d1ee2d31c7 examples-python-api: Fix `message_id` type.
The `message_id` was made an `str` object because
the request expected `Dict[str, str]`. The request is now
casted to `Dict[str, Any]` to fix the issue and removed
typecast of `message_id` to str.

python-zulip-api reference:
https://github.com/zulip/python-zulip-api/pull/653
2021-02-23 08:58:00 -08:00
Steve Howell 1a241cef88 node tests: Use array syntax more aggressively. 2021-02-23 09:15:36 -05:00
Steve Howell 2262f79cc8 node tests: Use override/with_field in billing.
This prevents the possibility of future leaks.
2021-02-23 09:15:36 -05:00
Steve Howell 009a6e0145 node tests: Use override in widgetize. 2021-02-23 09:15:36 -05:00
Steve Howell dbf514a055 node tests: Remove unnecessary test_ui wrappers. 2021-02-23 07:55:43 -05:00
Steve Howell ac69450681 zjsunit: Clear $ elements in run_test.
We now call $.clear_all_elements at the top
of run_test.

We have to exempt two modules from the new regime:

    compose
    settings_user_groups

Also, if modules do set_global("$", ...) we don't
try to call the non-existent function.

It's possible we'll want to move to something like
this, but we might want to clean up the two
sloppy_$ modules first:

    // AVOID THIS:
    // const $ = require("zjquery")

    run_test("test widget", ({override, $}) => {
        override(foo, "bar", ...);
        $.create(...);
        // do stuff
    });
2021-02-23 07:55:43 -05:00
Steve Howell 81fd1a5e6a node tests: Introduce test_ui wrappers.
These are a prep step for the next commit.
2021-02-23 07:55:43 -05:00
Steve Howell 2fae9dc0a2 node test: Stub out first element of search box. 2021-02-23 07:55:43 -05:00
Steve Howell 0b711516c9 node tests: Fix zjquery leaks in recent_topics. 2021-02-23 07:55:43 -05:00
Anders Kaseorg 3ccb4391d8 zjsunit: Restore missing fields correctly in with_field.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 20:21:41 -08:00
Anders Kaseorg 58b18fd499 zjsunit: Handle exceptions in with_field, with_overrides.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 20:21:41 -08:00
Anders Kaseorg 7e3735b9ba node_tests: Don’t read page_params from deprecated global variable.
Follow up to commit 89aa3155a9 (#17262).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 19:46:42 -08:00
Wesley Aptekar-Cassels be9ae9dac8 js: Don't escape "Last active" in buddy list.
This breaks the French translation, and is incorrect in general.
2021-02-22 16:08:25 -08:00
Alex Vandiver 0b736ef4cf puppet: Remove puppet_ops configuration for separate loadbalancer host. 2021-02-22 16:05:13 -08:00
Anders Kaseorg 279c4b0e24 puppeteer_tests: Port to TypeScript.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 16:03:10 -08:00
Anders Kaseorg cdff4cfe53 dependencies: Add ts-node.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 16:03:10 -08:00
Anders Kaseorg 3869727655 dependencies: Upgrade puppeteer from 7.0.4 to 7.1.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 16:03:10 -08:00
Anders Kaseorg 8dec7b9270 puppeteer_lib: Use class fields.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-22 16:03:10 -08:00