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

[DO NOT MERGE] Test new KDS tabs components in Coach Reports #10109

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion kolibri/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"intl": "^1.2.4",
"knuth-shuffle-seeded": "^1.0.6",
"kolibri-constants": "0.1.42",
"kolibri-design-system": "https://github.com/learningequality/kolibri-design-system#e203de2141dd9c8e807a1285a9d695a083576fc8",
"kolibri-design-system": "https://github.com/MisRob/kolibri-design-system#837fcabe7ced8dda7d44a2bb7adf28c067b2d736",
"lockr": "0.8.5",
"lodash": "^4.17.21",
"loglevel": "^1.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,60 @@
>

<KPageContainer>
<ReportsHeader :title="$isPrint ? $tr('printLabel', { className }) : null" />
<ReportsControls @export="exportCSV" />
<CoreTable :emptyMessage="coachString('groupListEmptyState')">
<template #headers>
<th>{{ coachString('groupNameLabel') }}</th>
<th>{{ coreString('lessonsLabel') }}</th>
<th>{{ coreString('quizzesLabel') }}</th>
<th>{{ coreString('learnersLabel') }}</th>
<th>{{ coachString('avgScoreLabel') }}</th>
<th>{{ coachString('lastActivityLabel') }}</th>
</template>
<template #tbody>
<transition-group
tag="tbody"
name="list"
>
<tr
v-for="tableRow in table"
:key="tableRow.id"
<ReportsHeader
:title="$isPrint ? $tr('printLabel', { className }) : null"
activeTabId="tabGroups"
/>
<KTabsPanel
tabsId="coachReports"
activeTabId="tabGroups"
>
<ReportsControls @export="exportCSV" />
<CoreTable :emptyMessage="coachString('groupListEmptyState')">
<template #headers>
<th>{{ coachString('groupNameLabel') }}</th>
<th>{{ coreString('lessonsLabel') }}</th>
<th>{{ coreString('quizzesLabel') }}</th>
<th>{{ coreString('learnersLabel') }}</th>
<th>{{ coachString('avgScoreLabel') }}</th>
<th>{{ coachString('lastActivityLabel') }}</th>
</template>
<template #tbody>
<transition-group
tag="tbody"
name="list"
>
<td>
<KRouterLink
:text="tableRow.name"
:to="classRoute('ReportsGroupReportPage', { groupId: tableRow.id })"
icon="group"
/>
</td>
<td>
{{ $formatNumber(tableRow.numLessons) }}
</td>
<td>
{{ $formatNumber(tableRow.numQuizzes) }}
</td>
<td>
{{ $formatNumber(tableRow.numLearners) }}
</td>
<td>
<Score :value="tableRow.avgScore" />
</td>
<td>
<ElapsedTime :date="tableRow.lastActivity" />
</td>
</tr>
</transition-group>
</template>
</CoreTable>
<tr
v-for="tableRow in table"
:key="tableRow.id"
>
<td>
<KRouterLink
:text="tableRow.name"
:to="classRoute('ReportsGroupReportPage', { groupId: tableRow.id })"
icon="group"
/>
</td>
<td>
{{ $formatNumber(tableRow.numLessons) }}
</td>
<td>
{{ $formatNumber(tableRow.numQuizzes) }}
</td>
<td>
{{ $formatNumber(tableRow.numLearners) }}
</td>
<td>
<Score :value="tableRow.avgScore" />
</td>
<td>
<ElapsedTime :date="tableRow.lastActivity" />
</td>
</tr>
</transition-group>
</template>
</CoreTable>
</KTabsPanel>
</KPageContainer>
</CoachAppBarPage>

Expand Down
62 changes: 43 additions & 19 deletions kolibri/plugins/coach/assets/src/views/reports/ReportsHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,14 @@
<p v-show="!$isPrint">
{{ $tr('description') }}
</p>
<HeaderTabs>

<HeaderTab
:text="coreString('lessonsLabel')"
:to="classRoute('ReportsLessonListPage')"
/>
<HeaderTab
:text="coreString('quizzesLabel')"
:to="classRoute('ReportsQuizListPage')"
/>
<HeaderTab
:text="coachString('groupsLabel')"
:to="classRoute('ReportsGroupListPage')"
/>
<HeaderTab
:text="coreString('learnersLabel')"
:to="classRoute('ReportsLearnerListPage')"
/>
</HeaderTabs>
<KTabsList
ref="tabsList"
tabsId="coachReports"
ariaLabel="Coach reports"
:activeTabId="activeTabId"
:tabs="tabs"
:style="{ marginBottom: '24px' }"
/>
</div>

</template>
Expand All @@ -46,17 +35,52 @@
name: 'ReportsHeader',
mixins: [commonCoach, commonCoreStrings],
props: {
activeTabId: {
type: String,
required: true,
},
title: {
type: String,
default: null,
},
},
data() {
return {
tabs: [
{
id: 'tabLessons',
label: this.coreString('lessonsLabel'),
to: this.classRoute('ReportsLessonListPage'),
},
{
id: 'tabQuizzes',
label: this.coreString('quizzesLabel'),
to: this.classRoute('ReportsQuizListPage'),
},
{
id: 'tabGroups',
label: this.coachString('groupsLabel'),
to: this.classRoute('ReportsGroupListPage'),
},
{
id: 'tabLearners',
label: this.coreString('learnersLabel'),
to: this.classRoute('ReportsLearnerListPage'),
},
],
};
},
computed: {
...mapGetters(['classListPageEnabled']),
reportTitle() {
return this.title || this.coachString('reportsLabel');
},
},
mounted() {
this.$nextTick(() => {
this.$refs.tabsList.focusActiveTab();
});
},
$trs: {
description: {
message: 'View reports for your learners and class materials',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,48 +7,56 @@
>

<KPageContainer>
<ReportsHeader :title="$isPrint ? $tr('printLabel', { className }) : null" />
<ReportsControls @export="exportCSV" />
<CoreTable :emptyMessage="coachString('learnerListEmptyState')">
<template #headers>
<th>{{ coachString('nameLabel') }}</th>
<th>{{ coachString('groupsLabel') }}</th>
<th>{{ coachString('avgScoreLabel') }}</th>
<th>{{ coachString('exercisesCompletedLabel') }}</th>
<th>{{ coachString('resourcesViewedLabel') }}</th>
<th>{{ coachString('lastActivityLabel') }}</th>
</template>
<template #tbody>
<transition-group
tag="tbody"
name="list"
>
<tr
v-for="tableRow in table"
:key="tableRow.id"
<ReportsHeader
:title="$isPrint ? $tr('printLabel', { className }) : null"
activeTabId="tabLearners"
/>
<KTabsPanel
tabsId="coachReports"
activeTabId="tabLearners"
>
<ReportsControls @export="exportCSV" />
<CoreTable :emptyMessage="coachString('learnerListEmptyState')">
<template #headers>
<th>{{ coachString('nameLabel') }}</th>
<th>{{ coachString('groupsLabel') }}</th>
<th>{{ coachString('avgScoreLabel') }}</th>
<th>{{ coachString('exercisesCompletedLabel') }}</th>
<th>{{ coachString('resourcesViewedLabel') }}</th>
<th>{{ coachString('lastActivityLabel') }}</th>
</template>
<template #tbody>
<transition-group
tag="tbody"
name="list"
>
<td>
<KRouterLink
:text="tableRow.name"
:to="classRoute('ReportsLearnerReportPage', { learnerId: tableRow.id })"
icon="person"
/>
</td>
<td>
<TruncatedItemList :items="tableRow.groups" />
</td>
<td>
<Score :value="tableRow.avgScore" />
</td>
<td>{{ $formatNumber(tableRow.exercises) }}</td>
<td>{{ $formatNumber(tableRow.resources) }}</td>
<td>
<ElapsedTime :date="tableRow.lastActivity" />
</td>
</tr>
</transition-group>
</template>
</CoreTable>
<tr
v-for="tableRow in table"
:key="tableRow.id"
>
<td>
<KRouterLink
:text="tableRow.name"
:to="classRoute('ReportsLearnerReportPage', { learnerId: tableRow.id })"
icon="person"
/>
</td>
<td>
<TruncatedItemList :items="tableRow.groups" />
</td>
<td>
<Score :value="tableRow.avgScore" />
</td>
<td>{{ $formatNumber(tableRow.exercises) }}</td>
<td>{{ $formatNumber(tableRow.resources) }}</td>
<td>
<ElapsedTime :date="tableRow.lastActivity" />
</td>
</tr>
</transition-group>
</template>
</CoreTable>
</KTabsPanel>
</KPageContainer>
</CoachAppBarPage>

Expand Down
Loading