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

Information Architecture Refactor: Update the Plan > Lesson Summary #12730

Merged
merged 15 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from 10 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
15 changes: 12 additions & 3 deletions kolibri/core/assets/src/views/CoreTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,20 @@

const tbodyCopy = [...this.$slots.tbody];
tbodyCopy.forEach(tbody => {
// Need to check componentOptions if wrapped in <transition-group>, or just children
// if in regular <tbody>
const tgroupChildren = get(tbody, 'componentOptions.children');
if (tgroupChildren) {
tableHasRows = tgroupChildren.length > 0;
if (tgroupChildren.length === 0) {
tableHasRows = false;
} else if (
tgroupChildren.length === 1 &&
tgroupChildren[0]?.tag?.includes('transition-group')
) {
const [child] = tgroupChildren;
const children = child.children || child.componentOptions?.children;
tableHasRows = !!children?.length > 0;
} else {
tableHasRows = true;
}
}

if (tbody.children) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<div
class="sort-widget"
:class="{ focused: hasFocus, 'not-focused': !hasFocus }"
@mousedown="e => $emit('mousedown', e)"
>
<KIconButton
v-show="!isFirst"
Expand Down
1 change: 1 addition & 0 deletions kolibri/core/lessons/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class LessonViewset(ValuesViewset):
"collection__name",
"collection__parent_id",
"created_by",
"date_created",
"lesson_assignment_collections",
)

Expand Down
11 changes: 11 additions & 0 deletions kolibri/plugins/coach/assets/src/routes/planLessonsRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,17 @@ export default [
},
],
},
{
name: LessonsPageNames.SUMMARY,
path: '/:classId/plan/lessonstemp/:lessonId/:tabId?',
component: LessonSummaryPage,
handler(toRoute) {
return showLessonSummaryPage(store, toRoute.params);
},
meta: {
titleParts: ['LESSON_NAME', 'CLASS_NAME'],
},
},
{
name: LessonsPageNames.SUMMARY,
path: path(CLASS, LESSON),
Expand Down
53 changes: 52 additions & 1 deletion kolibri/plugins/coach/assets/src/views/common/LessonStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,27 @@
</KGridItem>
</div>

<!-- Class name -->
<div class="status-item">
<KGridItem
class="status-label"
:layout4="{ span: 4 }"
:layout8="{ span: 4 }"
:layout12="layout12Label"
>
{{ coachString('classLabel') }}
</KGridItem>
<KGridItem
:layout4="{ span: 4 }"
:layout8="{ span: 4 }"
:layout12="layout12Value"
>
<div>
{{ className }}
</div>
</KGridItem>
</div>

<!-- Lesson Sizes -->
<div class="status-item">
<KGridItem
Expand All @@ -90,6 +111,28 @@
<KEmptyPlaceholder v-else />
</KGridItem>
</div>

<!-- Date created -->
<div class="status-item">
<KGridItem
class="status-label"
:layout4="{ span: 4 }"
:layout8="{ span: 4 }"
:layout12="layout12Label"
>
{{ coreString('dateCreated') }}
</KGridItem>
<KGridItem
:layout4="{ span: 4 }"
:layout8="{ span: 4 }"
:layout12="layout12Value"
>
<ElapsedTime
:date="lessonDateCreated"
style="margin-top: 8px"
/>
</KGridItem>
</div>
</KGrid>
<KModal
v-if="showLessonIsVisibleModal && !userHasDismissedModal"
Expand Down Expand Up @@ -135,6 +178,7 @@
import { mapActions } from 'vuex';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import bytesForHumans from 'kolibri.utils.bytesForHumans';
import ElapsedTime from 'kolibri.coreVue.components.ElapsedTime';
import { LESSON_VISIBILITY_MODAL_DISMISSED } from 'kolibri.coreVue.vuex.constants';
import Lockr from 'lockr';
import useSnackbar from 'kolibri.coreVue.composables.useSnackbar';
Expand All @@ -143,7 +187,7 @@

export default {
name: 'LessonStatus',
components: { Recipients },
components: { Recipients, ElapsedTime },
mixins: [coachStringsMixin, commonCoreStrings],
setup() {
const { createSnackbar } = useSnackbar();
Expand Down Expand Up @@ -185,6 +229,13 @@
userHasDismissedModal() {
return Lockr.get(LESSON_VISIBILITY_MODAL_DISMISSED);
},
lessonDateCreated() {
if (this.lesson.date_created) {
return new Date(this.lesson.date_created);
} else {
return null;
}
},
},
mounted() {
this.checkIfAnyLODsInClass();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
:label="resource.title"
/>
</h1>
<StatusElapsedTime
v-if="examOrLesson !== 'exam'"
v-show="!$isPrint"
:date="createdDate"
actionType="created"
/>
</div>
</template>
<template #options>
Expand All @@ -44,15 +38,13 @@
import { mapState } from 'vuex';
import MissingResourceAlert from 'kolibri-common/components/MissingResourceAlert';
import HeaderWithOptions from './HeaderWithOptions';
import StatusElapsedTime from './StatusElapsedTime';
import BackLink from './BackLink';

export default {
name: 'QuizLessonDetailsHeader',
components: {
HeaderWithOptions,
MissingResourceAlert,
StatusElapsedTime,
BackLink,
},
props: {
Expand Down Expand Up @@ -83,13 +75,6 @@
resource() {
return this.examOrLesson === 'lesson' ? this.lesson : this.exam;
},
createdDate() {
if (this[this.examOrLesson].date_created) {
return new Date(this[this.examOrLesson].date_created);
} else {
return null;
}
},
},
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<template>

<KButton
<KIconButton
hasDropdown
icon="optionsHorizontal"
appearance="flat-button"
:text="coreString('optionsLabel')"
>
Expand All @@ -11,7 +12,7 @@
@select="$emit('select', $event.value)"
/>
</template>
</KButton>
</KIconButton>

</template>

Expand Down
Loading