Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}),
/**
* Indicate the table's header's height in pixels.
*
* @property headerHeight
* @type {Number}
*/
headerHeight: computed('isWarningClosed', function() {
return this.isWarningClosed ? 31 : 56;
}),
// bound to the input field, updates the `search` property
// 300ms after changing
searchValue: debounceComputed('search', 300),
// model filtered based on this value
search: '',
escapedSearch: computed('search', function() {
return escapeRegExp(this.search.toLowerCase());
}),
filtered: computed('model.@each.name', 'search', function() {
if (isEmpty(this.escapedSearch)) {
return this.model;
}
return this.model.filter((item) => {
const regExp = new RegExp(this.escapedSearch);
return recursiveMatch(item, regExp);
import { action, computed } from '@ember/object';
import Controller from '@ember/controller';
import debounceComputed from 'ember-inspector/computed/debounce';
import searchMatch from 'ember-inspector/utils/search-match';
export default Controller.extend({
init() {
this._super(...arguments);
this.deprecations = [];
},
search: null,
searchValue: debounceComputed('search', 300),
toggleDeprecationWorkflow: false,
filtered: computed('deprecations.@each.message', 'search', function() {
return this.deprecations.filter(item => searchMatch(item.message, this.search));
}),
openResource: action(function(item) {
this.adapter.openResource(item.fullSource, item.line);
}),
traceSource: action(function(deprecation, source) {
this.port.send('deprecation:sendStackTraces', {
deprecation: {
message: deprecation.message,
sources: [source]
}
import { action, get, computed } from '@ember/object';
import Controller, { inject as controller } from '@ember/controller';
import debounceComputed from 'ember-inspector/computed/debounce';
import searchMatch from 'ember-inspector/utils/search-match';
export default Controller.extend({
application: controller(),
searchValue: debounceComputed('search', 300),
search: null,
filtered: computed('model.@each.name', 'search', function() {
return this.model
.filter((item) => searchMatch(get(item, 'name'), this.search));
}),
rows: computed('filtered.[]', function() {
return this.filtered.map(function(item) {
return {
name: item
};
});
}),