* use windows in 'time on page' query
* add imported time on page back
* join imported_pages instead of extra query
* don't forget aggregated time on page!
* eh?
* no need for separate window clause
* use dynamic_filter_condition in aggregate_time_on_page
* it's avg, not total
* fix dynamic_filter_condition call
* tests pass
* fewer changes
* fewer changes + feature flag
* base quickfix
* fewer changes
* fewer changes?
* fewer changes!
* replace coalesce with if(empty(),etc)
* make window_aggregate_time_on_page return same result as neighbor_
* breakdown as well
* add failing test
* more info
* more info
* format example
* add failing aggregate.ex test
* fix breakdown.ex windowing time_on_page calculation
* fix aggregate.ex windowing time_on_page calculation
* change upgrade CTA notice message for enterprise and business plans
* add dismissable option to Generic.notice
* more general notice about losing premium features in X days
* save notice dismissed per user
... more than one Plausible account can use the same device, so we should
scope the fact that the notice has been dismissed by user id.
* fix bug applying classes to Generic.notice
* apply shadow to the new notice on light mode
* use Heroicons.x_mark instead of raw SVG
* use Enum.filter instead of list comprehension
* Enable JSON log formatting
if `LOG_FORMAT=json` is set, the app will start logging
JSON-formatted messages. By the way, the Repo :loggers configration
was removed since it's been already deprecated by Ecto v3
(https://hexdocs.pm/ecto/changelog.html#deprecations-4).
* Update changelog
* Revert "Remove site pins for now"
This reverts commit 5eccf4eaf6.
* Implement basic site pin schema level logic within user specific preferences
* Add vertical ellipsis menu markup
* Implement basic changesets for user preferences
* Implement pin toggling
* Try to fix pin sorting
* Implement pin toggling in LV
* Adjust moduledocs for new schema(s)
* Remove unnecessary `distinct` from query
* Use `button` for pin/unpin action
* Generalize preference setting
* Rename schema and fields for clarity
* Rename `list_type` -> `entry_type`
* Safeguard setting options
* Test `set_option/4` and `toggle_pin/2`
* Add test for listing pinned sites via `Sites.list`
* Disallow pinning sites outside page explicitly
* Test pinning in LV
* Test conditional rendering of site settings in /sites
* Remove unnecessary TODO comment
* Safeguard `Sites.set_option/4` against invalid user/site combo
* Handle pinned sites in dashboard site picker
* Clear flashes upon (un)pinning sites
* Update CHANGELOG
* Prevent blinking of hamburger menu items on first paint
* Highlight hamburger handle on hover in /sites
* Start showing hotkeys in site picker again
* Sort pinned sites in the order they were pinned
* Update sites list order immediately after pin/unpin toggle
* Refactor and split `Sites.list/3`, extracting `Sites.list_with_invitations/3`
* Cap number of pinned sites at 9 per user
* First pass on visual indication of site cards (dis)appearing
* Apply ellipsis gradient+shadow on card hover
* Fix responsive padding of site cards
* Sort by invitations first, pinned sites second and then the rest
* Revert "Apply ellipsis gradient+shadow on card hover"
This reverts commit 0608796612639030ccbb12df639709f78edc1434.
* Apply more subtle hover effect on the ellipsis menu
* Make error and success flash LV boxes use separate component containers
* Promote `pinned_at` in table migration to a column
* Switch logic to using `pinned_at` as a standard schema field
* Refactor `Sites.list*` getting rid of subquery (h/t @ukutaht)
* Remove migration which is already merged upstream
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* fix underlined blank space in upgrade link
* Add :if clause to site limit notice
* Change test description
* Move growth? and trial? conditionals to CTA function
* Improve wording in billing notices
---------
Co-authored-by: Vinicius Brasil <vini@hey.com>
* Fix private preview notice typo
* fix link to choose-plan instead of upgrade
* do not display premium feature notice if legacy feature access
* register trial message
* change enterprise contact us copy
* fix test
---------
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
* price formatting
* fix space underlined
* add a redirect from :upgrade to :choose_plan
* Add premium feature notice to revenue goals
* add the number of API request to plan benefits
* be more explicit about Stats API requests
* start linking to the new upgrade page if FF enabled
* add redirect to :upgrade_to_enterprise_plan from :choose_plan
This commit intends to keep the existing behaviour of redirecting users
directly to the enterprise upgrade page when they click on an upgrade
link in an email and have an enterprise plan configured.
Hence, we can also simplify the /settings template and only link to
'/billing/choose-plan', even for enterprise plans.
* deprecate /billing/change-plan route based on FF
* Move new site template to HEEX
* Move new team member invitation template to HEEX
* Standardize exceeded limits error message
* Fix failing tests
* Limit Stats API access to unlimited trials
---------
Co-authored-by: Vinicius Brasil <vini@hey.com>
* Change limits for trials
* Keep legacy trial limits for users that registered before the business tier
* Change private preview notice for release
* Run formatter
* Add countdown to private preview notice
* Add button component
* Use new button in settings screen
* Use button component in registration screens
* Use new button component for Billing.upgrade_link
* Separate .button and .button_link
* Add attr definiton for disabled
* Fix funnels test
* allow using Stats API and Props for free_10k subscriptions
* return v3 plans for legacy trials
* do not display grandfathering notice for legacy trials
* set a more accurate BT release date
* fix bug on dev env
Allow the `find/1` function to find sandbox plans
* add error handling and tests for change_plan_preview
* fix feature warning bug
* fix credo warnings
* fix tests
* set BT release date further into the future
* rename function and some vars
* bugfix with limit exceeding
* fix test
* Show loading state for mini plots
* Dark mode
* Don't render no change in green
* Fix loading placeholders for mobile/desktop view
* Fixup test
* Make loading state background color for light theme one step brighter
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* use a different article in the email copies
... for recommending a plan, since the user can choose between Growth
and Business.
* small refactoring improvement
Rename `Plans.available_plans_with_prices` to `Plans.available_plans_for`,
taking an optional `with_prices` argument.
* highlight recommended tier for trial users on the ugprade page
* review suggestion
* Implement complete basics of LV sites
* Reimplement everything in LV except pagination
* Implement basic search capability
* PoC: plot visitors on sites index
* Add rudimentary clipped gradient in minicharts
* Fix clipping gradient, define once
* Format
* Add moduledoc to visitors component
* Move paginator helpers to the top core namespace
* Fix typespec of `Plausible.Sites.list`
* Split sites component into subcomponents
* Add function to uniformly calculate 24h intervals
and visitor totals across multiple sites.
* Integrate batch 24h interval query with plots on sites view
* Don't confuse heex compiler with alpine @ shorthands
* Make linear gradient svg definition truly invisible
* Implement basic pagination
* Extract `site_stats` from site and invitation cards
* Improve pagination
* Tweak css
* Improve filtering on pagination and make WSS fail graceful
* Test `last_24h_visitors_hourly_intervals/2`
* Replace /sites with LV implementation
* Add debounce to search filter
* Fix typespecs
* Fix styling
* Fix mini graph scaling factor calculation
* Fix search consuming itself
* Minimal tweaks to the plots
* Fixup
* Remove magic numbers from the plot
* Create `site_pins` table
* Add `SitePin` schema
* Implement listing invitations, sites and pins in a single query
* Add FIXME note
* Remove site pins for now
* Add tests for `Plausible.Sites.list/3`
* Add a couple more tests to sites dead view
* Remove unnecessary FIXME
* Add LV tests for Sites
* Calculate and display 24h visitors change
* Render the change in bold
* Add clarfying comment on virtual field in `Site` schema
* Remove unnecessary function from Invitations API
* Remove unused list opt from type definition in `Sites`
* Improve joins in list query slightly
* Add comment on manually computing sites list total
* Start searching from a singly character in domain field
* Add typespec to `last_24h_visitors_hourly_intervals`
* Extend moduledoc in visitors component
* Simplify loading sites in LV
* Simplify assigns in LV
* Add missing group for shadow under site card
* Make invitation modal render
* Make HTML in sites LV semantically correct
* Remove autofocus and focus search on `/`
* Remove shadow from search input
* Make search cancel on escape
* Fix tests relying on outdated HTML structure
* Make visitor chart color scheme consistent with dashboard chart
* Update styling of trend labels
* Fix empty state and improve search blur/focus handling
* Use live navigation for pagination
* Implement spinner on load from search
* Remove unused `Plausible.Stats.Clickhouse.last_24h_visitors/1`
* Calculate uniques correctly across hour boundaries
* Swap inlined svg for Heroicons component in invitation modal
* Add order by to base query in 24h hourly intervals
* Revert "Add order by to base query in 24h hourly intervals"
This reverts commit a6be5e3026.
* Query clickhouse 24h visitors only on second mount
* Remove redundant sign from percentage change when negative
* Switch to offset-based pagination
- offset seems easier to deal with for when actions on
paginated list will be performed such as site pinning;
tracking cursor data makes some entries disappear in
edge cases. The data set is still fairly small and
static, even for large customers.
- we're removing Phoenix.Pagination as it doesn't really
fir any use case, and it was only used to limit the number
of sites in the site picker
- site picker is now limited to 9 sites (future: pinned
sites will be prioritized there)
- no need to re-query for total count any more
- BTW, the old /sites template was removed
* Refine the plot queries; Tests pass snapshot
* Add PromEx plugin for LiveView
* Fix tiny plot cut-off at the top
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Warn user about Stats API when downgrading
* Update test/plausible/billing/quota_test.exs
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
---------
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
* fix the styling of the red text notice under checkout link
* avoid some code repetition
* simplify rendering the change_plan_link
* refactor disabling checkout link and showing disabled message
* disable change plan and upgrade link when exceeding pageview limit
* disable checkout when exceeding team member limit
* disable checkout when site limit exceeded
* extract checkout related code in a separate function
* stick to a single order of features
* losing features warning
* fix back link from change-plan-preview
* create Quota.exceeded_limits function
* restrict subscribing with exceeded limits on the API level too
* use with instead of case
Co-authored-by: Vini Brasil <vini@hey.com>
* use :map type instead of :any for user
Co-authored-by: Vini Brasil <vini@hey.com>
* create Quota.usage function
---------
Co-authored-by: Vini Brasil <vini@hey.com>
* replace unlisted plans with legacy plans
...and add a legacy plan that has an existing subscriber in Paddle. All
legacy plans are considered generation 1 - meaning that when a user on
one of these plans and they'll go to the upgrade page, then the listed
plans will be v1 for Growth and v3 for Business.
* remove redundant plans_sandbox function
* remove the unused 'scope' argument from Plans.find
* remove unused plan
* add basic test coverage for legacy plans
* add another plan with an existing active subscriber (fix another bug)