Skip to content

Commit

Permalink
Merge pull request #8215 from michaelchadwick/frontend-5645-sync-obj-…
Browse files Browse the repository at this point in the history
…families-expansion-collapsion

synchronize Course/Session objective description/parentObjectives FadeText status
  • Loading branch information
dartajax authored Dec 9, 2024
2 parents c0c365a + 52f4059 commit a1084fc
Show file tree
Hide file tree
Showing 42 changed files with 1,151 additions and 281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
@isSaveDisabled={{this.hasErrorForTitle}}
@save={{perform this.saveTitleChanges}}
@close={{this.revertTitleChanges}}
@fadeTextExpanded={{this.fadeTextExpanded}}
@onExpandAllFadeText={{this.expandAllFadeText}}
>
<HtmlEditor @content={{this.title}} @update={{this.changeTitle}} @autofocus={{true}} />
<ValidationError @validatable={{this}} @property="title" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default class ProgramYearObjectiveListItemComponent extends Component {
@tracked isManagingTerms;
@tracked termsBuffer = [];
@tracked selectedVocabulary;
@tracked fadeTextExpanded = false;

constructor() {
super(...arguments);
Expand Down Expand Up @@ -155,6 +156,10 @@ export default class ProgramYearObjectiveListItemComponent extends Component {
this.highlightSave.perform();
});

@action
expandAllFadeText(isExpanded) {
this.fadeTextExpanded = isExpanded;
}
@action
revertTitleChanges() {
this.title = this.args.programYearObjective.title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ module('Acceptance | Course - Competencies', function (hooks) {
details: true,
courseObjectiveDetails: true,
});
await page.details.objectives.objectiveList.objectives[1].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[1].parents.manage();
const m = page.details.objectives.objectiveList.objectives[1].parentManager;
await m.competencies[1].objectives[0].add();
assert.ok(m.competencies[0].objectives[0].notSelected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { setupApplicationTest } from 'frontend/tests/helpers';
import page from 'ilios-common/page-objects/course';
import percySnapshot from '@percy/ember';

module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
setupApplicationTest(hooks);
hooks.beforeEach(async function () {
this.user = await setupAuthentication({}, true);
Expand Down Expand Up @@ -65,7 +65,7 @@ module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
'program-year objective 1',
);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand All @@ -92,7 +92,7 @@ module('Acceptance | Course - Multiple Objective Parents', function (hooks) {
page.details.objectives.objectiveList.objectives[0].description.text,
'course objective 0',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.competencies[0].objectives[2].add();
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ module('Acceptance | Course - Objective Inactive Parents', function (hooks) {
assert.strictEqual(objectives[0].parents.list.length, 1);
assert.strictEqual(objectives[0].parents.list[0].text, 'inactive selected');

await objectives[0].parents.list[0].manage();
await objectives[0].parents.manage();
const m = objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down Expand Up @@ -135,7 +135,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down Expand Up @@ -185,7 +185,7 @@ module('Acceptance | Course with multiple Cohorts - Objective Parents', function
page.details.objectives.objectiveList.objectives[0].parents.list[1].text,
'program-year objective 3',
);
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

await m.selectCohort(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook

assert.strictEqual(firstObjective.description.text, 'course objective 0');
assert.ok(firstObjective.parents.empty);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();
const m = firstObjective.parentManager;

assert.ok(m.hasNoCohortWarning);
Expand All @@ -50,7 +50,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook
await page.details.cohorts.selectable[0].add();
await page.details.cohorts.save();
assert.strictEqual(page.details.cohorts.current.length, 1);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
assert.strictEqual(m.competencies.length, 1);
Expand All @@ -64,7 +64,7 @@ module('Acceptance | Course with no cohorts - Objective Parents', function (hook
await page.details.cohorts.selected[0].remove();
await page.details.cohorts.save();
assert.strictEqual(page.details.cohorts.current.length, 0);
await firstObjective.parents.list[0].manage();
await firstObjective.parents.manage();
assert.ok(m.hasNoCohortWarning);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
'program-year objective 0',
);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;

assert.strictEqual(m.selectedCohortTitle, 'program 0 cohort 0');
Expand Down Expand Up @@ -108,7 +108,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'default background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down Expand Up @@ -152,7 +152,7 @@ module('Acceptance | Course - Objective Parents', function (hooks) {
);

await percySnapshot(getUniqueName(assert, 'default background color'));
await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
await percySnapshot(getUniqueName(assert, 'managed background color'));

const m = page.details.objectives.objectiveList.objectives[0].parentManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ module('Acceptance | Course - Publish All Sessions', function (hooks) {
assert.ok(page.publishAll.isVisible);
assert.ok(page.publishAll.hasUnlinkedWarning);

await page.details.objectives.objectiveList.objectives[0].parents.list[0].manage();
await page.details.objectives.objectiveList.objectives[0].parents.manage();
const m = page.details.objectives.objectiveList.objectives[0].parentManager;
await m.competencies[0].objectives[0].add();
await page.details.objectives.objectiveList.objectives[0].parents.save();
Expand Down
Loading

0 comments on commit a1084fc

Please sign in to comment.