Commit Graph

55690 Commits

Author SHA1 Message Date
Prakhar Pratyush d763fae9d0 remote_server: Eliminate separate realms-only code path.
Given that most of the use cases for realms-only code path would
really like to upload audit logs too, and the others would likely
produce a better user experience if they upoaded audit logs, we
should just have a single main code path here i.e.
'send_analytics_to_push_bouncer'.

We still only upload usage statistics according to documented
option, and only from the analytics cron job.

The error handling takes place in 'send_analytics_to_push_bouncer'
itself.
2023-12-11 14:07:39 -08:00
Tim Abbott 6f93ab72c0 realm: Deactivate realms inside a transaction.
This is the only operating editing audit logs not already using a
transaction, and having it do so will simplify an upcoming interface
to be able to assume it is always inside a transaction.
2023-12-11 14:07:39 -08:00
Tim Abbott 629492e63b realm: Use delete_realm_user_sessions bulk query.
The previous logic was accidentally quadratic in a horrible way
involving querying all sessions on the server in a loop.
2023-12-11 14:07:39 -08:00
Tim Abbott 1100d3be51 sessions: Make delete_realm_user_sessions not quadratic.
This is exactly the scenario that Set objects exist for.
2023-12-11 14:07:39 -08:00
Prakhar Pratyush 688c011a80 test_realm: Remove invalid dummy-uuid used.
Earlier, it was passing tests because the deffered_work queue
that calls send_realms_only_to_push_bouncer didn't update the
realms propery based on response received from bouncer.

This prep commit removes the invalid "dummy-uuid" used, as any
call to send_realms_only_to_push_bouncer will update realms
properties too.

We return an empty realms array as the realm is created midway in
do_create_realm, so the uuid is not already available. Also, our
intent here is not to verify the behaviour of the
send_realms_only_to_push_bouncer function because we'll have
separate tests for that. Here, we verify that deffered_work event
was sent and eventually it made call to send_to_push_bouncer
with appropriate data.
2023-12-11 14:07:39 -08:00
Aman Agrawal eb92b31e1d stripe: Disable free trial for self hosted customers. 2023-12-11 13:23:49 -08:00
Aman Agrawal 23d712391e post_analytics: Migrate plan from server to realm after upgrade. 2023-12-11 13:23:49 -08:00
Aman Agrawal 64517a7ad3 stripe: Move migrate_customer_to_legacy_plan to `BillingSession`.
This will he helpful to call it for both remote realm and remote
server billing sessions.
2023-12-11 13:23:49 -08:00
Aman Agrawal b4e4ca14d5 models: Store `is_system_bot_realm` information for `RemoteRealm`.
This will help us filter out system bot realm and control
feature access to it.
2023-12-11 13:23:49 -08:00
Aman Agrawal 8e617f5df8 stripe: Fix customer charged for upgrade during free trial.
I accidentally free trials for both cloud and self hosted
enabled while testing, hence didn't catch it.

This mostly involves fixing `is_free_trial_offer_enabled` to
return the correct value and providing it the correct input.
2023-12-11 13:23:49 -08:00
Aman Agrawal df23701475 stripe: Rename add_server_to_legacy_plan.
This function will not also be used to migrate remote realms
to legacy plan.
2023-12-11 13:23:49 -08:00
Aman Agrawal a8fd350630 stripe: Use session specific method to create customer. 2023-12-11 13:23:49 -08:00
Sayam Samal e3878cf64a popovers: Add structural changes and fix CSS overlap.
The paragraph tag was being used along with the bold tag to style the
topic and stream in the popovers. The semantic meaning of these tags
are more specialized and should not be used in this context. Replaced
the <p> tags with the more general <div> tags and accounted for the
bold text via the `font-weight` CSS property.

The `.topic-name` class, used to style the topic/stream name in the
topic list in the left sidebar, was also being used to the style the
topic/stream name in the topic/stream popover. This lead to irrelevant
properties being applied to the popover > topic/stream name. Through
this commit, the styling for both of these different cases are now
separated using the appropriate selectors.

Fixes #27562.
2023-12-11 12:55:25 -08:00
Sayam Samal be31f7a5e6 streams_popover: Change stream name alignment from center to left.
Introduced `display: flex` to help with the align of the stream privacy
icon with the stream name text.
2023-12-11 12:55:25 -08:00
Sayam Samal 10aad0a9f3 streams_popover: Allow soft wrap opportunities for stream name.
When a stream name becomes very long, it may stretch the popover menu
by a lot. We prevent this by allowing the stream name to wrap onto
multiple lines.
2023-12-11 12:55:25 -08:00
Sayam Samal a2733c7bc3 streams_popover: Set popover width equal to width of longest menu item.
We set the streams popover width to be equal to the width of the longest
menu item, via the min-content intrinsic sizing. We also set all the
menu items to `white-space: nowrap` to prevent them wrapping. These
two changes allow the menu items to dictate the width of the popover
instead of a static max-width property, and thus helps with languages
where the length of the translated item may be long enough to wrap.
2023-12-11 12:55:25 -08:00
Sayam Samal 27ca8b0360 topics_popover: Remove '>' icon adjacent to the topic name. 2023-12-11 12:55:25 -08:00
Sayam Samal a9e0871f59 topics_popover: Change topic name alignment from center to left. 2023-12-11 12:55:25 -08:00
Sayam Samal b8fee4f176 topics_popover: Allow soft wrap opportunities for topic name.
When a topic name becomes very long, it may stretch the popover menu
by a lot. We prevent this by allowing the topic name to wrap onto
multiple lines.
2023-12-11 12:55:25 -08:00
Sayam Samal 8b128f4b59 topics_popover: Set popover width equal to width of longest menu item.
We set the topics popover width to be equal to the width of the longest
menu item, via the min-content intrinsic sizing. We also set all the
menu items to `white-space: nowrap` to prevent them wrapping. These
two changes allow the menu items to dictate the width of the popover
instead of a static max-width property, and thus helps with languages
where the length of the translated item may be long enough to wrap.
2023-12-11 12:55:25 -08:00
Anders Kaseorg 069925b9a7 requirements: Remove direct requirement on Twisted.
It’s still used indirectly via Scrapy, but we haven’t used it directly
since commit 09e17fbe17 (#2002).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-11 12:52:20 -08:00
Sayam Samal e5f2211397 gear_menu_popover: Align org info menu items to the left. 2023-12-11 12:25:09 -08:00
Sayam Samal 1f417b6a43 gear_menu_popover: Fix font size of org plan.
As per the intended design, the font size of the org plan should
be equal to the font size of other similar links such as org version.

It should not be one size smaller than it, such as those of the
upgrade links.
2023-12-11 12:25:09 -08:00
Sayam Samal 48bbf1cc6c gear_menu_popover: Add text wrapping to long org names.
Some organizations may have long names that could blow up the gear
menu width, in those cases we want to prevent it by wrapping the
org name by explicitly setting the white-space property, and thus
enabling any soft-wrap opportunities.
2023-12-11 12:25:09 -08:00
Sayam Samal ca9b1060b7 navbar_dropdowns: Let menu items control the width of dropdown menus.
Through this commit, we set the width of the navbar dropdowns to be
equal to the longest menu item, via the min-content intrinsic sizing.

Note, that the min-content width takes into account all soft-wrapping
opportunities, which could result in the wrapping of the menu items in
many cases. To prevent this, we use the white-space property to prevent
menu items from wrapping in any case.
2023-12-11 12:25:09 -08:00
Sayam Samal ada73eb6e0 gear_menu_popover: Fix padding of items in org info section.
We currently don't have appropriate padding applied to the lists and
links in the org info section of the gear menu popover. This becomes
an issue when we have a long org name, org url or org version, as
text starts touching the edges of the popover.

This commit adds the missing padding to the items in the org info
section of the gear menu popover.
2023-12-11 12:25:09 -08:00
Alya Abbott 581d4ce3c5 help: Improve Contact support help page. 2023-12-11 11:23:21 -08:00
Alya Abbott fd97d87491 help: Update development community stream descriptions. 2023-12-11 11:23:21 -08:00
Tim Abbott 81a04b5bd8 mailmap: Combine authors for Nehal Sharma. 2023-12-11 11:08:39 -08:00
Lauryn Menard 144b2a9988 support: Add forms for current plan actions to remote realms.
Pulls the forms for updating the billing collection method and
generally modifying the current plan to a separate template.

Uses the shared template to render these forms for both the
remote server and any attached remote realms.
2023-12-11 10:33:50 -08:00
Lauryn Menard 6f3e1cf653 support: Add remote realm current plan data to support view. 2023-12-11 10:33:50 -08:00
Lauryn Menard 7186f75b58 support: Add sponsorship/discount support forms to remote realms.
If there are remote realms attached to the remote server, adds
the forms to be able to update sponsorship requests, approve
sponsorship and update a discount.
2023-12-11 10:33:50 -08:00
Lauryn Menard 2684c21cca support: Create separate template for remote sponsorship/discounts.
Creates a separate template for the forms related to sponsorship
and discounts on the remote support view.
2023-12-11 10:33:50 -08:00
Lauryn Menard c2a76ccb3e support: Clean up template variables for remote server support. 2023-12-11 10:33:50 -08:00
Tim Abbott f1ffb1f56e emails: Extend expiration for login confirmation links. 2023-12-11 10:16:40 -08:00
Alya Abbott eb57b4c4f7 emails: Adjust wording in remote realm login link email. 2023-12-11 10:16:40 -08:00
Alya Abbott 9e90afc504 emails: Adjust wording in legacy server login link email. 2023-12-11 10:16:40 -08:00
Alya Abbott da5e1146f5 help: Add a help page on plans for self-hosted servers. 2023-12-11 10:16:40 -08:00
Mateusz Mandera c800951966 remote_billing: Add some useful fields to Remote...User models.
These are useful for auditing and follow what we have for UserProfile.
And is_active will be used in the future when we add user deactivation.
2023-12-11 09:39:24 -08:00
Karl Stolley 9c66b4a660 portico: Make Cloud tab inactive for self-hosters.
Copy here also points to the Cloud plans as described on zulip.com.
2023-12-11 09:03:00 -08:00
Karl Stolley 851f69c3ba portico: Point Zulip logo to zulip.com for self-hosters. 2023-12-11 09:03:00 -08:00
Karl Stolley c9d2ac1e1b portico: Don't show Find accounts or New org for self-hosters. 2023-12-11 09:03:00 -08:00
Sahil Batra d30b00d9f2 message_edit: Fix alignment of loading spinner.
This commit updates the CSS to fix the alignment of loading
spinner in "Save" button and also to make sure that button's
width does not change after clicking on the button.
2023-12-11 08:30:12 -08:00
Sahil Batra 5792895c10 message_edit: Always show white spinner on "Save" button.
We should show "white" spinner on "Save" button in message edit
form irrespective of the theme, as it looks better with the
button having blue background.
2023-12-11 08:30:12 -08:00
Sahil Batra d6e30ee3e8 settings: Add help link for "can_access_all_users_group" setting. 2023-12-11 08:29:14 -08:00
Alya Abbott e525160021
help: Document new UI for testing mobile push notifications.
Co-authored-by: Chris Bobbe <cbobbe@zulip.com>
2023-12-10 23:42:27 -08:00
N-Shar-ma d365c8739d compose: Use new custom icon for the compose edit control button. 2023-12-10 22:30:03 -08:00
Aman Agrawal ac8d5a5f0b remote_billing_page: Show error page for registration mismatch.
When a self-hosted Zulip server does a data export and then import
process into a different hosting environment (i.e. not sharing the
RemoteZulipServer with the original, we'll have various things that
fail where we look up the RemoteRealm by UUID and find it but the
RemoteZulipServer it is associated with is the wrong one.

Right now, we ask user to contact support via an error page but
might develop UI to help user do the migration directly.
2023-12-10 19:33:48 -08:00
Alya Abbott 82db8e7ac5 help: Document more clearly how guests experience unknown users. 2023-12-10 19:32:53 -08:00
Alya Abbott 0abcfb7b72 help: Update for Zulip Cloud Plus upgrades being self-serve. 2023-12-10 19:32:53 -08:00