Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-11-12 13:21:16 +0000
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
600055bc734ca649fae917b1ba1a9606f1ca0b00
600055bc
1 parent
672b15d3
Fixed tag searches and added tag search regression test
Fixes #222
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
1 deletions
app/Entity.php
resources/assets/sass/_pages.scss
tests/Entity/EntitySearchTest.php
app/Entity.php
View file @
600055b
...
...
@@ -175,7 +175,8 @@ class Entity extends Ownable
}
}
$isFuzzy
=
count
(
$exactTerms
)
===
0
||
count
(
$fuzzyTerms
)
>
0
;
$isFuzzy
=
count
(
$exactTerms
)
===
0
&&
count
(
$fuzzyTerms
)
>
0
;
// Perform fulltext search if relevant terms exist.
if
(
$isFuzzy
)
{
...
...
resources/assets/sass/_pages.scss
View file @
600055b
...
...
@@ -238,6 +238,9 @@
flex-direction
:
column
;
overflow-y
:
scroll
;
}
table
td
,
table
th
{
overflow
:
visible
;
}
}
[
toolbox-tab-content
]
{
...
...
tests/Entity/EntitySearchTest.php
View file @
600055b
...
...
@@ -97,6 +97,39 @@ class EntitySearchTest extends TestCase
->
seeStatusCode
(
200
);
}
public
function
test_tag_search
()
{
$newTags
=
[
new
\BookStack\Tag
([
'name'
=>
'animal'
,
'value'
=>
'cat'
]),
new
\BookStack\Tag
([
'name'
=>
'color'
,
'value'
=>
'red'
])
];
$pageA
=
\BookStack\Page
::
first
();
$pageA
->
tags
()
->
saveMany
(
$newTags
);
$pageB
=
\BookStack\Page
::
all
()
->
last
();
$pageB
->
tags
()
->
create
([
'name'
=>
'animal'
,
'value'
=>
'dog'
]);
$this
->
asAdmin
()
->
visit
(
'/search/all?term=%5Banimal%5D'
)
->
seeLink
(
$pageA
->
name
)
->
seeLink
(
$pageB
->
name
);
$this
->
visit
(
'/search/all?term=%5Bcolor%5D'
)
->
seeLink
(
$pageA
->
name
)
->
dontSeeLink
(
$pageB
->
name
);
$this
->
visit
(
'/search/all?term=%5Banimal%3Dcat%5D'
)
->
seeLink
(
$pageA
->
name
)
->
dontSeeLink
(
$pageB
->
name
);
}
public
function
test_ajax_entity_search
()
{
$page
=
\BookStack\Page
::
all
()
->
last
();
...
...
Please
register
or
sign in
to post a comment