Commit Graph

42389 Commits

Author SHA1 Message Date
Vishnu KS 051dab58ea navbar: Add gear menu advertisement for sponsoring zulip. 2021-05-12 10:21:48 -07:00
Tim Abbott b0f8bbfbd4 recent_topics: Fix annoying flicker on rerendering.
We were apparently not using the ListWidget API for replacing the
content of a widget without removing the whole thing from the DOM and
replacing it.

Unless ListWidget has unexpected bugs, this should have the exact same
result as the previous logic, with much a nicer user experience.
2021-05-12 10:02:48 -07:00
Tim Abbott 4dae2c53fb recent_topics: Make muted user avatars a bit less bright. 2021-05-12 09:38:36 -07:00
Abhijeet Prasad Bodas 336b791f8b recent topics: Use tippy tooltip instead of HTML title. 2021-05-12 09:30:24 -07:00
Abhijeet Prasad Bodas ed8faf1374 recent topics: Rename some HTML classes for readability. 2021-05-12 09:30:24 -07:00
Abhijeet Prasad Bodas e5a339df25 recent topics: Handle muted user avatars in participants.
We use styling same as that of the number shown for overflow
(e.g "+3") which has a gray background.
To keep these avatars up-to-date, we need to rerender the
recent topics view after receiving a `muted_users` event.

Also update the user documentation to mention this detail.
We deliberately avoid mentioning "recent topics" because
this applies to mobile too.
2021-05-12 09:30:24 -07:00
Abhijeet Prasad Bodas e4cbfcaf1d recent senders: Rename sender_info getter function for brevity.
We will also later use this function for attaching other
information to it like whether the sender has been muted
or not.
2021-05-12 09:30:24 -07:00
Tim Abbott cf69ce166c recent_topics: Avoid unnecessary rerenders via repeated Esc.
This also prevents unnecessary rerenders when changing the URL between
"#recent_topics" and "#" when it's the default view.
2021-05-12 08:42:29 -07:00
Tim Abbott 9e812c5683 hashchange: Show default view behind overlays on load.
This seems more consistent with what users would expect; Recent topics
may be a better default view in general, but if a user has picked
another default view, we should use that where the default view is
desired.
2021-05-12 08:42:24 -07:00
Steve Howell b4470ac8e1 performance: Add get_subscriptions_for_send_message.
This new function optimizes how we fetch subscriptions
for streams.  Basically, it excludes most long-term-idle
users from the query.

With 8k users, of which all but 400 are long term idle,
this speeds up get_recipient_info from about 150ms
to 50ms.

Overall this change appears to save a factor of 2-3 in the backend
processing time for sending or editing a message in large, public
streams in chat.zulip.org (at 18K users today).
2021-05-12 08:10:57 -07:00
Tim Abbott c690fa1174 compose_closed_ui: Avoid duplicate button in recent topics. 2021-05-11 23:57:57 -07:00
Tim Abbott 8e7761e15b compose: Move closed-compose functions to closed_compose_ui.js.
This improves the organization of our codebase a bit.
2021-05-11 23:57:57 -07:00
Tim Abbott 9239de408a compose: Remove now unused nonexistent_stream_reply_error.
This was a holdover from the legacy "reply" button behavior; with the
new wide button model, it just becomes a normal "compose" button.
2021-05-11 23:57:57 -07:00
Aman Agrawal 0d8a7efa09 compose_closed_ui: Show default label for empty narrows.
The default label for empty narrows depends on whether it's a
stream/topic narrow or a PMs narrow.

We leave some default text in compose.hbs for reply label
because it take some time for the js to display the
correct label.
2021-05-11 23:57:57 -07:00
Aman Agrawal 98b9c7284e recent_topics: Update reply button on topic row click.
Use can stay in recent_topics after clicking on mute and
read button, so we need to update reply button text here.
2021-05-11 23:51:01 -07:00
Aman Agrawal d8f554eb52 recent_topics: Set default text for reply btn when not focused in table.
When user is focused in search or filters, show "Compose Message"
as label which is more appropriate.
2021-05-11 23:51:00 -07:00
Aman Agrawal 7ab562d138 compose_closed_ui: Set text directly to compose_reply_button_label.
This will allow us set other text to it without making us restore
this html fragment when we replace it.
2021-05-11 23:51:00 -07:00
Tim Abbott a87749b478 api docs: Avoid confusing the API changelog with the changelog.
We change the title to be more descriptive and also link to the
overall Zulip changelog, since one can reasonably get to this page
when googling for "Zulip changelog".
2021-05-11 22:00:05 -07:00
Tim Abbott 9c8ed0fe1f i18n: Update translation data from Transifex. 2021-05-11 21:39:38 -07:00
Sumanth V Rao 72ead6e097 playgrounds: Rename `name` field to `playground_name`.
The browser seems to autofill the `Name` field of the add-playground
form. Most likely this behavior is a result of  value of the `name`
input field being `name`, causing the browser do to something weird
here. This name is now changed to `playground_name`.
2021-05-11 20:47:41 -07:00
Tim Abbott b15941610d message: Support avoiding database queries in has_message_access.
If the caller has already fetched the Stream or subscription details
for the user, those can be passed to has_message_access to avoid extra
database queries.
2021-05-11 20:46:49 -07:00
Tim Abbott 44fddcc9c1 message: Reorder checks in has_message_access.
This refactor makes this function easier to read and understand.
2021-05-11 20:46:49 -07:00
Alex Vandiver 237efdee6c send_email: Show more information about messages which failed to send. 2021-05-11 14:27:45 -10:00
Alex Vandiver feb7870db7 puppet: Adjust thresholds on autovac_freeze.
These thresholds are in relationship to the
`autovacuum_freeze_max_age`, *not* the XID wraparound, which happens
at 2^31-1.  As such, it is *perfectly normal* that they hit 100%, and
then autovacuum kicks in and brings it back down.  The unusual
condition is that PostgreSQL pushes past the point where an autovacuum
would be triggered -- therein lies the XID wraparound danger.

With the `autovacuum_freeze_max_age` set to 2000000000 in
`postgresql.conf`, XID wraparound happens at 107.3%.  Set the warning
and error thresholds to below this, but above 100% so this does not
trigger constantly.
2021-05-11 17:11:47 -07:00
Tim Abbott 6a374d6d28 drafts: Replace notification when saving a draft.
The old logic, inline in the compose area, has produced a very weird
effect where the buttons would move to fit the notification, ever
since design changes to use the full bottom row space.

We address this by just using a Tippy tooltip instead.
2021-05-11 15:01:25 -07:00
Mateusz Mandera c95cac2dd7 outgoing_webhook: Send response payload to bot owner if it was invalid.
When the format of the response received from the outgoing webhook
server is invalid (unparsable json, or just wrong format that doesn't
translate into a dictionary etc.), a message with the error is sent to
the bot owner. We should include the actual payload to make reasonable
debugging possible.

In notify_bot_owner we have to move the `if response_content` block to
append the payload to the message whenever it was specified as an
argument to the function. It shouldn't be nested inside
`elif status_code` as before.
2021-05-11 14:27:00 -07:00
Alex Vandiver 3ccb77da74 install: Tell NVM to not change $PATH earlier.
This removes a possible window where an installer error could leave
`nvm` in a state where it had prepended the full path to the
newly-installed `npm` to `$PATH`; we would like to avoid `nvm`
fiddling with path whenever possible (ref ebe930ab2c).
2021-05-11 11:25:34 -10:00
Tim Abbott 23b544d613 compose: Move drafts button to right end of bottom row.
This avoids it breaking up the list of buttons that start a message, a
state introduced when we moved the Reply button from right to left.
2021-05-11 14:09:48 -07:00
Abhijeet Prasad Bodas 421cf05176 people: Deduplicate get_full_names logic.
Share code between `safe_full_names` and `get_display_full_names`
functions, and rename `safe_full_names` to `get_full_names_for_poll`,
because that was the only place where this was used earlier.

This also has the nice side effect of showing "Muted user" instead
of the muted username in poll results.
2021-05-11 13:21:38 -07:00
Abhijeet Prasad Bodas c637994612 help: Fix typo in mute-a-user page.
Also make the sentence more clearer.
2021-05-11 13:21:38 -07:00
Alex Vandiver 0f1611286d management: Rename the deliver_email command to deliver_scheduled_email.
This makes it parallel with deliver_scheduled_messages, and clarifies
that it is not used for simply sending outgoing emails (e.g. the
`email_senders` queue).

This also renames the supervisor job to match.
2021-05-11 13:07:29 -07:00
Riken Shah f7baa3c388 puppeteer_test: Wait for 100ms after typing each char to avoid flake.
The reason for this flake is it missed clicking on the Set
All button (`.subs_set_all_users`) because it calculated
its position before/during it starts scrolling.

There are two scrolling events caused by typing `ot`,

* First is due to internal focus call before typing
which scrolled down the page to bring input in the view.

* Second is after it typed `ot` the user list is updated to
one value, which caused the modal height to decrease rapidly.

Note: It theory, there is three scrolling event,
First is of course internal focus then, after it typed `o`
the list is updated to two values and one is after `t` the
list is updated to a single value.
But as puppeteer is very quick it directly jumped to the
scrolling event after it typed `ot`.

For a more detailed explanation read,
https://chat.zulip.org/#narrow/stream/43-automated-testing/topic/master.20failing/near/1173996.

This commit just temporarily fixes this flake, it's not the
best approach to use time-based delays as they can't be
robust (e.g If the machine is super slow then time-based
delays can fail.).
2021-05-11 11:28:10 -07:00
Aman Agrawal 96565ee1d1 hashchange: Rename activate_home_tab for clarity. 2021-05-11 11:26:57 -07:00
Aman Agrawal 59a45d3521 hashchange: Render default view on empty hash.
Instead of changing the hash to the default_view hash, we render
the default_view directly in case of recent topics and all messages.

This also fixes the bug that user is unable to go back in
browser window history.
2021-05-11 11:26:57 -07:00
Aman Agrawal f95443ac8f recent_topics: Use is_visible for testing if RT is rendered.
We don't want to rely on browser hash to check if RT is visible
because soon we want to display default_view without any hash
and RT may or may not be visible in that hash.
2021-05-11 11:26:57 -07:00
Steve Howell 1e63282cc2 tests: Test email/push more thoroughly for idle users. 2021-05-11 14:33:12 +00:00
Steve Howell 3161b5d892 tests: Simplify test_user_message_filter. 2021-05-11 13:53:55 +00:00
Anders Kaseorg 5ca763fc24 eslint: Fix unicorn/prefer-switch.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 19:26:41 -07:00
Anders Kaseorg 04569bc17e settings_org: Remove unused case for realm_zoom properties.
Commit 4d04fa3118 (#11874) removed those
properties.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 19:26:41 -07:00
Anders Kaseorg a284299b85 eslint: Fix unicorn/prefer-array-flat.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 18:07:13 -07:00
Anders Kaseorg 42abc1b635 dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-05-10 18:07:13 -07:00
Aman Agrawal 512f16690a settings_streams: Use hash_util to check if settings is open.
Since both `organization` and `settings` are category of hash,
we can simply check if the current hash's category is among
them.
2021-05-10 17:55:03 -07:00
Aman Agrawal 570306fa69 subs: Use hash_util to get stream id.
Active stream's hash look like this - `#streams/1/announce`
Since the stream_id is present where typically hash section
is for all other hashes, get_current_hash_section should return
the same result.
2021-05-10 17:55:03 -07:00
Aman Agrawal b180c245b4 subs: Use hash_util to check if user is in "#streams/new". 2021-05-10 17:55:03 -07:00
Aman Agrawal b6f14c54e5 subs: Move active_stream function to hash_util.
This function better belongs in hash_util since it relies on
the current window hash.
2021-05-10 17:55:03 -07:00
Aman Agrawal c6a934da4c reload: Use hash_util to get current hash encoded.
We do this change to limit the use of window in other modules,
specifically window.location.hash.
2021-05-10 17:55:03 -07:00
Aman Agrawal e7129af8ac hash_util: Extract functions to be reused without `window`.
These functions can now be used in other libraries without
using window.location.hash in them and directly calling these
functions.
2021-05-10 17:55:03 -07:00
PIG208 d8db797798 doc: Fix configurations for images in the doc of newrelic.
The screenshot generating mechanism doesn't work for newrelic and
causes error because its configuration file doesn't exist. This
commit fixes the configuration and re-generate the screenshots.
2021-05-10 17:50:32 -07:00
PIG208 9b48a36b91 tools: Add support to generating bot avatars for non-webhook integrations.
New bot avatars are generated with this tool. Having the avatars generated,
we can run generate-integration-docs-screenshot to generate the doc
screenshots.

Fixes: #17792
2021-05-10 17:50:32 -07:00
PIG208 540072e860 tools: Support sending mock messages for non-webhook integrations.
Non-webhook integrations should have fixtures containing mock messages
in json format with fields "subject" and "body" indicating the topic
and content respectively.
2021-05-10 17:50:32 -07:00