diff --git a/packages/frontend/.lint-todo b/packages/frontend/.lint-todo index d8e55f85d5..2080df9e80 100644 --- a/packages/frontend/.lint-todo +++ b/packages/frontend/.lint-todo @@ -1,24 +1,4 @@ add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1719360000000|1734915600000|1750464000000|app/components/new-directory-user.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1719360000000|1734915600000|1750464000000|app/components/school-competencies-collapsed.hbs -add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|d0274adc777d08699935bd8c5f7a4a3346d93065|1719360000000|1734915600000|1750464000000|app/components/school-competencies-collapsed.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1719360000000|1734915600000|1750464000000|app/components/school-competencies-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|d0274adc777d08699935bd8c5f7a4a3346d93065|1719360000000|1734915600000|1750464000000|app/components/school-competencies-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|7312526529ca39ed820819d1478d8e1b8f555279|1719360000000|1734915600000|1750464000000|app/components/school-curriculum-inventory-institution-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|6|4|6|4|58a8dc317204df6b5fac13a4349906b0c7b1db7b|1719360000000|1734915600000|1750464000000|app/components/school-curriculum-inventory-institution-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|7312526529ca39ed820819d1478d8e1b8f555279|1719360000000|1734915600000|1750464000000|app/components/school-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|66a5b0f89c3a88a7c0b541518f72e20531cd4be7|1719360000000|1734915600000|1750464000000|app/components/school-session-attributes.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|1d825ec0c79a15f259a520b8cd57683cbcbef5a2|1719360000000|1734915600000|1750464000000|app/components/school-session-attributes.hbs -add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|23cd787c79c34a628dadb6e96dd4004d42eebb79|1719360000000|1734915600000|1750464000000|app/components/school-session-type-form.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|23cd787c79c34a628dadb6e96dd4004d42eebb79|1719360000000|1734915600000|1750464000000|app/components/school-session-type-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|66a5b0f89c3a88a7c0b541518f72e20531cd4be7|1719360000000|1734915600000|1750464000000|app/components/school-session-types-collapsed.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|a90be151f45cd8ab32827e9247a9a9eb7f1baef2|1719360000000|1734915600000|1750464000000|app/components/school-session-types-collapsed.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|66a5b0f89c3a88a7c0b541518f72e20531cd4be7|1719360000000|1734915600000|1750464000000|app/components/school-session-types-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|af2ee7cd6f5c12e29ee3d5dc0ec4a76db43b7556|1719360000000|1734915600000|1750464000000|app/components/school-session-types-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|66a5b0f89c3a88a7c0b541518f72e20531cd4be7|1719360000000|1734915600000|1750464000000|app/components/school-vocabularies-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|df089fc2824cc65ff8a25e7787cf29a1911298b6|1719360000000|1734915600000|1750464000000|app/components/school-vocabularies-expanded.hbs -add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|7312526529ca39ed820819d1478d8e1b8f555279|1719360000000|1734915600000|1750464000000|app/components/school-vocabulary-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|1fe23f11c7d96a9f1082ef86c3d1f725c2212c21|1719360000000|1734915600000|1750464000000|app/components/school-vocabulary-term-manager.hbs -add|ember-template-lint|no-at-ember-render-modifiers|6|4|6|4|99e02f01ac450458b91299ca7b0c6e67d69d26d2|1719360000000|1734915600000|1750464000000|app/components/school-vocabulary-term-manager.hbs add|ember-template-lint|no-at-ember-render-modifiers|4|4|4|4|5d93dc162628c4faaa7bce9ef9bfba305f14ce38|1719360000000|1734915600000|1750464000000|app/components/unassigned-students-summary.hbs add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|5f7f17419fe451673ab74fb58778311bc01912c0|1719360000000|1734915600000|1750464000000|app/components/unassigned-students-summary.hbs add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|ddf86727990ead62165fe28c6dff53552a4d49b7|1719360000000|1734915600000|1750464000000|app/components/user-menu.hbs @@ -79,8 +59,6 @@ add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|fc55335d86e2b3d97a0 add|ember-template-lint|no-at-ember-render-modifiers|6|2|6|2|12443b4ba50f603e3c3af3d9e10ce840e7b67d9e|1719360000000|1734915600000|1750464000000|app/components/program-year/objective-list-item.hbs add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|286929067e02096dda5597efc45c876218621874|1719360000000|1734915600000|1750464000000|app/components/program-year/objectives.hbs add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|f37fd8ee0b117114a09137593ed6f113b2c80806|1719360000000|1734915600000|1750464000000|app/components/program-year/objectives.hbs -add|ember-template-lint|no-at-ember-render-modifiers|6|4|6|4|7312526529ca39ed820819d1478d8e1b8f555279|1719360000000|1734915600000|1750464000000|app/components/school/emails-editor.hbs -add|ember-template-lint|no-at-ember-render-modifiers|7|4|7|4|534e66e31edefd389dd85626b3fe99ddc2d7750a|1719360000000|1734915600000|1750464000000|app/components/school/emails-editor.hbs add|ember-template-lint|no-at-ember-render-modifiers|10|6|10|6|d919d2af254f782c01fe2ba15416673e52e91124|1719360000000|1734915600000|1750464000000|app/components/reports/subject/new/academic-year.hbs add|ember-template-lint|no-at-ember-render-modifiers|11|6|11|6|940005188b476a060b0e5d3f05baea24ba178878|1719360000000|1734915600000|1750464000000|app/components/reports/subject/new/academic-year.hbs add|ember-template-lint|no-at-ember-render-modifiers|10|6|10|6|d919d2af254f782c01fe2ba15416673e52e91124|1719360000000|1734915600000|1750464000000|app/components/reports/subject/new/competency.hbs diff --git a/packages/frontend/app/components/school-competencies-collapsed.hbs b/packages/frontend/app/components/school-competencies-collapsed.hbs index 2910a5ce7d..494294256b 100644 --- a/packages/frontend/app/components/school-competencies-collapsed.hbs +++ b/packages/frontend/app/components/school-competencies-collapsed.hbs @@ -1,8 +1,6 @@
@@ -19,34 +17,30 @@
- {{#if this.load.isRunning}} - - {{else}} -
- - - - - +
+
- {{t "general.competencyDomain"}} - - {{t "general.summary"}} -
+ + + + + + + + {{#each (sort-by "title" this.domains) as |domain|}} + + + - - - {{#each (sort-by "title" this.domains) as |domain|}} - - - - - {{/each}} - -
+ {{t "general.competencyDomain"}} + + {{t "general.summary"}} +
+ {{domain.title}} + + {{t "general.subCompetencyCount" count=domain.childCount}} +
- {{domain.title}} - - {{t "general.subCompetencyCount" count=domain.childCount}} -
-
- {{/if}} + {{/each}} + + +
diff --git a/packages/frontend/app/components/school-competencies-collapsed.js b/packages/frontend/app/components/school-competencies-collapsed.js index c83d67f252..cca97d62c6 100644 --- a/packages/frontend/app/components/school-competencies-collapsed.js +++ b/packages/frontend/app/components/school-competencies-collapsed.js @@ -1,12 +1,21 @@ import Component from '@glimmer/component'; -import { tracked } from '@glimmer/tracking'; -import { restartableTask } from 'ember-concurrency'; +import { cached, tracked } from '@glimmer/tracking'; +import { TrackedAsyncData } from 'ember-async-data'; export default class SchoolCompetenciesCollapsedComponent extends Component { @tracked competenciesRelationship; + @cached + get schoolCompetenciesData() { + return new TrackedAsyncData(this.args.school.competencies); + } + get competencies() { - return this.competenciesRelationship ? this.competenciesRelationship.slice() : []; + if (this.schoolCompetenciesData.isResolved) { + return this.schoolCompetenciesData.value; + } + + return []; } get domains() { @@ -20,8 +29,4 @@ export default class SchoolCompetenciesCollapsedComponent extends Component { return competency.belongsTo('parent').id(); }); } - - load = restartableTask(async () => { - this.competenciesRelationship = await this.args.school.competencies; - }); } diff --git a/packages/frontend/app/components/school-competencies-expanded.hbs b/packages/frontend/app/components/school-competencies-expanded.hbs index d8132f6d9a..539e6dccd2 100644 --- a/packages/frontend/app/components/school-competencies-expanded.hbs +++ b/packages/frontend/app/components/school-competencies-expanded.hbs @@ -1,7 +1,5 @@
diff --git a/packages/frontend/app/components/school-competencies-expanded.js b/packages/frontend/app/components/school-competencies-expanded.js index 02103e7736..982389bd60 100644 --- a/packages/frontend/app/components/school-competencies-expanded.js +++ b/packages/frontend/app/components/school-competencies-expanded.js @@ -1,27 +1,27 @@ import Component from '@glimmer/component'; import { service } from '@ember/service'; import { all } from 'rsvp'; -import { tracked } from '@glimmer/tracking'; +import { cached, tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; -import { dropTask, restartableTask } from 'ember-concurrency'; +import { dropTask } from 'ember-concurrency'; import { filterBy, uniqueValues } from 'ilios-common/utils/array-helpers'; +import { TrackedAsyncData } from 'ember-async-data'; export default class SchoolCompetenciesExpandedComponent extends Component { @service store; @tracked competenciesToAdd = []; @tracked competenciesToRemove = []; - @tracked schoolCompetencies; - load = restartableTask(async () => { - this.cleanup(); - this.schoolCompetencies = await this.args.school.competencies; - }); + @cached + get schoolCompetenciesData() { + return new TrackedAsyncData(this.args.school.competencies); + } get competencies() { - if (!this.schoolCompetencies) { + if (!this.schoolCompetenciesData.isResolved) { return []; } - const arr = [...this.schoolCompetencies.slice(), ...this.competenciesToAdd]; + const arr = [...this.schoolCompetenciesData.value, ...this.competenciesToAdd]; return uniqueValues( arr.filter((competency) => !this.competenciesToRemove.includes(competency)), ); @@ -80,10 +80,11 @@ export default class SchoolCompetenciesExpandedComponent extends Component { } save = dropTask(async () => { - const domainsToRemove = this.schoolCompetencies.filter((competency) => { + const competencies = this.schoolCompetenciesData.value; + const domainsToRemove = competencies.filter((competency) => { return !competency.belongsTo('parent').id() && !this.competencies.includes(competency); }); - const competenciesToRemove = this.schoolCompetencies.filter((competency) => { + const competenciesToRemove = competencies.filter((competency) => { return competency.belongsTo('parent').id() && !this.competencies.includes(competency); }); @@ -104,6 +105,5 @@ export default class SchoolCompetenciesExpandedComponent extends Component { // cleanup this.cleanup(); this.args.setSchoolManageCompetencies(false); - this.schoolCompetencies = await this.args.school.competencies; }); } diff --git a/packages/frontend/app/components/school-curriculum-inventory-institution-manager.hbs b/packages/frontend/app/components/school-curriculum-inventory-institution-manager.hbs index f3c517f998..b795645a37 100644 --- a/packages/frontend/app/components/school-curriculum-inventory-institution-manager.hbs +++ b/packages/frontend/app/components/school-curriculum-inventory-institution-manager.hbs @@ -2,8 +2,6 @@
{ this.addErrorDisplaysFor([ diff --git a/packages/frontend/app/components/school-manager.hbs b/packages/frontend/app/components/school-manager.hbs index 430b788c67..90ca0db3d8 100644 --- a/packages/frontend/app/components/school-manager.hbs +++ b/packages/frontend/app/components/school-manager.hbs @@ -1,7 +1,6 @@