Skip to content

Commit

Permalink
[FEATURE] Add site filter for Analysis/Content
Browse files Browse the repository at this point in the history
  • Loading branch information
einpraegsam committed Feb 22, 2024
1 parent 6169b09 commit a94ba72
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
1 change: 0 additions & 1 deletion Classes/Controller/AnalysisController.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public function contentAction(FilterDto $filter, string $export = ''): ResponseI
'downloads' => $this->downloadRepository->findCombinedByHref($filter),
'languageData' => GeneralUtility::makeInstance(LanguagesDataProvider::class, $filter),
'domainData' => GeneralUtility::makeInstance(DomainDataProvider::class, $filter),
'domains' => $this->pagevisitsRepository->getAllDomains($filter),
]);

$this->addDocumentHeaderForCurrentController();
Expand Down
3 changes: 0 additions & 3 deletions Classes/Domain/DataProvider/DomainDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
declare(strict_types=1);
namespace In2code\Lux\Domain\DataProvider;

use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver;
use In2code\Lux\Domain\Repository\PagevisitRepository;
use In2code\Lux\Utility\LocalizationUtility;
Expand All @@ -27,7 +26,6 @@ class DomainDataProvider extends AbstractDataProvider
* ]
*
* @return void
* @throws DBALException
* @throws ExceptionDbalDriver
*/
public function prepareData(): void
Expand All @@ -41,7 +39,6 @@ public function prepareData(): void

/**
* @return array
* @throws DBALException
* @throws ExceptionDbalDriver
*/
protected function getDomains(): array
Expand Down
3 changes: 0 additions & 3 deletions Classes/Domain/DataProvider/LanguagesDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
declare(strict_types=1);
namespace In2code\Lux\Domain\DataProvider;

use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Driver\Exception as ExceptionDbalDriver;
use In2code\Lux\Domain\Repository\LanguageRepository;
use In2code\Lux\Domain\Repository\PagevisitRepository;
Expand All @@ -28,7 +27,6 @@ class LanguagesDataProvider extends AbstractDataProvider
* ]
*
* @return void
* @throws DBALException
* @throws ExceptionDbalDriver
*/
public function prepareData(): void
Expand All @@ -42,7 +40,6 @@ public function prepareData(): void

/**
* @return array
* @throws DBALException
* @throws ExceptionDbalDriver
*/
protected function getLanguagesFromSystem(): array
Expand Down
4 changes: 2 additions & 2 deletions Classes/Domain/Repository/PagevisitRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function getDomainsWithAmountOfVisits(FilterDto $filter): array
. ' left join ' . Visitor::TABLE_NAME . ' v on v.uid = pv.visitor'
. ' left join ' . Categoryscoring::TABLE_NAME . ' cs on v.uid = cs.visitor'
. ' where pv.domain!="" ' . $this->extendWhereClauseWithFilterTime($filter, true, 'pv')
. $this->extendWhereClauseWithFilterDomain($filter, 'pv')
. $this->extendWhereClauseWithFilterSite($filter, 'pv')
. $this->extendWhereClauseWithFilterScoring($filter, 'v')
. $this->extendWhereClauseWithFilterCategoryScoring($filter, 'cs')
. ' group by domain order by count desc';
Expand Down Expand Up @@ -432,7 +432,7 @@ public function getAllLanguages(FilterDto $filter): array
. ' left join ' . Visitor::TABLE_NAME . ' v on v.uid = pv.visitor'
. ' left join ' . Categoryscoring::TABLE_NAME . ' cs on v.uid = cs.visitor'
. ' where ' . $this->extendWhereClauseWithFilterTime($filter, false, 'pv')
. $this->extendWhereClauseWithFilterDomain($filter, 'pv')
. $this->extendWhereClauseWithFilterSite($filter, 'pv')
. $this->extendWhereClauseWithFilterScoring($filter, 'v')
. $this->extendWhereClauseWithFilterCategoryScoring($filter, 'cs')
. ' group by pv.language order by count desc ';
Expand Down
30 changes: 15 additions & 15 deletions Resources/Private/Partials/Filter/Analysis/Content.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ <h5><f:translate key="LLL:EXT:lux/Resources/Private/Language/locallang_db.xlf:mo
</button>
</div>

<f:if condition="{domains -> f:count()} > 0">
<div class="input-group form-group">
<f:form.select property="domain" class="form-control form-select" id="domain">
<f:form.select.option value="">
<f:translate key="LLL:EXT:lux/Resources/Private/Language/locallang_db.xlf:module.list.filter.firstoption.domain">Domain</f:translate>
</f:form.select.option>
<f:for each="{domains}" as="domain">
<f:form.select.option value="{domain}">{domain}</f:form.select.option>
</f:for>
</f:form.select>
<button type="button" class="btn btn-default" data-global-event="click" data-action-focus="#domain">
<core:icon identifier="actions-globe" />
</button>
</div>
</f:if>
<div class="input-group form-group">
<f:form.select
id="site"
class="form-control form-select"
property="site"
options="{filter.allowedSites}"
prependOptionLabel="{f:translate(key:'LLL:EXT:lux/Resources/Private/Language/locallang_db.xlf:module.analysis.dashboard.filter.sitesall')}"
prependOptionValue=""
optionValueField="identifier"
optionLabelField="configuration.websiteTitle"
value="{filter.site}" />
<button type="button" class="btn btn-default" data-global-event="click" data-action-focus="#site">
<core:icon identifier="actions-globe" size="small" />
</button>
</div>
</div>
</div>

Expand Down

0 comments on commit a94ba72

Please sign in to comment.