Replace findProperty and filterProperty with findBy and filterBy

This commit is contained in:
Robin Ward
2016-10-26 15:44:36 -04:00
parent 68b559d501
commit 7953a53cc5
35 changed files with 53 additions and 54 deletions
@@ -5,7 +5,7 @@ export default Ember.Component.extend({
@computed('user.role')
roleName(role) {
return this.get('roles').findProperty('id', role).label;
return this.get('roles').findBy('id', role).label;
},
actions: {
@@ -48,7 +48,7 @@ export default Ember.Component.extend({
}
const users = this.get('users');
if (users.findProperty('email', user.email)) {
if (users.findBy('email', user.email)) {
return this.set('invalid', true);
}
@@ -33,7 +33,7 @@ export default Ember.Object.extend(ValidState, {
},
fieldError(id, description) {
const field = this.get('fields').findProperty('id', id);
const field = this.get('fields').findBy('id', id);
if (field) {
field.setValid(false, description);
}
@@ -8,13 +8,13 @@ const Wizard = Ember.Object.extend({
totalSteps: length => length,
getTitle() {
const titleStep = this.get('steps').findProperty('id', 'forum-title');
const titleStep = this.get('steps').findBy('id', 'forum-title');
if (!titleStep) { return; }
return titleStep.get('fieldsById.title.value');
},
getLogoUrl() {
const logoStep = this.get('steps').findProperty('id', 'logos');
const logoStep = this.get('steps').findBy('id', 'logos');
if (!logoStep) { return; }
return logoStep.get('fieldsById.logo_url.value');
@@ -22,7 +22,7 @@ const Wizard = Ember.Object.extend({
// A bit clunky, but get the current colors from the appropriate step
getCurrentColors() {
const colorStep = this.get('steps').findProperty('id', 'colors');
const colorStep = this.get('steps').findBy('id', 'colors');
if (!colorStep) { return; }
const themeChoice = colorStep.get('fieldsById.theme_id');
@@ -34,7 +34,7 @@ const Wizard = Ember.Object.extend({
const choices = themeChoice.get('choices');
if (!choices) { return; }
const option = choices.findProperty('id', themeId);
const option = choices.findBy('id', themeId);
if (!option) { return; }
return option.data.colors;
@@ -1,7 +1,7 @@
export default Ember.Route.extend({
model(params) {
const allSteps = this.modelFor('application').steps;
const step = allSteps.findProperty('id', params.step_id);
const step = allSteps.findBy('id', params.step_id);
return step ? step : allSteps[0];
},