Commit Graph

58687 Commits

Author SHA1 Message Date
Aman Agrawal f58c586bee narrow: Rename to `message_view`.
This brings it in sync with other libraries like `message_list`
and `message_list_data`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 48cdfd25f7 narrow: Rename `by_topic` to `narrow_by_topic`. 2024-06-05 12:03:59 -07:00
Aman Agrawal fecb9afa94 narrow: Rename `activate` to `show`.
This make the main call which displays message list sound similar
to `recent_view.show` and `inbox_ui.show`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 69cd263312 narrow: Rename by_recipient to narrow_by_recipient.
This would make the call `message_view.narrow_by_recipient` sound
better than `message_view.by_recipient`.
2024-06-05 12:03:59 -07:00
Aman Agrawal 9374195418 narrow: Migrate uses of `by` function to `activate` function.
This is part of renaming effort of `narrow` to `message_view`.
2024-06-05 12:03:59 -07:00
Sayam Samal 552ab984a9 message_actions_popover: Hide extra separator in spectator view.
In the spectator view, we are only left with the last few options
belonging to the same group, and the separator is not needed.
2024-06-05 11:56:56 -07:00
Alex Vandiver 50c3dd88e6 models: Migrate ids of all non-Message-related tables to bigint.
Migrate all `ids` of anything which does not have a foreign key from
the Message or UserMessage table (and would thus require walking
those) to be `bigint`.  This is done by removing explicit
`BigAutoField`s, trading them for explicit `AutoField`s on the tables
to not be migrated, while updating `DEFAULT_AUTO_FIELD` to the new
default.

In general, the tables adjusted in this commit are small tables -- at
least compared to Messages and UserMessages.

Many-to-many tables without their own model class are adjusted by a
custom Operation, since they do not automatically pick up migrations
when `DEFAULT_AUTO_FIELD` changes[^1].

Note that this does multiple scans over tables to update foreign
keys[^2].  Large installs may wish to hand-optimize this using the
output of `./manage.py sqlmigrate` to join multiple `ALTER TABLE`
statements into one, to speed up the migration.  This is unfortunately
not possible to do generically, as constraint names may differ between
installations.

This leaves the following primary keys as non-`bigint`:
- `auth_group.id`
- `auth_group_permissions.id`
- `auth_permission.id`
- `django_content_type.id`
- `django_migrations.id`
- `otp_static_staticdevice.id`
- `otp_static_statictoken.id`
- `otp_totp_totpdevice.id`
- `two_factor_phonedevice.id`
- `zerver_archivedmessage.id`
- `zerver_client.id`
- `zerver_message.id`
- `zerver_realm.id`
- `zerver_recipient.id`
- `zerver_userprofile.id`

[^1]: https://code.djangoproject.com/ticket/32674
[^2]: https://code.djangoproject.com/ticket/24203
2024-06-05 11:48:27 -07:00
Alex Vandiver 04450389e1 push_notifications: Provide a stable ordering.
Otherwise, this can cause test failures based on internals of the database.
2024-06-05 11:48:27 -07:00
Alex Vandiver 53b30ed65d confirmation: Migrate Confirmation to bigint.
This model has no external references, and is among the larger
tables.  Migrate it to bigint.
2024-06-05 11:48:27 -07:00
Alex Vandiver 37803406e5 models: Migrate ids of UserActivity and UserActivityInterval to bigint.
These models have no external references, and are among the larger
tables.  Migrate them to bigints, starting with `useractivityinterval`
which is less likely to be being touched.
2024-06-05 11:48:27 -07:00
Alex Vandiver 4f4725f810 analytics: Migrate models' id columns to bigint.
This helps prevent wraparound on exceedingly large and old installs,
particularly Zulip Cloud.  These are relatively simple migrations
since they are not referenced by any other tables; however, they are
quite large, and are actively used from Django by running servers,
making this not a migration which is possible to run without stopping
the server.

Use the escape hatch in the previous commit to temporarily pause
analytics writes while the migration happens.  This should make the
migration transparent to users, at the small cost of an artificial dip
in statistics (specifically, to push notification counts, and unread
message counts) while the migration runs.
2024-06-05 11:48:27 -07:00
Alex Vandiver 04022353fa zerver: Move fts_update_log table id to bigint.
This table, while it does not contain a large number of rows, consumes
a primary key for every message send and update.  Since it is not
referenced by any other table, the migration is simple; and since it
does not contain many rows at any time, it should be fast.
2024-06-05 11:48:27 -07:00
Sayam Samal 09bf7d0f95 personal_menu_popover: Move the theme switcher to the settings group.
This moves the theme switcher from the randomly placed position to the
settings group since it is one of the user preference settings.
2024-06-05 11:16:55 -07:00
Alex Vandiver 0e19302c67 locale: Strip trailing whitespace in "Zulip" translation. 2024-06-05 10:44:53 -07:00
Alex Vandiver 03864db5a2 streams: Move enforcement of stripped-stream-names lower.
This catches things like trailing spaces in internationalized
default-stream names.
2024-06-05 10:44:53 -07:00
Prakhar Pratyush 22f3aebb33 compose: Show a one-time banner for jump to sent message conversation.
We immediately navigate the user to the conversation they just
sent a message to if they are not already in the appropriate
conversation view.

This commit adds a first-time banner to explain the same.

Fixes #29575.
2024-06-05 09:31:17 -07:00
Prakhar Pratyush e4cbca698d compose: Jump to conversation where message was sent.
Removes two 'narrow_to_recipient' banners which were
shown after sending a message to a different conversation.

Now, the sender is narrowed to the conversation where
message was sent.

Fixes #29186.
2024-06-05 09:30:34 -07:00
N-Shar-ma e959a392c9 compose: Make conversation arrow double as a go-to-conversation button.
The chevron arrow icon before the topic / dm user field now also acts as
a go to conversation button. Whenever the functionality is available,
the plain icon changes to look and behave like a button. The old go to
conversation button on the right of the field is removed.

Fixes: #28697.
2024-06-05 09:26:01 -07:00
Jason 55d6f809ba docs: Improve STARTTLS / SSL documentation for Django email settings.
Django has some somewhat archaic variable names for configuring SMTP
that are misleading for users not familiar with Django.  Be more
explicit about the correct configuration for both implicit and
explicit TLS.

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2024-06-05 09:19:31 -07:00
Aman Agrawal b1a143e47c css: Remove unused `row-fluid` class. 2024-06-05 09:15:32 -07:00
Aman Agrawal 96dee2b987 portico_error_pages: Collect zerver error pages into a folder.
Tested `link_does_not_exist.html`, `404.html` and `unsupported_browser`
pages render correctly.
2024-06-05 09:06:44 -07:00
Alex Vandiver 1b10bf1921 check-rabbitmq-consumers: Add missing f on format string. 2024-06-05 08:59:50 -07:00
Alex Vandiver 46a57e37aa push_notifications: Support test notifications from old servers.
4430ab9cbe changed this, assuming that all servers would send
`realm_url` -- however, only servers running that commit do.  Update
to accept either `realm_url` or `realm_uri` payload properties.
2024-06-04 23:07:39 -07:00
Sayam Samal 94627196df popovers: Fix popovers force closing on topic visibility change.
When a topic is muted, it is removed from the view in some cases.
This can lead to the popover being force closed since the popover is
anchored to the reference element.

We add a delay to all the methods that contribute to hiding the topic,
on mute, to allow the relevant animations to be completed before the
topic is hidden from view and the popover is closed.
2024-06-04 15:56:44 -07:00
Sayam Samal 56be95a1c8 topic_popover: Remove redundant code from previous visibility options.
Commit 3f2ab44f94 removed the 'development' guard and cleaned the
older UI of the previous topic visibility options implementation,
but it missed the related JS logic.

This commit removes this redundant code, which was now present in
`web/src/topic_popover.js`.
2024-06-04 15:56:44 -07:00
Sayam Samal d93a3bb175 topic_sidebar_actions: Use sliding animation in the visibility switcher.
This commit updates the sidebar topic actions popover to use the new
sliding tab switcher for the topics visibility policy switcher.

This also includes changes such as hiding the popover only on
successful request completion, and adds error feedback by indicating
it via the sliding animation.
2024-06-04 15:56:44 -07:00
Sayam Samal 8877833603 visibility_policy_popover: Add feedback via switcher when request fails. 2024-06-04 15:56:44 -07:00
Sayam Samal a3d60c9f09 visibility_policy_popover: Hide popover only when request is successful.
This hides the visibility policy popover only when the request to
change the topic visibility policy is successful.

This allows a user to retry changing the policy in case of a request
failure, without having to open the popover again from the start.
2024-06-04 15:56:44 -07:00
Sayam Samal db4c5cdfc6 visibility_policy_popover: Use sliding animation in the switcher.
This commit updates the topic visibility popover to use the new
sliding tab switcher, which was introduced in personal menu >
theme switcher.
2024-06-04 15:56:44 -07:00
Tim Abbott 6c67f92656 docs: Update changelog with changes since 8.x. 2024-06-04 15:37:05 -07:00
Kislay Verma 2c98263d4c left_sidebar: Rename "more topics" to "all topics".
This commit renames the occurrences of "more topics"
to "all topics" in comments and documentation.

Fixes #30014
2024-06-04 10:18:54 -07:00
Sahil Batra c8b8b836fd test_events: Update code to test for only allowed system groups.
This commit updates do_set_realm_permission_group_setting_test
to test for only allowed system groups.
2024-06-04 09:55:27 -07:00
Sahil Batra aac6d6cddb user_groups: Move get_group_setting_value_for_audit_log_data.
This commit moves get_group_setting_value_for_audit_log_data
to zerver.lib.user_groups.
2024-06-04 09:55:27 -07:00
Lauryn Menard c4f1d44dd7 i18n: Fix translated strings for delete profile field option.
Fixes how the confirmation modal title is generated for translation
for deleting an option or multiple options from a customer profile
field that's a list of options.
2024-06-04 09:54:35 -07:00
sujal shah d793cc0f54 tooltip: Render tooltips for `Not subscribed` and `All channels` tabs.
Render tooltips for both the tabs if the user is guest user.

Fixes #21869.
2024-06-04 09:49:50 -07:00
sujal shah 26ae173a2c left_sidebar: Change redirect link for Browse channels.
This commit changes the redirect links for "Browse channels" and
"Browse 1 more stream" to the Not subscribed(#streams/notsubscribed)
tab.
2024-06-04 09:49:50 -07:00
sujal shah 6c437eda77 stream_settings: Display No channel text when no channel present.
In the "not-subscribed" tab, when there are no channels to show, we
display a text message saying "No channels to show. View all channels"
along with a link that redirects the user to the "All channels" tab
(All channels(#channels/all)).

Updated the update_empty_left_panel_message function in
stream_settings_ui.js to modify and determine which banner to display
when no channels are available to show, modified that function to also
display the banner of the "not-subscribed" tab using a new classname
called 'not_subscribed_streams_tab_empty_text'.
2024-06-04 09:49:50 -07:00
sujal shah 619e234100 stream_settings: Change the if-else with switch statement. 2024-06-04 09:49:50 -07:00
sujal shah 6deb165ef6 stream_settings: Add Not subscribed tab to stream settings.
This commit adds a new tab to the stream settings overlay called
"Not subscribed" which lists all the streams the user is not
subscribed to. This tab is disabled if the user is a guest.

Introduced a new variable called "show_not_subscribed" to replicate
a similar model to how the subscribed tab is working. Currently,
there are only two tabs: "subscribed" and "all streams" so we can
use an if-else condition.

Refactored the 'update_stream_row_in_settings_tab' function inside
stream_ui_updates.js to include the case of a 'Not-subscribed' tab,
so that the tab is immediately updated in any add/remove subscription
event.

Fixed and added the node tests for these changes.
2024-06-04 09:49:50 -07:00
sujal shah d7936fe576 stream_overlay: Change the subscribed_only to show_subscribed.
This commit changes the variable and function name from
"subscribed_only" to "show_subscribed" and
"set_subscribed_only" to "set_show_subscribed"
so that in the next commit, when the "not subscribed" tab is added,
we can use a similar variable named "show_unsubscribed" and function
named "set_show_unsubscribed".
2024-06-04 09:49:50 -07:00
Aman Agrawal c6c8e831f8 portico_error_page: Apply `error` class to all the error pages.
This helps us control the CSS applied to the elements outside the
content scope of `portico_error_page.html`.
2024-06-04 09:41:34 -07:00
Aman Agrawal b2f0677c25 portico: Remove `container` and `row-fluild` bootstrap classes.
Fixes #28526

* Removed `container` and `row-fluid` class from error pages.
* Use a variable for footer height.
* Made header sticky instead of fixed allowing us to position
  page content without adding arbitrary padding or margin at top.
  Header is around 60px in height, so reduced that much top padding
  or margin.
2024-06-04 09:41:34 -07:00
Aman Agrawal b3a5b2b9aa 5xx: Fix header colors. 2024-06-04 09:41:34 -07:00
Aman Agrawal dd70110166 templates: Use a common template for error pages. 2024-06-04 09:41:34 -07:00
Aman Agrawal 27d2b89412 unsupported_browser: Remove not required extra bottom padding. 2024-06-04 09:41:34 -07:00
Varun Singh 6b42c18220 settings_preferences: Convert module to TypeScript. 2024-06-04 08:50:07 -07:00
Varun Singh 3c79b07a56 dependencies: Add @types/js-cookie to devDependencies. 2024-06-04 08:50:07 -07:00
Varun Singh b1943f560a settings_preferences: Refactor initialize function.
Before this commit the `user_settings_panel` object was declared as
a `const` and assigned an initial value of `{}`. Later, inside the
initialize function the object was mutated with three fields (`container`,
`settings_object`, `for_realm_settings`).

TypeScript does not allow this.Hence,we have removed the initial
value(`{}`) and changed the object to be a `let` var. This means,
when the `initialize` function is called `user_settings_panel` object is
undefined and hence `user_settings_panel.foo` will throw an exception.
To avoid this we have refactored the function by changing the way
`user_settings_panel` object is assigned value.
2024-06-04 08:50:07 -07:00
Varun Singh 796cc038c4 page_params: Add property to zod object. 2024-06-04 08:50:07 -07:00
Varun Singh be91b41236 settings_preferences: Don't store 'success_msg_html' if undefined.
Although both 'sticky' and 'success_msg_html' parameters
are passed optionally, the conditional took into account
only the former.
2024-06-04 08:50:07 -07:00