From 7cde99b9f65628efb6bcf39e4b6fb2561f6a64da Mon Sep 17 00:00:00 2001 From: Thomas Lee Date: Mon, 7 Dec 2015 18:38:59 -0800 Subject: [PATCH] removed @each dependent key --- app/components/course-objective-manager.js | 8 ++++---- app/components/detail-steward-manager.js | 4 ++-- app/components/detail-stewards.js | 2 +- app/components/instructorgroup-list.js | 2 +- app/components/instructorgroup-selection-manager.js | 2 +- app/components/learnergroup-details.js | 10 +++++----- app/components/learnergroup-list.js | 2 +- app/components/learnergroup-overview.js | 2 +- app/components/learnergroup-selection-manager.js | 8 ++++---- app/components/learningmaterial-manager.js | 2 +- app/components/live-search.js | 2 +- app/components/mesh-manager.js | 2 +- app/components/objective-manage-competency.js | 4 ++-- app/components/offering-manager.js | 8 ++++---- app/components/program-list.js | 2 +- app/components/programyear-competency-manager.js | 2 +- app/components/selectable-search-result.js | 2 +- app/components/session-objective-manager.js | 6 +++--- app/components/session-offerings-list.js | 2 +- app/components/user-search.js | 4 ++-- app/models/cohort.js | 6 +++--- app/models/learner-group.js | 10 +++++----- app/models/school.js | 2 +- app/models/session.js | 4 ++-- app/services/current-user.js | 2 +- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/app/components/course-objective-manager.js b/app/components/course-objective-manager.js index 2a0abd2971..ce7f872c4e 100644 --- a/app/components/course-objective-manager.js +++ b/app/components/course-objective-manager.js @@ -15,7 +15,7 @@ var competencyGroup = Ember.Object.extend({ var objectiveProxy = Ember.ObjectProxy.extend({ courseObjective: null, - selected: computed('content', 'courseObjective.parents.@each', function(){ + selected: computed('content', 'courseObjective.parents.[]', function(){ return this.get('courseObjective.parents').contains(this.get('content')); }), }); @@ -69,7 +69,7 @@ export default Component.extend({ showObjectiveList: false, showCohortList: false, cohorts: computed( - 'courseObjective.courses.@each', + 'courseObjective.courses.[]', 'courseObjective.courses.@each.cohorts.length', function(){ var courseObjective = this.get('courseObjective'); @@ -120,7 +120,7 @@ export default Component.extend({ }; }).sortBy('title'); }), - currentCohort: computed('selectedCohortId', 'cohorts.@each', function(){ + currentCohort: computed('selectedCohortId', 'cohorts.[]', function(){ var selectedCohortId = this.get('selectedCohortId'); if(selectedCohortId){ var matchingGroups = this.get('cohorts').filterBy('id', selectedCohortId); @@ -133,7 +133,7 @@ export default Component.extend({ return null; }), watchCohorts: on('init', observer( - 'availableCohorts.@each', + 'availableCohorts.[]', 'selectedCohortId', 'availableCohorts.length', function(){ diff --git a/app/components/detail-steward-manager.js b/app/components/detail-steward-manager.js index 997318a0f3..f43b07cd43 100644 --- a/app/components/detail-steward-manager.js +++ b/app/components/detail-steward-manager.js @@ -21,7 +21,7 @@ export default Component.extend({ promise: this.get('store').findAll('school') }); }), - availableSchools: computed('stewardedSchools.@each', 'stewardedDepartments.@each', 'schools.@each', function(){ + availableSchools: computed('stewardedSchools.[]', 'stewardedDepartments.[]', 'schools.[]', function(){ let defer = Ember.RSVP.defer(); let schoolProxy = Ember.ObjectProxy.extend({ departments: [], @@ -58,7 +58,7 @@ export default Component.extend({ promise: defer.promise }); }), - stewardSchools: computed('selectedSchools.@each', 'selectedDepartments.@each', 'schools.@each', function(){ + stewardSchools: computed('selectedSchools.[]', 'selectedDepartments.[]', 'schools.[]', function(){ let defer = Ember.RSVP.defer(); let schoolProxy = Ember.ObjectProxy.extend({ departments: [], diff --git a/app/components/detail-stewards.js b/app/components/detail-stewards.js index 8ae04cd260..b04b0f6c3e 100644 --- a/app/components/detail-stewards.js +++ b/app/components/detail-stewards.js @@ -9,7 +9,7 @@ export default Component.extend({ programYear: null, isManaging: false, bufferStewards: [], - stewardsBySchool: computed('programYear.stewards.@each', function(){ + stewardsBySchool: computed('programYear.stewards.[]', function(){ let deferred = Ember.RSVP.defer(); let programYear = this.get('programYear'); diff --git a/app/components/instructorgroup-list.js b/app/components/instructorgroup-list.js index 01f210bd0a..706461737d 100644 --- a/app/components/instructorgroup-list.js +++ b/app/components/instructorgroup-list.js @@ -4,7 +4,7 @@ const { Component, computed } = Ember; export default Component.extend({ instructorGroups: [], - proxiedInstructorGroups: computed('instructorGroups.@each', function(){ + proxiedInstructorGroups: computed('instructorGroups.[]', function(){ return this.get('instructorGroups').map(function(instructorGroup){ return Ember.ObjectProxy.create({ content: instructorGroup, diff --git a/app/components/instructorgroup-selection-manager.js b/app/components/instructorgroup-selection-manager.js index d30b8eafb9..990f76b6ff 100644 --- a/app/components/instructorgroup-selection-manager.js +++ b/app/components/instructorgroup-selection-manager.js @@ -14,7 +14,7 @@ export default Component.extend({ instructorGroups: alias('subject.instructorGroups'), sortedInstructorGroups: sort('instructorGroups', 'sortBy'), filteredAvailableInstructorGroups: computed( - 'instructorGroups.@each', + 'instructorGroups.[]', 'filter', 'availableInstructorGroups.@each.title', function(){ diff --git a/app/components/learnergroup-details.js b/app/components/learnergroup-details.js index 46ed343a63..61521ff95d 100644 --- a/app/components/learnergroup-details.js +++ b/app/components/learnergroup-details.js @@ -9,8 +9,8 @@ export default Component.extend({ learnerGroup: null, notInThisGroup: t('learnerGroups.notInThisGroup'), topLevelGroupMembersNotInThisGroup: computed( - 'learnerGroup.topLevelGroup.allDescendantUsers.@each', - 'learnerGroup.user.@each', + 'learnerGroup.topLevelGroup.allDescendantUsers.[]', + 'learnerGroup.user.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('learnerGroup.usersOnlyAtThisLevel').then(currentUsers => { @@ -30,9 +30,9 @@ export default Component.extend({ } ), cohortMembersNotInAnyGroup: computed( - 'learnerGroup.topLevelGroup.allDescendantUsers.@each', - 'learnerGroup.user.@each', - 'learnerGroup.cohort.users.@each', + 'learnerGroup.topLevelGroup.allDescendantUsers.[]', + 'learnerGroup.user.[]', + 'learnerGroup.cohort.users.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('learnerGroup.topLevelGroup').then(topLevelGroup => { diff --git a/app/components/learnergroup-list.js b/app/components/learnergroup-list.js index d5d4b30023..6035803555 100644 --- a/app/components/learnergroup-list.js +++ b/app/components/learnergroup-list.js @@ -4,7 +4,7 @@ const { Component, computed } = Ember; export default Component.extend({ learnerGroups: [], - proxiedLearnerGroups: computed('learnerGroups.@each', function(){ + proxiedLearnerGroups: computed('learnerGroups.[]', function(){ return this.get('learnerGroups').map(function(learnerGroup){ return Ember.ObjectProxy.create({ content: learnerGroup, diff --git a/app/components/learnergroup-overview.js b/app/components/learnergroup-overview.js index 4afa8aa75b..6067492590 100644 --- a/app/components/learnergroup-overview.js +++ b/app/components/learnergroup-overview.js @@ -13,7 +13,7 @@ export default Component.extend({ courseSort: ['title'], sortedCourses: sort('learnerGroup.courses', 'courseSort'), associatedCoursesTitles: mapBy('sortedCourses', 'title'), - associatedCoursesString: computed('associatedCoursesTitles.@each', function(){ + associatedCoursesString: computed('associatedCoursesTitles.[]', function(){ return this.get('associatedCoursesTitles').join(', '); }), diff --git a/app/components/learnergroup-selection-manager.js b/app/components/learnergroup-selection-manager.js index 48aac6ab2d..ba9765e9db 100644 --- a/app/components/learnergroup-selection-manager.js +++ b/app/components/learnergroup-selection-manager.js @@ -14,17 +14,17 @@ export default Component.extend({ cohorts: [], learnerGroups: alias('subject.learnerGroups'), sortedLearnerGroups: sort('learnerGroups', 'sortBy'), - filteredCohorts: computed('cohorts.@each', 'filter', 'learnerGroups.@each', function(){ + filteredCohorts: computed('cohorts.[]', 'filter', 'learnerGroups.[]', function(){ var self = this; var cohortProxy = Ember.ObjectProxy.extend({ selectedLearnerGroups: [], hasAvailableLearnerGroups: notEmpty('filteredAvailableLearnerGroups'), filter: '', filteredAvailableLearnerGroups: computed( - 'content.learnerGroups.@each', - 'content.learnerGroups.@each.allDescendants.@each', + 'content.learnerGroups.[]', + 'content.learnerGroups.@each.allDescendants.[]', 'filter', - 'selectedLearnerGroups.@each', + 'selectedLearnerGroups.[]', function(){ var defer = Ember.RSVP.defer(); var self = this; diff --git a/app/components/learningmaterial-manager.js b/app/components/learningmaterial-manager.js index c67261b6b3..e3c2acb5e3 100644 --- a/app/components/learningmaterial-manager.js +++ b/app/components/learningmaterial-manager.js @@ -12,7 +12,7 @@ export default Component.extend({ isCourse: false, isSession: not('isCourse'), learningMaterialStatuses: [], - statusOptions: computed('learningMaterialStatuses.@each', function(){ + statusOptions: computed('learningMaterialStatuses.[]', function(){ return this.get('learningMaterialStatuses').map(function(status){ return Ember.Object.create({ id: status.get('id'), diff --git a/app/components/live-search.js b/app/components/live-search.js index d8f9bc0852..64b872ddb8 100644 --- a/app/components/live-search.js +++ b/app/components/live-search.js @@ -17,7 +17,7 @@ export default Component.extend({ showMoreInputPrompt: false, searchReturned: false, searching: false, - sortedSearchResults: computed('results.@each', function(){ + sortedSearchResults: computed('results.[]', function(){ return this.get('results').sortBy('sortTerm'); }), diff --git a/app/components/mesh-manager.js b/app/components/mesh-manager.js index 9509a3385b..5308627c90 100644 --- a/app/components/mesh-manager.js +++ b/app/components/mesh-manager.js @@ -6,7 +6,7 @@ const { Component, computed } = Ember; var ProxiedDescriptors = Ember.ObjectProxy.extend({ terms: [], - isActive: computed('content', 'terms.@each', function(){ + isActive: computed('content', 'terms.[]', function(){ return !this.get('terms').contains(this.get('content')); }) }); diff --git a/app/components/objective-manage-competency.js b/app/components/objective-manage-competency.js index ac245c1c39..da9d9d2624 100644 --- a/app/components/objective-manage-competency.js +++ b/app/components/objective-manage-competency.js @@ -9,7 +9,7 @@ export default Component.extend({ programYear: oneWay('objective.programYear'), showCompetencyList: notEmpty('programYear.competencies'), classNames: ['objective-manager', 'objective-manage-competency'], - competencies: computed('programYear.competencies.@each', 'objective.competency', function(){ + competencies: computed('programYear.competencies.[]', 'objective.competency', function(){ if(!this.get('programYear')){ return []; } @@ -26,7 +26,7 @@ export default Component.extend({ let domainProxy = Ember.ObjectProxy.extend({ selectedCompetency: null, subCompetencies: [], - selected: computed('subCompetencies.@each', 'selectedCompetency', function(){ + selected: computed('subCompetencies.[]', 'selectedCompetency', function(){ let selectedSubCompetencies = this.get('subCompetencies').filter(competencyProxy => { return competencyProxy.get('id') === this.get('selectedCompetency.id'); }); diff --git a/app/components/offering-manager.js b/app/components/offering-manager.js index 59d24a2979..92e8e8bf13 100644 --- a/app/components/offering-manager.js +++ b/app/components/offering-manager.js @@ -27,7 +27,7 @@ export default Component.extend({ availableInstructorGroups: alias('offering.session.course.school.instructorGroups'), showRemoveConfirmation: false, buffer: null, - allInstructors: computed('instructors.@each', 'instructorGroups.@each.users.@each', function(){ + allInstructors: computed('instructors.[]', 'instructorGroups.@each.users.[]', function(){ var self = this; var defer = Ember.RSVP.defer(); var instructorGroups = this.get('instructorGroups'); @@ -176,7 +176,7 @@ export default Component.extend({ if(isEmpty(offering)){ return false; } - + let defer = RSVP.defer(); this.get('currentUser.userIsDeveloper').then(isDeveloper => { if(isDeveloper){ @@ -199,12 +199,12 @@ export default Component.extend({ }); } }); - + return PromiseObject.create({ promise: defer.promise }); }), - + actions: { save() { if (this.datesValidated() && this.timesValidated()) { diff --git a/app/components/program-list.js b/app/components/program-list.js index 9341164c42..a1b3ed8d74 100644 --- a/app/components/program-list.js +++ b/app/components/program-list.js @@ -4,7 +4,7 @@ const { Component, computed } = Ember; export default Component.extend({ programs: [], - proxiedPrograms: computed('programs.@each', function(){ + proxiedPrograms: computed('programs.[]', function(){ return this.get('programs').map(function(program){ return Ember.ObjectProxy.create({ content: program, diff --git a/app/components/programyear-competency-manager.js b/app/components/programyear-competency-manager.js index c686a6c68a..a81816f128 100644 --- a/app/components/programyear-competency-manager.js +++ b/app/components/programyear-competency-manager.js @@ -9,7 +9,7 @@ export default Component.extend({ selectedCompetencies: [], tagName: 'section', classNames: ['detail-block'], - filteredCompetencies: computed('availableCompetencies.@each', 'selectedCompetencies.@each', function(){ + filteredCompetencies: computed('availableCompetencies.[]', 'selectedCompetencies.[]', function(){ return this.get('availableCompetencies').filter( competency => { return !this.get('selectedCompetencies').contains(competency); diff --git a/app/components/selectable-search-result.js b/app/components/selectable-search-result.js index c5fbaa780a..96401ead0b 100644 --- a/app/components/selectable-search-result.js +++ b/app/components/selectable-search-result.js @@ -5,7 +5,7 @@ const { Component, computed } = Ember; export default Component.extend({ selectedItems: Ember.A(), item: null, - selected: computed('item', 'selectedItems.@each', function(){ + selected: computed('item', 'selectedItems.[]', function(){ return this.get('selectedItems').contains(this.item); }), click: function() { diff --git a/app/components/session-objective-manager.js b/app/components/session-objective-manager.js index 1a1582d1fc..794ea2f474 100644 --- a/app/components/session-objective-manager.js +++ b/app/components/session-objective-manager.js @@ -5,7 +5,7 @@ const { Component, computed, observer, on } = Ember; var objectiveProxy = Ember.ObjectProxy.extend({ sessionObjective: null, - selected: computed('content', 'sessionObjective.parents.@each', function(){ + selected: computed('content', 'sessionObjective.parents.[]', function(){ return this.get('sessionObjective.parents').contains(this.get('content')); }), }); @@ -14,7 +14,7 @@ export default Component.extend({ classNames: ['objective-manager'], sessionObjective: null, showObjectiveList: false, - course: computed('sessionObjective.courses.@each', function(){ + course: computed('sessionObjective.courses.[]', function(){ var sessionObjective = this.get('sessionObjective'); if(!sessionObjective){ return null; @@ -30,7 +30,7 @@ export default Component.extend({ promise:deferred.promise }); }), - proxiedObjectives: computed('course', 'course.objectives.@each', function(){ + proxiedObjectives: computed('course', 'course.objectives.[]', function(){ var sessionObjective = this.get('sessionObjective'); if(!sessionObjective){ return []; diff --git a/app/components/session-offerings-list.js b/app/components/session-offerings-list.js index fd8e2d50d9..3093a3cc38 100644 --- a/app/components/session-offerings-list.js +++ b/app/components/session-offerings-list.js @@ -12,7 +12,7 @@ export default Component.extend({ offerings: oneWay('session.offerings'), editable: true, offeringBlocks: computed( - 'offerings.@each.{startDate,endDate,room,instructorGroups.@each}', + 'offerings.@each.{startDate,endDate,room,instructorGroups.[]}', function(){ var offerings = this.get('offerings'); if(offerings == null){ diff --git a/app/components/user-search.js b/app/components/user-search.js index 027db2d3d1..958d856732 100644 --- a/app/components/user-search.js +++ b/app/components/user-search.js @@ -40,7 +40,7 @@ export default Component.extend({ let userProxy = Ember.ObjectProxy.extend({ isUser: true, currentlyActiveUsers: [], - isActive: computed('content', 'currentlyActiveUsers.@each', function(){ + isActive: computed('content', 'currentlyActiveUsers.[]', function(){ let user = this.get('content'); if(!user.get('enabled')){ return false; @@ -54,7 +54,7 @@ export default Component.extend({ let instructorGroupProxy = Ember.ObjectProxy.extend({ isInstructorGroup: true, currentlyActiveInstructorGroups: [], - isActive: computed('content', 'currentlyActiveInstructorGroups.@each', function(){ + isActive: computed('content', 'currentlyActiveInstructorGroups.[]', function(){ return !this.get('currentlyActiveInstructorGroups').contains(this.get('content')); }), sortTerm: oneWay('content.title'), diff --git a/app/models/cohort.js b/app/models/cohort.js index 91763895ae..5b61265192 100644 --- a/app/models/cohort.js +++ b/app/models/cohort.js @@ -12,7 +12,7 @@ export default DS.Model.extend({ learnerGroups: DS.hasMany('learner-group', {async: true}), users: DS.hasMany('user', {async: true}), displayTitle: '', - competencies: computed('programYear.competencies.@each', function(){ + competencies: computed('programYear.competencies.[]', function(){ var self = this; return new Ember.RSVP.Promise(function(resolve) { self.get('programYear').then(function(programYear){ @@ -24,7 +24,7 @@ export default DS.Model.extend({ }); }); }), - objectives: computed('programYear.objectives.@each', function(){ + objectives: computed('programYear.objectives.[]', function(){ var self = this; return new Ember.RSVP.Promise(function(resolve) { self.get('programYear').then(function(programYear){ @@ -36,7 +36,7 @@ export default DS.Model.extend({ }); }); }), - topLevelLearnerGroups: computed('learnerGroups.@each', function(){ + topLevelLearnerGroups: computed('learnerGroups.[]', function(){ let defer = Ember.RSVP.defer(); this.get('learnerGroups').then(groups => { let topLevelGroups = Ember.A(); diff --git a/app/models/learner-group.js b/app/models/learner-group.js index f58e442e5e..a6da5b475a 100644 --- a/app/models/learner-group.js +++ b/app/models/learner-group.js @@ -81,7 +81,7 @@ export default DS.Model.extend({ usersCount: computed('users.length', 'childUsersTotal', 'childrenUsersTotal', function(){ return this.get('users.length') + this.get('childUsersTotal') + this.get('childrenUsersTotal'); }), - availableUsers: computed('users', 'parent.users.@each', 'parent.childUsers.@each', function(){ + availableUsers: computed('users', 'parent.users.[]', 'parent.childUsers.[]', function(){ var group = this; return new Ember.RSVP.Promise(function(resolve) { group.get('parent').then(function(parent){ @@ -107,7 +107,7 @@ export default DS.Model.extend({ }); }); }), - allDescendantUsers: computed('users.@each', 'children.@each.users.@each', function(){ + allDescendantUsers: computed('users.[]', 'children.@each.users.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('users').then(users => { this.get('children').then(children => { @@ -123,7 +123,7 @@ export default DS.Model.extend({ promise: deferred.promise }); }), - usersOnlyAtThisLevel: computed('users.@each', 'allDescendants.@each', function(){ + usersOnlyAtThisLevel: computed('users.[]', 'allDescendants.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('users').then(users => { this.get('allDescendants').then(descendants => { @@ -186,7 +186,7 @@ export default DS.Model.extend({ var title = this.get('allParentsTitle') + this.get('title'); return title.replace(/([\s->]+)/ig,""); }), - allDescendants: computed('children.@each.allDescendants.@each', function(){ + allDescendants: computed('children.@each.allDescendants.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('children').then(function(learnerGroups){ var groups = []; @@ -211,7 +211,7 @@ export default DS.Model.extend({ promise: deferred.promise }); }), - allParents: computed('parent', 'parent.allParents.@each', function(){ + allParents: computed('parent', 'parent.allParents.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('parent').then(parent => { var parents = []; diff --git a/app/models/school.js b/app/models/school.js index 23bd86861c..dede832c52 100644 --- a/app/models/school.js +++ b/app/models/school.js @@ -17,7 +17,7 @@ export default DS.Model.extend({ curriculumInventoryInsitution: DS.belongsTo('curriculum-inventory-institution', {async: true}), sessionTypes: DS.hasMany('session-type', {async: true}), stewards: DS.hasMany('program-year-steward', {async: true}), - cohorts: computed('programs.@each', function(){ + cohorts: computed('programs.[]', function(){ var school = this; return new Ember.RSVP.Promise(function(resolve) { school.get('programs').then(function(programs){ diff --git a/app/models/session.js b/app/models/session.js index 114abd5dbf..75d60d4c40 100644 --- a/app/models/session.js +++ b/app/models/session.js @@ -33,7 +33,7 @@ var Session = DS.Model.extend(PublishableModel, { } return aDate > bDate ? 1 : -1; }), - firstOfferingDate: computed('sortedOfferingsByDate.@each', 'ilmSession.dueDate', function(){ + firstOfferingDate: computed('sortedOfferingsByDate.[]', 'ilmSession.dueDate', function(){ var self = this; var deferred = Ember.RSVP.defer(); this.get('ilmSession').then(function(ilmSession){ @@ -79,7 +79,7 @@ var Session = DS.Model.extend(PublishableModel, { return this.getOptionalPublicationIssues(); } ), - associatedLearnerGroups: computed('offerings.@each.learnerGroups.@each', function(){ + associatedLearnerGroups: computed('offerings.@each.learnerGroups.[]', function(){ var deferred = Ember.RSVP.defer(); this.get('offerings').then(function(offerings){ Ember.RSVP.all(offerings.mapBy('learnerGroups')).then(function(offeringLearnerGroups){ diff --git a/app/services/current-user.js b/app/services/current-user.js index 2cb9cc3f5a..539a12d840 100644 --- a/app/services/current-user.js +++ b/app/services/current-user.js @@ -37,7 +37,7 @@ export default Ember.Service.extend({ }); }), - availableCohortsObserver: observer('availableCohorts.@each', function(){ + availableCohortsObserver: observer('availableCohorts.[]', function(){ var self = this; this.get('availableCohorts').then(function(cohorts){ if(!cohorts.contains(self.get('currentCohort'))){