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

Remove Programs render modifiers #8189

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 0 additions & 6 deletions packages/frontend/.lint-todo
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,10 @@ add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|cb6d7acb9879902b89a
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|2bdc98d02ac5ea2a4bd5bac6a0f9e880abafdcbe|1722902400000|1730682000000|1754006400000|app/components/learner-group/instructor-manager.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|4|4|4|170987df2d1e4c134a0ac459fc0bdd8dd91b9929|1722902400000|1730682000000|1754006400000|app/components/learner-group/root.hbs
add|ember-template-lint|no-at-ember-render-modifiers|5|4|5|4|7c59a55b95fd159dd99afa6b20e5f05b5b68def0|1722902400000|1730682000000|1754006400000|app/components/learner-group/root.hbs
add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|66fe3cf991d61995cda5f5935874230700b5e21f|1722902400000|1730682000000|1754006400000|app/components/program/overview.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|0bcfaa7865c6a954a5b5226ffe44ddc6c63945ba|1722902400000|1730682000000|1754006400000|app/components/program/overview.hbs
add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|12f77ac1f8c43640397b771ba2c9830dd2041f23|1722902400000|1730682000000|1754006400000|app/components/program-year/collapsed-objectives.hbs
add|ember-template-lint|no-at-ember-render-modifiers|6|2|6|2|87dcba868bd23c9305b095ffbda9e90ab5b4918e|1722902400000|1730682000000|1754006400000|app/components/program-year/collapsed-objectives.hbs
add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|b759467cf4c3dc1d7e39d4bed1d085d51090d363|1722902400000|1730682000000|1754006400000|app/components/program-year/objective-list-item-expanded.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|c4f87a15e0dbf28e3a3b95d7b8259a419f93b29d|1722902400000|1730682000000|1754006400000|app/components/program-year/objective-list-item-expanded.hbs
add|ember-template-lint|no-at-ember-render-modifiers|5|2|5|2|fc55335d86e2b3d97a0614f6c046ba360820801c|1722902400000|1730682000000|1754006400000|app/components/program-year/objective-list-item.hbs
add|ember-template-lint|no-at-ember-render-modifiers|6|2|6|2|12443b4ba50f603e3c3af3d9e10ce840e7b67d9e|1722902400000|1730682000000|1754006400000|app/components/program-year/objective-list-item.hbs
add|ember-template-lint|no-at-ember-render-modifiers|3|2|3|2|286929067e02096dda5597efc45c876218621874|1722902400000|1730682000000|1754006400000|app/components/program-year/objectives.hbs
add|ember-template-lint|no-at-ember-render-modifiers|4|2|4|2|f37fd8ee0b117114a09137593ed6f113b2c80806|1722902400000|1730682000000|1754006400000|app/components/program-year/objectives.hbs
add|ember-template-lint|no-at-ember-render-modifiers|10|6|10|6|d919d2af254f782c01fe2ba15416673e52e91124|1722902400000|1730682000000|1754006400000|app/components/reports/subject/new/academic-year.hbs
add|ember-template-lint|no-at-ember-render-modifiers|11|6|11|6|940005188b476a060b0e5d3f05baea24ba178878|1722902400000|1730682000000|1754006400000|app/components/reports/subject/new/academic-year.hbs
add|ember-template-lint|no-at-ember-render-modifiers|10|6|10|6|d919d2af254f782c01fe2ba15416673e52e91124|1722902400000|1730682000000|1754006400000|app/components/reports/subject/new/competency.hbs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
{{if this.isManaging 'is-managing'}}
{{unless @programYearObjective.active 'is-inactive'}}"
data-test-program-year-objective-list-item
{{did-insert this.load @programYearObjective}}
{{did-update this.load @programYearObjective}}
>
<button
class="expand-row grid-item"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default class ProgramYearObjectiveListItemComponent extends Component {
@tracked termsBuffer = [];
@tracked selectedVocabulary;

@action
load() {
constructor() {
super(...arguments);
this.title = this.args.programYearObjective.title;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
<section
class="program-year-objectives"
{{did-insert this.load @programYear}}
{{did-update this.load @programYear @programYear.programYearObjectives}}
data-test-program-year-objectives
>
<section class="program-year-objectives" data-test-program-year-objectives>
<div class="header">
{{#if this.showCollapsible}}
<div>
Expand Down
11 changes: 8 additions & 3 deletions packages/frontend/app/components/program-year/objectives.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ export default class ProgramYearObjectivesComponent extends Component {
return this.objectiveCount > 0;
}

@action
load(element, [programYear]) {
this.objectiveCount = programYear.hasMany('programYearObjectives').ids().length;
constructor() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be further simplified. we don't need to set objectiveCount as component attribute.

instead, a getter would suffice here:

Suggested change
constructor() {
get objectivesCount() {
return this.args.programYear.hasMany('programYearObjectives').ids().length;
}

then, remove the tracked property by the same name further up in the class, and we're good to go.

super(...arguments);
this.objectiveCount = this.args.programYear.hasMany('programYearObjectives').ids().length;
}

// @action
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kruft, please remove.

// load(element, [programYear]) {
// this.objectiveCount = programYear.hasMany('programYearObjectives').ids().length;
// }

saveNewObjective = dropTask(async (title) => {
const programYearObjectives = await this.args.programYear.programYearObjectives;
const position = programYearObjectives.length
Expand Down
8 changes: 1 addition & 7 deletions packages/frontend/app/components/program/overview.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
<div
class="program-overview"
{{did-insert this.load @program}}
{{did-update this.load @program}}
data-test-program-overview
...attributes
>
<div class="program-overview" data-test-program-overview ...attributes>
<h2>
{{t "general.overview"}}
</h2>
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/app/components/program/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export default class ProgramOverviewComponent extends Component {
@tracked duration;
@Length(2, 10) @tracked shortTitle;

@action
load() {
constructor() {
super(...arguments);
this.duration = this.args.program.duration;
this.shortTitle = this.args.program.shortTitle;
}
Expand Down