analytics/lib/plausible/teams
Adam Rutkowski 08c7d2e948
Consolidated View life cycle + billing integration (#5866)
* Migration: add consolidated views feature to enterprise plans

* Migration: Add user preferences per team table

* Update static plan definitions

* Add feature module definition

* Display consolidated view availability in crm

* Extend ConsolidatedView interface:
 - add functions to manipulate user/team options (for CTA)
 - require at least two sites in order to create a consolidated view
 - require billing/plan compliance when computing eligibility

* Team/User preferences schema

* Implement consolidated view life cycle on /sites

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Uku Taht <uku.taht@gmail.com>

* Enroll `consolidated_view` feature flag

* Consolidated view access hardening (+feature flag)

- require team-wise feature flag instead of super admin role
- redirect to /sites if the team isn't eligible any more
- enforce regular site in shared links controller

* Remove no longer needed `ConsolidatedView.enabled?/1`

* Alias PrimaDropdown

* No consolidates views for shared links

* Remove user argument from `ok_to_display?`

* Adjust a temporary test

* More elaborate alert

* Fix responsive design issues on sites page

- Fix z-index issue with button dropdown
- Fix truncation issue with team name
- Improve responsiveness of site cards
- Fix focus state of site cards
- Improve responsiveness of consolidated view CTA
- Improve design of prima_dropdown component
- Replace `+` with plus icons in dropdown items

* Use the plus icon for standalone "Add website" too

cc @sanne-san

* Format

* Fix z-index issue with dropdowns on sites page

* Remove TODOs

* Make consolidated view cards disappear when searching

* Clean up test

* Use per-team membership user preferences

* Use conditional instead of `with` statement

* Inline `ensure_eligible`

* Use `Map.fetch!` getting preference from default struct

* fixup

* Revert "Migration: add consolidated views feature to enterprise plans"

Will be included via main branch sync

This reverts commit 05bec55276.

* Fix and test feature-flag effect on both view and CTA cards

---------

Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
Co-authored-by: Uku Taht <uku.taht@gmail.com>
2025-11-12 13:41:24 +00:00
..
invitations Remove kaffy (#5423) 2025-06-10 06:24:47 +00:00
management Customer support (#5390) 2025-05-15 08:05:32 +00:00
memberships Consolidated View life cycle + billing integration (#5866) 2025-11-12 13:41:24 +00:00
sites Remove kaffy (#5423) 2025-06-10 06:24:47 +00:00
billing.ex Provide safeguards for regular/consolidated sites distinction (#5742) 2025-09-23 09:32:11 +00:00
grace_period.ex Rework team creation constraints (#5003) 2025-01-29 13:05:44 +00:00
guest_invitation.ex Teams writes switch (#4883) 2024-12-16 11:11:14 +00:00
guest_membership.ex Teams writes switch (#4883) 2024-12-16 11:11:14 +00:00
invitation.ex Implement service for inviting to a team (#4948) 2025-01-08 14:14:10 +00:00
invitations.ex Consolidated view lifecycle (#5760) 2025-09-30 09:46:17 +00:00
membership.ex Set current_team when user has team membership in viewed site (#5284) 2025-04-08 08:09:47 +00:00
memberships.ex Consolidated View life cycle + billing integration (#5866) 2025-11-12 13:41:24 +00:00
policy.ex Add ability to enforce 2FA for all members of the team (#5855) 2025-11-04 16:33:44 +00:00
site_transfer.ex Teams writes switch (#4883) 2024-12-16 11:11:14 +00:00
sites.ex Provide safeguards for regular/consolidated sites distinction (#5742) 2025-09-23 09:32:11 +00:00
team.ex Minor crm fixes (#5863) 2025-11-05 14:28:53 +00:00
users.ex Revise system behaviour for SSO users (#5506) 2025-06-23 08:19:12 +00:00