Commit Graph

6565 Commits

Author SHA1 Message Date
Anders Kaseorg ee52618e1b namespace: Require rewired variables to be exported.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg db2723036f tests: Export rewired variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg a37aab19ed tests: Avoid override_rewire of imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Anders Kaseorg c57f12a792 tests: Remove override_rewire of nonexistent variables.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-08 12:38:14 -08:00
Karl Stolley 4038832889 unread_count: Set class for legacy quiet counters. 2024-11-07 14:56:38 -08:00
Karl Stolley 0e3be942b9 unread_count: Introduce classes for different counts.
This includes more prominent quiet counts, with increased
font-weight and, in dark mode, a brighter text color.
2024-11-07 14:56:38 -08:00
bedo a632948482 left_sidebar: Fix keyboard accessibility.
Fixes #31823

When home view changes, CSS just puts the selected home view
at the top of the left_sidebar navigation list (expanded)
or to the left (collapsed), but the rendered <li> elements
stay in the same order in DOM, so regarldess of current home view,
keyboard navigation always follows the order in which the <li>
elements appear in DOM.

Changes:
- Reorder <li> navigation elements in DOM based on current home view.

- Remove tabindex=0 from <a> elements, because they are now ordered
correctly in DOM.

- Add (tabindex="0" role="button") to the <i> collapsable VIEWS, to be
keyboard accessibile.
2024-11-07 11:55:48 -08:00
Tim Abbott fce6f4ef66 topic_list: Harden topic clicks against propagation.
I saw some profiling traces where it appears multiple copies of this
click handler got processed when clicking on a topic in the left
sidebar.

I suspect that was a profiling artifact, but the intent is for
on_topic_click to fully process clicks on topics in the sidebar, and
we should write the code to say that.
2024-11-07 10:46:30 -08:00
evykassirer a1e31a44bd buddy_list: Tweak spacing of rows, line-height, and circle placement.
This commit adds more space between rows, increases the line height
so that the status message doesn't touch the status emoji, and makes
the status circle a little bigger.
2024-11-07 10:33:04 -08:00
evykassirer bd10923f13 settings_realm_user_settings_default: Convert module to typescript. 2024-11-06 17:55:55 -08:00
Anders Kaseorg cd701c8468 webpack: Disable CompressionPlugin for Puppeteer tests.
Zopfli is very slow and the development server does not use its output
anyway.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-06 16:47:30 -08:00
evykassirer 898af8a9af user_circles: Fix bug causing incorrect colors in typeahead.
c39ae45d95 was incorrect, and should
only have been applied to the circles in the buddy list avatars.
In other places in the app, the transparency was over other colors
of background.
2024-11-06 16:36:40 -08:00
evykassirer 45d9c04e8e buddy_list: Fix vertical spacing issue. 2024-11-06 16:36:40 -08:00
evykassirer 174a458928 settings_users: Convert module to typescript. 2024-11-05 17:50:17 -08:00
evykassirer 6aa08b9c50 settings_users: Remove unnecessary bot user undefined check.
Users are fetched from `people_by_user_id_dict`.

`bot_info` is only called from:

* `bots_create_table`, with ids from `get_bot_ids` which are
  from this `people_by_user_id_dict`.
* `update_bot_data`, which is called in two places that check
  `is_valid_bot_user` on the bot id first.

So we should always get a `bot_user` back, and we're already relying
on the bot users being defined in several methods of the
`bot_list_widget`.
2024-11-05 17:50:17 -08:00
evykassirer 0e3374dc1b settings_users: Don't use `text()` with undefined value.
`text(undefined)` is a noop, and also isn't validly typed.
2024-11-05 17:50:17 -08:00
evykassirer 7fbdefcfc0 settings_users: Initialize full section objects.
Typescript likes objects to be fully initialized up front,
instead of adding functions to them later.
2024-11-05 17:50:17 -08:00
evykassirer 7ca644b905 settings_users: Make separate variables for each section.
This will help with the conversion to typescript.
2024-11-05 17:50:17 -08:00
evykassirer 85f8665851 util: Move compare_a_b from user_sort and generalize it. 2024-11-05 17:50:17 -08:00
evykassirer 01b1a51a86 stream_edit: Convert module to typescript. 2024-11-05 17:41:31 -08:00
evykassirer 16e3894bfa stream_edit: Remove use of e.trigger for copy link button.
This will help with the typescript conversion for this file.
2024-11-05 17:41:31 -08:00
evykassirer de8caa1b43 stream_edit: Use `this` instead of `e.target`.
These were all manually checked to still work.
`e.currentTarget` is equivalent to `this`, and
all instance of `e.target` were either the same
as `this` or used with a `closest` function that
still got the same value.
2024-11-05 17:41:31 -08:00
evykassirer 287c7e8f05 stream_edit: Pass string instead of function as html_body.
It seems like this was working fine, thanks to some internal
workings of Handlebars, but when we convert this file to
typescript, it will want a string for `html_body`.
2024-11-05 17:41:31 -08:00
evykassirer 686372e8a2 stream_edit: Parse notification labels instead of checking substrings. 2024-11-05 17:41:31 -08:00
evykassirer e739e9ae29 stream_edit: Don't set undefined text for email address.
`sub.email_address` can be `undefined`, `$foo.text(undefined)` has
no effect (it doesn't clear the text), and `text()` doesn't formally
accept `undefined`, so here we only call `text()` if the new value
isn't undefined.
2024-11-05 17:41:31 -08:00
evykassirer 924ebee421 stream_edit: Remove unecessary checks for invalid stream id.
None of these have showed up in Sentry in the last 90 days, and
it will be easier to type this file if we can assume we always
get a valid stream id and a valid sub for that stream id.
2024-11-05 17:41:31 -08:00
evykassirer 527d4672f8 settings_components: Fix types in save_discard_stream_settings_widget_status_handler.
This had been getting undefined `sub` already, in the modal to create
a new channel, but managed to not cause errors because
`properties_elements` was empty and `button_state` didn't equal
`"unsaved"`, leaving areas that treated `sub` as defined not accessible.
This commit fixes the type and handles the `undefined` case more directly.
2024-11-05 17:41:31 -08:00
evykassirer e50a51a8e1 settings: Convert general_notifications_table_labels.stream to tuples.
This will help with the typescript conversion.
2024-11-05 17:41:31 -08:00
Anders Kaseorg 799e59bb8f dependencies: Upgrade JavaScript dependencies.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 6037230ea8 eslint: Fix @typescript-eslint/consistent-indexed-object-style.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 03c3bb31dc settings_linkifiers: Remove dead code.
It’s been dead since d7e1e4a2c0 (#2261)
introduced it.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg 0bd9f4f674 install-node: Upgrade Node.js from 20.18.0 to 22.11.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
evykassirer 782fe316ca buddy_list: Support unread marker for avatar mode. 2024-11-05 15:10:29 -08:00
Aman Agrawal ca20a4df38 narrow_active: Remove broken tests.
These tests have been broken since long ago, we don't see any
errors since they are wrapped in `Sentry`. Also, We have a great
puppeteer test suite for the verification of loading current narrow.
2024-11-05 12:25:28 -08:00
Aman Agrawal e6113b0dd4 message_events: Discard message list that cannot be live updated.
Since we cannot cheaply live update `is-followed` narrow, we
discard any message list or data with that narrow if we
received a message event that changes topic visibility
from or to `FOLLOWED`.
2024-11-05 12:25:28 -08:00
Aman Agrawal 517fabd123 message_events: Extract function to check if filter has term type.
Not added to `Filter` library since this function is a bit
localized to message_events us case in the sense that it
checks for existence of `not-` prefix of the term type too.
2024-11-05 12:25:28 -08:00
Aman Agrawal 662f364283 fetch_status: Add function to copy current status of msg list data.
This will be used to copy over status of superset data to the
newly populated message list data.
2024-11-05 12:25:28 -08:00
Aman Agrawal 1f11650275 filter: Fix search narrow not live updated on topic move.
Since stream / topic change involves change in topic name, it could
involve new messages being included and some being discarded. Also,
messages could have been moved from an inaccessible stream to now
accessible stream for the user.
2024-11-05 12:25:28 -08:00
Aman Agrawal 06a50eaa78 echo: Update cached message data for locally echoed messages.
Since we only pass non echo messages to
message_events.insert_new_messages, where message lists get
updated, it is important to update locally echoed messages here.
2024-11-05 12:25:28 -08:00
Karl Stolley 96b62a5372 left_sidebar: Correct unread alignment in condensed popover. 2024-11-05 12:20:23 -08:00
Karl Stolley 331004f025 popovers: Add em conversion and missing annotation. 2024-11-05 12:20:23 -08:00
Karl Stolley bcaea0a6af left_sidebar: Better align low-attention unreads in nav area. 2024-11-05 12:20:23 -08:00
Karl Stolley 1984333454 left_sidebar: Scope line-height adjustment to low-res screens. 2024-11-05 12:20:23 -08:00
Sahil Batra c7ede831aa stream_settings: Update channel creation permission text.
This commit updates text shown in the right panel when
user does not have permission to create streams.
2024-11-05 11:14:02 -08:00
Sahil Batra 067e5a46c3 settings: Show stream and group info in a banner at the top.
Instead of having information about streams and groups below the
create button, we show that in a banner at the top irrespective
of whether user has permission to create them or not.

Fixes part of #32212.
2024-11-05 11:14:02 -08:00
Sahil Batra 9a50fae25a group-settings: Update right pannel for user without creation permission.
This commit updates the right panel for groups to be same as we
have it for stream settings when the user does not have permission
to create groups.

Fixes part of #32212.
2024-11-05 11:14:02 -08:00
Sahil Batra 9b6cb5b9dc group-settings: Rename "Who can manage this group" setting label.
This makes the naming consistent with the realm setting for
managing all groups.
2024-11-05 11:14:02 -08:00
Sahil Batra d63ae11551 settings: Make separate section for organization group settings.
Fixes #32214.
2024-11-05 11:14:02 -08:00
evykassirer 2b636e64ec buddy_list: Make avatar display option only visible in dev. 2024-11-05 10:48:15 -08:00
evykassirer 99856327f0 buddy_list: Clicking avatar opens menu instead of using ... icon. 2024-11-05 10:48:15 -08:00
evykassirer ce7c3705f7 buddy_list: Don't go to DM narrow on avatar click.
This commit also moves styles from user-presence-link
onto selectable_sidebar_block, since the link is no
longer wrapping the whole block contents.

The `data-name` was also moved to the top level `<li>`
because it's used in pupeteer tests.
2024-11-05 10:48:15 -08:00
evykassirer 08e7c5feea buddy_list: Refactor click handlers to not rely on placement of user-presence-link. 2024-11-05 10:48:15 -08:00
evykassirer 94368dcf2b buddy_list: Add option to view avatar in buddy list.
Fixes #19999.

This change adds an option to show users' avatar and
status in the buddy list. Previous options are still
available in the settings menu.
2024-11-05 10:48:15 -08:00
evykassirer 774f230074 people: Cache gravatar url on person object. 2024-11-05 10:48:15 -08:00
evykassirer c39ae45d95 user_circles: Use background color instead of transparency.
This sets us up to layer the status bubbles over avatars.
2024-11-05 10:48:15 -08:00
Sayam Samal 62b24c6d92 user_card_popover: Fix unknown user_id in unsaved message user mentions.
Previously, the event handler was targeting the `event.target` element
instead of the `event.currentTarget` element. Due to event bubbling,
this lead to incorrect element being used to extract the `data-user-id`,
resulting in an error whenever a user mention was clicked in the
unsaved message in the message box or the drafts view.
2024-11-05 09:41:07 -08:00
Lauryn Menard 10f03fce11 demo-orgs: Specify email input when rendering add email modal.
There are two inputs for the add email modal in demo organizations,
one to add the email address of the owner and one to update their
full name. We want the email input to be selected when the modal
is opened.
2024-11-05 08:57:35 -08:00
Lauryn Menard 1dc7ad13a9 invite-modal: Move "invite_as" name attribute to select element. 2024-11-05 08:49:28 -08:00
Lauryn Menard 15f010d6c9 invite-modal: Update custom time input element.
Adds "custom-expiration-time-input" name to input element and orders
attributes in template for readability.
2024-11-05 08:49:28 -08:00
Lauryn Menard 62b365cb31 invite-modal: Add name attribute to custom time unit select element.
Reorders the select element attributes to be more readable.
2024-11-05 08:49:28 -08:00
Lauryn Menard 8d79adceed invite-modal: Remove unused "custom_time_choice" name and class.
In HTML, option elements do not use/have the "name" attribute, so
the custom time choice select options do not need it to be set.

The "custom_time_choice" class is not referenced anywhere else in
the codebase, so it can be removed to make this template more
readable.
2024-11-05 08:49:28 -08:00
Lauryn Menard 8c900ff0fb invite-modal: Move "expires_in" name attribute to select element.
The "name" attribute should be on the select element and not on
the nested option elements.
2024-11-05 08:49:28 -08:00
Lauryn Menard 3d5c72f762 invite-modal: Remove "expires_in" for attribute for custom time input.
The "for" attribute on this label meant that clicking the label moved
the focus to the select element above the custom time input element.
2024-11-05 08:49:28 -08:00
Karl Stolley 2e1ab1c470 unread_counters: Adjust hover styles for inbox, recent views. 2024-11-04 15:31:12 -08:00
Karl Stolley ee63e836f8 marker_icons: Reduce opacity to spec on follow, mention icons. 2024-11-04 15:31:12 -08:00
Karl Stolley 16b8c7562a compose: Update colors for draft popover. 2024-11-04 15:31:12 -08:00
Karl Stolley 62b17217f5 unread_counters: Place new colors and set prominent value as default. 2024-11-04 15:31:12 -08:00
Karl Stolley b44af63d47 left_sidebar: Update DM partners icon color. 2024-11-04 15:31:12 -08:00
Karl Stolley ccad062f3c left_sidebar: Disallow selection of unread counts. 2024-11-04 15:31:12 -08:00
sanchi-t c73985da17 icon: Replace trash icon with archive icon.
Updated the existing trash icon used for the archive
action with a proper archive icon to improve clarity
and match its intended purpose.
2024-11-04 13:48:52 -08:00
Kislay Udbhav Verma 5a24dad5f8 copy_and_paste: Transform message links to pretty syntax.
Similar to #29302, we transform zulip message links to
a pretty syntax and in case there are some problematic
characters (#30071), we generate a fallback markdown link.

Fixes #31920
2024-11-04 13:44:40 -08:00
Kislay Udbhav Verma fad7a3f4b4 topic_link_util: Make stream topic link syntax consistent.
We pad the `>` with spaces in the generated fallback link to make
it consistent with other places where the syntax is used.

Fixes part of #31920
2024-11-04 13:44:40 -08:00
Sayam Samal efa5b3cce1 stream_popover: Handle no messages condition for a topic being moved.
Previously, when there were no messages in the topic being moved, the
banner in the move topic modal only showed a "Failed" error banner which
did not convey the actual error to the user. Also, a server call was
being made even when there were no messages in the topic being moved.

This commit explicitly handles the non-existent topic, prevents a call
to the server when the message_id is undefined, and displays a more
informative error banner to the user.
2024-11-04 13:25:10 -08:00
evykassirer d556c0e0a5 buddy_list: Move user link a bit left to line up with empty message.
More context here:
https://chat.zulip.org/#narrow/channel/101-design/topic/userlist.20avatar.20slow.20load/near/1974268
2024-11-01 17:04:53 -07:00
Tim Abbott 54b8a9233b groups: Clarify meaning of global admin setting.
The previous wording was ambiguous as to whether this permission means
the ability to administer all groups in the organization.
2024-11-01 17:03:32 -07:00
whilstsomebody ec43a66f26 update_ui: Standardize pencil icon color for todo and poll.
Ensure consistent pencil icon color for both todo and poll
features in hover and non-hover states across light and dark
themes.

Fixes #30339.
2024-11-01 16:45:17 -07:00
opmkumar b149d5fb70 refactor: Update on-change event to use custom-expiration-time-input.
Replaces custom-invite-expiration-time with custom-expiration-time-input
and custom-expiration-time-unit in the on-change event.
2024-11-01 16:41:58 -07:00
afeefuddin ea80791b96 demo_organizations_ui: Convert module to TypeScript. 2024-11-01 16:38:59 -07:00
Karl Stolley 0f30c93a2f left_sidebar: Solidify grid placement of filter-clearing button. 2024-11-01 15:30:35 -07:00
Maneesh Shukla 158cb6c747 settings: Extract common logic for hide_spinners.
Move the redundant code for hiding spinners and re-enabling buttons into
a common `hide_spinner` function inside `loading.ts`. This reduces
duplication between `hide_button_spinner` and `hide_dialog_spinner`.

Fixes #26691.
2024-11-01 12:10:28 -07:00
Maneesh Shukla 666e7bf433 settings: Extract common logic for show_spinner.
Consolidate the repeated logic for showing spinners into a shared
`show_spinner` function in `loading.ts`. This eliminates code
duplication between `show_button_spinner` and `show_dialog_spinner`,
streamlining spinner initialization and button disabling.

Fixes part of #26691.
2024-11-01 12:10:28 -07:00
Maneesh Shukla 9ad85445f8 settings: Add a class to the target span.
This commit adds a specific class to the target span element, making
 the code more robust and less reliant on generic selectors.

Fixes part of #26691.
2024-11-01 12:10:28 -07:00
opmkumar d6aae75f04 invites: Use shared helper function for setting expiration text.
Moves and renames `set_expires_on_text` to settings_components.ts,
so that it can be used in other modals with user set time inputs
that show a formatted string of that time input.

Updates invite_user_modal.hbs for the class names used in the new
shared helper function.

Co-authored-by: Ujjawal Modi <umodi2003@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-11-01 09:55:05 -07:00
opmkumar ea252f0769 invites: Refactor `valid_to` function.
Refactors the `valid_to` function to return the correct formatted
string for all cases (custom and preset) of invitation expiration
input values.

Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-11-01 09:55:05 -07:00
opmkumar 789a47fb6b invites: Use shared custom time helper function.
Moves `set_custom_time_inputs_visibility` function to
settings_components.ts so that it can be reused in
other modals with user set custom time inputs.

Updates user_invite_modal.hbs to use the class name
in the new shared helper function.

Co-authored-by: Ujjawal Modi <umodi2003@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-11-01 09:55:05 -07:00
opmkumar 523dc7e2be invite-user-modal: Add general class names for improved extensibility.
Adds general class names in invite_user_modal.hbs for custom time
the input and unit so that these elements more easily be extended
for use in other modals with a user specified custom time.

Updates the listener in invite.ts that was using the removed
"custom-expiration-time" class to instead use the id for the
input and unit div, "custom-invite-expiration-time".

Corresponding updates have been made to the relevant CSS files to
ensure consistent styling and future scalability.

Co-authored-by: Ujjawal Modi <umodi2003@gmail.com>
Co-authored-by: Lauryn Menard <lauryn@zulip.com>
2024-11-01 09:55:05 -07:00
Lauryn Menard bc0f9c4876 keyboard-shortcuts: Display "Ctrl" for Vim "Esc" keybinding behavior.
For all users, we want to display "Ctrl" for the "Ctrl" "[" keyboard
shortcuts that match the "Esc" Vim keybinding behavior.

We use the "data-mac-key" attribute to override the default mapping
of "Ctrl" to "Cmd" for Mac users in the documentation of these
keyboard shortcuts.

Fixes #20107.
2024-11-01 09:36:56 -07:00
Lauryn Menard 40524e6dfa util: Make get_custom_time_in_minutes throw error for unknown unit.
Still returns the time value from the input so that the app doesn't
break.
2024-11-01 09:35:15 -07:00
Lauryn Menard cadc8f4d46 portico: Use CSS class for styling of find accounts tip text. 2024-11-01 09:34:26 -07:00
Lauryn Menard 7e0ef8429c portico: Remove unused CSS rules for h3 elements.
The h3 elements were removed from these templates in
commit 58d00af6c3.
2024-11-01 09:34:26 -07:00
evykassirer ebe15dcf25 buddy_data: Don't filter out inactive participants.
This was filtering out users that were marked as
inactive for more than a year, but we want to show
all participants, including inactive ones.

More discussion on this here:
https://chat.zulip.org/#narrow/channel/9-issues/topic/In.20this.20conversation.20and.20invisible.20mode/near/197309
2024-10-31 23:23:56 -07:00
evykassirer b7b2930760 buddy_list: Redesign top of right sidebar.
Fixes #31974.
2024-10-31 16:29:49 -07:00
evykassirer 68c06c0f47 buddy_list: Remove unnecesssary right padding from header.
It isn't needed because the scrollbar doesn't go that high.
2024-10-31 16:29:49 -07:00
evykassirer 205b20e7df buddy_list: Rename 'Search people' to 'Filter users' for consistancy.
This is part of #31974.
2024-10-31 16:29:49 -07:00
Karl Stolley ea26be590f left_sidebar: Open up grid for topic filter box. 2024-10-31 11:01:30 -07:00
Aditya Kumar Kasaudhan d1ff871523 webhooks: Support filtering GitHub activity from private repositories.
Currently, the GitHub webhook sends activity from both public and private
repositories, which could lead to unintended disclosure of sensitive
information from private repositories.

This commit introduces a ignore_private_repositories parameter to the
webhook URL. When set to true, the webhook ignore processing activity from
private repositories, ensuring that such activities are not posted to
Zulip streams. By default, if the parameter is omitted or set to false,
activities from both public and private repositories are processed
normally. This provides users with the flexibility to control the
visibility of private repository activities without altering the default
behavior.

More importantly, this introduces a cleaner mechanism for individual
incoming webhooks to declare support for settings not common to all
webhook integrations.

Fixes #31638.
2024-10-31 10:40:28 -07:00
Sahil Batra 50674a7a28 user_groups: Do not enable "Add" button if input is empty.
This makes sure that the "Add" button in members panel is
not enabled if the pill input is empty, in two cases - when
the members panel is opened and also when the members panel
is live-updated due to change in permission.
2024-10-31 09:53:14 -07:00
Sahil Batra aed8ac9672 settings: Fix disabled look for group settings pills UI.
We now have a grey-ish background color for the pill container
with opacity also reduced like we do for the disabled select
elements in settings.

Needed to adjust the selectors so that the CSS for disabled
state correctly overrides the CSS for enabled state.
2024-10-31 09:53:14 -07:00
Sahil Batra 9a6ef9db93 user_group_popover: Show members count if there are empty subgroups.
We show "0 members" text when a group has no direct members but
has subgroups which are all empty.

The behavior for when a group has neither direct members nor
subgroups is same where we show "This group has no members".
2024-10-31 09:53:14 -07:00
Sahil Batra 4a89fffd8a group-settings: Link to help center section for group permissions.
Fixes #25938.
2024-10-31 09:53:14 -07:00
Sahil Batra 9b0e26e954 settings: Refactor code for handling group settings UI.
This commit updates code to just use permission settings
list from server_supported_permission_settings data
instead of calling create_realm_group_setting_widget
individually for each setting.

Also, updated the code to create dropdown widgets to check
if only system groups are allowed or not for a setting
instead of using a hardcoded list.
2024-10-30 12:03:36 -07:00
Sahil Batra 8e0a8dfa32 settings: Use new pills UI for message delete permissions. 2024-10-30 12:03:36 -07:00
Sahil Batra b8bc20e87c settings: Use new pills UI for move message permission settings. 2024-10-30 12:03:36 -07:00
Sahil Batra d9f4c473fb settings: Do not disable time limit settings.
Previously we disabled time limit settings for moving
messages when non-admin and non-moderators users were
not allowed move messages as the time limit does not
apply to admins and moderators. And the time limit
setting to delete messages was disabled when all the
users who were allowed to delete their own message also
had permission to delete any message since time limit
does not apply to users who were allowed to delete any
message.

Now, as we use the new UI and allow the permission
settings to be set to anonymous groups, we just do
not disable the time limit setting to avoid complexity
and we anyways mention about cases when time limit is
not applicable.
2024-10-30 12:03:36 -07:00
Sahil Batra fb1c7fffa2 settings: Use new UI for can_add_custom_emoji_group setting. 2024-10-30 12:03:36 -07:00
Sahil Batra dce229ba17 settings: Use new pills UI for DM permission settings.
We now use pills UI for direct_message_initiator_group
and direct_message_permission_group setting.
2024-10-30 12:03:36 -07:00
Sahil Batra 5fbc46f82c settings: Fix banner shown on custom emoji panel.
Previously the banner was always shown to admins and to users who
cannot add emoji with the banner mentioning who can add emoji.

This commit updates the code to only show the banners who cannot
add emoji irrespective of their role, and just mention that they
do not have permission without any detail about who can add.
2024-10-30 12:03:36 -07:00
Sahil Batra 891e58bb1a settings: Fix live-update of setting elements.
Some of the group setting elements were not live-updated
correctly since they were not present in realm_settings
dict and sync_realm_settings is only called for settings
present in that dict.
2024-10-30 12:03:36 -07:00
Sahil Batra 072da3b0d3 settings: Extract template file for group setting pill UI.
This helps in writing same code again and again for different
settings.

Can also update group settings to use this template in further
commits.
2024-10-30 12:03:36 -07:00
Sahil Batra a7e6d5d770 settings: Remove unused fields passed to settings template.
There is no need to pass the value of group settings to
template as rendering the UI is handled in JS. This was
probably added due to the old enum value setting being
passed to the template.
2024-10-30 12:03:36 -07:00
Karl Stolley 0cab8df681 compose: Extend 4px border-radius to topic box.
All similar elements in the compose box--the channel/DM widget, the
pill container on DMs, and the compose textarea--all use a 4px
border-radius, correcting the topic box's outlier status.
2024-10-30 11:23:22 -07:00
Karl Stolley 17561d09a1 compose: Give tab-focused widget wrapper sensible border. 2024-10-30 11:23:22 -07:00
Karl Stolley 9231c97454 compose: Bring colors into variablized concord. 2024-10-30 11:23:22 -07:00
Aman Agrawal 3fe1e554a6 echo: Fix send messages not visible when auto narrowed to recipient.
We simply forgot to `add_to_narrow` locally echoed messages if
the current narrow changed before we received confirmation from
server.
2024-10-30 10:03:30 -07:00
Vector73 ed5638ec3c settings: Add `can_move_messages_between_topics_group` realm setting.
Added `can_move_messages_between_topics_group` realm setting to replace
`edit_topic_policy`.
2024-10-29 16:27:04 -07:00
evykassirer 1edf507be9 buddy_list: Show all sections (uncollapse) when searching. 2024-10-29 16:06:41 -07:00
evykassirer b826143537 buddy_list: Fix bug where header didn't show correct participant count. 2024-10-29 16:06:41 -07:00
evykassirer 3db32f1416 buddy_list: Rename all_participant_ids.
This helps avoid confusion with `participant_user_ids`
which is a property of the buddy list and describes
the currently visible participants, whereas
`all_participant_ids` describes all participants,
even those hidden due to search.
2024-10-29 16:06:41 -07:00
evykassirer 2b168a9936 buddy_list: Show empty placeholder for participants section in search.
This was overlooked when we added this section because it usually
can't have an empty placeholder, but it actually still can in search.
2024-10-29 16:06:41 -07:00
evykassirer f157bfe181 buddy_list: Simplify logic to update empty list placeholders.
Because we regularly change what we want the placeholder
text to be, as the user enters and exits search, it's simpler
to just not use `data-search-results-empty` and set up the
placeholder from the buddy list code directly. Previously we
were trying to sometimes use `data-search-results-empty` and
sometimes set it directly, which is more confusing and complex.
2024-10-29 16:06:41 -07:00
evykassirer d0dc33d8da buddy_list: Move fill_screen call to the end of populate().
Sometimes we might want to re-fill the screen after collapsing
or uncollapsing a section, so it's better to fill the screen
just once after determining if we should collapse the "other
users" section. Also, this commit removes a call to
`render_section_headers()` because that's always called at the
end of `fill_screen_with_content()`.
2024-10-29 16:06:41 -07:00
evykassirer b335c19d1c buddy_list: Refactor section collapse logic to be shared. 2024-10-29 16:06:41 -07:00
evykassirer ec1b265ff8 buddy_list: Refactor section toggle to not need custom classname. 2024-10-29 16:06:41 -07:00
Sahil Batra f29083f2ef settings: Disable save button if nobody group is not allowed.
This commit adds code to disable the save button if there no
pills selected for the setting and the setting cannot be set
to "Nobody" group.
2024-10-29 15:06:16 -07:00
Sahil Batra 8fa225d885 settings: Use new pills UI for group related realm settings.
This commit updates the code to use new UI for can_create_groups
and can_manage_all_groups settings.
2024-10-29 15:06:16 -07:00
Sahil Batra c8e906d49e settings: Use pills UI for channel creation settings.
We now use new pills UI for public and private channel
creation settings. The UI for web-public channel
creation setting is still a dropdown as we allow only
system groups for that.
2024-10-29 15:06:16 -07:00
Sahil Batra 60b12367cc settings: Use new settings UI for create_multiuse_invite_group. 2024-10-29 15:06:16 -07:00
Sahil Batra d370499557 settings: Refactor create_group_setting_widget.
This commit updates create_group_setting_widget code
to not accept setting type as a a parameter as we
would use separate function for realm settings.
2024-10-29 15:06:16 -07:00
evykassirer 35424adcc3 settings_account: Convert module to typescript. 2024-10-29 14:50:25 -07:00
evykassirer 8eb0ca3a7c settings_account: Move async call into ui_init. 2024-10-29 14:50:25 -07:00
evykassirer 7431d87d0c settings_account: Fix type for failure_msg_html (undefined). 2024-10-29 14:50:25 -07:00
evykassirer a6850410a8 settings_account: Use `this` instead of event target.
The first two are equivalent because they call `closest`
and the last one is directly equivalent. We're making these
changes to aid with the conversion to typescript.
2024-10-29 14:50:25 -07:00
evykassirer adf3280f1e settings_acount: Standardize type passed to update custom fields. 2024-10-29 14:50:25 -07:00
Sahil Batra caf919fca2 user_groups: Don't allow adding deactivated groups as subgroups in UI.
We already have the code to ignore the deactivated groups before
sending the request and show appropriate message. This commit
just adds code to not show them in the typeahead and also not
create its pill if user types the full group name.
2024-10-29 11:02:03 -07:00
Sahil Batra 69c0a772cc user_groups: Do not allow manually entering pills of invalid subgroups.
Even though we do not show groups that cannot be used as subgroups
in typeahead, user can still type the complete to get the pill
and make the request to the server which currently returns not so
good error message. This commit fixes it to not create the pill for
such cases and hence not making any request to server.
2024-10-29 11:02:03 -07:00
Sahil Batra 98ed8d8f49 add_subscribers_pill: Extract function for enabling/disabling the button.
This function will be used to handle the add button in group members
UI as well.
2024-10-29 11:02:03 -07:00
Sahil Batra 98255677d7 user_groups: Extract function to check if group can be used as subgroup.
We would use the same function in further commit to not add pills
for invalid subgroups by typing the full group name.
2024-10-29 11:02:03 -07:00
Aman Agrawal 5cdd17a7f1 unread_ops: Fix channel narrow not marked unread.
Mark as unread from here was not working in a channel feed when
we don't have all the messages fetched locally since the
channel ID was incorrectly passed as a string.

Copied the correction code from bulk_update_read_flags_for_narrow.
2024-10-29 10:48:48 -07:00
Aman Agrawal 4e00fb1d67 unread_ops: Remove unused parameters. 2024-10-29 10:48:48 -07:00
Karl Stolley eb31fdbe3c buttons: Shore up styles on a.button instances. 2024-10-29 10:41:32 -07:00
Karl Stolley aaaa52c5c0 buttons: Ensure active buttons take .button:active background color. 2024-10-29 10:41:32 -07:00
Alya Abbott de5a9d13c1 channel settings: Remove extraneous channel name from modal. 2024-10-27 22:03:30 -07:00
Aman Agrawal 1de1570a0c narrow_state: Extract cannot compute response. 2024-10-25 16:33:00 -07:00
sanchi-t 1577d45575 compose_validate: Show error banner for archived streams. 2024-10-25 16:06:43 -07:00
Sanchit Sharma 795b2ba14e do_deactivate_stream: Remove unnecessary mutations.
Streams should not be marked as private, and subscribers
of the deactivated stream should not be removed.

Update the confirmation message when archiving a stream.
2024-10-25 16:06:42 -07:00
sanchi-t f04fb937a3 narrow: Remove blueslip error code line.
When clicking on a message from an archived
stream, the `adjusted_terms` may be null since
archived streams are not sent back to the client.
This results in an error for the user.
2024-10-25 16:06:42 -07:00
sanchi-t e60711f871 stream_create: Add functionality to rename archived streams.
Users with appropriate permissions will now have the option
to rename archived streams.
2024-10-25 16:06:42 -07:00
sanchi-t 5dfa8ac9fe popover_menus_data: Hide actions user can't take for archived channels. 2024-10-25 16:06:42 -07:00
sanchi-t e8bb9e2de1 get_invite_stream_data: Do not display archived channels.
User should not be able to sent invite for archived channels.
2024-10-25 16:06:42 -07:00
sanchi-t dbc90ba2e5 stream_list: Prevent archived channels to show up in left sidebar. 2024-10-25 16:06:42 -07:00