`.@each` on leafs is deprecated in favor of `.[]`

This commit is contained in:
Robin Ward 2016-04-28 16:49:24 -04:00
parent 400c061046
commit 6451eb7637
No known key found for this signature in database
GPG Key ID: 0E091E2B4ED1B83D
17 changed files with 26 additions and 26 deletions

View File

@ -63,6 +63,6 @@ export default Ember.ArrayController.extend({
**/ **/
hasMasterKey: function() { hasMasterKey: function() {
return !!this.get('model').findBy('user', null); return !!this.get('model').findBy('user', null);
}.property('model.@each') }.property('model.[]')
}); });

View File

@ -40,7 +40,7 @@ export default Ember.ArrayController.extend({
return _(expanded).sortBy(group => group.granted_at).reverse().value(); 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. 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')); return _.sortBy(badges, badge => badge.get('name'));
}.property('badges.@each', 'model.@each'), }.property('badges.[]', 'model.[]'),
/** /**
Whether there are any badges that can be granted. Whether there are any badges that can be granted.

View File

@ -27,7 +27,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
}); });
} }
return []; return [];
}.property('model.user_fields.@each'), }.property('model.user_fields.[]'),
actions: { actions: {
toggleTitleEdit() { toggleTitleEdit() {

View File

@ -27,7 +27,7 @@ export default Ember.View.extend({
// force rerender // force rerender
this.rerender(); this.rerender();
} }
}, 150).observes("controller.model.@each"), }, 150).observes("controller.model.[]"),
render(buffer) { render(buffer) {
const formattedLogs = this.get("formattedLogs"); const formattedLogs = this.get("formattedLogs");

View File

@ -13,7 +13,7 @@ export default Ember.Component.extend({
_topicListChanged: function() { _topicListChanged: function() {
this._initFromTopicList(this.get('topicList')); this._initFromTopicList(this.get('topicList'));
}.observes('topicList.@each'), }.observes('topicList.[]'),
_initFromTopicList(topicList) { _initFromTopicList(topicList) {
if (topicList !== null) { if (topicList !== null) {

View File

@ -46,7 +46,7 @@ export default Ember.Component.extend({
} }
}, },
@observes('content.@each') @observes('content.[]')
_rerenderOnChange() { _rerenderOnChange() {
this.rerender(); this.rerender();
}, },

View File

@ -127,7 +127,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
failed: true, failed: true,
reason: I18n.t('user.email.invalid') reason: I18n.t('user.email.invalid')
}); });
}.property('accountEmail', 'rejectedEmails.@each'), }.property('accountEmail', 'rejectedEmails.[]'),
emailValidated: function() { emailValidated: function() {
return this.get('authOptions.email') === this.get("accountEmail") && this.get('authOptions.email_valid'); 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, ok: true,
reason: I18n.t('user.password.ok') reason: I18n.t('user.password.ok')
}); });
}.property('accountPassword', 'rejectedPasswords.@each', 'accountUsername', 'accountEmail', 'isDeveloper'), }.property('accountPassword', 'rejectedPasswords.[]', 'accountUsername', 'accountEmail', 'isDeveloper'),
@on('init') @on('init')
fetchConfirmationValue() { fetchConfirmationValue() {

View File

@ -7,7 +7,7 @@ export default Ember.Controller.extend({
limit: null, limit: null,
offset: null, offset: null,
@computed('model.owners.@each') @computed('model.owners.[]')
isOwner(owners) { isOwner(owners) {
if (this.get('currentUser.admin')) { if (this.get('currentUser.admin')) {
return true; return true;

View File

@ -27,7 +27,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
**/ **/
hasAtLeastOneLoginButton: function() { hasAtLeastOneLoginButton: function() {
return Em.get("Discourse.LoginMethod.all").length > 0; return Em.get("Discourse.LoginMethod.all").length > 0;
}.property("Discourse.LoginMethod.all.@each"), }.property("Discourse.LoginMethod.all.[]"),
loginButtonText: function() { loginButtonText: function() {
return this.get('loggingIn') ? I18n.t('login.logging_in') : I18n.t('login.title'); return this.get('loggingIn') ? I18n.t('login.logging_in') : I18n.t('login.title');

View File

@ -49,7 +49,7 @@ export default Ember.Controller.extend({
moreBadgesCount: function() { moreBadgesCount: function() {
return this.get('user.badge_count') - this.get('user.featured_user_badges.length'); 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() { hasCardBadgeImage: function() {
const img = this.get('user.card_badge.image'); const img = this.get('user.card_badge.image');

View File

@ -15,7 +15,7 @@ export default Ember.Controller.extend({
Discourse.User.currentProp('can_send_private_messages'); Discourse.User.currentProp('can_send_private_messages');
}.property('controllers.user.viewingSelf'), }.property('controllers.user.viewingSelf'),
@computed('selected.@each', 'bulkSelectEnabled') @computed('selected.[]', 'bulkSelectEnabled')
hasSelection(selected, bulkSelectEnabled){ hasSelection(selected, bulkSelectEnabled){
return bulkSelectEnabled && selected && selected.length > 0; return bulkSelectEnabled && selected && selected.length > 0;
}, },

View File

@ -40,7 +40,7 @@ export default RestModel.extend({
notLoading: Ember.computed.not('loading'), notLoading: Ember.computed.not('loading'),
filteredPostsCount: Ember.computed.alias("stream.length"), filteredPostsCount: Ember.computed.alias("stream.length"),
@computed('posts.@each') @computed('posts.[]')
hasPosts() { hasPosts() {
return this.get('posts.length') > 0; return this.get('posts.length') > 0;
}, },
@ -53,7 +53,7 @@ export default RestModel.extend({
canAppendMore: Ember.computed.and('notLoading', 'hasPosts', 'lastPostNotLoaded'), canAppendMore: Ember.computed.and('notLoading', 'hasPosts', 'lastPostNotLoaded'),
canPrependMore: Ember.computed.and('notLoading', 'hasPosts', 'firstPostNotLoaded'), canPrependMore: Ember.computed.and('notLoading', 'hasPosts', 'firstPostNotLoaded'),
@computed('hasLoadedData', 'firstPostId', 'posts.@each') @computed('hasLoadedData', 'firstPostId', 'posts.[]')
firstPostPresent(hasLoadedData, firstPostId) { firstPostPresent(hasLoadedData, firstPostId) {
if (!hasLoadedData) { return false; } if (!hasLoadedData) { return false; }
return !!this.get('posts').findProperty('id', firstPostId); 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. 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. This is the collection we'll ask for when scrolling upwards.
**/ **/
@computed('posts.@each', 'stream.@each') @computed('posts.[]', 'stream.[]')
previousWindow() { previousWindow() {
// If we can't find the last post loaded, bail // If we can't find the last post loaded, bail
const firstPost = _.first(this.get('posts')); 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 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. stream. This is the collection we use when scrolling downwards.
**/ **/
@computed('posts.lastObject', 'stream.@each') @computed('posts.lastObject', 'stream.[]')
nextWindow(lastLoadedPost) { nextWindow(lastLoadedPost) {
// If we can't find the last post loaded, bail // If we can't find the last post loaded, bail
if (!lastLoadedPost) { return []; } if (!lastLoadedPost) { return []; }

View File

@ -15,7 +15,7 @@ const Site = RestModel.extend({
return result; return result;
}, },
@computed("post_action_types.@each") @computed("post_action_types.[]")
flagTypes() { flagTypes() {
const postActionTypes = this.get('post_action_types'); const postActionTypes = this.get('post_action_types');
if (!postActionTypes) return []; if (!postActionTypes) return [];
@ -26,7 +26,7 @@ const Site = RestModel.extend({
categoriesByCount: Ember.computed.sort('categories', 'topicCountDesc'), categoriesByCount: Ember.computed.sort('categories', 'topicCountDesc'),
// Sort subcategories under parents // Sort subcategories under parents
@computed("categoriesByCount", "categories.@each") @computed("categoriesByCount", "categories.[]")
sortedCategories(cats) { sortedCategories(cats) {
const result = [], const result = [],
remaining = {}; remaining = {};

View File

@ -32,7 +32,7 @@ const Topic = RestModel.extend({
return poster && poster.user; return poster && poster.user;
}, },
@computed('posters.@each') @computed('posters.[]')
lastPoster(posters) { lastPoster(posters) {
var user; var user;
if (posters && posters.length > 0) { if (posters && posters.length > 0) {

View File

@ -147,10 +147,10 @@ const UserAction = RestModel.extend({
} }
return rval; return rval;
}.property("childGroups", }.property("childGroups",
"childGroups.likes.items", "childGroups.likes.items.@each", "childGroups.likes.items", "childGroups.likes.items.[]",
"childGroups.stars.items", "childGroups.stars.items.@each", "childGroups.stars.items", "childGroups.stars.items.[]",
"childGroups.edits.items", "childGroups.edits.items.@each", "childGroups.edits.items", "childGroups.edits.items.[]",
"childGroups.bookmarks.items", "childGroups.bookmarks.items.@each"), "childGroups.bookmarks.items", "childGroups.bookmarks.items.[]"),
switchToActing() { switchToActing() {
this.setProperties({ this.setProperties({

View File

@ -229,7 +229,7 @@ const User = RestModel.extend({
ua.action_type === UserAction.TYPES.topics; ua.action_type === UserAction.TYPES.topics;
}, },
@computed("groups.@each") @computed("groups.[]")
displayGroups() { displayGroups() {
const groups = this.get('groups'); const groups = this.get('groups');
const filtered = groups.filter(group => { const filtered = groups.filter(group => {

View File

@ -23,7 +23,7 @@ export default Ember.View.extend({
_updateBar: function() { _updateBar: function() {
Em.run.scheduleOnce('afterRender', this, '_updateProgressBar'); 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() { _updateProgressBar: function() {
// speeds up stuff, bypass jquery slowness and extra checks // speeds up stuff, bypass jquery slowness and extra checks