Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed @each dependent key #1221

Merged
merged 1 commit into from
Dec 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/components/course-objective-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}),
});
Expand Down Expand Up @@ -69,7 +69,7 @@ export default Component.extend({
showObjectiveList: false,
showCohortList: false,
cohorts: computed(
'courseObjective.courses.@each',
'courseObjective.courses.[]',
'[email protected]',
function(){
var courseObjective = this.get('courseObjective');
Expand Down Expand Up @@ -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);
Expand All @@ -133,7 +133,7 @@ export default Component.extend({
return null;
}),
watchCohorts: on('init', observer(
'availableCohorts.@each',
'availableCohorts.[]',
'selectedCohortId',
'availableCohorts.length',
function(){
Expand Down
4 changes: 2 additions & 2 deletions app/components/detail-steward-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
Expand Down Expand Up @@ -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: [],
Expand Down
2 changes: 1 addition & 1 deletion app/components/detail-stewards.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down
2 changes: 1 addition & 1 deletion app/components/instructorgroup-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/components/instructorgroup-selection-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default Component.extend({
instructorGroups: alias('subject.instructorGroups'),
sortedInstructorGroups: sort('instructorGroups', 'sortBy'),
filteredAvailableInstructorGroups: computed(
'instructorGroups.@each',
'instructorGroups.[]',
'filter',
'[email protected]',
function(){
Expand Down
10 changes: 5 additions & 5 deletions app/components/learnergroup-details.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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 => {
Expand Down
2 changes: 1 addition & 1 deletion app/components/learnergroup-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/components/learnergroup-overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(', ');
}),

Expand Down
8 changes: 4 additions & 4 deletions app/components/learnergroup-selection-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
'[email protected].@each',
'content.learnerGroups.[]',
'[email protected].[]',
'filter',
'selectedLearnerGroups.@each',
'selectedLearnerGroups.[]',
function(){
var defer = Ember.RSVP.defer();
var self = this;
Expand Down
2 changes: 1 addition & 1 deletion app/components/learningmaterial-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
2 changes: 1 addition & 1 deletion app/components/live-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}),

Expand Down
2 changes: 1 addition & 1 deletion app/components/mesh-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
})
});
Expand Down
4 changes: 2 additions & 2 deletions app/components/objective-manage-competency.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
}
Expand All @@ -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');
});
Expand Down
8 changes: 4 additions & 4 deletions app/components/offering-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default Component.extend({
availableInstructorGroups: alias('offering.session.course.school.instructorGroups'),
showRemoveConfirmation: false,
buffer: null,
allInstructors: computed('instructors.@each', '[email protected].@each', function(){
allInstructors: computed('instructors.[]', '[email protected].[]', function(){
var self = this;
var defer = Ember.RSVP.defer();
var instructorGroups = this.get('instructorGroups');
Expand Down Expand Up @@ -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){
Expand All @@ -199,12 +199,12 @@ export default Component.extend({
});
}
});

return PromiseObject.create({
promise: defer.promise
});
}),

actions: {
save() {
if (this.datesValidated() && this.timesValidated()) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/program-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion app/components/programyear-competency-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion app/components/selectable-search-result.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions app/components/session-objective-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
}),
});
Expand All @@ -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;
Expand All @@ -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 [];
Expand Down
2 changes: 1 addition & 1 deletion app/components/session-offerings-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
4 changes: 2 additions & 2 deletions app/components/user-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions app/models/cohort.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -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){
Expand All @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions app/models/learner-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand All @@ -107,7 +107,7 @@ export default DS.Model.extend({
});
});
}),
allDescendantUsers: computed('users.@each', '[email protected].@each', function(){
allDescendantUsers: computed('users.[]', '[email protected].[]', function(){
var deferred = Ember.RSVP.defer();
this.get('users').then(users => {
this.get('children').then(children => {
Expand All @@ -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 => {
Expand Down Expand Up @@ -186,7 +186,7 @@ export default DS.Model.extend({
var title = this.get('allParentsTitle') + this.get('title');
return title.replace(/([\s->]+)/ig,"");
}),
allDescendants: computed('[email protected].@each', function(){
allDescendants: computed('[email protected].[]', function(){
var deferred = Ember.RSVP.defer();
this.get('children').then(function(learnerGroups){
var groups = [];
Expand All @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion app/models/school.js
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Loading