github.com/outbrain/consul@v1.4.5/ui-v2/app/controllers/dc/acls/policies/index.js (about)

     1  import Controller from '@ember/controller';
     2  import { get } from '@ember/object';
     3  import WithFiltering from 'consul-ui/mixins/with-filtering';
     4  export default Controller.extend(WithFiltering, {
     5    queryParams: {
     6      s: {
     7        as: 'filter',
     8        replace: true,
     9      },
    10    },
    11    filter: function(item, { s = '', type = '' }) {
    12      const sLower = s.toLowerCase();
    13      return (
    14        get(item, 'Name')
    15          .toLowerCase()
    16          .indexOf(sLower) !== -1 ||
    17        get(item, 'Description')
    18          .toLowerCase()
    19          .indexOf(sLower) !== -1
    20      );
    21    },
    22    actions: {},
    23  });