-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8279 from stopfstedt/rm_ember_render_modifiers_in…
…_program_year_components replaces ember-render-modifiers with getters in program-year components.
- Loading branch information
Showing
5 changed files
with
108 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 20 additions & 17 deletions
37
packages/frontend/app/components/program-year/collapsed-objectives.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,34 @@ | ||
import Component from '@glimmer/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { restartableTask } from 'ember-concurrency'; | ||
import { cached } from '@glimmer/tracking'; | ||
import { TrackedAsyncData } from 'ember-async-data'; | ||
|
||
export default class ProgramYearCollapsedObjectivesComponent extends Component { | ||
@tracked objectives; | ||
@tracked objectivesWithCompetency; | ||
@tracked objectivesWithMesh; | ||
@tracked objectivesWithTerms; | ||
@cached | ||
get objectivesData() { | ||
return new TrackedAsyncData(this.args.programYear.programYearObjectives); | ||
} | ||
|
||
load = restartableTask(async (element, [objectivePromise]) => { | ||
if (!objectivePromise) { | ||
return false; | ||
} | ||
this.objectives = await objectivePromise; | ||
get objectives() { | ||
return this.objectivesData.isResolved ? this.objectivesData.value : []; | ||
} | ||
|
||
this.objectivesWithCompetency = this.objectives.filter((objective) => { | ||
get objectivesWithCompetency() { | ||
return this.objectives.filter((objective) => { | ||
return !!objective.belongsTo('competency').id(); | ||
}); | ||
this.objectivesWithMesh = this.objectives.filter((objective) => { | ||
} | ||
|
||
get objectivesWithMesh() { | ||
return this.objectives.filter((objective) => { | ||
const meshDescriptorIds = objective.hasMany('meshDescriptors').ids(); | ||
return meshDescriptorIds.length > 0; | ||
}); | ||
this.objectivesWithTerms = this.objectives.filter((objective) => { | ||
} | ||
|
||
get objectivesWithTerms() { | ||
return this.objectives.filter((objective) => { | ||
const termIds = objective.hasMany('terms').ids(); | ||
return termIds.length > 0; | ||
}); | ||
|
||
return true; | ||
}); | ||
} | ||
} |
4 changes: 1 addition & 3 deletions
4
packages/frontend/app/components/program-year/objective-list-item-expanded.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters