Commit Graph

40568 Commits

Author SHA1 Message Date
Steve Howell 5bd73ce190 zjsunit: Show more of the traceback.
We still reduce a lot of clutter, but this
shows wrappers around `run_test` now.
2021-02-20 12:00:24 -05:00
Steve Howell 490894475e node tests: Prevent zjquery leaks in pm_list.
We weren't leaking anything, but this change
prevents future leaks.
2021-02-20 10:29:30 -05:00
Steve Howell d34723987f node tests: Make sure we try to find container in pm_list. 2021-02-20 10:29:30 -05:00
Steve Howell 7e4d784888 node tests: Use override/with_field in pm_list. 2021-02-20 10:29:30 -05:00
Sumanth V Rao 94d6dd5ee5 docs: Update author protocol section of the code-reviewing docs. 2021-02-20 09:17:53 -05:00
Tim Abbott 04197309ae docs: Explain the export tool purpose more clearly.
The reference to "hardware platforms" was confusing -- we really mean
different logical Zulip database installations.
2021-02-19 10:05:40 -08:00
Steve Howell 7c408bc525 node tests: Use override in buddy tests. 2021-02-19 10:06:44 -05:00
sahil839 15e74a637c tests: Check cases when full members and their bots can send messages.
Currently there are only tests for verifying the error case and there
are no tests to check the case where messages are sent successfully
in 'STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS' stream.

This commit adds tests for checking that full members and bots owned
by them can send message successfully in streams with post policy as
'STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS'.
2021-02-18 18:38:52 -08:00
sahil839 81ae29d461 stream: Allow new bot to send message if its owner is full member.
We currently not allow new bots to send message in stream with post
policy as 'STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS', but we should
allow them to send messages if their owner is a full member.

This will make it consistent with behavior in stream with post
policy as 'STREAM_POST_POLICY_ADMINS_ONLY' where we allow non admin
bots with owner as admin to send messages.
2021-02-18 18:38:52 -08:00
sahil839 3df87d0901 stream: Fix error handling in access_stream_for_send_message.
According to tests we should not allow bot without owners to
post in streams with STREAM_POST_POLICY_RESTRICT_NEW_MEMBERS.
But the code does not handle this and the related test passes
and raises error for case of bots without owner because the bot
is itself a new member.

This commit fixes this by adding a condition to check if there
is no bot owner and then raise error if there is no owner.
2021-02-18 18:38:52 -08:00
Tim Abbott e865e3156d docs: Update GSoC ideas list.
This list is by no means final, but it has substantial updates from
last year's list.
2021-02-18 17:43:17 -08:00
Tim Abbott 38c3e3d855 docs: Move GSoC ideas to contributing/, and index.
This better fits the organization of our files; I would have fixed
this last year, but it's not easy to update the links from Google's
site.
2021-02-18 16:01:16 -08:00
Steve Howell fed1eaf7d7 minor: Inline filter_table in subs.js.
The old structure of having a two-line wrapper was
mostly driven by testing concerns.  Now I just
have a single function with the optional argument.
2021-02-18 13:38:16 -08:00
Steve Howell c3ee1286f4 stream settings: Simplify live-updates for left panel.
Now we just update the whole row any time a sub
changes.  This prevents a whole class of bugs.

As the TODOs indicate here, some of the post-processing
that we have to do on rows after rendering the
template will soon go away.
2021-02-18 13:38:16 -08:00
Steve Howell 7f6287c058 minor: Add comments for stream setting live-updates.
I audited all the functions in stream_ui_updates and
added TODO comments to functions that are clearly just
updating rows in the left panel of Manage Streams.

In an upcoming commit I will simplify the approach so
that we just re-render the entire row.
2021-02-18 13:38:16 -08:00
Steve Howell bbd045de02 refactor: Inline rerender_subscriptions_settings.
The extra level of indirection here was annoying,
and this helps an upcoming simplification to
live updates.
2021-02-18 13:38:16 -08:00
Steve Howell 374d2ff3e2 stream settings: Fix tooltips for stream counts.
The tooltips for the left panel of stream settings
have been broken since November 2018 due to my
commit 8f915da2ca.

The code prior to 2018 was restoring tooltips
right inside the loop where we were detaching
the row from the DOM to put it back into the
DOM at another place.  And then I tried to
just add them in bulk, forgetting that I was
in the middle of all the DOM manipulation (and
hence my selector for the loop was a noop).

Also, I don't think we've ever had them for live
events that add streams.  (I fixed that too.)

It's not clear to me that this code is actually
necessary, as we get hover help without
calling $(...).tooltip(...) properly.

This is probably why we didn't notice any
breakage when we merged my 2018 commit.
2021-02-18 13:38:16 -08:00
Steve Howell a87596a3f9 subs cleanup: Simplify is_sub_already_present().
Checking for the button was a brittle way to do this.

Note that the code on master is flawed insofar as
we don't respect the search filters.  I don't fix that
bug here.  This is a tactical change to eliminate
another function.

Upcoming changes will make it so that all the bugs
related to "notdisplayed" will simply go away.
2021-02-18 13:38:16 -08:00
Tim Abbott 6206d0486a docs: Document official private streams.
These aren't relevant to most users, but in the interest of
transparency, we also don't want the existence of these to feel like a
secret.  And maybe publishing their existence will result in folks who
we forget to add to these private streams asking about them.
2021-02-18 10:18:39 -08:00
Steve Howell b4ab662442 puppeteer: Make subscribe/unsubscribe test more robust.
We generally want to avoid clicking on DOM elements
that may not actually be visible due to the prior
operation.  Instead, we can just find the visible
element after each step.

I also introduce a couple helper functions to
de-clutter the click/unclick/click steps, and I do
a couple extra clicks for good measure.

You can verify that the test will fail if you
add an early return to update_check_button_for_sub.
2021-02-18 11:05:46 -05:00
Anders Kaseorg ca0b01033d lint: Remove custom whitespace rules already enforced by Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-17 22:21:42 -08:00
Mateusz Mandera 138d67e852 docs: Writing tweaks to performance.md. 2021-02-17 14:29:31 -08:00
Wesley Aptekar-Cassels 4173070b3d notifications: Fix composebox notification escaping
The "Narrow to PM with" notification above the composebox was
double-escaped, mangling names with single quotes in them. This removes
the escaping in i18next, causing the name to be escaped only in
handlebars.
2021-02-17 14:04:30 -08:00
Alex Vandiver e30b524896 iptables: Limit smokescreen port 4750, add camo port.
Limit incoming connections to port 4750 to only the smokescreen host,
and also allow access to the Camo server on that host, on port 9292.
2021-02-17 13:52:38 -08:00
Aman Agrawal 5cbc21efd5 wsl_docs: Inform user how to uninstall WSL. 2021-02-17 10:27:08 -08:00
Alex Vandiver 1caff01463 puppet: Configure nginx for long keep-alives when behind a loadbalancer.
These optimizations only makes sense when all connections at a TCP
level are coming from the same host or set of hosts; as such, they
are only enabled if `loadbalancer.ips` is set in the `zulip.conf`.
2021-02-17 10:25:33 -08:00
Anders Kaseorg 6988e8a9d2 docs: Mention a way to check the running vboxadd version.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-17 10:24:33 -08:00
Anders Kaseorg 378295351d desktop-app-install-guide: Update for APT repository move.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-02-17 10:24:04 -08:00
Abhijeet Prasad Bodas fc0488fdb1 actions: Rename notify_topic_moved_streams function.
This is a minor refactor which renames the
notify_topic_moved_streams function to
send_message_moved_breadcrumbs.

This is done because this function will be also used
for other things in the future, when moving streams
or when using the /digress command, for example.
2021-02-16 17:28:59 -08:00
Steve Howell 06d9497a40 docs: Add minor tweaks to performance doc. 2021-02-16 17:10:17 -08:00
Aman Agrawal 009f88210a left_sidebar: Show title when mouse hover anywhere on the button.
Instead of showing title text when user hovers over the text in
the button, show title when user hovers anywhere on the button.
2021-02-16 17:00:20 -08:00
Aman Agrawal 827aaa227e stream_edit: Extract generic pill functions to be reused in future. 2021-02-16 16:58:29 -08:00
Suyash Vardhan Mathur 96bfeeb9e6 api docs: Expand checking for deprecated fields.
Added assertion to check that if a deprecated flag is in a field's
schema, then it should have deprecated mentioned in description
as well, and moved these checks to a separate function.
Fixes part of #15967.
2021-02-16 15:34:52 -08:00
Alex Vandiver 422fea8f20 docs: Minor edits to scalability article. 2021-02-16 15:33:06 -08:00
Steve Howell 34b429dfd5 node tests: Simplify subs tests for filtering.
This is prep for future simplifications to the
real code.
2021-02-16 13:11:10 -08:00
Steve Howell dad90fe770 node tests: Extract locals for stream names.
This just makes the next diff smaller.  It makes
sense on its own to just flatten the code.
2021-02-16 13:11:10 -08:00
Steve Howell 0e4ba368e0 node tests: Remove tooltips logic in subs test.
The zjquery setup here isn't worth the complexity here.

The function being tested just does a simple jQuery
loop.
2021-02-16 13:11:10 -08:00
Steve Howell 62e272ce27 stream settings: Remove obsolete scrolling code.
We just want to reset the scrollbar here, which
we still do via ui.reset_scrollbar.

You don't want to preserve scroll position if
you are filtering or re-sorting.
2021-02-16 13:11:10 -08:00
Steve Howell 0060644712 stream settings: Rename vars to left_panel_params.
This replaces either "query" or "search_params".
2021-02-16 13:11:10 -08:00
Steve Howell 9862156158 stream settings: Clean up functions to redraw left panel.
We have long had this annoying two-pass way of building the
DOM that I am trying to eliminate.

The function names that I introduce here describe the current
situation more accurately.

In passing I make it so that we only throttle redraws when
users are actually typing.  Using a throttled redraw when
you click on the sort icons is at best unnecessary, and it
may actually aggravate double clicks.
2021-02-16 13:11:10 -08:00
Steve Howell 20a8077cbd minor: Make sort_toggler a const.
Unlike the other toggler in this module, there
is no reason that sort_toggler has to be a module
level variable.
2021-02-16 13:11:10 -08:00
Tim Abbott 912c6ab905 docs: Add table to scalability article.
This table can hopefully replace some of the prose discussion about
relative scalability impact (though I don't do that editing in this
commit).
2021-02-16 12:56:31 -08:00
m-e-l-u-h-a-n 03e4ccbc2d message-view: Increase spacing for lists coming after paragraphs.
Lists that were followed by a paragraph (i.e. our p+ul, p+ol CSS rule)
in messages had negative top margin of -3px.  Adjusting the margin
here is important, because the default styling would result in an
excessive gap that made bulleted lists weirdly far from the previous
paragraph.  See #12113 for background.

However, the -3px negative margin was so large that it reduced spaces
between paragraph and lists, such that there was too little visible
separation between the two.  We fix this by going with a 0px
margin-top instead.

This has been tested for various structures of messages:
1. text + bulleted list
2. bulleted list + unbulleted list(or two lists)
3. only list.

And it looks good in all cases.

Fixes #17284.
2021-02-16 08:56:26 -08:00
Suyash Vardhan Mathur 05928bbdee api docs: Change font size for code and response blocks.
The code blocks and response blocks had small and unreadable font,
because they were using the bootstrap defaults without adjustment for
the size of content on the rest of the page.  Fixes part of
zulip#15967.
2021-02-16 08:22:35 -08:00
Alex Vandiver a88af1b5a2 camo: Install on smokescreen host. 2021-02-16 08:12:31 -08:00
Alex Vandiver 29f60bad20 smokescreen: Put the version into the supervisorctl command.
This makes it reload correctly if the version is changed.
2021-02-16 08:12:31 -08:00
Tim Abbott a3e1b9161c openapi: Document deprecation for max_message_id field. 2021-02-16 08:08:40 -08:00
Tim Abbott 7323163149 confirmation: Adjust language for link_expired template.
This both is better copy and also cleared for translators, who in
languages with gendered nouns don't need to guess what gender to use
for "one" without context.
2021-02-16 07:42:13 -08:00
Sumanth V Rao caa7548c4a click_handler: Fix bug in intro_reply hotspot.
This bug was caught thanks to the earlier commit which
introduces the "Restart tutorial" feature. To reproduce
the bug,

    1. Restart tutorial
    2. Click "Got it!" on the intro_reply hotspot
    3. Repeat steps 1 and 2

The hotspot for intro_reply won't disappear the second
time around and the intro_stream hotspot would be displayed
simultaneously.

The reason for this was the intro_reply's "Got it!"
button codepath never removing the item completely from
the DOM. This would then conflict with the new intro_reply
hotspot which would get assigned a different 'id'.
2021-02-15 18:35:00 -08:00
Sumanth V Rao 540cca595c hotspots: Fix typos in function name and code comment. 2021-02-15 18:33:21 -08:00