Browse Source

Use `some` for the tags search instead of munging and searching

pull/4383/head
John Cowen 6 years ago
parent
commit
e7a3235afc
  1. 7
      ui-v2/app/controllers/dc/nodes/show.js
  2. 7
      ui-v2/app/controllers/dc/services/index.js

7
ui-v2/app/controllers/dc/nodes/show.js

@ -26,10 +26,9 @@ export default Controller.extend(WithFiltering, {
get(item, 'ID')
.toLowerCase()
.indexOf(term) !== -1 ||
(get(item, 'Tags') || [])
.join('')
.toLowerCase()
.indexOf(term) !== -1 ||
(get(item, 'Tags') || []).some(function(item) {
return item.toLowerCase().indexOf(term) !== -1;
}) ||
get(item, 'Port')
.toString()
.toLowerCase()

7
ui-v2/app/controllers/dc/services/index.js

@ -31,10 +31,9 @@ export default Controller.extend(WithHealthFiltering, {
(get(item, 'Name')
.toLowerCase()
.indexOf(term) !== -1 ||
(get(item, 'Tags') || [])
.join('')
.toLowerCase()
.indexOf(term) !== -1) &&
(get(item, 'Tags') || []).some(function(item) {
return item.toLowerCase().indexOf(term) !== -1;
})) &&
item.hasStatus(status)
);
},

Loading…
Cancel
Save