Replace findProperty and filterProperty with findBy and filterBy
This commit is contained in:
@@ -9,7 +9,7 @@ export default Ember.Controller.extend({
|
||||
@computed('embedding.embeddable_hosts.@each.isCreated')
|
||||
showSecondary() {
|
||||
const hosts = this.get('embedding.embeddable_hosts');
|
||||
return hosts.length && hosts.findProperty('isCreated');
|
||||
return hosts.length && hosts.findBy('isCreated');
|
||||
},
|
||||
|
||||
@computed('embedding.base_url')
|
||||
|
||||
@@ -5,7 +5,7 @@ export default Ember.Controller.extend({
|
||||
filteredContent: function() {
|
||||
if (!this.get('categoryNameKey')) { return []; }
|
||||
|
||||
const category = (this.get('adminSiteSettings.model') || []).findProperty('nameKey', this.get('categoryNameKey'));
|
||||
const category = (this.get('adminSiteSettings.model') || []).findBy('nameKey', this.get('categoryNameKey'));
|
||||
if (category) {
|
||||
return category.siteSettings;
|
||||
} else {
|
||||
|
||||
@@ -19,7 +19,7 @@ export default Ember.Controller.extend({
|
||||
selectedCount: function() {
|
||||
var model = this.get('model');
|
||||
if (!model || !model.length) return 0;
|
||||
return model.filterProperty('selected').length;
|
||||
return model.filterBy('selected').length;
|
||||
}.property('model.@each.selected'),
|
||||
|
||||
selectAllChanged: function() {
|
||||
@@ -52,14 +52,14 @@ export default Ember.Controller.extend({
|
||||
|
||||
actions: {
|
||||
approveUsers: function() {
|
||||
AdminUser.bulkApprove(this.get('model').filterProperty('selected'));
|
||||
AdminUser.bulkApprove(this.get('model').filterBy('selected'));
|
||||
this._refreshUsers();
|
||||
},
|
||||
|
||||
rejectUsers: function() {
|
||||
var maxPostAge = this.siteSettings.delete_user_max_post_age;
|
||||
var controller = this;
|
||||
AdminUser.bulkReject(this.get('model').filterProperty('selected')).then(function(result){
|
||||
AdminUser.bulkReject(this.get('model').filterBy('selected')).then(function(result){
|
||||
var message = I18n.t("admin.users.reject_successful", {count: result.success});
|
||||
if (result.failed > 0) {
|
||||
message += ' ' + I18n.t("admin.users.reject_failures", {count: result.failed});
|
||||
|
||||
Reference in New Issue
Block a user