Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2017-10-03 23:22:01 +0300
committerGitHub <noreply@github.com>2017-10-03 23:22:01 +0300
commit9af4e95aa976f3a6533e95b776b5298f73e5f916 (patch)
treed612cd4d32019e9e52ce1398b8bf214ec06a8e0f /plugins/Contents
parent359c3ec875b554c7b71a933b26d18cdde0bb8f4e (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/Contents')
-rw-r--r--plugins/Contents/Columns/ContentInteraction.php25
-rw-r--r--plugins/Contents/Columns/ContentName.php27
-rw-r--r--plugins/Contents/Columns/ContentPiece.php25
-rw-r--r--plugins/Contents/Columns/ContentTarget.php25
-rw-r--r--plugins/Contents/Contents.php4
-rw-r--r--plugins/Contents/lang/en.json3
6 files changed, 62 insertions, 47 deletions
diff --git a/plugins/Contents/Columns/ContentInteraction.php b/plugins/Contents/Columns/ContentInteraction.php
index a50467f9d6..e188fab521 100644
--- a/plugins/Contents/Columns/ContentInteraction.php
+++ b/plugins/Contents/Columns/ContentInteraction.php
@@ -8,9 +8,9 @@
*/
namespace Piwik\Plugins\Contents\Columns;
-use Piwik\Piwik;
+use Piwik\Columns\Discriminator;
+use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
-use Piwik\Plugins\Actions\Segment;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
@@ -19,19 +19,22 @@ class ContentInteraction extends ActionDimension
{
protected $columnName = 'idaction_content_interaction';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
-
- protected function configureSegments()
+ protected $type = self::TYPE_TEXT;
+ protected $acceptValues = 'The type of interaction with the content. For instance "click" or "submit".';
+ protected $segmentName = 'contentInteraction';
+ protected $nameSingular = 'Contents_ContentInteraction';
+ protected $namePlural = 'Contents_ContentInteractions';
+ protected $category = 'General_Actions';
+ protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
+
+ public function getDbColumnJoin()
{
- $segment = new Segment();
- $segment->setSegment('contentInteraction');
- $segment->setName('Contents_ContentInteraction');
- $segment->setAcceptedValues('The type of interaction with the content. For instance "click" or "submit".');
- $this->addSegment($segment);
+ return new ActionNameJoin();
}
- public function getName()
+ public function getDbDiscriminator()
{
- return Piwik::translate('Contents_ContentInteraction');
+ return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
diff --git a/plugins/Contents/Columns/ContentName.php b/plugins/Contents/Columns/ContentName.php
index 6168a48725..47255787d6 100644
--- a/plugins/Contents/Columns/ContentName.php
+++ b/plugins/Contents/Columns/ContentName.php
@@ -8,10 +8,10 @@
*/
namespace Piwik\Plugins\Contents\Columns;
-use Piwik\Exception\InvalidRequestParameterException;
-use Piwik\Piwik;
+use Piwik\Columns\Discriminator;
+use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
-use Piwik\Plugins\Actions\Segment;
+use Piwik\Exception\InvalidRequestParameterException;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
@@ -20,19 +20,22 @@ class ContentName extends ActionDimension
{
protected $columnName = 'idaction_content_name';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
-
- protected function configureSegments()
+ protected $segmentName = 'contentName';
+ protected $nameSingular = 'Contents_ContentName';
+ protected $namePlural = 'Contents_ContentNames';
+ protected $acceptValues = 'The name of a content block, for instance "Ad Sale"';
+ protected $type = self::TYPE_TEXT;
+ protected $category = 'General_Actions';
+ protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
+
+ public function getDbColumnJoin()
{
- $segment = new Segment();
- $segment->setSegment('contentName');
- $segment->setName('Contents_ContentName');
- $segment->setAcceptedValues('The name of a content block, for instance "Ad Sale"');
- $this->addSegment($segment);
+ return new ActionNameJoin();
}
- public function getName()
+ public function getDbDiscriminator()
{
- return Piwik::translate('Contents_ContentName');
+ return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
diff --git a/plugins/Contents/Columns/ContentPiece.php b/plugins/Contents/Columns/ContentPiece.php
index 4cd0722e5a..0bf5464611 100644
--- a/plugins/Contents/Columns/ContentPiece.php
+++ b/plugins/Contents/Columns/ContentPiece.php
@@ -8,9 +8,9 @@
*/
namespace Piwik\Plugins\Contents\Columns;
-use Piwik\Piwik;
+use Piwik\Columns\Discriminator;
+use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
-use Piwik\Plugins\Actions\Segment;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
@@ -19,19 +19,22 @@ class ContentPiece extends ActionDimension
{
protected $columnName = 'idaction_content_piece';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
-
- protected function configureSegments()
+ protected $segmentName = 'contentPiece';
+ protected $nameSingular = 'Contents_ContentPiece';
+ protected $namePlural = 'Contents_ContentPieces';
+ protected $acceptValues = 'The actual content. For instance "ad.jpg" or "My text ad"';
+ protected $type = self::TYPE_TEXT;
+ protected $category = 'General_Actions';
+ protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
+
+ public function getDbColumnJoin()
{
- $segment = new Segment();
- $segment->setSegment('contentPiece');
- $segment->setName('Contents_ContentPiece');
- $segment->setAcceptedValues('The actual content. For instance "ad.jpg" or "My text ad"');
- $this->addSegment($segment);
+ return new ActionNameJoin();
}
- public function getName()
+ public function getDbDiscriminator()
{
- return Piwik::translate('Contents_ContentPiece');
+ return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
diff --git a/plugins/Contents/Columns/ContentTarget.php b/plugins/Contents/Columns/ContentTarget.php
index 9e81c687f3..7448770749 100644
--- a/plugins/Contents/Columns/ContentTarget.php
+++ b/plugins/Contents/Columns/ContentTarget.php
@@ -8,9 +8,9 @@
*/
namespace Piwik\Plugins\Contents\Columns;
-use Piwik\Piwik;
+use Piwik\Columns\Discriminator;
+use Piwik\Columns\Join\ActionNameJoin;
use Piwik\Plugin\Dimension\ActionDimension;
-use Piwik\Plugins\Actions\Segment;
use Piwik\Plugins\Contents\Actions\ActionContent;
use Piwik\Tracker\Action;
use Piwik\Tracker\Request;
@@ -19,19 +19,22 @@ class ContentTarget extends ActionDimension
{
protected $columnName = 'idaction_content_target';
protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL';
-
- protected function configureSegments()
+ protected $type = self::TYPE_URL;
+ protected $nameSingular = 'Contents_ContentTarget';
+ protected $namePlural = 'Contents_ContentTargets';
+ protected $segmentName = 'contentTarget';
+ protected $category = 'General_Actions';
+ protected $sqlFilter = '\\Piwik\\Tracker\\TableLogAction::getIdActionFromSegment';
+ protected $acceptValues = 'For instance the URL of a landing page: "http://landingpage.example.com"';
+
+ public function getDbColumnJoin()
{
- $segment = new Segment();
- $segment->setSegment('contentTarget');
- $segment->setName('Contents_ContentTarget');
- $segment->setAcceptedValues('For instance the URL of a landing page: "http://landingpage.example.com"');
- $this->addSegment($segment);
+ return new ActionNameJoin();
}
- public function getName()
+ public function getDbDiscriminator()
{
- return Piwik::translate('Contents_ContentTarget');
+ return new Discriminator('log_action', 'type', $this->getActionId());
}
public function getActionId()
diff --git a/plugins/Contents/Contents.php b/plugins/Contents/Contents.php
index 289bdb25ec..580b752a53 100644
--- a/plugins/Contents/Contents.php
+++ b/plugins/Contents/Contents.php
@@ -14,7 +14,7 @@ use Piwik\Piwik;
class Contents extends \Piwik\Plugin
{
/**
- * @see Piwik\Plugin::registerEvents
+ * @see \Piwik\Plugin::registerEvents
*/
public function registerEvents()
{
@@ -59,4 +59,4 @@ class Contents extends \Piwik\Plugin
$joins[] = 'LEFT JOIN ' . Common::prefixTable('log_action') . ' AS log_action_content_interaction
ON log_link_visit_action.idaction_content_interaction = log_action_content_interaction.idaction';
}
-}
+} \ No newline at end of file
diff --git a/plugins/Contents/lang/en.json b/plugins/Contents/lang/en.json
index 0947590f69..e4bef887a0 100644
--- a/plugins/Contents/lang/en.json
+++ b/plugins/Contents/lang/en.json
@@ -7,8 +7,11 @@
"ContentInteractions": "Content Interactions",
"InteractionRate": "Interaction Rate",
"ContentName": "Content Name",
+ "ContentNames": "Content Names",
"ContentPiece": "Content Piece",
+ "ContentPieces": "Content Pieces",
"ContentTarget": "Content Target",
+ "ContentTargets": "Content Targets",
"Contents": "Contents",
"InteractionsMetricDocumentation": "The number of times a content block was interacted with (eg, a 'click' on a banner or ad).",
"ImpressionsMetricDocumentation": "The number of times a content block, such as a banner or an ad, was displayed on a page.",