* Use forked version of
* Add necessary scaffolding for enabling LV on dashboard
* Implement basics for LV pages breakdown
* Make tile and tabs latency friendly
* Bring back eslint-disable pragma in live_socket.js
* Document the code somewhat
* Fix live navigation callback in React
* Make dashboard components inside portals testable
* Add very rudimentary basic tests
* Fix typo
* Fix eslint pragma in `live_socket.js`
* Works
* Move shared link password check to AuthorizeSiteAccess plug
* Write changelog, cleanup
* Handle cookies already fetched in AuthorizeSiteAccess
* Unify shared link kind with plugins API entity
* 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>
* 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>
* 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
* feature gate creating shared links
* feature gate GET shared_link
* stop granting shared links access in code + organize tests
* allow GET shared_link for WP
* prevent shared link creation with special name
unless created by the Plugins API, the name WordPress - Shared Dashboard
will be considered reserved.
* do not render special shared links in site settings > visibility
* remove hardcoded special name from test
* add function doc for special names
* prevent updates to special name as well
* warn about losing access to shared links
* make features_usage return empty list on ce
* Update lib/plausible/sites.ex
Co-authored-by: hq1 <hq@mtod.org>
* move special name check to changeset
* fix tests
---------
Co-authored-by: hq1 <hq@mtod.org>
* Stop showing footer with stats, except when user is not logged in / viewing shared dashboard
* Add testsfor Site Settings menu CE and EE
* Fix test titles, test org and tags
* Remove new_time_on_page feature flag
* Update tests to use new time on page
* Mark time-on-page as a public metric in APIv2
* CHANGELOG.md
* Validate time_on_page in APIv2
* Update typing
* Remove redudant arguments
* Update GA4 test
* Update stats_controller_test
* Remove assertion from csv_importer
* Add nil case to new time on page tests
* CSV import/export support for time-on-page
Note only the new time-on-page metric is exported this way
* visibility check for graphing of time_on_page
* FE no longer receives/sends legacy_time_on_page_cutoff
* Remove current_user from exports
* Remove legacy_time_on_page_cutoff from query.include, make behavior work off of site.legacy_time_on_page_cutoff explicitly
* Remove dead function
* More current_user_id removals
* site.legacy_time_on_page_cutoff migration
* Update migration logic
* Cronjob for setting legacy_time_on_page_cutoff
* Test site creation default legacy_time_on_page_cutoff
* Use site.legacy_time_on_page_cutoff
Leaving the query param logic for now for testing purposes
* tweak cron
* Work around defaults in tests
* Fixes
* Make cutoff date in job configurable - useful for backfilling
* Backend: get rid of scroll_depth.ex
This commit starts treating the scroll depth feature as *always visible*,
removing the ClickHouse queries on dashboard loads and starting to always
include scroll_depth in dashboard reports and export queries.
* Frontend: remove site.scrollDepthVisible
* adjust csv_importer_test
* remove site.scroll_depth_visible_at
* Replace GET /segments and GET /segments/:segment_id with server-rendered list, fix issue with dashboard report columns
* Remove WIP comments and throw earlier for invalid dashboard state
* Fix Segments details issue on public / shared link sites, add tests
* Support passing `include` as a query parameter for dashboard APIs
* Mark time-on-page metric sortable
It now is thanks to the changed query
* new-time-on-page flag with cutoff being sent to the frontend
* Add correct tooltip title
* Implement metric warning for when legacy and new time_on_page metrics are mixed
* Send legacy_time_on_page_cutoff to backend
* Make time-on-page graphable with the new metric
* Only show metric warnings for time_on_page if flag is enabled
* Changelog
* Solve an clickhouse error when querying timeseries with only legacy time-on-page
* Add tests for timeseries of new time-on-page
Along the way fix an issue with comparisons not working properly
* Solve a typing issue
* Allow toggling legacy_time_on_page_cutoff off in dashboard
* Slightly better workaround
* Solve typing issue
* Prettier
* Guard against no warning
* Solve warning
* Revert "Ensure no export button is rendered for public roles"
This reverts commit 213fafe041.
* Revert "Restrict public CSV export access (#5089)"
This reverts commit d3d0547484.
* Keep the Role.public enum needed elsewhere
* Resolve segment owner names and dates in site timezone in the BE
* Fix SegmentAuthorship
* Fix issue with updating dangling segment
* Refactor flaky PATCH segment test
* Unify segment type label logic
* Refactor SegmentOwnership type definitions for clarity
* WIP
* Load members
* Assert that we know has_not_done will not work without changes
* Add tests
* Assert that dates are in the expected format
* Add tests, better authorship dates, api.js -> api.ts
* Add error panels
* Flatten errors on the API side
* Stop name copy from getting too long
* Make comparison mode and edit segment modes exclusive
* Fix flicker calculating space
* Fix issue with definite state not persisting
* Unhitch modals from query-context
* Separate API format and dashboard format of segment_data
* Clarify purpose of useDefiniteLocationState
* Tweak UI: site switcher, save as segment
* Fix issues with modals
* Remove commented and unnecessary code, better query context
* Fix too permissive site members dataset
* Make sure Segment doesn't show up as an option to customer without the FF
* Fix issue with 'See more' menu being present when it should not be
* Permit :has_not_done filter in segments
* Refactor to matching on filter list structure
* Flatten :and stemming from segment filters on first level
* Update test
* Add tests for `Teams.get_or_create/1` and `Teams.get_by_owner/1`
* Start populating `current_team` in assigns fetching value from session
* Clean up team passing in invitation services
* Make site transfer service handle multi-team scenario
* Handle multi-team and permission transfer errors on controller level
* Handle multi-teams in site creation on service and controller level
* Drop validation limiting full membership to a single team
* Make user deletion account for public team ownership
* Adjust feature availability checks for Stats API key
* Use current_team when determining limits on site transfer invitation
* Adjust trial upgrade email submission to account for multiple owners
* Remove unnecessary `Teams.load_for_site/1`
* Spike renaming `owner` and `ownership` relationships to plural versions
* Make HelpScout integration handle owner of multiple teams gracefully
* Add FIXME note
* Resolve paddle callback issue by always provisioning a new team when none passed
* Set `current_team` as `my_team` only when user is an owner
* Implement basics of Teams CRM
* Extend Teams CRM
* Further adjust User and Site CRM and refine Team CRM
* Convert Enterprise Plan CRM to refer to team directly and not via user
* Remove unused virtual fields from User schema
* Add note to HelpScout integration
* Allow listing multiple owners under Site Settings / People
* Remove unused User schema relations
* Fix current team fetch in auth plug and context
* Implement basic team switcher
* Ensure (site) editor role is properly handled in site actions auth
* Don't set `site_limit_exceeded` error marker on `permission_denied` error
* Link from HS integration to Team CRM instead of User CRM when available
* Ensure consistent ordering of preloaded owners
* Add `with_subscription` preload for optimisitation
* Add ability to search sites by team identifier
* Add ability to pick team when transferring ownership directly
* Fix failing HelpScout tests
* Scope by team when listing sites in dashboard and via API (optional)
* Add ability to search by team identifier in plans CRM lookup widget
* Add subscription plan, status and grace period to team status info
* Expose teams list in user CRM edit form and fix team details CRM view
* Fix Team Switcher styling
* Reorganise header nav menu
* Avoid additional queries when authenticating user
* Hide the pay/site transfer message on lock screen when teams FF is on
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* Restrict public CSV export access
* restrict export
* Restrict public CSV export access
* Revert "restrict export"
This reverts commit f756486420.
* Don't show CSV export option for viewers who are not logged in
---------
Co-authored-by: Adam Rutkowski <hq@mtod.org>
* WIP: Update scroll_depth_visible_at in ingestion
* Simplify code and test genserver directly
* No more check_scroll_depth_visible!
* Update a test
* Update a test
* GenServer -> ets
* Additional where
* Fix a test
* add migration
* move scroll_depth_enabled? fn
* maybe set engagement_metrics_enabled_at when requesting dashboard
* maybe set engagement_metrics_enabled_at in shared_link action
* maybe set engagement_metrics_enabled_at on full export
* fix tests
* feature gate scroll depth on the dashboard with site.engagement_metrics_enabled_at
* feature gate scroll depth in full export too
* fix npm ci
* Rename things into FE, remove unneccessary flag checks
* Continue with renaming
* Rename site flag to be more descriptive
* Move business logic, calculate based on scroll depth, make more precalculatable
* Some docs
* Rename to site.scrollDepthVisible in frontend
* Update migration
* Fix template
* Remove boilerplate from tests
* Update tests
* More straight-forward test
* Update condition
---------
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
* Expose site_id and site_native_stats_start_at via query
This allows to do more query-building without exposing and passing `site` directly.
* Very basic has_done/has_done_not operator support
No event:goal support yet, no validations
* Add validations that only event: dimensions can be used within has_done/has_done_not
* Allow event:goal filters nested within has_done/has_done_not behavioral filters
* Minor fix for do_decide_custom_prop_table
* has_done support for goals
Minor changes along the way:
- preloaded_goals structure changes
- event:goal restrictions were loosened within has_done
- we don't allow nesting has_done anymore
* Dont query imports when behavioral filters are present
* Update callsites of filtering_on_dimension? to work with new behavioral filters
* has_done_not -> has_not_done
* Changelog entry
* Typegen
* credo cleanup
* Fix changelog
* Remove changelog
* Mark has_done as internal-only
* combine two validations into a single loop
* has_done is now session-based not user-based
* Update a test
* Update transform_tree
* migration: add scroll_depth to events_v2
* (cherry-pick) ingest scroll depth
* replace convoluted test with more concise ones
* QueryParser: parse internal scroll_depth metric + validation
* turn QueryComparisonsTest into QueryInternalTest
* rename file
* (cherry pick) query scroll depth 15b14d3
...and move the tests into `internal_query_test.exs`
* review feedback
* Get rid of unnecessary separation between aggregate and group scroll depth
* Drop irrelevant other metrics in tests
* add test ensuring scroll depth unavailable in Stats API v1
* Put scroll depth on the dashboard
* Top Stats
* Main Graph
* Top Pages > Details
* feature flag for dashboard scroll depth access
* ignore credo warning
* enable scroll_depth flag in tests
* remove duplication
* write timestamps explicitly in a test
* revert moving tests around
* Add query_comparisons_test back
* Move scroll_depth tests into query_test
* Delete query_internal_test
* rename setup util (got updated on master)
* use pageleave_factory where applicable
* Use the correct generated query-api.d.ts
* npm format
* Comparisons: Move code to LegacyQueryBuilder
* WIP: Return comparison results to frontend
* refactor: remove useless param
* Different result format
* Pass object to metric.renderValue
* remove dead code
* Fixup response format
* Comparison in a tooltip
Not perfect at all, but a good start. Problems arise with money etc.
* Simple change arrow
* Extract metric entry to ts
* popper attempt WIP
* Slightly nicer content
* Solve warning
* Unified changeArrow in app
* Remove needless spanning
* Always set `graph_metric` in top stats.
FE already has business logic around whether a given metric is graphable
* Remove dead code
* Move Money module under dashboard utils, keep in build
* change <Metric /> definition to take in a `formatter` and store default formatters in another (typed) const
* Use standard system for formatting numbers
* Arrows only in table
* remove dead import
* Inline renderValue
* Render metric name in tooltip
* numberFormatter -> numberShortFormatter
* numberShortFormatter update
* Separate long/short formatters
* Use long vs short formatters
* Put column name into tooltip
* Slightly improved label handling for percentages, conversion rate
* Improved boundary handling in tooltip.js
* Iterate tooltips, no tooltip for - revenue
* Update top stats tests after graph_metric change
* Change revenue metrics stats API return structure
Conversion now happens earlier in query pipeline, we return float for comparison purposes
* useQueryContext in a component
* graph_metric for current visitors to fix realtime view
* No tooltips if fully - row
* renderValue as a proper function
* Simplify MetricEntry
* Use common const
* tooltip to typescript
* More explicit return structure
* metric-entry -> metric-value
* Restore some files
* ChangeArrow
* Restore MoreLink
* Fix typing in MoreLink
* <MetricValue />
* Tests for MetricValue and ChangeArrow
* details modal fixups
* re-add space between arrow and percentage
* Solve stylelint issues
* Update test
* Format
* Add flag `breakdown_comparisons_ui`
* reformat
* Remove no change icon, better alignment
* Revert "Remove no change icon, better alignment"
This reverts commit a8d62b6383.
* number-formatter.ts
* numberLongFormatter refactor
* useMemo dependency
* Handle nulls/undefined in top stats
---------
Co-authored-by: Uku Taht <uku.taht@gmail.com>
* Refactor and fix `AuthorizeSiteAccess` plug shared link case handling
* Make plug module name more consistent
* Add moduledoc
* Add regression test for shared link auth case
* Adjust failing case test to account for different response
* Further restrict accepted input and configuration
* Extend plug-specific tests
* Tag EE-only test properly
* Remove one DB roundtrip from AuthorizeSiteAccess
* Improve naming slightly
* Filter shared link by site ID on query level already
---------
Co-authored-by: Uku Taht <uku.taht@gmail.com>
* query.date_range is now in UTC instead of user timezone
This simplifies things down the line and fixes several bugs where
query.date_range is cast to naivedatetime for ecto purposes
Many places still remain broken:
- comparison queries
- `to_date_range` calls
* Make default_for_date_range not care about time zones
* Make timezone parameter mandatory for to_date_range
* Simplify utc_date_range, update legacy query builder
* Fix more cases where query date range is needed
* query.date_range -> query.utc_time_range
* Query.date_range/1 function
* ensure_include_imported update
* Clean up send_email_report
* Dont include imports for time:hour and time:minute dimensions
Also include more information about import warnings in query results
* Update lib/plausible/stats/query_result.ex
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
* Revert patch
* Imported disabled graph notice (#4522)
* add explicit skip_imported_reason for unsupported interval
* stop returning information about imports from main_graph
* return warning about interval in Stats API Timeseries
* display warning bubble about interval too short for imported data
* update changelog
* improve styling of the exclamation circle icon
* return tuple from timeseries instead of map
* rename variable
* Update CHANGELOG.md
---------
Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
* Migration: add installation meta
* Update site schema with installation meta
* Remove VERIFICATION_ENABLED env var
* Add context API to create/remove special goals
* Add context api to update installation meta
* Remove verification enabled check
* Update new progress flow definitions
* Update generic components
* Remove internal /status API
* Implement installation live view
* Update traffic change notifier link
* Update verification, no more modal
* Update routes
* Remove focus.html - will unify everything under app layout
* Fix broken link
* Update templates with focus_box mostly
* Update controller tests
* Update controllers and stop using the focus layout
* copy changes
* Update verification.ex
* Remove dead template
* Update settings_general.html.heex
* Update copy in tests
* Update installation.ex
* Remove dangling dot
* Fix link
* Update installation.ex
* Update installation.ex
* Better tooltips?
* Simpler labels
* Revert "Simpler labels"
This reverts commit 797560ef82f2067458b03b884be5aecc8fdc72bc.
* Add copy to clipboard link and fix snippet's dark mode
* Offer installation detection skip only if ws connected
* Put COPY link at the bottom with background
* Make tooltips link to docs
* Fix cherry-pick gone wrong
* Hide tooltips on mobile screens
* WIP: 404 tracking wizard
* Revert "WIP: 404 tracking wizard"
This reverts commit a9c9c79bbd.
* Update lib/plausible_web/live/components/verification.ex
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Update lib/plausible_web/live/installation.ex
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Use current_user from socket.assigns
* Update lib/plausible_web/live/installation.ex
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Use current_user from socket.assigns
* Use conn.private to steer verification tests
* Drop non-sticky tooltip in favour of component parametrization
Co-authored-by: Artur Pata <artur.pata@gmail.com>
* Reapply "WIP: 404 tracking wizard"
This reverts commit 3ba81671d7.
* Fix installation tests including 404 tracking
* Fixup the tooltip component
* Format
* Update installation.ex
* Put flash whenever installation option changes
* Use last known installation type on domain change
* Extract user flow definition to provide compile-time checks
* See if this helps running CE migrations successfully
* Use `styled_link` on registration/login views
* Don't crash when there's no conn.private carried over
* Format
* Push "Determining installation type" message a bit lower
* Use links and footer lists uniformly
This commit introduces a `<.focus_list/>` component
for rendering focus box footer links with colored
discs. It also equips generic link components
with the ability of sending non-GET requests
along with CSRF token, so we can apply uniform
styling and stop using legacy Phoenix link tags.
cc @zoldar @apata
* ws 👾
* Render more descriptive flashes on script config change
---------
Co-authored-by: Marko Saric <34340819+metmarkosaric@users.noreply.github.com>
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
Co-authored-by: Artur Pata <artur.pata@gmail.com>
* Set log_comment with request information
* CRMAuthPlug -> SuperAdminOnlyPlug
* Super basic debug view
* Handle clustered setups
* Changelog entry
* Cleanup
* fragment trick to use ecto querying, filtering
* Move clustered_table? function to IngestRepo module
* Format
* More resilient user_id getting in helper
* Make goals accept wildcards in :is queries
* Add support for contains/does_not_contains in the backend
* Support all operations for event custom properties
* Support does_not_contain on the frontend
* Changelog entry
* Render filter operations nicely for does not contain
Found 3 extra pixels for operation dropdown
* Remove multiple_filters feature flag
* Do not parse query params from dogfooded events
* Revert "Do not parse query params from dogfooded events"
This reverts commit ee97b87864.
* Ignore URL params entirely when dogfooding demo dashboard