Commit Graph

55172 Commits

Author SHA1 Message Date
Karl Stolley
4987600edc message_edit: Don't hide spinner on save success.
Hiding the spinner confusingly flashes the Save button before the
edit view closes. This just prevents that from happening, so that
the sign of success is the rendered, edited message.
2023-12-03 10:32:43 -08:00
Mateusz Mandera
7f33d6f0ea zilencer: Tie RemotePushDeviceToken to RemoteRealm at registration.
This consists of the following pieces:
1. Makes servers using the bouncer send realm_uuid in requests for token
   registration. (Sidenote: realm_uuid is already sent in the "send
   notification" codepath as of
   48db4bf854)
2. This allows the bouncer to tie RemotePushDeviceToken to the
   RemoteRealm with matching realm_uuid at registration time.
3. Introduce handling of some potential weird edge cases around the
   realm_uuid and RemoteRealm objects in get_remote_realm_helper.
2023-12-03 09:51:45 -08:00
Mateusz Mandera
c9b0602320 tests: Create default RemoteRealms in populate_db.
This default setup will be more realistic, matching the ordinary
conditions for a modern server.
Especially needed as we add bouncer code that will expect to have
RemoteRealm entries for realm_uuid values for which it receives
requests.
2023-12-03 09:51:45 -08:00
Mateusz Mandera
a67dd6dc1f realms: Call send_realms_only_to_push_bouncer at realm creation/import. 2023-12-03 08:49:58 -08:00
Karl Stolley
780d60a9ee left_sidebar: Remove tabindex from correct home-view element. 2023-12-03 08:44:54 -08:00
Karl Stolley
0e4dfa04b3 top_navbar: Contain stream, description elements. 2023-12-03 08:40:45 -08:00
evykassirer
875b7f1377 padded widget: Unabbreviate content_sel to content_selector. 2023-12-03 08:39:07 -08:00
Anders Kaseorg
1efc6efd23 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-01 18:52:00 -08:00
Karl Stolley
871054bd1e plans_page: Allow different max-widths on cloud, self-hosted panes. 2023-12-01 15:12:31 -08:00
Karl Stolley
5eb86f3fbb plans_page: Add responsive non-JS plan-pane scrolling. 2023-12-01 15:12:31 -08:00
Karl Stolley
056dde8618 plans_page: Place responsive styles, other than plans pane. 2023-12-01 15:12:31 -08:00
Karl Stolley
94cf3b57a3 plans_page: Add dashed separators. 2023-12-01 15:12:31 -08:00
Karl Stolley
5bfe45b244 plans_page: Implement button styles and icons. 2023-12-01 15:12:31 -08:00
Karl Stolley
c5b4b452c1 plans_page: Place swooshes on question headers. 2023-12-01 15:12:31 -08:00
Karl Stolley
6fb2e28cd2 plans_page: Add curvature to pricing tabs. 2023-12-01 15:12:31 -08:00
Karl Stolley
abbf511322 plans_page: Adjust spacing, curved borders. 2023-12-01 15:12:31 -08:00
Karl Stolley
854d2820d5 plans_page: Place pricing styles. 2023-12-01 15:12:31 -08:00
Karl Stolley
8529d86fc6 plans_page: Place custom bullets with flexbox. 2023-12-01 15:12:31 -08:00
Alya Abbott
6f796e0cbd plans_page: Adjust /plans content.
[squash]: Update sponsorsip and question boxes for Cloud.

[squash]: Update tabs subtitles.

[squash]: Content for info boxes for self-hosted plans.

[squash]: Adjust content to fit design.

portico: Tweak /plans text.
2023-12-01 15:12:31 -08:00
Karl Stolley
dbaef860bf plans_page: Place non-button link colors. 2023-12-01 15:12:31 -08:00
Karl Stolley
4f8cc13417 plans_page: Place text, background colors. 2023-12-01 15:12:31 -08:00
Karl Stolley
b0db397ec6 plans_page: Add independent additional info sections for cloud, self-hosted. 2023-12-01 15:12:31 -08:00
Karl Stolley
29a09ca793 plans_page: Add cloud Plus plan. 2023-12-01 15:12:31 -08:00
Karl Stolley
c9f33344e2 plans_page: Add JS toggle for showing cloud or self-hosted plans. 2023-12-01 15:12:31 -08:00
Karl Stolley
eb36256d7a plans_page: Handle typesetting and vertical alignment. 2023-12-01 15:12:31 -08:00
Karl Stolley
52f8f56286 plans_page: Rough out structures and grid layout. 2023-12-01 15:12:31 -08:00
Karl Stolley
a6498ad666 plans_page: Simplify structures and present page header. 2023-12-01 15:12:31 -08:00
Karl Stolley
9e4cda6ecc plans_page: Align content with Vlad's mock. 2023-12-01 15:12:31 -08:00
Karl Stolley
93aa5747d3 plans_page: Duplicate existing pricing for business page. 2023-12-01 15:12:31 -08:00
N-Shar-ma
82895ff535 compose: Update icons for formatting buttons.
Also made the buttons bigger, and updated breakpoints accordingly.

Fixes: #27845.
2023-12-01 13:51:39 -08:00
Aman Agrawal
5d49e54d33 upgrade: Show tier corresponding to session on upgrade page. 2023-12-01 08:55:58 -08:00
Aman Agrawal
6b70be38b3 models: Add method to get CustomerPlan name from tier. 2023-12-01 08:55:58 -08:00
Aman Agrawal
b35ea18829 stripe: Make get_price_per_license more readable. 2023-12-01 08:55:58 -08:00
Aman Agrawal
8500eae87e billing_page: Successfully render for remote realms and server. 2023-12-01 08:55:58 -08:00
Aman Agrawal
42c0e2ca3e billing_page: Use URL name redirect instead of importing it. 2023-12-01 08:55:58 -08:00
Aman Agrawal
0888608fcc billing_page: Remove completed TODO.
See 003b29ba14
2023-12-01 08:55:58 -08:00
Aman Agrawal
e949fb47ff billing: Rename billing_home to billing_page. 2023-12-01 08:55:58 -08:00
Aman Agrawal
c822e953be urls: Rename function names to match naming syntax of remote pages. 2023-12-01 08:55:58 -08:00
Aman Agrawal
a2c1a2f4bb urls: Use /billing URL to direct user to upgrade page.
This is more about keeping the same syntax for all the pages.
2023-12-01 08:55:58 -08:00
Aman Agrawal
d0c0b11fbf upgrade: Make purchase upgrade work for remove servers and realms.
We are upgrading them to cloud standard right now, we can easily
change tiers in future while adding pricing and configuration for
them.
2023-12-01 08:55:58 -08:00
Aman Agrawal
e9bbb67035 upgrade: Make card add / update work for remote servers. 2023-12-01 08:55:58 -08:00
Aman Agrawal
9889dc38fe event_status: Pass billing_base_url to calculate realm specific URLs. 2023-12-01 08:55:58 -08:00
Aman Agrawal
bb7b0b6731 upgrade: Provide billing_base_url in page_params.
This makes it cleaner to calculate URLs for the current session type.
2023-12-01 08:55:58 -08:00
Aman Agrawal
222077804b upgrade: Simplify getting session data for card update. 2023-12-01 08:55:58 -08:00
Aman Agrawal
0286f10816 stripe: Move non class specific function outside.
Doesn't seem to benefit from being defined inside the class.
2023-12-01 08:55:58 -08:00
Aman Agrawal
25cf0f71a3 event_status: Remove unused variables in context. 2023-12-01 08:55:58 -08:00
Aman Agrawal
953f0f436e stripe_event_handler: Rename get_billing_session. 2023-12-01 08:55:58 -08:00
Prakhar Pratyush
b32950d790 notifications: Revert API changes for push_notifications_enabled.
This commit reverts the API changes in 56ec1c2.
2023-12-01 08:14:14 -08:00
Alex Vandiver
569c364392 users: Fetch and lock the user row before updating its role.
We want to both (a) take a lock on the UserProfile row, and (b)
modify the passed-in UserProfile object, so that callers see the
changes in the object they hold.  Unfortunately,
`select_for_update` cannot be combined with `refresh_from_db`
(https://code.djangoproject.com/ticket/28344).  Call
`select_for_update` and throw away the result, so that we know we have
the lock on the row, then re-fill the `user_profile` object with the
values now that the lock exists.
2023-11-30 16:15:23 -08:00
Alex Vandiver
9b1bdfefcd nagios: Use a better index on UserActivity for zephyr alerting.
Limiting only by client_name and query leads to a very poorly-indexed
lookup on `query` which throws out nearly all of its rows:

```
Nested Loop  (cost=50885.64..60522.96 rows=821 width=8)
  ->  Index Scan using zerver_client_name_key on zerver_client  (cost=0.28..2.49 rows=1 width=4)
        Index Cond: ((name)::text = 'zephyr_mirror'::text)
  ->  Bitmap Heap Scan on zerver_useractivity  (cost=50885.37..60429.95 rows=9052 width=12)
        Recheck Cond: ((client_id = zerver_client.id) AND ((query)::text = ANY ('{get_events,/api/v1/events}'::text[])))
        ->  BitmapAnd  (cost=50885.37..50885.37 rows=9052 width=0)
              ->  Bitmap Index Scan on zerver_useractivity_2bfe9d72  (cost=0.00..16631.82 rows=..large.. width=0)
                    Index Cond: (client_id = zerver_client.id)
              ->  Bitmap Index Scan on zerver_useractivity_1b1cc7f0  (cost=0.00..34103.95 rows=..large.. width=0)
                    Index Cond: ((query)::text = ANY ('{get_events,/api/v1/events}'::text[]))
```

A partial index on the client and query list is extremely effective
here in reducing PostgreSQL's workload; however, we cannot easily
write it as a migration, since it depends on the value of the ID of
the `zephyr_mirror` client.

Since this is only relevant for Zulip Cloud, we manually create the
index:

```sql
CREATE INDEX CONCURRENTLY zerver_useractivity_zehpyr_liveness
    ON zerver_useractivity(last_visit)
 WHERE client_id = 1005
   AND query IN ('get_events', '/api/v1/events');
```

We rewrite the query to do the time limit, distinct, and count in SQL,
instead of Python, and make use of this index.  This turns a 20-second
query into two 10ms queries.
2023-11-30 16:01:55 -08:00