Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
4c3dad7a
Commit
4c3dad7a
authored
Dec 21, 2017
by
Mattias J Duffy
Browse files
searching by tags
parent
b77e231a
Pipeline
#1872
passed with stage
in 1 minute and 50 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/CardContainer.js
View file @
4c3dad7a
...
...
@@ -5,8 +5,20 @@ import Grid from 'material-ui/Grid';
const
CardContainer
=
({
searchTerm
,
facilities
})
=>
{
const
filterCards
=
(
facility
)
=>
{
const
lsearchTerm
=
searchTerm
.
toLowerCase
()
const
name
=
facility
.
facility_name
.
toLowerCase
()
return
name
.
includes
(
searchTerm
.
toLowerCase
())
const
tags
=
facility
.
facility_product_tags
tags
.
forEach
((
tag
)
=>
{
return
tag
.
toLowerCase
()
})
let
hasTag
=
true
;
let
index
=
tags
.
findIndex
((
tag
)
=>
{
return
tag
.
includes
(
lsearchTerm
)
})
if
(
index
===
-
1
){
hasTag
=
false
}
return
name
.
includes
(
lsearchTerm
)
||
hasTag
}
// console.log(facilities)
return
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment