Add searching ACL's by token

This commit is contained in:
John Cowen 2018-06-13 14:39:43 +01:00
parent fd696314f1
commit 005fbcd149
2 changed files with 7 additions and 3 deletions

View File

@ -28,10 +28,14 @@ export default Controller.extend(WithFiltering, {
}); });
}), }),
filter: function(item, { s = '', type = '' }) { filter: function(item, { s = '', type = '' }) {
const sLower = s.toLowerCase();
return ( return (
get(item, 'Name') (get(item, 'Name')
.toLowerCase() .toLowerCase()
.indexOf(s.toLowerCase()) !== -1 && .indexOf(sLower) !== -1 ||
get(item, 'ID')
.toLowerCase()
.indexOf(sLower) !== -1) &&
(type === '' || get(item, 'Type') === type) (type === '' || get(item, 'Type') === type)
); );
}, },

View File

@ -1,4 +1,4 @@
{{!<form>}} {{!<form>}}
{{freetext-filter onchange=(action onchange) value=search placeholder="Search by name"}} {{freetext-filter onchange=(action onchange) value=search placeholder="Search by name/token"}}
{{radio-group name="type" value=type items=filters onchange=(action onchange)}} {{radio-group name="type" value=type items=filters onchange=(action onchange)}}
{{!</form>}} {{!</form>}}