Commit Graph

6493 Commits

Author SHA1 Message Date
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