`.@each` on leafs is deprecated in favor of `.[]`
This commit is contained in:
parent
400c061046
commit
6451eb7637
|
@ -63,6 +63,6 @@ export default Ember.ArrayController.extend({
|
|||
**/
|
||||
hasMasterKey: function() {
|
||||
return !!this.get('model').findBy('user', null);
|
||||
}.property('model.@each')
|
||||
}.property('model.[]')
|
||||
|
||||
});
|
||||
|
|
|
@ -40,7 +40,7 @@ export default Ember.ArrayController.extend({
|
|||
return _(expanded).sortBy(group => group.granted_at).reverse().value();
|
||||
|
||||
|
||||
}.property('model', 'model.@each', 'model.expandedBadges.@each'),
|
||||
}.property('model', 'model.[]', 'model.expandedBadges.[]'),
|
||||
|
||||
/**
|
||||
Array of badges that have not been granted to this user.
|
||||
|
@ -62,7 +62,7 @@ export default Ember.ArrayController.extend({
|
|||
});
|
||||
|
||||
return _.sortBy(badges, badge => badge.get('name'));
|
||||
}.property('badges.@each', 'model.@each'),
|
||||
}.property('badges.[]', 'model.[]'),
|
||||
|
||||
/**
|
||||
Whether there are any badges that can be granted.
|
||||
|
|
|
@ -27,7 +27,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
|
|||
});
|
||||
}
|
||||
return [];
|
||||
}.property('model.user_fields.@each'),
|
||||
}.property('model.user_fields.[]'),
|
||||
|
||||
actions: {
|
||||
toggleTitleEdit() {
|
||||
|
|
|
@ -27,7 +27,7 @@ export default Ember.View.extend({
|
|||
// force rerender
|
||||
this.rerender();
|
||||
}
|
||||
}, 150).observes("controller.model.@each"),
|
||||
}, 150).observes("controller.model.[]"),
|
||||
|
||||
render(buffer) {
|
||||
const formattedLogs = this.get("formattedLogs");
|
||||
|
|
|
@ -13,7 +13,7 @@ export default Ember.Component.extend({
|
|||
|
||||
_topicListChanged: function() {
|
||||
this._initFromTopicList(this.get('topicList'));
|
||||
}.observes('topicList.@each'),
|
||||
}.observes('topicList.[]'),
|
||||
|
||||
_initFromTopicList(topicList) {
|
||||
if (topicList !== null) {
|
||||
|
|
|
@ -46,7 +46,7 @@ export default Ember.Component.extend({
|
|||
}
|
||||
},
|
||||
|
||||
@observes('content.@each')
|
||||
@observes('content.[]')
|
||||
_rerenderOnChange() {
|
||||
this.rerender();
|
||||
},
|
||||
|
|
|
@ -127,7 +127,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
failed: true,
|
||||
reason: I18n.t('user.email.invalid')
|
||||
});
|
||||
}.property('accountEmail', 'rejectedEmails.@each'),
|
||||
}.property('accountEmail', 'rejectedEmails.[]'),
|
||||
|
||||
emailValidated: function() {
|
||||
return this.get('authOptions.email') === this.get("accountEmail") && this.get('authOptions.email_valid');
|
||||
|
@ -326,7 +326,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
ok: true,
|
||||
reason: I18n.t('user.password.ok')
|
||||
});
|
||||
}.property('accountPassword', 'rejectedPasswords.@each', 'accountUsername', 'accountEmail', 'isDeveloper'),
|
||||
}.property('accountPassword', 'rejectedPasswords.[]', 'accountUsername', 'accountEmail', 'isDeveloper'),
|
||||
|
||||
@on('init')
|
||||
fetchConfirmationValue() {
|
||||
|
|
|
@ -7,7 +7,7 @@ export default Ember.Controller.extend({
|
|||
limit: null,
|
||||
offset: null,
|
||||
|
||||
@computed('model.owners.@each')
|
||||
@computed('model.owners.[]')
|
||||
isOwner(owners) {
|
||||
if (this.get('currentUser.admin')) {
|
||||
return true;
|
||||
|
|
|
@ -27,7 +27,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||
**/
|
||||
hasAtLeastOneLoginButton: function() {
|
||||
return Em.get("Discourse.LoginMethod.all").length > 0;
|
||||
}.property("Discourse.LoginMethod.all.@each"),
|
||||
}.property("Discourse.LoginMethod.all.[]"),
|
||||
|
||||
loginButtonText: function() {
|
||||
return this.get('loggingIn') ? I18n.t('login.logging_in') : I18n.t('login.title');
|
||||
|
|
|
@ -49,7 +49,7 @@ export default Ember.Controller.extend({
|
|||
|
||||
moreBadgesCount: function() {
|
||||
return this.get('user.badge_count') - this.get('user.featured_user_badges.length');
|
||||
}.property('user.badge_count', 'user.featured_user_badges.@each'),
|
||||
}.property('user.badge_count', 'user.featured_user_badges.[]'),
|
||||
|
||||
hasCardBadgeImage: function() {
|
||||
const img = this.get('user.card_badge.image');
|
||||
|
|
|
@ -15,7 +15,7 @@ export default Ember.Controller.extend({
|
|||
Discourse.User.currentProp('can_send_private_messages');
|
||||
}.property('controllers.user.viewingSelf'),
|
||||
|
||||
@computed('selected.@each', 'bulkSelectEnabled')
|
||||
@computed('selected.[]', 'bulkSelectEnabled')
|
||||
hasSelection(selected, bulkSelectEnabled){
|
||||
return bulkSelectEnabled && selected && selected.length > 0;
|
||||
},
|
||||
|
|
|
@ -40,7 +40,7 @@ export default RestModel.extend({
|
|||
notLoading: Ember.computed.not('loading'),
|
||||
filteredPostsCount: Ember.computed.alias("stream.length"),
|
||||
|
||||
@computed('posts.@each')
|
||||
@computed('posts.[]')
|
||||
hasPosts() {
|
||||
return this.get('posts.length') > 0;
|
||||
},
|
||||
|
@ -53,7 +53,7 @@ export default RestModel.extend({
|
|||
canAppendMore: Ember.computed.and('notLoading', 'hasPosts', 'lastPostNotLoaded'),
|
||||
canPrependMore: Ember.computed.and('notLoading', 'hasPosts', 'firstPostNotLoaded'),
|
||||
|
||||
@computed('hasLoadedData', 'firstPostId', 'posts.@each')
|
||||
@computed('hasLoadedData', 'firstPostId', 'posts.[]')
|
||||
firstPostPresent(hasLoadedData, firstPostId) {
|
||||
if (!hasLoadedData) { return false; }
|
||||
return !!this.get('posts').findProperty('id', firstPostId);
|
||||
|
@ -101,7 +101,7 @@ export default RestModel.extend({
|
|||
Returns the window of posts above the current set in the stream, bound to the top of the stream.
|
||||
This is the collection we'll ask for when scrolling upwards.
|
||||
**/
|
||||
@computed('posts.@each', 'stream.@each')
|
||||
@computed('posts.[]', 'stream.[]')
|
||||
previousWindow() {
|
||||
// If we can't find the last post loaded, bail
|
||||
const firstPost = _.first(this.get('posts'));
|
||||
|
@ -121,7 +121,7 @@ export default RestModel.extend({
|
|||
Returns the window of posts below the current set in the stream, bound by the bottom of the
|
||||
stream. This is the collection we use when scrolling downwards.
|
||||
**/
|
||||
@computed('posts.lastObject', 'stream.@each')
|
||||
@computed('posts.lastObject', 'stream.[]')
|
||||
nextWindow(lastLoadedPost) {
|
||||
// If we can't find the last post loaded, bail
|
||||
if (!lastLoadedPost) { return []; }
|
||||
|
|
|
@ -15,7 +15,7 @@ const Site = RestModel.extend({
|
|||
return result;
|
||||
},
|
||||
|
||||
@computed("post_action_types.@each")
|
||||
@computed("post_action_types.[]")
|
||||
flagTypes() {
|
||||
const postActionTypes = this.get('post_action_types');
|
||||
if (!postActionTypes) return [];
|
||||
|
@ -26,7 +26,7 @@ const Site = RestModel.extend({
|
|||
categoriesByCount: Ember.computed.sort('categories', 'topicCountDesc'),
|
||||
|
||||
// Sort subcategories under parents
|
||||
@computed("categoriesByCount", "categories.@each")
|
||||
@computed("categoriesByCount", "categories.[]")
|
||||
sortedCategories(cats) {
|
||||
const result = [],
|
||||
remaining = {};
|
||||
|
|
|
@ -32,7 +32,7 @@ const Topic = RestModel.extend({
|
|||
return poster && poster.user;
|
||||
},
|
||||
|
||||
@computed('posters.@each')
|
||||
@computed('posters.[]')
|
||||
lastPoster(posters) {
|
||||
var user;
|
||||
if (posters && posters.length > 0) {
|
||||
|
|
|
@ -147,10 +147,10 @@ const UserAction = RestModel.extend({
|
|||
}
|
||||
return rval;
|
||||
}.property("childGroups",
|
||||
"childGroups.likes.items", "childGroups.likes.items.@each",
|
||||
"childGroups.stars.items", "childGroups.stars.items.@each",
|
||||
"childGroups.edits.items", "childGroups.edits.items.@each",
|
||||
"childGroups.bookmarks.items", "childGroups.bookmarks.items.@each"),
|
||||
"childGroups.likes.items", "childGroups.likes.items.[]",
|
||||
"childGroups.stars.items", "childGroups.stars.items.[]",
|
||||
"childGroups.edits.items", "childGroups.edits.items.[]",
|
||||
"childGroups.bookmarks.items", "childGroups.bookmarks.items.[]"),
|
||||
|
||||
switchToActing() {
|
||||
this.setProperties({
|
||||
|
|
|
@ -229,7 +229,7 @@ const User = RestModel.extend({
|
|||
ua.action_type === UserAction.TYPES.topics;
|
||||
},
|
||||
|
||||
@computed("groups.@each")
|
||||
@computed("groups.[]")
|
||||
displayGroups() {
|
||||
const groups = this.get('groups');
|
||||
const filtered = groups.filter(group => {
|
||||
|
|
|
@ -23,7 +23,7 @@ export default Ember.View.extend({
|
|||
|
||||
_updateBar: function() {
|
||||
Em.run.scheduleOnce('afterRender', this, '_updateProgressBar');
|
||||
}.observes('controller.streamPercentage', 'controller.model.postStream.stream.@each').on('init'),
|
||||
}.observes('controller.streamPercentage', 'controller.model.postStream.stream.[]').on('init'),
|
||||
|
||||
_updateProgressBar: function() {
|
||||
// speeds up stuff, bypass jquery slowness and extra checks
|
||||
|
|
Loading…
Reference in New Issue