diff --git a/plugins/Insights/API.php b/plugins/Insights/API.php index 131bc65c01e..08eedc1f557 100644 --- a/plugins/Insights/API.php +++ b/plugins/Insights/API.php @@ -58,7 +58,7 @@ public function getInsightsOverview($idSite, $period, $date) for ($index = $firstTableId; $index <= $lastTableId; $index++) { if (!in_array($index, $reportTableIds)) { - DataTable\Manager::getInstance()->deleteTable($index); + $dataTableManager->deleteTable($index); } } diff --git a/plugins/Insights/Controller.php b/plugins/Insights/Controller.php index 6512487a9fe..8526052215c 100644 --- a/plugins/Insights/Controller.php +++ b/plugins/Insights/Controller.php @@ -13,7 +13,7 @@ use Piwik\View; /** - * + * Insights Controller */ class Controller extends \Piwik\Plugin\Controller { diff --git a/plugins/Insights/javascripts/insightsDataTable.js b/plugins/Insights/javascripts/insightsDataTable.js index c031ade4b74..18780b4d7a3 100644 --- a/plugins/Insights/javascripts/insightsDataTable.js +++ b/plugins/Insights/javascripts/insightsDataTable.js @@ -40,6 +40,14 @@ this.initOrderBy(domElem); this.initComparedToXPeriodsAgo(domElem); this.initFilterBy(domElem); + this.setFixWidthToMakeEllipsisWork(domElem); + }, + + setFixWidthToMakeEllipsisWork: function (domElem) { + var width = domElem.width(); + if (width) { + $('td.label', domElem).width(parseInt(width * 0.60, 10)); + } }, _changeParameter: function (params) { diff --git a/plugins/Insights/tests/ApiTest.php b/plugins/Insights/tests/ApiTest.php index c62a20aab46..1e0818d8c7c 100644 --- a/plugins/Insights/tests/ApiTest.php +++ b/plugins/Insights/tests/ApiTest.php @@ -11,6 +11,7 @@ use Piwik\DataTable; use Piwik\Plugins\Insights\API; use Piwik\API\Request as ApiRequest; +use Piwik\Plugins\Insights\tests\Fixtures\SomeVisitsDifferentPathsOnTwoDays; /** * @group Insights @@ -21,7 +22,7 @@ class ApiTest extends \IntegrationTestCase { /** - * @var \Test_Piwik_Fixture_SomeVisitsDifferentPathsOnTwoDays + * @var SomeVisitsDifferentPathsOnTwoDays */ public static $fixture = null; @@ -240,4 +241,4 @@ private function assertRows($expectedLabels, DataTable $dataTable) } } -ApiTest::$fixture = new \Test_Piwik_Fixture_SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file +ApiTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays(); \ No newline at end of file diff --git a/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php similarity index 94% rename from tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php rename to plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php index 2486dcf6492..6fc2861b926 100644 --- a/tests/PHPUnit/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php +++ b/plugins/Insights/tests/Fixtures/SomeVisitsDifferentPathsOnTwoDays.php @@ -5,13 +5,15 @@ * @link http://piwik.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -use Piwik\Date; +namespace Piwik\Plugins\Insights\tests\Fixtures; + +use Piwik\Date; /** * Adds one website and tracks several visits from one visitor on * different days that span about a month apart. */ -class Test_Piwik_Fixture_SomeVisitsDifferentPathsOnTwoDays extends Test_Piwik_BaseFixture +class SomeVisitsDifferentPathsOnTwoDays extends \Test_Piwik_BaseFixture { public $idSite = 1; public $date1 = '2010-12-14';