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

Implement recommendations display #4803

Open
wants to merge 37 commits into
base: search-recommendations
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
23e49e6
Adds translator object + strings for search recs feature
akolson Aug 29, 2024
3e85347
change SearchOrBrowserWindow from Vuetify to KDS components
akolson Aug 29, 2024
fe76812
add about recommendations link
akolson Sep 3, 2024
1b5fe71
Update Translator object to expose a destructurable interface for str…
akolson Sep 3, 2024
13c7d15
Merge branch 'search-recs-strings-feature-file' into implement-recomm…
akolson Sep 3, 2024
f51e08f
adds recommendations title
akolson Sep 3, 2024
eeb8537
updates strings
akolson Sep 3, 2024
003d109
Merge branch 'search-recs-strings-feature-file' into implement-recomm…
akolson Sep 3, 2024
a43dcbb
Adds about recommendations modal
akolson Sep 3, 2024
675cdae
updates strings
akolson Sep 3, 2024
c56f907
Merge branch 'search-recs-strings-feature-file' into implement-recomm…
akolson Sep 3, 2024
3532e75
Adds reponsiveness to page
akolson Sep 4, 2024
c8f8db9
Adds sample data request
akolson Sep 5, 2024
fa81206
Merge branch 'merge-into-search-recs' into implement-recommendations-…
akolson Sep 5, 2024
3a74adc
Add latest KDS rc4 as dependency
akolson Sep 6, 2024
835e78c
Adds KCard
akolson Sep 9, 2024
b80aedb
Merge branch 'search-recommendations' into implement-recommendations-…
akolson Sep 18, 2024
e3f0cba
Adds KCardGrid
akolson Sep 24, 2024
93b8ef3
Adds preliminary logic to load recommendations
akolson Oct 31, 2024
078638c
Merge remote-tracking branch 'upstream/unstable' into merge-into-sear…
akolson Oct 31, 2024
4f1f84e
Merge branch 'merge-into-search-recs' into implement-recommendations-…
akolson Oct 31, 2024
1d000da
Merge branch 'merge-into-search-recs' into implement-recommendations-…
akolson Oct 31, 2024
8e200d5
fixes bug in translateMetadataString
akolson Oct 31, 2024
dc29890
Make minor tweaks to UI
akolson Nov 4, 2024
7009c10
updates kds version
akolson Nov 13, 2024
30d397f
Adds pagination logic
akolson Nov 27, 2024
7e98efc
Refactors code
akolson Dec 3, 2024
e4e2eeb
More code refators and logic fixes
akolson Dec 3, 2024
4ce5884
code clean-up
akolson Dec 3, 2024
95a1b52
adds ai flag check on UI and fetch
akolson Dec 4, 2024
0cb9469
Merge remote-tracking branch 'upstream/search-recommendations' into i…
akolson Dec 4, 2024
9f8de26
minor UI fixes
akolson Dec 4, 2024
596e109
further UI improvements
akolson Dec 5, 2024
7574c06
UI fixes
akolson Dec 9, 2024
c6e3a0c
additional UI fixes
akolson Dec 10, 2024
75df365
Updates kds to latest version
akolson Dec 11, 2024
48cda0d
Merge branch 'search-recommendations' into implement-recommendations-…
akolson Dec 13, 2024
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 contentcuration/contentcuration/dev_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

ROOT_URLCONF = "contentcuration.dev_urls"

INSTALLED_APPS += ("drf_yasg", "automation")
INSTALLED_APPS += ("drf_yasg",)
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
<template>

<KCard
class="recommended-resource-card"
:to="to"
:title="title"
orientation="horizontal"
:headingLevel="headingLevel"
:title="node.title"
:headingLevel="2"
thumbnailScaleType="contain"
thumbnailDisplay="small"
thumbnailAlign="right"
:thumbnailSrc="thumbnailSrc"
:style="{ margin: '16px 0 16px 0' }"
:thumbnailSrc="node.thumbnail_src"
@click="onClick"
>
<template #aboveTitle>
<div>
<KIcon
icon="practiceSolid"
/>
<span>Practice</span>
</div>
<template #select>
<Checkbox
:key="`checkbox-${node.id}`"
:inputValue="isSelected(node)"
@input="toggleSelected(node)"
>
<span class="visuallyhidden">{{ $tr('selectCard', { title: node.title }) }}</span>
</Checkbox>
</template>
<template #title>
<template #aboveTitle>
<ContentNodeLearningActivityIcon
:learningActivities="learningActivities"
showEachActivityIcon
includeText
small
/>
</template>
<template #belowTitle>
<div class="bellow-title-style">
<p>
below title slot section for the KCard component:
below title slot section for the KCard component
</p>
<div>
<KTextTruncator
:text="channelName"
:maxLines="2"
/>
</div>
</template>
<template #footer>
<div class="align-right-style">
<KIconButton icon="openNewTab" class="card-icon-size" />
<KIconButton icon="thumbDown" class="card-icon-size" />
</div>
<KFixedGrid :numCols="2">
<KFixedGridItem alignment="right">
<KIconButton icon="openNewTab" />
<KIconButton icon="thumbDown" />
</KFixedGridItem>
</KFixedGrid>
</template>
</KCard>

Expand All @@ -43,37 +49,68 @@

<script>

import find from 'lodash/find';
import LearningActivities from 'kolibri-constants/labels/LearningActivities';
import { ContentKindLearningActivityDefaults } from 'shared/leUtils/ContentKinds';
import Checkbox from 'shared/views/form/Checkbox';
import ContentNodeLearningActivityIcon from 'shared/views/ContentNodeLearningActivityIcon';

export default {
name: 'RecommendedResourceCard',
components: {
Checkbox,
ContentNodeLearningActivityIcon,
},
props: {
to: {
node: {
type: Object,
required: true,
},
title: {
type: String,
default: null,
},
headingLevel: {
type: Number,
selected: {
type: Array,
required: true,
},
thumbnailSrc: {
type: String,
default: null,
},
computed: {
channelName() {
return this.node.channel?.name || '';
},
learningActivities() {
return {
[ContentKindLearningActivityDefaults[this.node.kind] || LearningActivities.EXPLORE]: true,
};
},
isSelected() {
return function(node) {
return Boolean(find(this.selected, { id: node.id }));
};
},
},
methods: {
toggleSelected(node) {
this.$emit('change_selected', { nodes: [node], isSelected: !this.isSelected(node) });
},
onClick() {
this.$emit('preview', this.node);
},
},
$trs: {
selectCard: 'Select { title }',
},
};

</script>


<style>
.align-right-style{
display: flex;
justify-content: flex-end;
}
.recommended-resource-card {
max-width:400px
.visuallyhidden {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
border: 0;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<DropdownWrapper
component="VFlex"
sm6
md5
lg4
xl3
class="pr-4"
md6
lg6
xl6
class="pr-3"
>
<template #default="{ attach, menuProps }">
<VSelect
Expand All @@ -23,7 +23,7 @@
/>
</template>
</DropdownWrapper>
<VFlex sm6 md5 lg4 xl3 class="pr-5">
<VFlex sm6 md6 lg6 xl6>
<LanguageDropdown v-model="languageFilter" />
</VFlex>
</VLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@
<style lang="less" scoped>

.modal-container.fluid {
max-width: 1200px;
display: flex;
align-items: center;
justify-content: center;
max-width: 100%;
}

</style>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<VNavigationDrawer
permanent
floating
class="import-search-filters px-2"
class="import-search-filters"
>
<!-- Channel -->
<p class="font-weight-bold grey--text mb-1">
Expand Down
Loading
Loading