diff --git a/packages/ilios-common/addon/components/course/objective-list.hbs b/packages/ilios-common/addon/components/course/objective-list.hbs index a6a0bcca6c..ee930da8fa 100644 --- a/packages/ilios-common/addon/components/course/objective-list.hbs +++ b/packages/ilios-common/addon/components/course/objective-list.hbs @@ -1,39 +1,37 @@
- {{#if this.courseSessionsLoaded}} - {{#if this.isSorting}} - - {{/if}} + {{#if this.isSorting}} + + {{/if}} - {{#if (and this.courseObjectiveCount (not this.isSorting))}} - {{#if (and @editable (gt this.courseObjectiveCount 1))}} - - {{/if}} -
- {{t "general.description"}} - {{t "general.parentObjectives"}} - {{t "general.vocabularyTerms"}} - {{t "general.meshTerms"}} - {{t "general.actions"}} -
- {{#if (and (is-array this.courseObjectives) this.cohortObjectivesLoaded)}} - {{#each this.courseObjectives as |courseObjective|}} - - {{/each}} - {{else}} - - {{/if}} + {{#if (and this.courseObjectiveCount (not this.isSorting))}} + {{#if (and @editable (gt this.courseObjectiveCount 1))}} + + {{/if}} +
+ {{t "general.description"}} + {{t "general.parentObjectives"}} + {{t "general.vocabularyTerms"}} + {{t "general.meshTerms"}} + {{t "general.actions"}} +
+ {{#if (and (is-array this.courseObjectives) this.cohortObjectivesLoaded)}} + {{#each this.courseObjectives as |courseObjective|}} + + {{/each}} + {{else}} + {{/if}} {{/if}}
\ No newline at end of file diff --git a/packages/ilios-common/addon/components/course/objective-list.js b/packages/ilios-common/addon/components/course/objective-list.js index 5b6d71c8c8..6ea1485e04 100644 --- a/packages/ilios-common/addon/components/course/objective-list.js +++ b/packages/ilios-common/addon/components/course/objective-list.js @@ -8,22 +8,8 @@ import { findById } from 'ilios-common/utils/array-helpers'; export default class CourseObjectiveListComponent extends Component { @service store; @service intl; - @service dataLoader; @tracked isSorting = false; - @cached - get courseSessionsData() { - return new TrackedAsyncData(this.getCourseSessions(this.args.course)); - } - - get courseSessions() { - return this.courseSessionsData.isResolved ? this.courseSessionsData.value : null; - } - - get courseSessionsLoaded() { - return this.courseSessionsData.isResolved; - } - @cached get courseObjectivesAsyncData() { return new TrackedAsyncData(this.args.course.courseObjectives); @@ -39,7 +25,7 @@ export default class CourseObjectiveListComponent extends Component { } get courseObjectives() { - if (this.courseSessionsLoaded && this.courseObjectivesAsync) { + if (this.courseObjectivesAsync) { return this.courseObjectivesAsync.slice().sort(sortableByPosition); } @@ -51,7 +37,7 @@ export default class CourseObjectiveListComponent extends Component { } get courseCohorts() { - if (this.courseSessionsLoaded && this.courseCohortsAsync) { + if (this.courseCohortsAsync) { return this.courseCohortsAsync; } @@ -79,10 +65,6 @@ export default class CourseObjectiveListComponent extends Component { return this.args.course.hasMany('courseObjectives').ids().length; } - async getCourseSessions(course) { - await this.dataLoader.loadCourseSessions(course.id); - } - async getCohortObjectives(cohorts, intl) { return await map(cohorts, async (cohort) => { const programYear = await cohort.programYear;