With commit f0d1332ba2, we no longer need to mock `topic_list.js`
in the `topic_list_data` node test. Instead, we can pass a string
directly to that function. The default is an empty string unless
there is a search input. Also, updates the default of the zoom to
be false instead of undefined in the tests.
When in a private narrow, the "Message X" button is disabled if direct
messages are not allowed in the organisation and the current recipient
is not a bot.
Note that when the recipient is a user group with 1, more or all bots,
the button is disabled then too as such PMs are not allowed. Only when
the recipient is a single bot, then it's not disabled, as DMs with one
bot are allowed even in organisations where DMs are disabled.
This commit fixes the comment about number of database queries
when moving message from muted topic to mention clearly about
the number of queries added due to original topic being muted.
We do not include the queries that is executed to check whether
the topic is muted or not, as they will be executed in all cases.
This commit adds code to disable the topic input in "Move topic"
modal if user cannot edit topics as per edit_topic_policy setting.
We do not check time-based permissions here as the first message
of the object may not be available. This commit also fixes a small
typo in the comment for that code along with updating the comment
to mention about disabling topic input.
If user tries to move messages older than the allowed time limit,
we show a confirmation modal stating that the older messages will
not be moved and only the alloed messages are moved if user clicks
on "Confirm" button.
We previously allowed moving messages that have passed the time limit
using "change_all" value for "propagate_mode" parameter. This commit
changes the behavior to not allow moving messages (both stream and
topic edit) that have passed the time limit for non-admin and
non-moderator users.
Previously, editing topic of "(no topic)" messages was allowed
irrespective of time limit or the "edit_topic_policy" setting.
Since we are working in the direction of having "no topic" messages
feel reasonable, this commit changes the code to not consider them
as a special case and topic editing restrictions apply to them as
well now like all other messages.
We still highlight the topic edit icon in recipient bar without
hovering for "no topic" messages, but it is only shown when user
has permission to edit topics.
Until now, we had been inserting a hard-coded number of new lines before
and after a quoted message. Now we replace that with an optional parameter
to make it customizable for different use cases.
This is a preparatory commit for the next commits, which will allow
inserting other elements as a block in the compose box.
Updated topics_sidebar_actions.hbs to include a option to add/remove
unmute visibility_policy for a topic is in a muted stream,
if in development environment.
Added 2 new classes sidebar-popover-unmute-topic and
sidebar-popover-remove-unmute for unmute topic option. Also, Renamed
previous sidebar-popover-unmute-topic to sidebar-popover-remove-mute.
Added 4 new click handlersthat uses
user_topics.set_user_topic_visibility_policy() to update
topic's visibility_policy.
Fixes#24244
Updated user_topics.js to include all visibility policies
rather than just mute/inherit visibility policies.
Replaced muted_topics Map with `all_user_topics` Map which has
structure: {stream_id:{topic_name:{date_updated,visibility_policy}}}.
Removed add_muted_topic, remove_muted_topic functions which were
adding/removing topics in muted_topics Map. Added new function
update_user_topics which take parameter stream_id, topic,
visibility_policy, and date_updated(optional) which adds a topic
to all_user_topics with date_updated and visibility_policy,
if visibility_policy is not equal to inherit.
else, removes topic from all_user_topics.
Added get_topic_visibility_policy which returns visibility_policy
if stream_id is not undefined else return false.
Added 2 helper functions is_topic_muted and is_topic_unmuted which
uses get_topic_visibility_policy and return true if topic is
muted and unmuted respectively else return false.
Replaced switch case statement which was using add_muted_topic
and remove_muted_topic functions in set_user_topic with new function
update_user_topics.
Fixes#24244
Removed functions mute_topic and unmute_topic in muted_topics_ui.js
which were using old API endpoints to mute/unmute topics.
In user_topics.js added new function set_user_topic_visibility_policy
which uses new API endpoint `/user_topics` to update the topic's
visibility_policy to visibility_policy passed to
set_user_topic_visibility_policy function as a parameter.
In functions toggle_topic_mute and mute_or_unmute_topic, replaced
the calls of mute_topic and unmute_topic with the new
user_topics.set_user_topic_visibility_policy function.
Added "web/src/user_topics.js" in EXEMPT_FILES in test-js-with-node
as adding function `set_user_topic_visibility_policy` resulted in
user_topics.js losing 100% test coverage.
Fixes#24244
This commit adds "Nobody" group option to system_user_groups_list in
settings_config.js. We do not allow can_remove_subscribers_group to
be set to "Nobody" group currently, but it is nice to add support
for this here since it will be used in more settings in future.
This commit refactors get_realm_user_groups_for_dropdown_list_widget
function to use "group_permission_settings" module instead of
passing variables like "allow_internet_group", etc. individually
for each settings.
We lose some test coverage due to this commit, but that would be
fixed when we add some more group-based settings and allow groups
other than system groups in the group based settings.
This commit adds a new module group_permission_settings.ts
which is used to define configuration options like
allow_owners_group, allow_nobody_group, etc. for group-based
settings similar to GroupPermissionSetting dataclass we have
in backend.
Following important changes are being made here:
* color_class lib is removed since it not used anywhere now.
* We don't need the `dark_background` class since the background
color is already adjusted based on color scheme. So, all
instances of it being used is removed.
stream_privacy template has conditions to show stream privacy icon
for all the cases, so we use it here since we also want to show
`#` icon for public streams.
Until now, lists with 3+ digit markers would have their beginnings cut off
to align with 2 digit markers. We fix that by having custom styling for
markers where we align markers only up to 2 digits, and let larger numbers
take up more space pushing the list item content forward as required to fit
the marker.
Separates the context dictionary that is used for `send_email` for
the `followup_day1` and `followup_day2` emails.
Prep commit for updates to `followup_day2` email.
The previous implementation leaked database connections, as a new
thread (and thus a new thread-local database connection) was made for
each timer execution. While these connections were relatively
lightweight in Python, they also incur memory overhead in the
PostgreSQL server itself. The logic for managing the timer was also
unclear, and the unavoidable deadlock in the stopping logic was rather
unfortunate.
Rewrite with one explicit worker thread which handles the delayed
message sending. The RabbitMQ consumer creates the database rows, and
notifies the worker to start its 5s timeout. Because it is controlled
by a condition variable, it does not hold the lock while waiting, and
can be notified to exit.
Despite the timestamp being hidden while sending the message, the link
on the timestamp (message url) was still hoverable and clickable, and
had a tooltip.
Here we disable the tooltip, but
https://github.com/zulip/zulip/issues/25069 remains open for the link
part.
At times, it might get confusing for users who are on
slow connections if their messages has not been sent
even after 5s. Including a spinner that will only show
up after 5 seconds has elapsed will keep user informed
about their slow connection.
5s is set as minimum time because showing up a spinner
before than might be distracting for users on normal
connections.
Fixes: #19328.
This commit changes behaviour of banners
in user groups panel and emoji settings panel
under organization settings.
Now banner in these panels is only
shown when user is an administrator or user
does not have permissions to perform actions
on panel.
Fixes#24157.
The flatpickr keyboard UI functions are very confusing. We previously
had a bug where typing keys that were not keyboard shortcuts or
numeric values could throw an exception due to accessing hotkey.name
when hotkey was undefined.
Fix this, and add a bundle of comments improving the documentation of
this confusing code path. Unfortunately, the implementation is still
somewhat mysterious; we leave debugging that to future work.
Fixes#24773.
Co-authored-by: Tim Abbott <tabbott@zulip.com>
In `insert_syntax_and_focus`, we now explicitly focus the textarea
before inserting the content, rather than relying on insert() to do
this for us. A comment is added documenting the quirks of insert that
require this.
This fixes a bug where the compose box might not be focused after
inserting video call links, emojis from the picker, GIPHY gifs, and
some other buttons.
Per the issue #25045, this commit changes some occurences of `uri`
appeared in variable `root_domain_uri`. Files affected are some
html files that used this variables and a backend file
`context_processors.py` that set it as a key.
Following the issue #23380 and PR #25038, this commit changes all
occurences of `uri` into `url` in all comments, local variables,
handlebars templates (.hbs) function names and their callers in
all `.js` and `.ts` files.
When there are no operators to narrow down
the search to, pass into `deactivate()` if
we're in `recent conversations`.
If we are, it will go to `all messages`.
This is done by using `is_visible()`
function of `recent_topics_util`.