* Update report percentages on dashboard and details view
* Add percentages to Countries, Regions, and Cities reports
* Add percentages to Channels, Sources, and UTM reports
* Add percentages to top pages, entry pages, and exit pages reports
* Update tests to include percentages
* Change dashboard copy from title case to sentence case
* Update details modal style
* Make animations snappier
* Introduce max height to modal and make inner content scrollable
* Improve modal mobile design
- Enable horizontal scroll for details modal on mobile
- Add responsive spacing and positioning to modal
* Added mobile tap behavior to external link in list report
* Show tooltips only when in comparison mode or when the number is abbreviated
* remove previously added showTooltip prop
- This isn't needed anymore since we now handle the tooltip logic in the MetricValue component
* Show long format upon hovering detailed view metrics
* Added mobile tapping behaviour to detailed view
* Added percentages to all detailed views
* Add mobile swipe-to-close behavior for modal
* Adjust sensitivity of modal drag to close
* Use hammerjs for swipe-to-close modal behaviour
* Prevent dragging if gesture starts inside table
* Show 2 decimal places for percentages < 0.1% across dashboard
* Adjust dark mode styles
* Add hover effect to external link icon
* Update tests to expect two-decimal percentages
* Undo hammer install and revert to old modal styling
* Remove CR and % columns from goals and custom props reports on dashboard, and show on hover in detailed view
* Remove unused constants
* Undo conversion rate on hover behaviour
- Unlike percentages, CR should show permanently.
* Show percentages permanently in custom props detailed view
* Adjust width of conversion metrics column
* Updated metric-value test
* Update top-bar test
* Added changelog entry
* Fix test expectations for percentages with imported data
- Update tests to expect correct percentages (≤100%) when imported data is included. These tests will fail until the percentage calculation bug is fixed, documenting the expected behavior.
* Add imported_visitors to tests to ensure correct total_visitors calculation
* Correct imported_visitors count in test
* Limit preloading goals
* Enforce max limit for goals per site
* typo
* credo
* Remove logger call
* Integrate #5916
* Add a test
* Add test
* Unignore opts
* rename Query.build -> Query.parse_and_build
* rename two test files and move 4 %Query{} building functions into subfolder
* rename StatsAPIFilterParser to LegacyStatsAPIFilterParser
* rename Filters.QueryParser to QueryParser
* turn QueryParserTest into QueryParseAndBuildTest
* move query_parser.ex out of filters directory
* separate build from parse
* disable sample_threshold in the new intermediate build function, for now
* remove now redundant test util functions
* remove unused import
* address todo from earlier
* credo
* Make module names in sync with paths in tests
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Consolidated Views: flip CTA flow, ask to upgrade first
Avoiding accidental dark pattern here: we'll first ask the
user to upgrade, instead of letting them create a team
they might not need, uninformed.
* Test
* !fixup
* Updated empty states across settings
* Fix funnels and props functionality not hiding when toggled off
- Add show_content? attribute to generic tile component
- Ensure content is hidden when toggled off
- Avoid rendering border and empty space when toggled off
- Fix formatting
* Update personal sites empty state
* Make `tile` component lv-embeddable (#5891)
* Use new tile component for funnels, goals, imports and custom properties
- Update the settings live views to use the new tile component
- Ensure tile component is updated when feature visibility is toggled
- Extract `no_search_results` and `empty_state` components for better readability
- Extract `highlighted` component
- Update tests
* Add empty states for team sites and simplify empty state logic
- Hide top bar on `/sites` when empty state is shown
- Extract empty state logic to a separate function
- Show the same empty state for both personal and team sites, with different copy
- extract search logic to a separate function
- add tests for various empty states cases
* Clean up:
- remove HTTP feature visibility routes now that
we're doing it 100% via LV
- add tests for feature toggling
- move "site_role" to where it's used (upgrade CTA),
since there were already some feature-related function calls
there
- fix random test failures left
* Fixup
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Fix Safari bug where `+ Add another step` button wasn't hidden properly
* Increase spacing between add step button and conversion rate when both are shown
* 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>
* 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
* 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>
* 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
* 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>
* 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
* 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
* 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
* 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>
* 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>
* 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
* Create static consolidated view UI on `/sites` page
- Improve existing site card layout
- Add static UI for the consolidated view
- Add dismissable upgrade card UI
- Extract favicon fetching logic to function
- Configure configurable fallback icon per route
- Add `/favicon/sources_globe/` route with different icon than `/favicon/sources/` to use on `/sites` page
* Improve the mobile view of the `/sites` page
* Minor query interface UX extension (#5713)
* Minor query interface extension
* !fixup
* !fixup
* Initial implementation of consolidated views on /sites
* Improve loading state
* no need to handle nil in main interface
* Juggle `can_manage_consolidated_view?`
* Require team setup in order to enable consolidated view
* nil catcher
* Fixup test fixture
* Don't show Consolidated View tab in CS if team is not setup
* Reorganize + test
* Remove comment
* Only show consolidated views to superadmins for now
* Remove temporary sleep
* CE unused bindings
* Clean up seeds
* EE
* Fixup test
* Test non-superadmin scenario
* Add a test guarding parity between small plots (consolidated vs individual)
* Move private function so CE won't complain
* See if the graphs are now similar at least :)
* sort
* Map keys are unsorted
* Ensure engagement events aren't counted as visitors on smol graphs
* just try and revert
* Revert "just try and revert"
This reverts commit 7584f59816.
* Simplify globe icon handling
* Remove unnecessary @rest
* Split tests into more focused cases
* Address jumpiness on furious refresh cycle
* Revert "Address jumpiness on furious refresh cycle"
This reverts commit 5c03b36918.
* Another attempt at jumpiness
* Enforce less noticeable lag applying the diff from loading to loaded
* Reduce flashing on stats load
---------
Co-authored-by: Sanne de Vries <sannedv@protonmail.com>
* do not use cache bust url in initial installaton check
* make installation_v2_cache_bust replace diagnostics, not add them
The test added in this commit also surfaced the function clause error
encountered on prod. This is also fixed in this commit by making sure
delays are given to Req retries as integers, rather than floats.
* assert_matches
* detection handled/unhandled telemetry
* telemetry for verification too
* move sentry call next to telemetry event
* fix ce compile warning
* fix case clause
* remove implicit nil
* telemetry_event functions without argument
* Upgrade phoenix and phoenix_live_view
* Use new phoenix controller options
* Run mix format
* Upgrade lazy_html and bcrypt
* Always put root layout
* Remove deprecated use Plug.Test
* Escpaing updates for LazyHTML
* Fix double layouts in site settings
* Fix more escaping in tests
* More LazyHTML updates
* Fix remaining LazyHTML issues
* More Floki -> LazyHTML conversions
* More Floki -> LazyHTML conversions
* Fix another issue with Floki -> LazyHTML
* Fix another lazyHTML issue
* Remove parsing from tree
* Fix HTML escaping in teams_test
* More test fixes
* More test fixes
* Add layout to browser_sso_notice pipeline
* Extract elem_count helper
* skip experimental comment
* alias
* remove cv abbreviations
* uncapitalize word
* use enabled?/1 in tests
* ask for confirmation before delete
* remove settings link
* Extract `has_sites_to_consolidate?` and `enabled?` for consolidated
views
* Ensure consolidated view is validated on site removal
* Verify condolidated view preconditions on regular site removal
* Hook only regular sites
* Alias
* Revert "Alias"
This reverts commit 5c95b1fa0a.
* Fix flaky test
* Always update stats start dates for consolidated views
* Ensure consistent regular site id ordering
* Introduce `reset_if_enabled/1` - along with site transfers and deletions
* Credo
* Re-implement reset_if_enabled to delete only when necessary
* Turn `has_sites_to_consolidate/1` private
* Move test to a different describe block
* Test `stats_start_date` refresh for consolidated views
* Credo
* Remove transaction wrap
* Fix typo
* WIP
* Add tailwind migration script
* Change deprecated classes via migration script
* Manual fixes
* Restore color configuration with CSS variables
* Convert the rest of the config
* Fix dropdown ring opacity
* Remove migration script
* Fix stylelint errors
* NPM run format
* Fix shadow and rounded variant usage
* Add custom CSS to components layer
* Fix dark: and hover: conflict in settings_tab
* Fix funnel form background opacity
* Fix final bg-opacity
* Bring back cursor-pointer for buttons by default
* npm run format
* move lib/plausible/installation_support/ -> /extra/lib/...
* extract Live.AwaitingPageviews exclusively for CE
* VerificationTest to ee only
* fix the rest of the compile/test errors on CE
* fix warning about not using default for optional argument
* move module attr
* virtual rollups -> consolidated sites
* fix queryparser and test
* fix legacy_query_builder and test
* fix typespec
* simple consolidated view query test (Stats API)
* add test util
* skip verification on consolidated sites
* add test for internal (dashboard) stats query
* fix CE
* Fix showing consilidated stats on the dashboard
...by making sure site.native_stats_start_at and stats_start_date are
set.
* fix CE again
* add typespecs and tests for native_stats_start_at
* skip else clause
* use ConsolidatedView.enable in test util
* defensive where builder
* remove redundant cache
* get query.consolidated_site_ids from cache
* fix test
* fix CE
* fix CE again
* eligibility check when enabling cvs
* create cvs with native_stats_start_at assigned already
* fix dialyzer warning
* Account for feature check error when adding custom prop via Sites API
* Expand Teams API with team membership check predicate
* Validate feature availability for Sites API endpoints
* Refactor tests to account for differrent errors