Commit Graph

6100 Commits

Author SHA1 Message Date
Shubham Padia b7764eb6f0 settings: Remove user_group_edit_policy from the frontend. 2024-10-01 17:35:14 -07:00
Shubham Padia f0b9d610a5 settings: Use `can_manage_all_groups` to control who can manage groups.
We also add the exception for the group creator to be able to edit their
group in this commit. This exception was added in the backend in earlier
commits.
2024-10-01 17:35:14 -07:00
Shubham Padia 2b6414acfb settings: Add can_manage_all_groups setting to realm.
This commit does not add the logic of using this setting to actually
check the permission on the backend. That will be done in a later
commit.
Only owners can modify this setting, but we will add that logic in a
later commit in order to keep changes in this commit minimal.
Adding the setting breaks the frontend, since the frontend tries to find
a dropdown widget for the setting automatically. To avoid this, we've
added a small temporary if statement to `settings_org.js`.
Although, most lists where we insert this setting follow an unofficial
alphabetical order, `can_manage_all_groups` has been bunched together
with `can_create_groups` since keeping those similar settings together
would be nicer when checking any code related to creating/managing a
user group.
2024-10-01 17:35:14 -07:00
Shubham Padia a9e14a184c settings: Use `can_create_groups` to control who can create user groups. 2024-10-01 17:35:14 -07:00
Shubham Padia 17276e95a1 dropdown_widget: Allow passing is_setting_disabled in the template.
This is a preparatory commit to allow disabling
dropdown_widget_with_label for `can_create_groups` and
`can_manage_all_groups` for non-owners.
2024-10-01 17:35:14 -07:00
Shubham Padia fc46673f23 settings: Add can_create_groups setting to realm.
This commit does not add the logic of using this setting to actually
check the permission on the backend. That will be done in a later
commit.

Adding the setting breaks the frontend, since the frontend tries to find
a dropdown widget for the setting automatically. To avoid this, we've
added a small temporary if statement to `settings_org.js`.
2024-10-01 17:35:14 -07:00
Vector73 66113365a5 saved_snippets: Add new feature for saved snippets.
Fixes #31227.
2024-10-01 11:48:15 -07:00
Lauryn Menard 8301dcd421 compose-recipients: Resize compose box text area for placeholder.
When adding or removing recipients for a direct message, the
placeholder text may cause a change in the size of the compose box,
so this adds a call to `compose_ui.autosize_textarea` when setting
that placeholder attribute.
2024-10-01 10:29:16 -07:00
Tim Abbott 2f8e2f77aa user_group_edit: Fix use of stream in user-facing string. 2024-10-01 10:25:59 -07:00
sanchi-t 84f9765b18 css: Remove non-existent class selctor. 2024-10-01 10:24:16 -07:00
sanchi-t 0f506eaf91 css: Refactor theme colors for `kbd`.
This change moves the light and dark theme colors for `kbd` to
CSS variables.
2024-10-01 10:24:16 -07:00
Sahil Batra f97da983cf user_groups: Handle inaccessible streams in group deactivation error.
If the user group being deactivated is used as a setting for a stream
which cannot be accessed by the user trying to deactivate the group,
we show "Unknown stream" in the banner mentioning where the group
is used.
2024-10-01 09:45:37 -07:00
Sahil Batra 58ab97a0b4 user_groups: Show details for group deactivation error.
This commit adds code to list the groups and streams
where the group is being used as settings in a banner.

The banner also mentions if the group is being used for
realm settings.
2024-10-01 09:45:37 -07:00
sanchi-t 19ba94b946 css: Refactor theme colors for `app_components`.
This change moves the light and dark theme colors for
`app_components` to CSS variables.
2024-10-01 09:41:22 -07:00
sanchi-t a8e809e63f css: Refactor theme colors for `.table-striped`.
This change moves the light and dark theme colors for
`.table-striped` to CSS variables.
2024-10-01 09:40:47 -07:00
sanchi-t 72971cda8e css: Refactor theme colors for `.demo-organization-warning`.
This change moves the light and dark theme colors for
`.demo-organization-warning` to CSS variables.
2024-10-01 09:40:47 -07:00
evykassirer 9ba6c18e3a reload: Only add stream_id if it's defined.
This isn't a bug fix, but it does clean up the code. `reload_setup`
only uses the `stream_id` if it can parse it as an integer and
otherwise falls back to `undefined`, so it makes more sense to not
include undefined stream ids.
2024-09-30 17:48:17 -07:00
Shubham Padia 7a0a71b7d1 message_edit: Use display: grid instead of relative positioning.
Fixes #31750.
The control buttons of the edit box were flickering b/w default cursor
and pointer cursor after c1d155d923.
The addition of `position: relative` to `.edit-content-container` was
causing that. We've now added a div to apply position:relative to, this
div does not have any edit controls in it's children.
2024-09-30 17:40:37 -07:00
evykassirer 261f01ede8 input_pill: Highlight previous pill after backspace deletion.
This is helpful for when a user wants to delete multiple pills
in a row, now that a pill needs to be highlighted before it can
be deleted.

It makes more sense intuitively for the previous pill to be selected
after backspace, since the direction of deletion is backwards. We
still potentially focus next() if there is no previous pill, which
is most helpful when the input element has no more pills left, since
this focuses the text field.
2024-09-30 16:37:12 -07:00
evykassirer 6e85fa8fcc input_pill: Highlight/focus pill before removing it.
Select the pill on the first backspace and delete the whole pill on
the second backspace. If the pill is already highlighted from
left-pressing, then backspace would delete it right away.

We're making this change because it can be quite annoying to
re-type out a pill that's accidentally deleted, and users might
think pills are editable and accidentally delete the whole thing
with a backspace stroke.
2024-09-30 16:37:12 -07:00
evykassirer f5be62f60d buddy_list: Include offline users in participants list for large orgs. 2024-09-30 16:35:13 -07:00
evykassirer 38e5b4b8fc buddy_list: Show conversation participants in the right sidebar.
Fixes #31129.
2024-09-30 16:35:13 -07:00
evykassirer 12033d6690 message_view_header: Add blueslip logging for undefined sub.
To try to figure out why this is happening:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20Failed.20to.20process.20an.20event
2024-09-30 16:32:03 -07:00
Anders Kaseorg 2440c6d244 electron_bridge: Harden against hypothetical DOM clobbering attacks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-30 16:31:27 -07:00
Anders Kaseorg b0653d1ea4 uploaded_files_list: Fix id pollution.
The HTML id attribute is supposed to be globally unique; it’s not an
appropriate place to store a user-controlled string, or to identify
part of a component that’s rendered more than once.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-30 14:15:31 -07:00
Karl Stolley 762617e23f left_sidebar: Add hover styles for action headings. 2024-09-30 13:38:33 -07:00
Karl Stolley 04f6082dfb left_sidebar: Add color for collapsed nav item hover. 2024-09-30 13:38:33 -07:00
Karl Stolley f73e39c63d sidebars: Restyle vdots icon colors and hover states. 2024-09-30 13:38:33 -07:00
Karl Stolley 872a1e64a6 left_sidebar: Add hover effects for section headings. 2024-09-30 13:38:33 -07:00
Karl Stolley 8c54c1df3e sidebars: Add active and hover sidebar-row styles. 2024-09-30 13:38:33 -07:00
Karl Stolley 1d4f282cbd sidebars: Present neutral and active sidebar-row states. 2024-09-30 13:38:33 -07:00
evykassirer 471d042a11 message_notifications: Convert module to typescript. 2024-09-30 12:07:27 -07:00
evykassirer 6c390551de unread: Remove useless message_unread function. 2024-09-30 12:07:27 -07:00
evykassirer 4215c9d707 message_notifications: Check if NotificationAPI is undefined.
`window.Notification` can be `undefined` in iOS Safari.
https://bugs.webkit.org/show_bug.cgi?id=247315

This hasn't caused any known bugs, but it's better to catch
this case with an undefined check than to assert it's defined
when we convert this file to typescript.
2024-09-30 12:07:27 -07:00
Lauryn Menard 9f3553815e help: Link to dedicated articles vs getting org started guide.
As the guide to getting an organization started is being replaced
by the moving to zulip guide, replace links to subsections of the
old guide to instead go to dedicated articles about those topics.
2024-09-30 11:58:31 -07:00
Lauryn Menard d8fd0d8599 scheduled-messages-ui: Set channel ID in narrow term to a string. 2024-09-30 11:25:02 -07:00
Aman Agrawal e5a0157f84 messages_ovelay: Use specific name for `row_item_selector`. 2024-09-30 11:23:29 -07:00
Aman Agrawal e646b3b7b6 messages_overlay: Force specific name for `message-info-box` selector. 2024-09-30 11:23:29 -07:00
Aman Agrawal d2561b778a scheduled_message: Use specific name for `message-info-box` selector. 2024-09-30 11:23:29 -07:00
Aman Agrawal 4a72801091 scheduled_messages: Use specific name for `items_list_selector`. 2024-09-30 11:23:29 -07:00
Aman Agrawal 3f1b78aab9 scheduled_messages: Use specific name for `items_container_selector`.
This avoids selecting an element from hidden other elements having
the same class.
2024-09-30 11:23:29 -07:00
Karl Stolley a8217aee36 lightbox: Treat $original_media_element as singular. 2024-09-30 11:12:40 -07:00
Karl Stolley cad8330988 lightbox: Make selected-media logic less brittle. 2024-09-30 11:12:40 -07:00
evykassirer cd9dc3959a reload: Handle stream messages without specified stream.
The stream id can be undefined when the compose box is open
to start a stream message, but no stream has been selected
from the dropdown yet.

Fixes this error:
https://chat.zulip.org/#narrow/stream/464-kandra-js-errors/topic/Error.3A.20Failed.20to.20preserve.20state/near/1948680

Introduced in 97ffccb45f
2024-09-29 12:21:20 -07:00
Tim Abbott c73462f124 stream_settings: Fix already-subscribed error handling.
This was not correctly migrated in 65893292b5.
2024-09-27 16:51:07 -07:00
sanchi-t 82fd3c9b32 css: Refactor theme colors for `alerts`.
This change moves the light and dark theme colors for
`alerts` to CSS variables.
2024-09-27 13:27:58 -07:00
Aman Agrawal b6c37a3474 register: Ask which review site for how found zulip. 2024-09-27 13:23:08 -07:00
Karl Stolley 112d7b60fe lightbox: Correctly center lightbox thumbnails. 2024-09-27 13:22:05 -07:00
Karl Stolley b8037a9980 lightbox: Remove any video players when navigating thumbnails. 2024-09-27 13:22:05 -07:00
Karl Stolley c36c561f07 lightbox: Only open the first returned media element. 2024-09-27 13:22:05 -07:00
Karl Stolley cc877f9c83 lightbox: Use temporary class to track selected media. 2024-09-27 13:22:05 -07:00
Karl Stolley 2e26c3bb9d lightbox: Show first media element on hotkey activation. 2024-09-27 13:22:05 -07:00
Benjamin Masters 6180725579
modals: Fix typo in introduce_zulip_view_model. 2024-09-27 17:56:44 +00:00
Aman Agrawal 790d5c44a1 stripe: Allow customer to switch license management type.
Fixes #28633

Added a button to switch license management type on billing page.

Tested that the plan switch works correctly.

Tested that when switching from manual to automatic license
management, customer is only billed for billable users for the
next billing cycle.
2024-09-26 16:13:28 -07:00
Anders Kaseorg b7e02436b8 eslint: Avoid @typescript-eslint/no-deprecated for jQuery ‘on’.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-26 13:27:26 -07:00
Anders Kaseorg 2dce73ecfa bot_data: Avoid deprecated ZodObject.deepPartial().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-26 13:16:12 -07:00
AJ Kerrigan 697c79a6cc
docs: Advertise Inbox and Recent view navigation shortcuts.
Add to the help center and in-app shortcuts overlay, near the existing
"Go to combined feed" shortcut, documentation for the similar inbox/recent view
navigation shortcuts.
2024-09-26 13:13:35 -07:00
Sahil Batra 6ddaaa4ef9 signup: Show realm name in a tooltip on signup page.
This is needed to make sure that user can see the realm
name in case it does not fits into the UI and is shown
with ellipsis.

Fixes #31676.
2024-09-26 11:58:31 -07:00
Aman Agrawal 6e4895b05f landing-page: Update streams_and_topics_day images.
Removed the night images since they were not being used and these
new day mode images are designed to look not too bright in the
dark mode screens too.
2024-09-26 09:27:01 -07:00
Anders Kaseorg fb623f4450 eslint: Fix @typescript-eslint/no-duplicate-type-constituents.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-25 15:43:37 -07:00
Anders Kaseorg e63365a4da katex_server: Fix import/no-named-as-default.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-25 15:41:01 -07:00
Anders Kaseorg 890f9e67f4 settings_linkifiers: Fix zod import.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-25 15:40:04 -07:00
tnmkr a435b7687a custom_profile_fields: Update label for non-editable field toggle.
The rewording clarifies that this setting allows users to change only
the value of the field for their own account.

This is a follow-up to #29570 which implented the setting through a
series of 3 commits ending in 23efb5cec7.
2024-09-25 11:14:41 -07:00
Tim Abbott 21ddd719e7 message_events: Fix move_message_stream_id type confusion. 2024-09-25 11:13:09 -07:00
evykassirer 76a602842d message_list: Make data required in the constructor. 2024-09-24 17:16:15 -07:00
evykassirer 28c3701677 message_list: Move comment from constructor to class definition. 2024-09-24 17:16:15 -07:00
evykassirer 35bb00a6e5 message_view: Rename TargetMessageIdInfo to be more specific. 2024-09-24 17:16:15 -07:00
evykassirer 608c5ee54a message_view: Make trigger required for changehash and update_hash_to_match_filter. 2024-09-24 17:16:15 -07:00
evykassirer af915523a7 message_view: Convert module to typescript. 2024-09-24 15:43:27 -07:00
evykassirer b0785f0f2c message_view: Name mutated opts separate from function params.
This will help with Typescript conversion.
2024-09-24 15:43:27 -07:00
evykassirer 5b151cff96 message_view: Rename show's original opts to show_opts.
This will help with Typescript conversion.
2024-09-24 15:43:27 -07:00
evykassirer 3da3661a34 message_view: Access window.history.state through browser_history. 2024-09-24 15:43:27 -07:00
evykassirer df03d65cad browser_history: Use zod to parse window.history.state. 2024-09-24 15:43:27 -07:00
evykassirer 7bff149325 filter: Fix bug where invalid stream name could throw an error. 2024-09-24 15:00:10 -07:00
Sahil Batra 758fdc87e0 group_setting_pill: Do not allow guest users for some settings.
For settings with allow_everyone_group is False, guest users
are not allowed to do the task controlled by that setting even
if the guest user is member of the group which is used for
that setting.

So, we do not show guest users in typeahead for such settings
and also not create a pill when someone types full email of
the guest user in the input.

There is no such restriction in the API and it is fine
since we eventually have the check to not give guest user
the permission.
And we still allow guests to be part of any group, so there is
no restriction on using groups containing guests as subgroups
of the anonymous groups and showing them in typeahead.
2024-09-24 14:36:45 -07:00
Sahil Batra d0fbad3250 group_setting_pill: Pass setting_type in pill_config.
We only use pills UI for can_manage_group setting currently,
but we can still pass setting_type in pill_config so that we
can use that while calling get_group_permission_setting_config
for checking if group is allowed to be used in the setting when
creating group pill from group name.
2024-09-24 14:36:45 -07:00
Sahil Batra c4026615ae user_group_pill: Accept setting_type as parameter in typeahead_source.
We currently use the pills UI only for can_manage_group setting so
it is fine to pass setting type as "group" directly to
get_realm_user_groups_for_setting, but it would be better to just
accept setting_type as parameter in typeahead_source and pass that
to get_realm_user_groups_for_setting as other settings will also
use the pills UI in future.
2024-09-24 14:36:45 -07:00
evykassirer b2e1c5aec4 message_fetch: Don't allow undefined narrow term operands. 2024-09-24 14:34:07 -07:00
Vlad Korobov edef41ca32 portico: hello images are always x2 size 2024-09-24 14:19:48 -07:00
Karl Stolley 89e32bc917 left_sidebar: Place redesigned subheaders. 2024-09-24 11:08:50 -07:00
Karl Stolley 87965d61f2 left_sidebar: Set new heading icon and effects. 2024-09-24 11:08:50 -07:00
Karl Stolley 61221ddc74 sidebars: Update colors, opacity for side bar titles and toggles. 2024-09-24 11:08:50 -07:00
Karl Stolley 74fc257a05 left_sidebar: Place redesigned styles for action headings. 2024-09-24 11:08:50 -07:00
Karl Stolley 14695dd26a sidebars: Update typography for sidebar titles. 2024-09-24 11:08:50 -07:00
Tim Abbott 08e04e2195 message_edit_notice_tooltip: Rewrite to fix inverted check.
Apparently, abece73c5a had misconverted
the case where edit history is disabled.
2024-09-23 18:13:17 -07:00
Pratik Chanda aeebbbb825 tooltips: Defer computing last_edit_timestr until tooltip renders.
Earlier, we used to compute last_edit_timestr as data-tippy-content
when rendering the whole message feed.

This commit changes the behaviour by computing the `last_edit_timestr`
when a user hovers over the message_edit_notice.

Fixes: zulip#27240.
2024-09-23 18:13:17 -07:00
tnmkr 23efb5cec7 custom_profile_fields: Support non editable profile fields.
This commit allows configuration of "editable_by_user" property from the
organization settings modal. It also adds support for non-editable
fields in profile settings modal.

Fixes #22883.

Co-Authored-By: Ujjawal Modi <umodi2003@gmail.com>
2024-09-23 18:09:38 -07:00
tnmkr fc5cdd9e83 custom_profile_fields: Remove bottom margin from settings_url_input.
This margin was extending the size of the parent div, which caused
tooltips applied to the parent to trigger in the empty space below this
input.

Other elements in this section do not have bottom margins. So this
change also helps with uniformity.

This commit is a prep for #22883.
2024-09-23 18:09:38 -07:00
tnmkr ddecba4e1c custom_profile_fields: Add "editable_by_user" setting.
This new property allows organization administrators to specify whether
users can modify the custom profile field value on their own account.
This property is configurable for individual fields.

By default, existing and newly created fields have this property set to
true, that is, they allow users to edit the value of the fields.

Fixes part of #22883.

Co-Authored-By: Ujjawal Modi <umodi2003@gmail.com>
2024-09-23 18:09:38 -07:00
Aditya Kumar Kasaudhan aabecf131c typeahead: Improve link styling in typeahead suggestions.
Previously, links in typeahead suggestions appeared inconsistent with
the surrounding text when highlighted. This commit updates the link
styling to match the text color and adds a subtle underline with reduced
opacity for better visual consistency.

Fixes #31005.
2024-09-23 18:01:47 -07:00
Pratik Chanda 34296ae505 message_header: Display current year in header on year change.
Earlier, when subsequent message had different year, date divider
would leave out year from `time_str` if it was from current year.

This commit adds year to time display if two adjacent messages have
different year and the second message is from current year.

Fixes: zulip#26673.
2024-09-23 17:57:21 -07:00
sanchi-t 07af9b357b css: Refactor theme colors for `.message_edit_history_content`.
This change moves the light and dark theme colors for
`.message_edit_history_content` to CSS variables.
2024-09-23 16:07:51 -07:00
opmkumar 1ddc1d2d12
search: Refactor how close buttons are handled.
We refactor the following inputs to use a `placeholder-shown` CSS selector to
show/hide the close button, rather than custom JS logic:
- Filter topics field in the left sidebar
- Filter direct messages field under direct messages
- Stream message topic
2024-09-23 16:04:10 -07:00
Anders Kaseorg 5bde07c842 stats: Fix @typescript-eslint/explicit-function-return-type.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-23 15:59:33 -07:00
Anders Kaseorg 18b8d0f1b2 bootstrap_typeahead: Address @typescript-eslint/no-floating-promises.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-09-23 15:42:31 -07:00
evykassirer e7f5e526bc buddy_list: Refactor maybe_remove_user_id for ease of adding user lists. 2024-09-23 15:41:00 -07:00
evykassirer 5c6e3a7aac buddy_list: Refactor render code for readability. 2024-09-23 15:41:00 -07:00
evykassirer cd5a61eb52 buddy_list: Rename list element to not be named container.
This was confusing because there are other elements named
e.g. "#buddy-list-users-matching-view-container", which are
distinct from "#buddy-list-users-matching-view", and the
elements with the latter id should not be named with container
in the variable name.
2024-09-23 15:41:00 -07:00
evykassirer bc835d78a6 buddy_list: Add shared classnames to simplify styles.
This will be particularly helpful for the third buddy
list section we're about to add.
2024-09-23 15:41:00 -07:00
Sayam Samal acb13cb1cb icons: Update bot icon in Settings UI.
As a follow-up to cca891689c, this updates
the old bot icon in the Settings UI with the new one antenna bot icon.
2024-09-23 14:09:47 -07:00