Skip to content
Snippets Groups Projects
Commit ae85a40b authored by Chris Hallberg's avatar Chris Hallberg Committed by Demian Katz
Browse files

Exclude facet labels. Closes #1592.

parent 5bc03847
No related merge requests found
......@@ -85,15 +85,16 @@ class SearchFacetsTest extends \VuFindTest\Unit\MinkTestCase
$this->snooze();
$items = $page->findAll('css', '#modal #facet-list-count .js-facet-item');
$this->assertEquals($limit * 2, count($items));
$excludeControl = $exclusionActive ? 'Exclude matching results ' : '';
$this->assertEquals(
'Weird IDs 9 '
. 'Fiction 7 '
. 'The Study Of P|pes 1 '
. 'The Study and Scor_ng of Dots.and-Dashes:Colons 1 '
. 'The Study of "Important" Things 1 '
. 'The Study of %\'s? 1 '
. 'The Study of +\'s? 1 '
. 'The Study of @Twitter #test 1 '
'Weird IDs 9 ' . $excludeControl
. 'Fiction 7 ' . $excludeControl
. 'The Study Of P|pes 1 ' . $excludeControl
. 'The Study and Scor_ng of Dots.and-Dashes:Colons 1 ' . $excludeControl
. 'The Study of "Important" Things 1 ' . $excludeControl
. 'The Study of %\'s? 1 ' . $excludeControl
. 'The Study of +\'s? 1 ' . $excludeControl
. 'The Study of @Twitter #test 1 ' . $excludeControl
. 'more ...',
$this->findCss($page, '#modal #facet-list-count')->getText()
);
......@@ -107,10 +108,10 @@ class SearchFacetsTest extends \VuFindTest\Unit\MinkTestCase
$items = $page->findAll('css', '#modal #facet-list-index .js-facet-item');
$this->assertEquals($limit, count($items)); // reset number of items
$this->assertEquals(
'Fiction 7 '
. 'The Study Of P|pes 1 '
. 'The Study and Scor_ng of Dots.and-Dashes:Colons 1 '
. 'The Study of "Important" Things 1 '
'Fiction 7 ' . $excludeControl
. 'The Study Of P|pes 1 ' . $excludeControl
. 'The Study and Scor_ng of Dots.and-Dashes:Colons 1 ' . $excludeControl
. 'The Study of "Important" Things 1 ' . $excludeControl
. 'more ...',
$this->findCss($page, '#modal #facet-list-index')->getText()
);
......@@ -219,7 +220,7 @@ class SearchFacetsTest extends \VuFindTest\Unit\MinkTestCase
$genreMore = $this->findCss($page, '#more-narrowGroupHidden-genre_facet');
$genreMore->click();
$this->facetListProcedure($page, $limit, true);
$this->assertEquals(1, count($page->find('css', '.active-filters')));
$this->assertEquals(1, count($page->findAll('css', '.active-filters')));
}
/**
......
......@@ -50,7 +50,10 @@
<?php if ($this->exclude && !$this->facet['isApplied']): ?>
<?php $excludeURL = $this->urlBase . $this->url->addFacet($this->group, $this->facet['value'], 'NOT'); ?>
<a href="<?=$excludeURL ?>" data-lightbox-ignore title="<?=$this->transEsc('exclude_facet') ?>" class="exclude"><i class="fa fa-times" aria-hidden="true"></i></a>
<a href="<?=$excludeURL ?>" data-lightbox-ignore class="exclude">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only"><?=$this->transEsc('exclude_facet') ?></span>
</a>
<?php endif; ?>
<?=$hasSubLinks ? '</li>' : '</a>'; ?>
......@@ -33,7 +33,10 @@
--></a>
<span class="badge"><?=$this->localizedNumber($thisFacet['count']) ?></span>
<?php if ($allowExclude): ?>
<a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], 'NOT')?>" title="<?=$this->transEsc('exclude_facet')?>"><i class="fa fa-times" aria-hidden="true"></i></a>
<a href="<?=$this->currentPath() . $results->getUrlQuery()->addFacet($title, $thisFacet['value'], 'NOT')?>">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only"><?=$this->transEsc('exclude_facet') ?></span>
</a>
<?php endif; ?>
<?php endif; ?>
</span>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment