-
Notifications
You must be signed in to change notification settings - Fork 278
[Remove Vuetify from Studio] Channel details in Channels - content #5540
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
MisRob
merged 43 commits into
learningequality:unstable
from
vtushar06:fix/channel-details-in-channel
Jan 27, 2026
+650
−267
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
b4b7827
Add StudioDetailsRow component for displaying studio details
vtushar06 13c795b
Add StudioDetailsPanel component for displaying detailed studio infor…
vtushar06 8cc6dc6
Replace DetailsPanel with StudioDetailsPanel in ChannelDetailsModal
vtushar06 bf39104
Add unit tests for StudioDetailsRow component
vtushar06 fcfa1db
Add tests for StudioDetailsPanel component
vtushar06 4d126f9
Refactor StudioChip and StudioDetailsRow styles; update ChannelDetail…
vtushar06 47896ea
Remove unnecessary comments from StudioChip component
vtushar06 5600ff2
Remove duplicate StudioChip files - using contributor's implementatio…
vtushar06 02dd1fa
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 96b7ac1
Enhance tests for StudioDetailsPanel and StudioDetailsRow components;…
vtushar06 ff8e9e0
Refactor StudioDetailsPanel and StudioDetailsRow components; improve …
vtushar06 2534418
Remove unnecessary comments from StudioDetailsPanel tests
vtushar06 2533dba
Refactor StudioDetailsPanel and StudioDetailsRow components; improve …
vtushar06 2443393
Merge branch 'unstable' into fix/channel-details-in-channel
vtushar06 b5b35d7
Update license chip reference to use dynamic keys for improved unique…
vtushar06 6c28b87
Add data-testid attribute to details panel for improved testing
vtushar06 11ec9b6
readdunit tests for StudioChip component functionality
vtushar06 f4ed7e4
updated StudioDetailsPanel to improve thumbnail handling and responsi…
vtushar06 507e085
Enhance StudioDetailsRow responsiveness with useKResponsiveWindow
vtushar06 558d629
Remove isChannel prop from StudioDetailsPanel tests
vtushar06 8970839
fixed linting issues in studiodetailspanel and studiodetailsrow
vtushar06 e4b2d60
updated import path for StudioCopyToken in StudioDetailsPanel
vtushar06 eb2100e
Add mock translation
vtushar06 6a297c0
resolved JS errors
vtushar06 b631ff5
updated mock in StudioDetailsPanel tests
vtushar06 5cf1564
Remove _uid
MisRob 687b3ea
[TODO REVERT] QA channel data
MisRob d7e3edd
Remove CSS grid in favor of KDS grids
MisRob cc7fe93
Simplify thumbnails
MisRob 20fcecf
Merge branch 'unstable' into fix/channel-details-in-channel
MisRob e92e700
Use StudioCopyToken
MisRob 3866c4c
Improve chip styling
MisRob 19c3049
Use KExternalLink
MisRob 9c9e5c8
Semantic heading
MisRob 4abc8e5
Remove obsolete class
MisRob e0712cc
Use StudioDetailsPanel for printing and in admin
MisRob 8752764
Add printing support to StudioThumbnail
MisRob f50079e
Revert "[TODO REVERT] QA channel data"
MisRob cc82c6f
Improve loader position
MisRob dc2fc89
Simplify tests
MisRob b7938bb
Revert comment removal
MisRob d2621fb
Revert print style selector
MisRob 21ec59b
Return test id
MisRob 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
22 changes: 22 additions & 0 deletions
22
contentcuration/contentcuration/frontend/shared/utils/icons.js
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,22 @@ | ||
| import { ContentKindsNames } from 'shared/leUtils/ContentKinds'; | ||
|
|
||
| const EMPTY = '_empty'; | ||
| const CONTENT_KIND_ICONS = { | ||
| [ContentKindsNames.TOPIC]: 'topic', | ||
| [ContentKindsNames.TOPIC + EMPTY]: 'emptyTopic', | ||
| [ContentKindsNames.VIDEO]: 'video', | ||
| [ContentKindsNames.AUDIO]: 'audio', | ||
| [ContentKindsNames.SLIDESHOW]: 'slideshow', | ||
| [ContentKindsNames.EXERCISE]: 'exercise', | ||
| [ContentKindsNames.DOCUMENT]: 'document', | ||
| [ContentKindsNames.HTML5]: 'html5', | ||
| [ContentKindsNames.ZIM]: 'html5', | ||
| }; | ||
|
|
||
| export function getContentKindIcon(kind, isEmpty = false) { | ||
| const icon = (isEmpty ? [kind + EMPTY] : []).concat([kind]).find(k => k in CONTENT_KIND_ICONS); | ||
| if (!icon) { | ||
| throw new Error(`Icon not found for content kind: ${kind}`); | ||
| } | ||
| return CONTENT_KIND_ICONS[icon]; | ||
| } |
118 changes: 118 additions & 0 deletions
118
contentcuration/contentcuration/frontend/shared/views/__tests__/StudioDetailsPanel.spec.js
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,118 @@ | ||
| import { render, screen } from '@testing-library/vue'; | ||
| import VueRouter from 'vue-router'; | ||
| import ContentLevels from 'kolibri-constants/labels/Levels'; | ||
| import Categories from 'kolibri-constants/labels/Subjects'; | ||
| import StudioDetailsPanel from '../details/StudioDetailsPanel.vue'; | ||
|
|
||
| const renderComponent = (props = {}) => { | ||
| return render(StudioDetailsPanel, { | ||
| props, | ||
| routes: new VueRouter(), | ||
| }); | ||
| }; | ||
|
|
||
| describe('StudioDetailsPanel', () => { | ||
| const fullChannel = { | ||
| name: 'Complete Channel', | ||
| description: 'A fully populated channel', | ||
| thumbnail_url: 'https://example.com/thumb.jpg', | ||
| published: true, | ||
| version: 2, | ||
| primary_token: 'abc12345', | ||
| language: 'en', | ||
| created: '2025-01-15T10:00:00Z', | ||
| last_published: '2025-01-20T15:30:00Z', | ||
| resource_count: 42, | ||
| resource_size: 1024000000, | ||
| kind_count: [], | ||
| levels: [ContentLevels.LOWER_PRIMARY, ContentLevels.UPPER_PRIMARY], | ||
| categories: [Categories.MATHEMATICS, Categories.SCIENCES], | ||
| includes: { coach_content: 1, exercises: 1 }, | ||
| tags: [{ tag_name: 'science' }, { tag_name: 'math' }], | ||
| languages: [], | ||
| accessible_languages: [], | ||
| authors: ['Author One', 'Author Two'], | ||
| providers: [], | ||
| aggregators: [], | ||
| licenses: [], | ||
| copyright_holders: [], | ||
| original_channels: [], | ||
| sample_nodes: [], | ||
| }; | ||
|
|
||
| const minimalChannel = { | ||
| name: 'Minimal Channel', | ||
| description: '', | ||
| thumbnail_url: null, | ||
| published: false, | ||
| version: null, | ||
| primary_token: null, | ||
| language: null, | ||
| created: null, | ||
| last_published: null, | ||
| resource_count: 0, | ||
| resource_size: 0, | ||
| kind_count: [], | ||
| levels: [], | ||
| categories: [], | ||
| includes: { coach_content: 0, exercises: 0 }, | ||
| tags: [], | ||
| languages: [], | ||
| accessible_languages: [], | ||
| authors: [], | ||
| providers: [], | ||
| aggregators: [], | ||
| licenses: [], | ||
| copyright_holders: [], | ||
| original_channels: [], | ||
| sample_nodes: [], | ||
| }; | ||
|
|
||
| it('renders channel header with name and description', () => { | ||
| renderComponent({ details: fullChannel, loading: false }); | ||
|
|
||
| expect(screen.getByText('Complete Channel')).toBeInTheDocument(); | ||
| expect(screen.getByText('A fully populated channel')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| describe('published channel with full data', () => { | ||
| beforeEach(() => { | ||
| renderComponent({ details: fullChannel, loading: false }); | ||
| }); | ||
|
|
||
| it('displays published status and version', () => { | ||
| expect(screen.getByText('Published on')).toBeInTheDocument(); | ||
| expect(screen.getByText('Published version')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('displays translated levels and categories', () => { | ||
| expect(screen.getByText('Lower primary')).toBeInTheDocument(); | ||
| expect(screen.getByText('Upper primary')).toBeInTheDocument(); | ||
| expect(screen.getByText('Mathematics')).toBeInTheDocument(); | ||
| expect(screen.getByText('Sciences')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('displays resource count and metadata', () => { | ||
| expect(screen.getByText('42')).toBeInTheDocument(); | ||
| expect(screen.getByText('Author One')).toBeInTheDocument(); | ||
| expect(screen.getByText('Author Two')).toBeInTheDocument(); | ||
| expect(screen.getByText('science')).toBeInTheDocument(); | ||
| expect(screen.getByText('math')).toBeInTheDocument(); | ||
| }); | ||
| }); | ||
|
|
||
| describe('unpublished channel with missing data', () => { | ||
| beforeEach(() => { | ||
| renderComponent({ details: minimalChannel, loading: false }); | ||
| }); | ||
|
|
||
| it('displays unpublished status', () => { | ||
| expect(screen.getByText('Unpublished')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('shows placeholder text for empty fields', () => { | ||
| const placeholders = screen.getAllByText('---'); | ||
| expect(placeholders.length).toBeGreaterThan(0); | ||
| }); | ||
| }); | ||
| }); |
40 changes: 40 additions & 0 deletions
40
contentcuration/contentcuration/frontend/shared/views/__tests__/StudioDetailsRow.spec.js
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,40 @@ | ||
| import { render, screen } from '@testing-library/vue'; | ||
| import VueRouter from 'vue-router'; | ||
| import StudioDetailsRow from '../details/StudioDetailsRow.vue'; | ||
|
|
||
| const renderComponent = (props = {}, slots = {}) => { | ||
| return render(StudioDetailsRow, { | ||
| props, | ||
| slots, | ||
| routes: new VueRouter(), | ||
| }); | ||
| }; | ||
|
|
||
| describe('StudioDetailsRow', () => { | ||
| it('renders label and text value', () => { | ||
| renderComponent({ | ||
| label: 'Channel size', | ||
| text: '1.5 GB', | ||
| }); | ||
|
|
||
| expect(screen.getByText('Channel size')).toBeInTheDocument(); | ||
| expect(screen.getByText('1.5 GB')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('renders slot content', () => { | ||
| renderComponent({ label: 'Authors' }, { default: '<div>Author One, Author Two</div>' }); | ||
|
|
||
| expect(screen.getByText('Authors')).toBeInTheDocument(); | ||
| expect(screen.getByText('Author One, Author Two')).toBeInTheDocument(); | ||
| }); | ||
|
|
||
| it('displays tooltip when definition is provided', () => { | ||
| renderComponent({ | ||
| label: 'Resources for coaches', | ||
| text: '5', | ||
| definition: 'Resources only visible to coaches', | ||
| }); | ||
|
|
||
| expect(screen.getByLabelText('Resources only visible to coaches')).toBeInTheDocument(); | ||
| }); | ||
| }); |
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
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.
Uh oh!
There was an error while loading. Please reload this page.