Commit Graph

6 Commits

Author SHA1 Message Date
Artur Pata f7b535df4b
Fix dashboard report behavior when goals are in segments - variant C (#5175)
* 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
2025-03-13 13:02:14 +00:00
Artur Pata 47b8553ca1
Implement Site Segments billing feature (#5129)
* Implement Site Segments billing feature

* Make sure Site Segments benefit appears only when feature flag is present

* Add site_segments flag to v3 plans

* Refactor new filter menu back to ghost button

* Stop error state from persisting (#5131)

* Refactor how Segments appear on Choose Plan page

* Limit to 500 segments per site
2025-03-04 10:09:40 +00:00
Artur Pata 5ae2fd89f0
Resolve segment owner names and dates in site timezone in the BE (#5119)
* 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
2025-02-28 07:06:20 +00:00
Artur Pata 421e7d2766
Add Saved Segments UI (variant D) (#4891)
* 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
2025-02-26 12:32:25 +00:00
Artur Pata 5af43a93d5
Refactor Segments controller to be thinner (#4981)
* Refactor segments model

* Fix inconsistent code

* Remove superfluous error case

* Beautify Plausible.Segments module
2025-01-20 09:58:31 +00:00
Artur Pata f169f0caff
Establish saved segments API (#4899)
* Implement segments endpoint controllers

* Refactor endpoint controllers to be based on capabilities

* Add saved_segments feature flag check

* Fix issue when querying all segments on Growth plans

* Validate segment

* Refactor naming to permissions

* Add some permission based tests

* Give more info to compiler about expected args shape

* Implement centralized permission checking module

* Refactor to conventional rights validation

* Update tests

* Add name and segment_data length and filter depth validation

* Refactor route names and add tests for FF check plug

* Refactor mixed segments query name

* Remove inconsistent strict not equals

* Use a different format for result is Map case

* Remove newline between spec and def

* Fix issue with too deep nesting

* Verify in tests that segment is actually removed/not removed from DB

* Fix typo in fn name
2025-01-14 10:12:36 +00:00