-
-
Notifications
You must be signed in to change notification settings - Fork 301
Community channels page #5770
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
Merged
marcellamaki
merged 8 commits into
learningequality:unstable
from
AlexVelezLl:community_channels_page
Mar 30, 2026
Merged
Community channels page #5770
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
86cf30f
Add community library page on channelslist
AlexVelezLl 5c162b9
About community library
AlexVelezLl bb5d337
Add Community Channel Details page
AlexVelezLl b22272c
Adapt StudioChannelCard and StudioDetailsPanel
AlexVelezLl 2720b83
Address PR comments
AlexVelezLl 9a3f537
Add communityLibrary CTA
AlexVelezLl ebc4482
Fix countries missing on some languages
AlexVelezLl 21cff99
Bumps kds version
AlexVelezLl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...on/frontend/channelList/views/Channel/CommunityLibraryList/AboutCommunityLibraryModal.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <template> | ||
|
|
||
| <KModal | ||
| :title="aboutCommunityLibraryTitle$()" | ||
| :cancelText="gotItLabel$()" | ||
| @cancel="$emit('close')" | ||
| > | ||
| <p>{{ aboutCommunityLibraryDescription$() }}</p> | ||
| <strong>{{ whatCanYouDoHere$() }}</strong> | ||
| <ul> | ||
| <li>{{ whatCanYouDoHereItem1$() }}</li> | ||
| <li>{{ whatCanYouDoHereItem2$() }}</li> | ||
| <li>{{ whatCanYouDoHereItem3$() }}</li> | ||
| </ul> | ||
| <p | ||
| :style="{ | ||
| color: $themeTokens.error, | ||
| marginTop: '16px', | ||
| }" | ||
| > | ||
| {{ needKolibriVersionToImport$() }} | ||
| </p> | ||
| </KModal> | ||
|
|
||
| </template> | ||
|
|
||
|
|
||
| <script setup> | ||
|
|
||
| import { communityChannelsStrings } from 'shared/strings/communityChannelsStrings'; | ||
|
|
||
| const { | ||
| aboutCommunityLibraryTitle$, | ||
| aboutCommunityLibraryDescription$, | ||
| whatCanYouDoHere$, | ||
| whatCanYouDoHereItem1$, | ||
| whatCanYouDoHereItem2$, | ||
| whatCanYouDoHereItem3$, | ||
| gotItLabel$, | ||
| needKolibriVersionToImport$, | ||
| } = communityChannelsStrings; | ||
|
|
||
| </script> | ||
| > | ||
173 changes: 173 additions & 0 deletions
173
.../frontend/channelList/views/Channel/CommunityLibraryList/CommunityChannelDetailsModal.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,173 @@ | ||
| <template> | ||
|
|
||
| <StudioImmersiveModal v-model="isModalOpen"> | ||
| <template #header> | ||
| <span class="notranslate">{{ channel ? channel.name : '' }}</span> | ||
| </template> | ||
| <StudioLargeLoader | ||
| v-if="show('channelDetails', isLoading, 500)" | ||
| :style="{ marginTop: '160px' }" | ||
| /> | ||
| <div | ||
| v-else-if="channel" | ||
| :style="{ | ||
| marginTop: '16px', | ||
| }" | ||
| > | ||
| <StudioDetailsPanel | ||
| v-if="channel" | ||
| class="channel-details-wrapper" | ||
| :details="channel" | ||
| :loading="isLoading" | ||
| :tokenDefinition="needKolibriVersionToImport$()" | ||
| /> | ||
| </div> | ||
| </StudioImmersiveModal> | ||
|
|
||
| </template> | ||
|
|
||
|
|
||
| <script> | ||
|
|
||
| import Vue, { computed, onMounted, watch } from 'vue'; | ||
| import useKShow from 'kolibri-design-system/lib/composables/useKShow'; | ||
| import { useRouter } from 'vue-router/composables'; | ||
| import StudioDetailsPanel from 'shared/views/details/StudioDetailsPanel.vue'; | ||
| import StudioLargeLoader from 'shared/views/StudioLargeLoader'; | ||
| import StudioImmersiveModal from 'shared/views/StudioImmersiveModal'; | ||
| import useStore from 'shared/composables/useStore'; | ||
| import { getChannel } from 'shared/data/public'; | ||
| import { useFetch } from 'shared/composables/useFetch'; | ||
| import { ChannelVersion } from 'shared/data/resources'; | ||
| import LanguagesMap from 'shared/leUtils/Languages'; | ||
| import LicensesMap from 'shared/leUtils/Licenses'; | ||
| import { communityChannelsStrings } from 'shared/strings/communityChannelsStrings'; | ||
|
|
||
| function mapResponseChannel(channel) { | ||
| const language = channel.lang_code || channel.included_languages?.[0] || null; | ||
| return { | ||
| ...channel, | ||
| published: true, | ||
| count: channel.total_resource_count || 0, | ||
| resource_count: channel.total_resource_count || 0, | ||
| language, | ||
| thumbnail_url: channel.thumbnail, | ||
| modified: channel.last_updated, | ||
| resource_size: channel.published_size || 0, | ||
| last_published: channel.last_published || channel.last_updated, | ||
| primary_token: channel.token, | ||
| languages: | ||
| channel.included_languages?.map( | ||
| langCode => LanguagesMap.get(langCode)?.native_name || langCode, | ||
| ) || [], | ||
| licenses: | ||
| channel.included_licenses | ||
| ?.map(licenseId => LicensesMap.get(licenseId)?.license_name) | ||
| .filter(Boolean) || [], | ||
|
|
||
| // We don't have this data available for public channels, | ||
| // so we null it out to avoid confusion | ||
| levels: null, | ||
| includes: null, | ||
| accessible_languages: null, | ||
| sample_nodes: null, | ||
| tags: null, | ||
| authors: null, | ||
| copyright_holders: null, | ||
| aggregators: null, | ||
| providers: null, | ||
| }; | ||
| } | ||
| export default { | ||
| name: 'ChannelDetailsModal', | ||
| components: { | ||
| StudioDetailsPanel, | ||
| StudioLargeLoader, | ||
| StudioImmersiveModal, | ||
| }, | ||
| setup(props) { | ||
| const router = useRouter(); | ||
| const store = useStore(); | ||
| const isModalOpen = computed({ | ||
| get: () => true, | ||
| set: value => { | ||
| if (!value) { | ||
| // When the modal is closed, navigate back to the previous page | ||
| router.back(); | ||
| } | ||
| }, | ||
| }); | ||
| const { show } = useKShow(); | ||
|
|
||
| const loadChannelDetails = async () => { | ||
| try { | ||
| const channelResponse = await getChannel(props.channelId, { public: false }); | ||
| const [channelVersion] = await ChannelVersion.fetchCollection({ | ||
| channel: channelResponse.id, | ||
| version: channelResponse.version, | ||
| }); | ||
| return mapResponseChannel({ | ||
| ...channelResponse, | ||
| ...channelVersion, | ||
| }); | ||
| } catch (error) { | ||
| store.dispatch('errors/handleAxiosError', error); | ||
| return null; | ||
| } | ||
| }; | ||
|
|
||
| const { | ||
| isLoading, | ||
| data: channel, | ||
| fetchData: fetchChannelDetails, | ||
| } = useFetch({ | ||
| asyncFetchFunc: loadChannelDetails, | ||
| }); | ||
|
|
||
| watch( | ||
| () => props.channelId, | ||
| channelId => { | ||
| if (channelId) { | ||
| fetchChannelDetails(); | ||
| } | ||
| }, | ||
| { immediate: true }, | ||
| ); | ||
|
|
||
| onMounted(() => { | ||
| Vue.$analytics.trackAction('community_channel_details', 'View', { | ||
| id: props.channelId, | ||
| }); | ||
| }); | ||
|
|
||
| const { needKolibriVersionToImport$ } = communityChannelsStrings; | ||
|
|
||
| return { | ||
| show, | ||
| isLoading, | ||
| channel, | ||
| isModalOpen, | ||
|
|
||
| needKolibriVersionToImport$, | ||
| }; | ||
| }, | ||
| props: { | ||
| channelId: { | ||
| type: String, | ||
| default: null, | ||
| }, | ||
| }, | ||
| }; | ||
|
|
||
| </script> | ||
|
|
||
|
|
||
| <style lang="scss" scoped> | ||
|
|
||
| .channel-details-wrapper { | ||
| max-width: 900px; | ||
| padding-bottom: 100px; | ||
| margin: 0 auto; | ||
| } | ||
|
|
||
| </style> |
92 changes: 92 additions & 0 deletions
92
...ation/frontend/channelList/views/Channel/CommunityLibraryList/CommunityLibraryFilters.vue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <template> | ||
|
|
||
| <div | ||
| class="filters-container" | ||
| :class="{ disabled }" | ||
| > | ||
| <KTextbox | ||
| v-model="keywordInput" | ||
| clearable | ||
| :label="searchLabel$()" | ||
| :appearanceOverrides="{ maxWidth: '100%' }" | ||
| @input="setKeywords" | ||
| /> | ||
|
|
||
| <KSelect | ||
| v-model="countriesFilter" | ||
| :label="countryLabel$()" | ||
| :options="countryOptions" | ||
| multiple | ||
| clearable | ||
| /> | ||
|
|
||
| <KSelect | ||
| v-model="languagesFilter" | ||
| :label="languagesLabel$()" | ||
| :options="languageOptions" | ||
| multiple | ||
| clearable | ||
| /> | ||
|
|
||
| <KSelect | ||
| v-model="categoriesFilter" | ||
| :label="categoriesLabel$()" | ||
| :options="categoryOptions" | ||
| multiple | ||
| clearable | ||
| /> | ||
| </div> | ||
|
|
||
| </template> | ||
|
|
||
|
|
||
| <script setup> | ||
|
|
||
| import { injectCommunityChannelsFilters } from './useCommunityChannelsFilters'; | ||
| import { communityChannelsStrings } from 'shared/strings/communityChannelsStrings'; | ||
|
|
||
| defineProps({ | ||
| disabled: { | ||
| type: Boolean, | ||
| default: false, | ||
| }, | ||
| }); | ||
|
|
||
| const { searchLabel$, countryLabel$, languagesLabel$, categoriesLabel$ } = | ||
| communityChannelsStrings; | ||
|
|
||
| const { | ||
| keywordInput, | ||
| setKeywords, | ||
| countriesFilter, | ||
| countryOptions, | ||
| languagesFilter, | ||
| languageOptions, | ||
| categoriesFilter, | ||
| categoryOptions, | ||
| } = injectCommunityChannelsFilters(); | ||
|
|
||
| </script> | ||
|
|
||
|
|
||
| <style lang="scss" scoped> | ||
|
|
||
| .filters-container { | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: 12px; | ||
| height: 100%; | ||
| min-height: 0; | ||
| overflow-y: auto; | ||
|
|
||
| &.disabled { | ||
| pointer-events: none; | ||
| opacity: 0.7; | ||
| } | ||
|
|
||
| ::v-deep .ui-textbox-feedback { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| </style> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: There's a stray
>character after the closing</script>tag. Vue SFC parsers will likely ignore it, but it should be removed to keep the file clean.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, good catch