-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Consolidated View life cycle + billing integration #5866
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 12 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
05bec55
Migration: add consolidated views feature to enterprise plans
aerosol 92ef4a0
Migration: Add user preferences per team table
aerosol 0ce1fe3
Update static plan definitions
aerosol 7ae18f5
Add feature module definition
aerosol b6b4edf
Display consolidated view availability in crm
aerosol b11e3f5
Extend ConsolidatedView interface:
aerosol 5fa19b7
Team/User preferences schema
aerosol 11e031c
Implement consolidated view life cycle on /sites
aerosol 80c13dd
Enroll `consolidated_view` feature flag
aerosol 87e593f
Consolidated view access hardening (+feature flag)
aerosol 2ae4797
Remove no longer needed `ConsolidatedView.enabled?/1`
aerosol 9b2bfe3
Alias PrimaDropdown
aerosol 00556c8
No consolidates views for shared links
aerosol 93412ec
Remove user argument from `ok_to_display?`
aerosol c116447
Adjust a temporary test
aerosol 386c173
More elaborate alert
aerosol a54bff8
Fix responsive design issues on sites page
sanne-san 111294d
Use the plus icon for standalone "Add website" too
aerosol d5d4ba7
Format
aerosol f2b5a2d
Fix z-index issue with dropdowns on sites page
sanne-san 0d7b949
Remove TODOs
aerosol 6e4409d
Make consolidated view cards disappear when searching
aerosol 876ae2a
Clean up test
aerosol 5108d40
Use per-team membership user preferences
aerosol ba695c4
Use conditional instead of `with` statement
aerosol 9a1dff7
Inline `ensure_eligible`
aerosol 47e30e3
Use `Map.fetch!` getting preference from default struct
aerosol ad8712e
fixup
aerosol c92e06f
Revert "Migration: add consolidated views feature to enterprise plans"
aerosol 3ff5d0c
Merge branch 'master' into consolidated-view-billing
aerosol 9e70222
Fix and test feature-flag effect on both view and CTA cards
aerosol 9cab9b2
Merge remote-tracking branch 'origin/master' into consolidated-view-b…
aerosol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| defmodule Plausible.Teams.UserPreference do | ||
| @moduledoc """ | ||
| Team-specific user preferences schema | ||
| """ | ||
|
|
||
| use Ecto.Schema | ||
| import Ecto.Changeset | ||
|
|
||
| @type t() :: %__MODULE__{} | ||
|
|
||
| @options [:consolidated_view_cta_dismissed] | ||
|
|
||
| schema "team_user_preferences" do | ||
zoldar marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| field :consolidated_view_cta_dismissed, :boolean, default: false | ||
|
|
||
| belongs_to :team, Plausible.Teams.Team | ||
| belongs_to :user, Plausible.Auth.User | ||
|
|
||
| timestamps() | ||
| end | ||
|
|
||
| defmacro options, do: @options | ||
|
|
||
| def changeset(user, team, attrs \\ %{}) do | ||
| %__MODULE__{} | ||
| |> cast(attrs, @options) | ||
| |> put_assoc(:user, user) | ||
| |> put_assoc(:team, team) | ||
| end | ||
| end | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| defmodule PlausibleWeb.Components.PrimaDropdown do | ||
| @moduledoc false | ||
| alias Prima.Dropdown | ||
| use Phoenix.Component | ||
|
|
||
| defdelegate dropdown(assigns), to: Prima.Dropdown | ||
| defdelegate dropdown_trigger(assigns), to: Prima.Dropdown | ||
|
|
||
| slot(:inner_block, required: true) | ||
|
|
||
| # placement: bottom-end should probably be default in prima. Feels more natural | ||
| # for dropdown menus than bottom-start which is the current default | ||
| def dropdown_menu(assigns) do | ||
| ~H""" | ||
| <Dropdown.dropdown_menu | ||
| placement="bottom-end" | ||
| class="p-1.5 rounded-md bg-white shadow-xs ring-1 ring-gray-300 focus:outline-none" | ||
| > | ||
| {render_slot(@inner_block)} | ||
| </Dropdown.dropdown_menu> | ||
| """ | ||
| end | ||
|
|
||
| attr(:as, :any, default: nil) | ||
| attr(:disabled, :boolean, default: false) | ||
| attr(:rest, :global, include: ~w(navigate patch href)) | ||
| slot(:inner_block, required: true) | ||
|
|
||
| def dropdown_item(assigns) do | ||
| ~H""" | ||
| <Dropdown.dropdown_item | ||
| as={@as} | ||
| disabled={@disabled} | ||
| class="rounded-md text-gray-700 data-focus:bg-gray-100 data-focus:text-gray-900 block px-4 py-2 text-sm" | ||
| {@rest} | ||
| > | ||
| {render_slot(@inner_block)} | ||
| </Dropdown.dropdown_item> | ||
| """ | ||
| end | ||
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.