Commit Graph

3907 Commits

Author SHA1 Message Date
Artur Pata b624f39d17
Release 3.1.0 (#5883) 2025-11-13 07:02:48 +00:00
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
RobertJoonas dfbf0a9f4e
remove external page links from consolidated views (#5880) 2025-11-12 13:02:28 +00:00
Adam Rutkowski b0e8c8bdd0
Migration: team membership user preferences table (#5881) 2025-11-12 10:47:00 +00:00
RobertJoonas f24aa4f305
Consolidated view email reports (#5876)
* fix weekly/monthly email reports + stats report tests

* fix title of stats email reports

* add missing test

* do not render review installation link for consolidated view traffic drop emails + test

* refactor email_match_query to predicate fn

* make site_id_query_filter a public fn

* make traffic spike notifications work + test

* improve spike/drop notification email copies

* fix ScheduleEmailReports introduction comment

* add tests for stats report email scheduling

* remove space before .

* apply credo suggestion

* fix CE tests, use module attrs for text assertions

* skip frequency comment

* single query

* rename to site_member

* single query for real
2025-11-11 13:26:52 +00:00
RobertJoonas 0274f25a9e
Limit consolidated site access to specific site routes (#5867)
* authorize consolidated views to only access selected site routes

* a test

* apply the same plug logic to public apis

* fix test on CE

* add plug tests

* reduce number of args with a single opts argument

* assigns -> private
2025-11-10 11:20:30 +00:00
Adrian Gruntkowski 62e9ec5f05
Add `recovery_id` column to `sessions_v2` and `events_v2` (#5875) 2025-11-07 15:04:01 +00:00
Adam Rutkowski 49c9cabaed
Minor crm fixes (#5863)
* Bump `accept_traffic_until` on `trial_expiry_date` change

* Fix domain escaping in CRM

* Format
2025-11-05 14:28:53 +00:00
Marko Saric 839aebd782
Update README.md (#5873) 2025-11-05 13:55:26 +00:00
Adrian Gruntkowski 1a5eba85e7
Reduce noise in 2FA enforce notifications and update docs link (#5869)
* Do not send email notification to users who already enabled 2FA

* Update docs link

* Improve email notification assertion
2025-11-05 08:05:41 +00:00
Artur Pata af7dd46458
Fix shared link hostname (#5870)
* Fix missing share link hostname

* Update changelog

* Tests
2025-11-05 06:43:15 +00:00
Artur Pata 2ca24e77cc
Make sure imported data switch appears on Safari (#5872) 2025-11-05 06:31:59 +00:00
Artur Pata 040fb349f7
Update bamboo, bamboo_mua & co (#5871) 2025-11-05 06:17:38 +00:00
Uku Taht 16cbc07f3d
Use Prima for invitation modal (#5843)
* Replace invitation modal with Prima

* Better focus handling

* Simplify css

* Remove unnecessary transition classes

* Clarify comment about testing

* Fix typo

* Remove alpine.js initialization

* Use prima 0.1.7

* Unlock autumn and rustler deps

* Npm run format

* Fix invitation modal reject button on mobile

Co-authored-by: Bijay-Shre-stha <bijayashrestha929@gmail.com>

* Update assets/js/liveview/live_socket.js

Co-authored-by: Artur Pata <artur.pata@gmail.com>

---------

Co-authored-by: Bijay-Shre-stha <bijayashrestha929@gmail.com>
Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-11-04 19:21:05 +00:00
Adrian Gruntkowski a07aaa67eb
Add ability to enforce 2FA for all members of the team (#5855)
* Introduce `force_2fa` team policy and add API for toggling it

* Implement 2FA enforcement

* Make team policy available to CE too

* Improve copy (h/t @metmarkosaric)

* Send email to all team members when enforcing 2FA is enabled

* Only owners can enable and disable enforcing 2FA

* Don't send email to the user who enabled enforcing 2FA

* Add team selection screen to 2FA enforce exceptions

* Fix email URL

* Add tests

* Hide the Force 2FA section for non-owners completely

* Improve e-mail formatting

* Point at 2FA docs page for now

* Add changelog entry

* Reverse the exception to make dialyzer happy

* Fix a typo

Co-authored-by: Uku Taht <Uku.taht@gmail.com>

* Fix typespec 🤡 (h/t @ukutaht)

* Deliver force 2FA email notifications asynchronously

* Fix a typo in AlpineJS variable name (h/t @ukutaht)

* Put parameter in path helper instead of concatenating it as a string

* Improve and test audit logging of toggling 2FA enforcement

* Introduce 3 second delay before redirect

* Test audit logging only on EE

---------

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
2025-11-04 16:33:44 +00:00
Adrian Gruntkowski 592dc8ed97
Add migration adding `teams.policy` to CE (#5868) 2025-11-04 16:09:50 +00:00
RobertJoonas d0ba8f7bd0
Consolidated view settings (#5795)
* render error reason in flash message (cs)

* exclude whole sections in consolidated site settings

* filter settings general

* make goal settings work + tests

* do not render funnels cta

* change title of consolidated view settings

* disable consolidated view revenue goal creation (UI)

* disable consolidated view revenue goal creation (API)

* change title of add goal form

* make Props.suggest_keys_to_allow work for consolidated views

* fix props settings rendering for consolidated views + basic tests

* fix form view + tests

* exclude site settings integrations too

* fix CE tests

* refactor check_no_currency_if_consolidated

* use consolidated? instead of regular?

* use revenue?

* lookup site_ids by site domain

* fix CE

* fix CE again

* extract display_name function
2025-11-04 14:17:26 +00:00
Sanne de Vries 7de8526b6a
Fix regression in shared link settings form (#5862)
- As the form was moved to a modal, the help text has been removed unintentionally. This adds it back.
2025-11-03 17:22:16 +00:00
Artur Pata a44ce24867
Fix tracker script config backfill (#5860) 2025-11-03 13:31:25 +00:00
Sanne de Vries d7c641e6a6
Move shared link form to modal (#5849)
* Move shared link form to modal

- As a preliminary step for enabling adding a pinned segment to a shared link, the functionality to add or edit a shared link is being moved to a modal.
- Minor UI improvements, such as update the style of the edit and delete buttons.

* Update tests

- Add shared_link_settings_test.exs for LiveView interactions (deletion, errors)
- Add shared_link_settings/form_test.exs for modal form testing (create, edit, validation)
- Update controller tests: remove deleted actions, update visibility test

* Update lib/plausible_web/components/generic.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Update lib/plausible_web/components/generic.ex

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>

* Refactor icon button components

* Fix spelling error

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2025-11-03 12:51:04 +00:00
Artur Pata 64aa2434e9
Update CE-facing changelog about script v2 related changes (#5845) 2025-11-03 10:22:34 +00:00
Artur Pata 51ce8a41b5
Fix migration for CE 3.0.1 to current (#5844)
* Fix migration for CE

* Remove dead code
2025-11-03 10:22:22 +00:00
Artur Pata 457c483416
Omit Subscription and Invoices menu on CE (#5856)
* Update mua

* Fix issue with unexpected menu items

* Update changelog
2025-11-03 09:23:10 +00:00
Artur Pata a204c89066
Stop trying to compile detector and verifier on CE (#5857) 2025-11-03 09:22:55 +00:00
Adrian Gruntkowski 0405055f95
Improve HelpScout integration layout (#5853) 2025-10-31 14:36:25 +00:00
apata 2ad3c18f76 Released tracker script version 0.4.4 2025-10-31 08:01:23 +00:00
Artur Pata c9cbea7cd8
Add JSDoc types (#5842)
* Enhance TypeScript definitions for Plausible tracking library

Updated the plausible.d.ts file to improve documentation by adding JSDoc comments for all functions and properties. This enhances clarity and usability for developers integrating the tracking library.

* Update CHANGELOG.md to reflect changes in TypeScript definition comments for improved IDE integration

* Format

* Remove subtitle from changelog

---------

Co-authored-by: Ahmed Hassanein <eng.a7mad.gamal@gmail.com>
2025-10-31 07:56:01 +00:00
Marko Saric 546f0c3cdf
Update the onboarding email copy (#5789)
* Update site_setup_help_email.html.heex

* Update welcome_email.html.heex

* Update create_site_email.html.heex

* Fix formatting

* Fix flakiness due to sync persistor tests not cleaning up

* Update tests

* Fix CE tests

---------

Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
2025-10-30 14:32:19 +00:00
RobertJoonas d1b6817cfe
Change domain flow improvements (#5850)
* add opts to Check.perform signature

* increase domain change detection timeout to 11s

* same footer after submit + docs link

* domain change flow improvements

* fix for CE

* fix link

* rename to @plausible-analytics/tracker

* change icon
2025-10-30 11:17:54 +00:00
Sanne de Vries ce424bf436
Update site switcher UI to accommodate for consolidated view (#5838)
* Update site switcher UI to accommodate for consolidated view

* Implement logic to display consolidated view in site picker

* Fix "All sites" selected state in site switcher

* Fixup tests

* Include consolidated view assigns in shared links

* Format

* Extract `ConsolidatedView.ok_to_display?/2`

* Format

* I'll pretend no one saw this

* Skip unnecessary `on_ee`

* oops

---------

Co-authored-by: Adam Rutkowski <hq@mtod.org>
2025-10-29 10:58:45 +00:00
Sanne de Vries 638a59b8f5
Add border to tab component (#5848)
- Update tab component visually for extra affordance
2025-10-29 08:34:22 +00:00
Artur Pata 59839d2fd8
Declare favicon external resource properly (#5841) 2025-10-28 11:24:49 +00:00
Artur Pata 89c8cb3485
Make graphs dependant on centrally determined theme (#5840) 2025-10-28 11:18:25 +00:00
dependabot[bot] 2a5850aff0
Bump actions/setup-node from 5 to 6 (#5813)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 5 to 6.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cenk Kücük <cenk@plausible.io>
2025-10-28 10:58:15 +00:00
Sanne de Vries 90404c4ec3
Fix dark mode improvements oversights (#5839)
- Added dark mode change to CHANGELOG.md
- Fixed broken `WithImportedSwitch` icon focus outline
- Updated comments in `app.css` referencing old color scheme
2025-10-28 10:21:10 +00:00
dependabot[bot] 5754f2be6b
Bump actions/download-artifact from 5 to 6 (#5829)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:29:07 +00:00
dependabot[bot] 1eda271438
Bump actions/upload-artifact from 4 to 5 (#5830)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 09:28:33 +00:00
Artur Pata 2a6720cbfa
Update deps (#5837)
* Update playwright to 1.56.1

* chore: Bump tracker_script_version to 33

* Run audit fix for /assets

---------

Co-authored-by: apata <apata@users.noreply.github.com>
2025-10-28 08:44:42 +00:00
Sanne de Vries 91363a2825
Improve dark mode (#5819)
* Improve dark mode

- Switch from `slate` to `zinc` for the gray color palette
- Darken overall dark mode UI
- Switch from `green` to `emerald` for the green color palette
- Update a few previously missed instances of title case to sentence case
- Consolidate button styles and change naming from `bright` to `secondary`
- Update button disabled styles
- Fix tooltip not adjusting to content width
- Update graph tooltip layout and typography
- Add transition effects to hover states
- Reduce footer logo size

* Fix oversights

- Update funnel graph colors
- Update graph grid colors
- Improve focus styles
- Improve disabled input styles

* Fix more oversights in relation to dashboard filtering

- Improve consistency of input, button, combobox and modal components in relation to settings area
- Fix segment tooltip color

* Fix search input style in funnel and segments dropdowns

* Add white background to favicon images in dark mode

- The GitHub and ChatGPT favicons are hard to see in dark mode, so we add a white background to them.

* Fix tooltip color to fit all backgrounds in dark mode

* Fix tests

* Fixed more tests

* Extract SourceFavicon component to eliminate favicon duplication

* Fix regression on installation page after rebase

* Fix formatting issues

* Fix favicon test failure in CI by reading placeholder icon at compile time

* Undo previous commit
2025-10-28 08:28:15 +00:00
RobertJoonas 46f05d81c9
Verification / Detection follow-ups (#5836)
* make timeout configurable for a check via check_opts

* add an internal_check_timeout test case to verification/checks_test.exs

* move verification observability tests to a separate file

... make it sync and test capturing Sentry events too

* separate detection observability checks too

* test sentry events in detection

* consider internal check timeouts browserless issues in detection too

* test util function defs to ee_only
2025-10-27 16:50:54 +00:00
Adam Rutkowski fc34357865
CRM: 24h charts + minor extensions (#5832)
* Display 24h charts in CRM

* Move New Custom Plan button to the top of the page

* Allow custom plan deletion

* Add managed proxy price modifier to custom plan estimation
2025-10-27 14:29:11 +00:00
Adam Rutkowski 7de63a01ae
Set Consolidated View's timezone to what majority of sites has (#5834)
* Set Consolidated View's timezone to what majority of sites has

* clean up
2025-10-27 14:28:39 +00:00
Adam Rutkowski ce02ab0799
Crop big consolidated views (#5835)
* Crop big consolidated views

* number format
2025-10-27 13:01:17 +00:00
Artur Pata 0e0415fd6b
Broadcast tracker script config updates (#5806)
* Broadcast tracker script config updates

* Fix broadcast_put typespec

* Preload site association on CE

* Stop preloading uselessly

* Reload tracker_script_config on CE only
2025-10-27 10:48:06 +00:00
RobertJoonas 7540511deb
Clean up detection sentry events + tests (#5833)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* get rid of legacy verification

* rename Checks.InstallationV2 -> Checks.VerifyInstallation

* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation

* rename installationv2 (live) files as well

* delete old change-domain routes

Also rename current liveview modules and routes, removing the v2 suffix

* rename domain_change_v2 files, removing v2 suffix

* remove legacy JS verifier code

Also fix dockerignore and elixir.yml referencing a wrong priv path

* rename verification_v2_test -> verification_test

* remove v2 prefix from logs and sentry messages

* clean up duplicate external_sites_controller_test.exs tests

* remove flag

* fix typespec

* pass timeout as query param to Browserless too

* Fixup external sites controller test module (#5826)

* fix test description

* clean up detection sentry events + tests

* improve naming

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-10-27 10:31:24 +00:00
RobertJoonas a83b4f3583
Clean up legacy verification code and script v2 flag (#5824)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* get rid of legacy verification

* rename Checks.InstallationV2 -> Checks.VerifyInstallation

* delete Live.Installation and rename Live.InstallationV2 -> Live.Installation

* rename installationv2 (live) files as well

* delete old change-domain routes

Also rename current liveview modules and routes, removing the v2 suffix

* rename domain_change_v2 files, removing v2 suffix

* remove legacy JS verifier code

Also fix dockerignore and elixir.yml referencing a wrong priv path

* rename verification_v2_test -> verification_test

* remove v2 prefix from logs and sentry messages

* clean up duplicate external_sites_controller_test.exs tests

* remove flag

* fix typespec

* pass timeout as query param to Browserless too

* Fixup external sites controller test module (#5826)

* fix test description

---------

Co-authored-by: Artur Pata <artur.pata@gmail.com>
2025-10-27 09:39:41 +00:00
RobertJoonas ad2c8e8e39
Verification Fixes (#5822)
* add module name to service_error when check times out

Otherwise, it can sometimes remain unclear in the diagnostics, whether
it was InstallationV2 or InstallationV2CacheBust that timed out.

* Remove duplicate timeout logic

The current production logs show two types of verification timeouts:

* service_error: "Unhandled Browserless response status: 408" (vast
  majority of cases)
* service_error: :timeout (only a few cases)

The latter happens when we hit the Req receive_timeout
(endpoint_timeout + 2s). I've seen Browserless not respect the timeout
param from time to time, so it's better to keep the timeout logic
"in-house" only.

* make service_error into a map with code and extra

* interpret temporary service errors

...but still consider them "unhandled" for telemetry, also notifying Sentry
and logging the warning.

* separate sentry messages (verification)

* make Verification.ChecksTest more DRY

* organize tests into describe blocks

* test verification telemetry and logging

* fix codespell

* pass timeout as query param to Browserless too
2025-10-27 09:17:15 +00:00
Adrian Gruntkowski f3ccfde980
Adjust persistor metrics buckets and remove decode measurement (#5831) 2025-10-27 08:12:09 +00:00
Artur Pata 51b56f496d
Fix 2FA disable dialog (#5827) 2025-10-24 15:25:57 +00:00
Artur Pata 49317f57fc
Stop docs info icon hovering over account menu (#5823) 2025-10-24 11:04:21 +00:00