diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2017-10-03 23:22:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-03 23:22:01 +0300 |
commit | 9af4e95aa976f3a6533e95b776b5298f73e5f916 (patch) | |
tree | d612cd4d32019e9e52ce1398b8bf214ec06a8e0f /plugins/ExampleTracker | |
parent | 359c3ec875b554c7b71a933b26d18cdde0bb8f4e (diff) |
Better segment editor and fixes (#12040)
* column tweak
* fix install
* more tweaks
* rename column to dimension
* various fixes
* added new control expandable select
* starting to refactor segment selector
* make segment editor work again
* use translation keys
* defined some metrics
* set types
* simplify
* simplify
* fix join generator
* add possibility to use custom join table names when using query builder and it uses an inner query
* fix bug in query selector when selecting same field name from different tables twice
* more metadata
* more tweaks
* improve selector
* add possibility to use custom entity names
* also processed archived metrics
* generate sql filter, suggested values callback, and accept values automatically for columns with enums
* several tweaks
* focus search field when opening it
* various tweaks
* added missing method
* format and fix more metadata
* more fixes
* better definition
* define custom filter
* fix definition
* fix various tests
* fix more tests
* fix bug in logquery builder
* fix referrerurl segment was missing
* fix some tests
* fix more tests
* add group
* refactor for better definition
* fix a bug in log query builder when similar columns are used in archiver
* add goal metrics
* various fixes
* make datatable row more flexible
* various fixes and visualization enhancements
* simply segment editor and make it smaller
* remove trailing comma
* various fixes and added new dimension
* fix formatting of returning customer
* added missing primary key
* fixes
* various fixes and improvements
* make sure to update segment definition when selecting a value from auto complete list
* various fixes and more metrics
* more metrics
* more dimensions and fixes
* fix some tests
* fix some integration tests
* update submodule
* fix some system tests
* fix ui tests
* trigger new test run
* fix more ui tests
* fix system tests
* update submodule
* fix categories
* sort segments by category for more consistency
* add custom variables
* some translations and fixes
* add minute segment
* more segments
* added plurals
* added some docs
* fix test
* fix tests
* fix tests
* added suggested values
* fix some tests
* various fixes
* fix more tests
* allow to select segments on any site
* make sure to include file
* added doc block
* fix some system tests
* fix most system tests
* fix ui test
* fix system test
* adjust examples
* added more tests and docs
* no metrics for these dimensions
* added developer changelog and made some classes public api
* some fixes for entity names
* add possibility to set format metrics in test
* more consistency in defining the name
* get idsites only if provided
* fix integration tests
* added another segment for visit start hour and visit start minute
* more clear name for segment
* use old segment name to not break bc
* various fixes
* more test fixes
* fix no suggested values for new segment
* add event value
* for boolean dimensions only sum metric
* update available widgets when updating reporting menu
* Add new segments in developer changelog + typo
* fix system tests
* fix screenshot test
Diffstat (limited to 'plugins/ExampleTracker')
4 files changed, 46 insertions, 51 deletions
diff --git a/plugins/ExampleTracker/Columns/ExampleActionDimension.php b/plugins/ExampleTracker/Columns/ExampleActionDimension.php index b0ce98f7c9..3710659d6d 100644 --- a/plugins/ExampleTracker/Columns/ExampleActionDimension.php +++ b/plugins/ExampleTracker/Columns/ExampleActionDimension.php @@ -27,6 +27,12 @@ use Piwik\Tracker\Action; class ExampleActionDimension extends ActionDimension { /** + * The name of the dimension which will be visible for instance in the UI of a related report and in the mobile app. + * @return string + */ + protected $nameSingular = 'ExampleTracker_DimensionName'; + + /** * This will be the name of the column in the log_link_visit_action table if a $columnType is specified. * @var string */ @@ -41,28 +47,21 @@ class ExampleActionDimension extends ActionDimension protected $columnType = 'VARCHAR(255) DEFAULT NULL'; /** - * The name of the dimension which will be visible for instance in the UI of a related report and in the mobile app. - * @return string + * The type of the dimension is automatically detected by the columnType. If the type of the dimension is not + * detected correctly, you may want to adjust the type manually. The configured type will affect how the dimension + * is formatted in the UI. + * @var string */ - public function getName() - { - return Piwik::translate('ExampleTracker_DimensionName'); - } + // protected $type = self::TYPE_TEXT; /** - * By defining one or multiple segments a user will be able to filter their visitors by this column. For instance + * By defining a segment a user will be able to filter their visitors by this column. For instance * show all actions only considering users having more than 10 achievement points. If you do not want to define a - * segment for this dimension just remove the column. + * segment for this dimension, simply leave the name empty. */ - protected function configureSegments() - { - $segment = new Segment(); - $segment->setSegment('keywords'); - $segment->setCategory('General_Actions'); - $segment->setName('ExampleTracker_DimensionName'); - $segment->setAcceptedValues('Here you should explain which values are accepted/useful: Any word, for instance MyKeyword1, MyKeyword2'); - $this->addSegment($segment); - } + protected $segmentName = 'keywords'; + + protected $acceptValues = 'Here you should explain which values are accepted/useful for segments: Any word, for instance MyKeyword1, MyKeyword2'; /** * This event is triggered before a new action is logged to the log_link_visit_action table. It overwrites any diff --git a/plugins/ExampleTracker/Columns/ExampleConversionDimension.php b/plugins/ExampleTracker/Columns/ExampleConversionDimension.php index 6b6bf3d51f..752104c1c8 100644 --- a/plugins/ExampleTracker/Columns/ExampleConversionDimension.php +++ b/plugins/ExampleTracker/Columns/ExampleConversionDimension.php @@ -43,28 +43,27 @@ class ExampleConversionDimension extends ConversionDimension protected $columnType = 'INTEGER(11) DEFAULT 0 NULL'; /** + * The type of the dimension is automatically detected by the columnType. If the type of the dimension is not + * detected correctly, you may want to adjust the type manually. The configured type will affect how the dimension + * is formatted in the UI. + * @var string + */ + // protected $type = self::TYPE_NUMBER; + + /** * The name of the dimension which will be visible for instance in the UI of a related report and in the mobile app. * @return string */ - public function getName() - { - return Piwik::translate('ExampleTracker_DimensionName'); - } + protected $nameSingular = 'ExampleTracker_DimensionName'; /** - * By defining one or multiple segments a user will be able to filter their visitors by this column. For instance + * By defining a segment a user will be able to filter their visitors by this column. For instance * show all reports only considering users having more than 10 achievement points. If you do not want to define a - * segment for this dimension just remove the column. + * segment for this dimension, simply leave the name empty. */ - protected function configureSegments() - { - $segment = new Segment(); - $segment->setSegment('myConversionSegmentName'); - $segment->setCategory('General_Visit'); - $segment->setName('ExampleTracker_DimensionName'); - $segment->setAcceptedValues('Here you should explain which values are accepted/useful: Any number, for instance 1, 2, 3 , 99'); - $this->addSegment($segment); - } + protected $segmentName = 'myConversionSegmentName'; + + protected $acceptValues = 'Here you should explain which values are accepted/useful for segments: Any number, for instance 1, 2, 3 , 99'; /** * This event is triggered when an ecommerce order is converted. In this example we would store a "0" in case it diff --git a/plugins/ExampleTracker/Columns/ExampleDimension.php b/plugins/ExampleTracker/Columns/ExampleDimension.php index 738d0be9e1..25e48bb306 100644 --- a/plugins/ExampleTracker/Columns/ExampleDimension.php +++ b/plugins/ExampleTracker/Columns/ExampleDimension.php @@ -23,8 +23,6 @@ class ExampleDimension extends Dimension * The name of the dimension which will be visible for instance in the UI of a related report and in the mobile app. * @return string */ - public function getName() - { - return Piwik::translate('ExampleTracker_DimensionName'); - } + protected $nameSingular = 'ExampleTracker_DimensionName'; + }
\ No newline at end of file diff --git a/plugins/ExampleTracker/Columns/ExampleVisitDimension.php b/plugins/ExampleTracker/Columns/ExampleVisitDimension.php index 15d32592a6..0997a18ee7 100644 --- a/plugins/ExampleTracker/Columns/ExampleVisitDimension.php +++ b/plugins/ExampleTracker/Columns/ExampleVisitDimension.php @@ -41,28 +41,27 @@ class ExampleVisitDimension extends VisitDimension protected $columnType = 'INTEGER(11) DEFAULT 0 NULL'; /** + * The type of the dimension is automatically detected by the columnType. If the type of the dimension is not + * detected correctly, you may want to adjust the type manually. The configured type will affect how the dimension + * is formatted in the UI. + * @var string + */ + // protected $type = self::TYPE_NUMBER; + + /** * The name of the dimension which will be visible for instance in the UI of a related report and in the mobile app. * @return string */ - public function getName() - { - return Piwik::translate('ExampleTracker_DimensionName'); - } + protected $nameSingular = 'ExampleTracker_DimensionName'; /** - * By defining one or multiple segments a user will be able to filter their visitors by this column. For instance + * By defining a segment a user will be able to filter their visitors by this column. For instance * show all reports only considering users having more than 10 achievement points. If you do not want to define a - * segment for this dimension just remove the column. + * segment for this dimension, simply leave the name empty. */ - protected function configureSegments() - { - $segment = new Segment(); - $segment->setSegment('achievementPoints'); - $segment->setCategory('General_Visit'); - $segment->setName('ExampleTracker_DimensionName'); - $segment->setAcceptedValues('Here you should explain which values are accepted/useful: Any number, for instance 1, 2, 3 , 99'); - $this->addSegment($segment); - } + protected $segmentName = 'achievementPoints'; + + protected $acceptValues = 'Here you should explain which values are accepted/useful for segments: Any number, for instance 1, 2, 3 , 99'; /** * The onNewVisit method is triggered when a new visitor is detected. This means here you can define an initial |