Skip to content

Commit

Permalink
Merge pull request #7613 from stopfstedt/5202_no_subgroups_no_headers
Browse files Browse the repository at this point in the history
don't display list of sub-groups if learner group doesn't have any.
  • Loading branch information
dartajax committed Feb 8, 2024
2 parents 87c4563 + e659bd6 commit 3f94790
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/frontend/app/components/learner-group/root.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,15 @@
{{/if}}
</div>
<div class="list">
<LearnerGroup::List
@learnerGroups={{this.learnerGroups}}
@canCopyWithLearners={{false}}
@copyGroup={{perform this.copyGroup}}
@sortBy={{this.sortGroupsBy}}
@setSortBy={{set this.sortGroupsBy}}
/>
{{#if @learnerGroup.childrenCount}}
<LearnerGroup::List
@learnerGroups={{this.learnerGroups}}
@canCopyWithLearners={{false}}
@copyGroup={{perform this.copyGroup}}
@sortBy={{this.sortGroupsBy}}
@setSortBy={{set this.sortGroupsBy}}
/>
{{/if}}
</div>
</section>
<section class="cohortmembers">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@
}
}
}

.learner-group-overview-content {
border-bottom: 1px dotted c.$orange;
}
}

.cohortmembers {
Expand All @@ -69,6 +73,8 @@
}

.subgroups {
@include cm.detail-container-content;

.header {
@include cm.detail-container-header;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,4 +563,28 @@ module('Integration | Component | learner-group/root', function (hooks) {
assert.ok(component.bulkAssignment.isVisible);
assert.strictEqual(component.actions.title, 'Upload Group Assignments');
});

test('sub-groups list not visible if learner group has no sub-groups', async function (assert) {
const learnerGroup = this.server.create('learner-group', {
cohort: this.cohort,
});
const learnerGroupModel = await this.owner
.lookup('service:store')
.findRecord('learner-group', learnerGroup.id);

this.set('learnerGroup', learnerGroupModel);

await render(hbs`<LearnerGroup::Root
@canUpdate={{true}}
@setIsEditing={{(noop)}}
@setSortUsersBy={{(noop)}}
@setIsBulkAssigning={{(noop)}}
@sortUsersBy="fullName"
@learnerGroup={{this.learnerGroup}}
@isEditing={{false}}
@isBulkAssigning={{false}}
/>`);

assert.notOk(component.subgroups.list.isVisible);
});
});

0 comments on commit 3f94790

Please sign in to comment.