Skip to content

Commit

Permalink
refs #57 make sure text ellipsis works and label is always only one l…
Browse files Browse the repository at this point in the history
…ine. moved test fixture to insights plugin as demonstration for other plugin developers as it is very insights related anyway
  • Loading branch information
tsteur committed Mar 4, 2014
1 parent 6034c0e commit 23186d7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/Insights/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/Insights/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use Piwik\View;

/**
*
* Insights Controller
*/
class Controller extends \Piwik\Plugin\Controller
{
Expand Down
8 changes: 8 additions & 0 deletions plugins/Insights/javascripts/insightsDataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions plugins/Insights/tests/ApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -21,7 +22,7 @@
class ApiTest extends \IntegrationTestCase
{
/**
* @var \Test_Piwik_Fixture_SomeVisitsDifferentPathsOnTwoDays
* @var SomeVisitsDifferentPathsOnTwoDays
*/
public static $fixture = null;

Expand Down Expand Up @@ -240,4 +241,4 @@ private function assertRows($expectedLabels, DataTable $dataTable)
}
}

ApiTest::$fixture = new \Test_Piwik_Fixture_SomeVisitsDifferentPathsOnTwoDays();
ApiTest::$fixture = new SomeVisitsDifferentPathsOnTwoDays();
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 23186d7

Please sign in to comment.