Commit Graph

49271 Commits

Author SHA1 Message Date
Sahil Batra de259b3c4a stream_settings: Refactor code for stream message retention setting.
This commit refactors the code for stream message retentions setting
to match it with the other time limit settings -

- Rename the "Retain for N days after posting" option to "Custom".
We also update the option value from "retain_for_period" to
"custom_period".

- Change the label of custom input to "Retention period (days)"
as it is more descriptive and clear than just labelling it as "N".

- The custom input is also moved to be below the dropdown and
also has left margin as with the other time limit realm settings.
2022-11-22 17:14:35 -08:00
Sahil Batra ec1f41eb9d settings: Rename dependent-block class to dependent-settings-block.
This commit renames dependent-block class to dependent-settings-block
and also moves the CSS to app_components.css. This class will now
only be used for this particular type of custom inputs and thus
we do not need ID in the selectors for applying the CSS.
2022-11-22 17:14:35 -08:00
Sahil Batra 30f4e67aaa settings: Rename "org-subsection-parent" class to "settings-subsection-parent".
This commit renames the "org-subsection-parent" class used for
organization settings subsections to "settings-subsection-parent"
such that we can use same for the stream settings and avoid
duplicating code for handling save-discard widget which will be
added in future.
2022-11-22 17:14:35 -08:00
Sahil Batra e9316499cb settings_org: Pass subsection elem to get_subsection_property_elements.
We passed subsection elem to get_subsection_property_elements function
in all cases except the one when calling from discard button click
handler and we passed the input elem instead in that case.

This commit changes the code to pass subsection element directly
in the discard button click handler as well such that we can use
get_subsection_property_elements function for the stream settings
code and do not find the subsection element inside the function.
2022-11-22 17:14:35 -08:00
Sahil Batra d00c428c88 settings: Refactor code that handles radio type settings.
This commit changes the settings code to consider the
parent div of the radio inputs as prop-element and not
individual input elements since all inputs are actually
for a single setting. We still need to handle these settings
as special cases at some places but that can also be fixed.

As a result of this change, we can use ID to get setting
name from the element in populate_data_for_request.
2022-11-22 17:14:35 -08:00
Sahil Batra 662998d431 settings: Add id for display and notification settings elements.
This commit adds id attribute to display and notification settings
elements except for the radio-type settings which will be handled
later in further commits and for checkbox type settings which
already had id.

The id will only be used for default settings section but they
have been added to user settings also as both of them share common
template.

This is a prep commit for refactoring the code for radio-type
settings in settings_org.js.
2022-11-22 17:14:35 -08:00
Sahil Batra fe179412ce settings: Move save-discard widget css to app_components.css.
We move the css to app_components.css from settings.css because
we are going to add save-discard widget in stream settings as
well and thus we can reuse the CSS there.
2022-11-22 17:14:35 -08:00
Sahil Batra 515446039c stream_edit: Remove unused handler.
We do not need this handler anymore since "Micromodal"
makes sure that events are not propagated and the
behavior is as expected without this handler.

Also, there are no elements with selectors used in
this handler.
2022-11-22 17:14:35 -08:00
Ujjawal Modi 23f2d44c6d settings: Improve success feedback for deleting alert words
We add the alert word that was removed to the banner text, and also
reorder a bit for clearer UI.

Fixes #22813
2022-11-22 16:23:56 -08:00
Tim Abbott 9b40bf804c docs: Clarify opening of direct installation section.
Fixes #23615.
2022-11-22 15:54:09 -08:00
Tim Abbott 016c4700ab css: Remove Bootstrap CSS reset for h5/h6.
This has no visual changes.

I hand-verified all the places we include these elements in the UI:
* Markdown rendered inside the app.
* Markdown rendered on portico pages.
* The only such element in our HTML templates is the <h5>s for
  organization logos.

For a couple of these, we were relying on the default margins provided
by Bootstrap.
2022-11-22 13:55:21 -08:00
Tim Abbott ed6a462c47 css: Delete Bootstrap navbar CSS.
This is not used by Zulip directly; the one place we have a .navbar is
on the /hello page, which actually is just a naming collision for the
"navbar" in the mobile device widget.
2022-11-22 13:55:21 -08:00
Tim Abbott 2a3f708e9a gear_menu: Delete unused Bootstrap tabs code.
Before 2017, Zulip's manage streams and settings UIs were tab in the
same pane position as our current message feed and recent topics.

That original implementation was implemented using Bootstrap tabs;
while it hasn't been in use for years, we had a bunch of stale code
related to it leftover in this module.
2022-11-22 13:55:21 -08:00
Tim Abbott f29e748e3b puppeteer: Stop looking for tab-pane elements.
These haven't been a part of Zulip's navigation in several years, so
it's just a reference to a useless extra CSS class.
2022-11-22 13:55:21 -08:00
Aman Agrawal fd422a4dd8 resize: Call `resize_app` after hiding recent topics first time.
See the code comment for why it is being called. We also remove the
unused `message_feed_shown` which was added to be used for this
purpose.

I decided to not call this with `requestAnimationFrame` since it
is changing position of elements in DOM and not letting browser
do a reflow after that can lead to wrong calculations later on.
2022-11-22 13:55:21 -08:00
Aman Agrawal a0f42edaa2 message_scroll: Only run `scroll_finished` when RT is not visible.
We didn't use to control how `active` class is set on
`#message_feed_container`. It was done by bootstrap on its own
and it doesn't even matter if `message_feed_container` is visible
for it to have `active` class according to bootstrap. So, we only
run `scroll_finished` when recent topics is not visible which
seems logical.
2022-11-22 13:55:21 -08:00
Tim Abbott 930f588fff css: Remove bootstrap navbar-search CSS.
I confirmed all of these rules were already overridden by our own CSS
on the only element with this CSS class.
2022-11-22 13:55:21 -08:00
Tim Abbott 9b5fb74f90 css: Remove bootstrap form-search CSS.
Only a couple lines were effective on a single element, so we just
inline those to the element in question.
2022-11-22 13:55:21 -08:00
Tim Abbott 4cd79d00ee bootstrap: Remove <address> CSS reset.
<address> Tag is not used.
2022-11-22 13:55:21 -08:00
Tim Abbott c8290421a1 css: Replace CSS reset for <cite> with local rules.
Browser default font-style for `cite` is `italic` and
there is no default value for `blockquote`.
2022-11-22 13:55:21 -08:00
Tim Abbott 3619fb2c29 css: Remove Bootstrap strong/em reset.
These roughly match the user-agent stylesheet; some browsers do
`font-weight: bolder` instead for strong, but the difference shouldn't
be important for us.
2022-11-22 13:55:21 -08:00
Tim Abbott 0ebcdf6838 css: Remove Bootstrap audio element rule.
display: none is already the default for audio elements without
controls.
2022-11-22 13:55:21 -08:00
Lauryn Menard 024932a489 narrow-banner: Fix empty narrow banner titles with user's full name.
Fixes an issue introduced in 6b4ab21 when we started using the
user's full name for empty narrow titles in a single operator
narrow of either "pm-with", "group-pm-with" or "sender".

For these empty narrow titles, any ', & or < characters in the
user's full name are not escaped.
2022-11-22 11:58:21 -08:00
Zixuan James Li 1698778145 user_groups: Remove unused remove_user_from_user_group.
remove_user_from_user_group's only caller has been removed in 271333301d.
Its usage has been superseded by remove_members_from_user_group.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
2022-11-21 13:41:06 -08:00
Lauryn Menard a67a622adc recent-conversations: Check for data change when processing message.
Add in a check to `recent_topics_data.process_message` so that we
know if any conversation data was updated and can rerender the
based on that information.
2022-11-20 17:26:26 -08:00
Aman Agrawal 6926415c26 recent: Don't modify `row_focus` if table is not focused.
This fixes an error in the `inplace_rerender` code when we
are trying to remove a rendered row and correcting the `row_focus`
if it is on the row being removed. If the table is not in focus,
we don't need to do anything.
2022-11-20 17:24:45 -08:00
Mateusz Mandera 51ed2442fa oneclick: Wait in a loop until the image build droplet gets an IP.
The script will fail if we process with a droplet object with no
.ip_address, which can sometimes happen if we just droplet.load().
Sometimes that gives droplet.ip_address set to None. If we wait in a
loop, we eventuall get the .ip_address set.
2022-11-18 12:45:08 -08:00
Alex Vandiver b8ab02022c docs: Renumber unique IDs on policies for easier uniqueness. 2022-11-18 10:24:42 -08:00
Alex Vandiver 183653df9f docs: Include full policy for avatars and uploads buckets.
The documentation included the full policy for the file uploads
bucket, but only one additional statement for the avatars bucket; the
reader needed to assemble the full policy themselves.

Switch to explicitly providing the full policy for both.

Fixes #23110.
2022-11-18 10:24:42 -08:00
Alex Vandiver 68173d2212 docs: Remove a now-unused link reference.
031260573f removed the use of this.
2022-11-18 10:24:42 -08:00
Anders Kaseorg 9972fcc85b custom_check: Remove exclusions for comment annotations check.
Commit 2762121162 (#21552) made them
unnecessary.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-11-18 10:08:24 -08:00
Anders Kaseorg 4dce3c54d9 custom_check: Remove assertEquals check.
Ruff checks this as U005 (and even auto-fixes it).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-11-18 10:08:24 -08:00
Anders Kaseorg 73c4da7974 ruff: Fix N818 exception name should be named with an Error suffix.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-11-17 16:52:00 -08:00
Anders Kaseorg eb2c822d3f eslint: Enable object-shorthand avoidExplicitReturnArrows option.
This is equivalent in the absence of ‘this’ (which ESLint knows to
check for).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2022-11-17 16:48:44 -08:00
Tim Abbott 88873138ac Update version following 6.0 release. 2022-11-17 16:42:36 -08:00
Tim Abbott f0e5f69c01 Release Zulip Server 6.0. 2022-11-17 11:44:45 -08:00
Alex Vandiver bf00e44bde docs: Document the `export_search` compliance export tool. 2022-11-17 11:19:59 -08:00
Alex Vandiver e41ee10966 export_search: Add a sender limit. 2022-11-17 11:19:59 -08:00
Alex Vandiver 809246e1dc docs: Fix a typo in a link anchor. 2022-11-17 11:19:59 -08:00
Alex Vandiver ab71e97f1c docs: Remove an unused link anchor. 2022-11-17 11:19:59 -08:00
Tim Abbott 5565c85624 i18n: Update translations from Transifex. 2022-11-17 11:05:47 -08:00
Aman Agrawal f0d87fcf6e unread_ops: Provide more responsive feedback flagging msgs read/unread.
Processing 1k messages takes roughly 1s on a live server like
chat.zulip.org, which is a good enough duration after which
user will be looking to get some feedback on the request. Once
we show the in-progress banner, it makes sense to do bigger
batches to speed up the process.
2022-11-17 10:55:34 -08:00
Tim Abbott 59633e36cb unread: Simplify include_anchor for mark all as read. 2022-11-17 10:26:57 -08:00
Tim Abbott 911cf46c72 unread: Fix mark all as read when oldest unread message is muted.
As detailed in the comment, the new "mark all as read" bankrupcty code
path would fail to mark as read muted stream messages that are older
than the oldest unread non-muted message.

This was because of the semantics of the `first_unread` anchor value
being actually "fire unmuted unread".

We can just change this to "oldest", because we're already using an
`is:unread` for the narrow query; doing so likely is a small
optimization, since we save the query to compute the first unread.
2022-11-17 10:26:57 -08:00
Lauryn Menard 16c45aaf42 narrow: Show empty narrow banner if all topics muted in stream.
Adjusts the check in `message_filter.process_results` to happen
after the messages have been processed so that the empty narrow
banner is shown if there are no messages in the current message
list, which covers the case of there being no messages returned
from the server (e.g. a keyword search, no private messages with
a user) and the case of all existing stream topics being muted
by the current user.
2022-11-17 10:24:49 -08:00
Aman Agrawal 7e1fe7e569 recent: Remove participant avatars from PM rows.
Fixes: #23561.
2022-11-17 09:37:46 -08:00
Tim Abbott 14e14c4d35 unread: Do full rerender of recent view on mark unread.
This matches the current bulk-operation behavior of the message lists,
and avoids spending an enormous amount of time adjusting unread counts
once per message in a loop over thousands of messages.

Also add some comments on adjacent code paths.
2022-11-17 09:06:33 -08:00
Lauryn Menard 79c0d7fbab recent-conversations: Update logic for processing messages.
As of 550a32b, when private messages were added to recent
conversations, `recent_topics_data.process_message` will
always return true.

Updates `recent_topics_data.process_message` for no return
value. Also, removes the `topic_data_changed` logic from
`recent_topics_ui.process_messages` and instead checks for
messages to process before updating the data and calling the
rerender.

`recent_topics_ui.complete_rerender` first checks for whether
the recent conversations view is visible before rerendering.
2022-11-17 09:05:24 -08:00
Sahil Batra 5c833f0423 compose_ui: Revert changes for replace_syntax done in 1ca4566eb2.
This commit reverts the changes for replace_syntax in 1ca4566eb2
and we again use JS replace instead of replace from text-field-edit.

We do this change because replace from text-field-edit leaves the
replaced text selected, which we don't want. This change is
temporary and we can probably use replace method from
text-field-edit once this issue is fixed in upstream.
2022-11-17 08:29:11 -08:00
Aman Agrawal c3589ad763 unread_ops: Fix plural and singular forms of text. 2022-11-17 00:46:26 -08:00