Commit Graph

45056 Commits

Author SHA1 Message Date
Manan Rathi 230607853d loading_page: Fix the color of the App-loading text.
Fixes #20172
2021-11-15 10:57:30 -08:00
Ganesh Pawar 6262c88e00 modal: Grey out the submit button when disabled. 2021-11-15 10:38:57 -08:00
Ganesh Pawar ca4d9b0fd6 modal: Mark submit button CSS `color` property as important.
This is necessary to override the global `color` property defined
for disabled buttons in night mode.
2021-11-15 10:38:57 -08:00
Aman Agrawal 5f4595d7b6 landing_page: Avoid gradient overflowing under content.
Gradient under content makes links which are of similar color
hard to see.
2021-11-14 18:56:34 -08:00
Alex Vandiver a2f89f21e3 email_change: Show deactivated page if realm is now deactivated.
We also catch if the user is now deactivated.
2021-11-14 18:55:40 -08:00
Alex Dehnert dfaeb10087
settings: Link to help on restrict wildcard mentions.
This is necessary to indicate the definition for "large streams" used.
2021-11-12 11:33:35 -08:00
Alex Vandiver bc5539d871 tornado: Move SIGTERM shutdown handler into a callback.
A SIGTERM can show up at any point in the ioloop, even in places which
are not prepared to handle it.  This results in the process ignoring
the `sys.exit` which the SIGTERM handler calls, with an uncaught
SystemExit exception:

```
2021-11-09 15:37:49.368 ERR  [tornado.application:9803] Uncaught exception
Traceback (most recent call last):
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/http1connection.py", line 238, in _read_message
    delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/httpserver.py", line 314, in finish
    self.delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/routing.py", line 251, in finish
    self.delegate.finish()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 2097, in finish
    self.execute()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 2130, in execute
    **self.path_kwargs)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/gen.py", line 307, in wrapper
    yielded = next(result)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/tornado/web.py", line 1510, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/handlers.py", line 150, in get
    request = self.convert_tornado_request_to_django_request()
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/handlers.py", line 113, in convert_tornado_request_to_django_request
    request = WSGIRequest(environ)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zulip-py3-venv/lib/python3.6/site-packages/django/core/handlers/wsgi.py", line 66, in __init__
    script_name = get_script_name(environ)
  File "/home/zulip/deployments/2021-11-08-05-10-23/zerver/tornado/event_queue.py", line 611, in <lambda>
    signal.signal(signal.SIGTERM, lambda signum, stack: sys.exit(1))
SystemExit: 1
```

Supervisor then terminates the process with a SIGKILL, which results
in dropping data held in the tornado process, as it does not dump its
queue.

The only command which is safe to run in the signal handler is
`ioloop.add_callback_from_signal`, which schedules the callback to run
during the course of the normal ioloop.  This callbacks does an
orderly shutdown of the server and the ioloop before exiting.
2021-11-12 09:57:23 -08:00
Alya Abbott 847bf8207f portico: Link back to /for/X pages from Lean case study. 2021-11-11 06:24:58 -08:00
Alex Vandiver 6c14978cd1 zilencer: Truncate "remove" notifications from remote servers.
This is 4d055a6695, but for notifications which are received from
remote hosts.
2021-11-10 13:39:35 -08:00
Lauryn Menard 6046f94521 settings: Fix live `update_page` behavior for user settings.
Changes `update_page` to only update the modified user setting instead
of updating all of the user settings on the page. This is modeled on
the behavior for updates to the realm user default settings.

This is a follow up on feedback in #20070.
2021-11-10 13:03:20 -08:00
akshatdalton e9a2183fda drafts: Fix tooltip css in draft controls.
Tooltip popover in draft controls was too narrow.
Now its width is set to max-content width.
This looks nice.
2021-11-10 12:54:53 -08:00
akshatdalton 2b1cc006fa drafts: Add hotkey hint to restore draft. 2021-11-10 12:54:53 -08:00
Tim Abbott 12c6ee7962 drafts: Document that drafts are not shared with other devices.
We plan to change this in the future, but we should make sure it's
clear to users what the current model is.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels 151db3c9ef drafts: Increase the duration of "Saved as draft" tooltip.
Now that it's further away from the composebox, we probably want it to
be visible for longer. Doubling it from 1.5 seconds to 3 seconds seems
reasonable to start with, although we should tune it based on feedback.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels fe89dee284 compose: Remove "Drafts" button.
Now that this is in the left sidebar, we can remove the now-redundant
compose area button for it.  This also changes where the "Saved as
draft" tooltip appears.
2021-11-10 12:53:44 -08:00
Wesley Aptekar-Cassels df8f0b2afe left_sidebar: Add "Drafts" item.
This currently shows the drafts as a popup. Eventually, we'll want to
migrate it to be a view in the center pane, as we did with Recent
Topics.

This uses the same style as starred messages in order to show the number
of drafts.

See CZO for more context:
https://chat.zulip.org/#narrow/stream/101-design/topic/drafts.20in.20sidebar
2021-11-10 12:53:44 -08:00
akshatdalton f2c7e8e80f markdown: Ensure all markdown fixtures have unique names.
This commit ensures that all markdown fixtures have unique
test names by rewriting the names of some of them and adding
a test in `test_markdown.py`.

Earlier this was over-writing the value for same keys in
`load_markdown_tests` in `test_markdown.py`.
2021-11-10 12:36:47 -08:00
Aman Agrawal cfbed9a60c recent_topics: Re-select last selected topic.
Since the position of topic in recent topics can change, we
focus the last selected topic using the `topic_key` instead
of relying `row_focus` value which is incorrect.
2021-11-10 12:25:15 -08:00
Aman Agrawal 7f61997d09 recent_topics: Directly pass topic index instead of element.
Since the element may get re-rendered while we extract info from
it, we do it as fast as possible to avoid errors.
2021-11-10 12:25:15 -08:00
Aman Agrawal c6d74c4b67 recent_topics: Separate behaviour for scrolling and hotkeys.
When user is scrolling, we simply keep the center element in
focus.

When user is using hotkeys, we keep the focused element in
center.

When user is using keyboard, we need to always keep the
"focused" topic in visible scrolling area.

We determine if the topic row is above or below the visible
area and scroll half_height_of_visible_area so that the selected
topic is visible.

This gives a nice navigation experience for both the views.

Reduced height of recent topics table to account for
compose box so that focused element is not below compose box.
2021-11-10 12:25:15 -08:00
Alex Vandiver 6b6dcf6ce1 soft_deactivate: Handle multiple SUBSCRIPTION_DEACTIVATEDs.
Race conditions in stream unsubscription may lead to multiple
back-to-back SUBSCRIPTION_DEACTIVATED RealmAuditLog entries for the
same stream.  The current logic constructs duplicate UserMessage
entries for such, which then later fail to insert.

Keep a set of message-ids that have been prep'd to be inserted, so
that we don't duplicate them if there is a duplicated
SUBSCRIPTION_DEACTIVATED row.  This also renames the `message` local
variable, which otherwise overrode the `message` argument of a
different type.
2021-11-10 12:19:25 -08:00
Mateusz Mandera 8f1105eab0 saml: Add some docstrings to SAMLDocument class. 2021-11-10 12:08:56 -08:00
Mateusz Mandera 17485e2f4d saml: Refactor get_issuing_idp to rely on class polymorphism. 2021-11-10 12:08:56 -08:00
Mateusz Mandera 3702b31dd2 saml: Refactor some SAMLRequest/SAMLResponse processing logic.
Using these tuples is clearly uglier than using classes for storing
these encoded stream. This can be built on further to implement the
various fiddly logic around handling these objects inside appropriate
class method.
2021-11-10 12:08:56 -08:00
Mateusz Mandera 64a04d90b2 saml: Pass correct settings object to OneLogin_Saml2_Logout_Request.
config is a dict, but the OneLogin_Saml2_Logout_Request expects to
receive a OneLogin_Saml2_Settings object.
2021-11-10 12:08:56 -08:00
YashRE42 f21cee7caa upload: Return single elem for get_item(drag_drop_container) w/ edit.
Previously, opening multiple message_edits and then drag-dropping a
file into any one of them would cause all of them to upload ie you'd
get one uploaded file in each message_edit.

This bug was caused by returning multiple elements from
upload.get_item("drag_drop_container", config) when config.mode =
"edit".

This commit changes the selector to use the row provided (config.row),
and so ensures that the above bug doesn't happen.
2021-11-10 12:06:15 -08:00
YashRE42 e8eb6724ad message_view_header: Switch selector for hover to ~ instead of +.
This is a prep commit for adding extended descriptions to
message_view_header, it ensures hover effects work even if we add
additional elements to the message_view_header.
2021-11-10 11:05:22 -08:00
Ganesh Pawar 7a505e3857 user_profile_modal: Migrate modal to Micromodal. 2021-11-10 11:04:38 -08:00
Tim Abbott f905171e78 stream_edit: Remove unused import.
This was introduced when rebasing
d62e44fcba on top of
8cc781f0c8, which removed the other use
of this module in this file.
2021-11-10 10:33:12 -08:00
Ganesh Pawar d62e44fcba stream_privacy_setting_modal: Migrate modal to dialog_widget. 2021-11-10 10:23:31 -08:00
Aman Agrawal 9af4d5a155 reminder: Don't ack server for reminder / scheduled messages. 2021-11-10 09:12:23 -08:00
Aman Agrawal 3237196687 reminder: Fix incorrect method applied on object.
The intention here is to apply `find` on the array of values
in the object.
2021-11-10 09:12:23 -08:00
Aman Agrawal 59a62573ed popover_menus: Simplify check for any active popovers. 2021-11-10 09:12:23 -08:00
isakhagg 7edbf673e4 poll: Handle duplicate poll options.
Fixes #20164.
2021-11-10 09:07:03 -08:00
Anders Kaseorg 7a431a690d dev-vagrant-docker: Upgrade docker-systemctl-replacement to 1.5.4505.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-11-10 09:02:56 -08:00
Ganesh Pawar 6bc291cdf2 edit_bot: Remove unnecessary CSS from bot owner button.
Fixes #20201.
2021-11-10 09:02:08 -08:00
Aman Agrawal a8c488bc56 compose: Use calendarContainer to check if flatpickr is open.
`calendarContainer` is defined for flatpickr instance if it is
open.

This also fixes a bug where the flatpickr doesn't open when
user tries to toggle it using the global time icon in compose.
2021-11-10 09:00:59 -08:00
Aman Agrawal 6ce4561004 package: Upgrade tippy to fix false warnings.
This was an error from tippy which showed false warnings
on importing `delegate`.

See https://github.com/atomiks/tippyjs/pull/1006 for more
details.
2021-11-10 08:57:22 -08:00
Alex Vandiver 01c007ceaf puppet: Remove an out-of-date comment.
Comment was missed in 9d57fa9759.
2021-11-09 21:52:17 -08:00
Alex Vandiver 7af2fa2e92 puppet: Use sysv status command, not supervisorctl status.
Since Supervisor 4, which is installed on Ubuntu 20.04 and Debian 11,
`supervisorctl status` returns exit code 3 if any of the
supervisor-controlled processes are not running.

Using `supervisorctl status` as the Puppet `status` command for
Supervisor leads to unnecessarily trying to "start" a Supervisor
process which is already started, but happens to have one or more of
its managed processes stopped.  This is an unnecessary no-op in
production environments, but in docker-init enviroments, such as in
CI, attempting to start the process a second time is an error.

Switch to checking if supervisor is running by way of sysv init.  This
fixes the potential error in CI, as well as eliminates unnecessary
"starts" of supervisor when it was already running -- a situation
which made zulip-puppet-apply not idempotent:

```
root@alexmv-prod:~# supervisorctl status
process-fts-updates                                             STOPPED   Nov 10 12:33 AM
smokescreen                                                     RUNNING   pid 1287280, uptime 0:35:32
zulip-django                                                    STOPPED   Nov 10 12:33 AM
zulip-tornado                                                   STOPPED   Nov 10 12:33 AM
[...]

root@alexmv-prod:~# ~zulip/deployments/current/scripts/zulip-puppet-apply --force
Notice: Compiled catalog for alexmv-prod.zulipdev.org in environment production in 2.32 seconds
Notice: /Stage[main]/Zulip::Supervisor/Service[supervisor]/ensure: ensure changed 'stopped' to 'running'
Notice: Applied catalog in 0.91 seconds

root@alexmv-prod:~# ~zulip/deployments/current/scripts/zulip-puppet-apply --force
Notice: Compiled catalog for alexmv-prod.zulipdev.org in environment production in 2.35 seconds
Notice: /Stage[main]/Zulip::Supervisor/Service[supervisor]/ensure: ensure changed 'stopped' to 'running'
Notice: Applied catalog in 0.92 seconds
```
2021-11-09 21:52:17 -08:00
Manan Rathi aac8ceadf9 user docs: Add documentation for /todo.
Fixes #20141.

Co-authored-by: Alya Abbott <alya@zulip.com>
2021-11-09 10:16:47 -08:00
Tim Abbott 4aedb129ea settings: Add comments for default settings update_page. 2021-11-09 10:05:08 -08:00
Sahil Batra f49980098d settings: Fix live update code for twenty_four_hour_time setting.
We need to handle live-update of twenty_four_hour_time setting
separately in update_page because the database value of this
setting is boolean but we use dropdown in the frontend for this
setting with option values as "true" and "false" strings.
2021-11-09 10:03:23 -08:00
Sahil Batra 4a1153b06c settings: Fix bug in "Default user settings" section.
There was no heading for "Time format" setting in the
"Default user settings" section and thus no save-discard
widget to update the setting. This commit fixes the bug
and changes the heading to be only "Time" since there is
no realm-level default of language setting.

This bug was introduced in adb612a0b4.
2021-11-09 10:03:23 -08:00
Ganesh Pawar 41ddf29e76 move_topic_to_stream: Migrate modal to dialog_widget. 2021-11-09 10:02:43 -08:00
Aman Agrawal 05bd417de4 flatpickr: Visual improvements.
* Fix time input buttons not positioned correctly.
On <768px screens:
* Center align flatpickr.
* Remove bottom arrow.

We should ideally have a semi-transparent black background
for flatpickr on mobile but it is hard to do so with flatpickr
being inserted into DOM by an external library.
2021-11-09 09:40:52 -08:00
Aman Agrawal 8c46fde342 flatpickr: Show the same picker on mobile as on desktop.
Flatpickr tries to show a different picker for mobile which
is not visible for some reason. We display the same picker
on mobile which we know works for our use case.

Docs: https://flatpickr.js.org/options/

```
Set disableMobile to true to always use the non-native picker.
By default, flatpickr utilizes native datetime widgets unless
certain options (e.g. disable) are used.
```
2021-11-09 09:40:52 -08:00
Sahil Batra 041711dcbd streams: Add padding between subscriber-list columns.
This commit adds 5px of padding between columns of
subscriber-list such that the list doesn't look too
bad on narrow widths. This does not completely fixes
the issue on narrow widths but is atleast a small
improvement.
2021-11-09 15:11:02 +05:30
Sahil Batra 46660e5daa streams: Show "hidden" in subscriber-list when email is not accessible. 2021-11-09 13:26:31 +05:30
Sahil Batra 305131c7d7 settings: Show "hidden" in users list when email is not accessible. 2021-11-09 13:22:44 +05:30