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

Learner Groups now use same loading style as Instructor Groups #7857

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
32 changes: 32 additions & 0 deletions packages/frontend/app/components/learner-groups/loading.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<table class="learner-groups-loading" ...attributes>
<thead>
<tr>
<th class="text-left" colspan="2">
{{t "general.learnerGroupTitle"}}
</th>
<th class="text-center hide-from-small-screen">
{{t "general.members"}}
</th>
<th class="text-center hide-from-small-screen">
{{t "general.subgroups"}}
</th>
<th class="text-right">
{{t "general.actions"}}
</th>
</tr>
</thead>
<tbody>
{{! template-lint-disable no-unused-block-params }}
{{#each (repeat @count) as |empty|}}
<tr class="is-loading">
<td class="text-left" colspan="2">{{truncate
(repeat (random 3 10) "ilios rocks")
michaelchadwick marked this conversation as resolved.
Show resolved Hide resolved
100
}}</td>
<td class="text-center hide-from-small-screen">{{random 1 9}}</td>
<td class="text-center hide-from-small-screen">{{random 1 9}}</td>
<td class="text-right"></td>
</tr>
{{/each}}
</tbody>
</table>
2 changes: 1 addition & 1 deletion packages/frontend/app/components/learner-groups/root.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
@setSortBy={{@setSortBy}}
/>
{{else}}
<PulseLoader />
<LearnerGroups::Loading />
Copy link
Member

Choose a reason for hiding this comment

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

This accepts a count of all the learner groups that will eventually show up on the page and has a row for each one. I think you'll need to massage the data loading a bit to get the same info you need here.

{{/if}}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/app/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
@import "components/learner-group/members";

@import "components/learner-groups/root";
@import "components/learner-groups/loading";

@import "components/instructor-group/courses";
@import "components/instructor-group/header";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@use "../../mixins" as m;

.learner-groups-loading {
@include m.main-list-loading-table;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupIntl } from 'ember-intl/test-support';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
import a11yAudit from 'ember-a11y-testing/test-support/audit';

module('Integration | Component | learner-groups/loading', function (hooks) {
setupRenderingTest(hooks);
setupIntl(hooks, 'en-us');

test('it renders', async function (assert) {
await render(hbs`<LearnerGroups::Loading />`);
assert.dom('tbody tr').exists({ count: 1 });
await a11yAudit(this.element);
});
});