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

The hybrid learning home page #8504

Merged
merged 27 commits into from
Oct 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1ef9f6c
Add tests for recent lessons and quizzes sections
MisRob Sep 16, 2021
340fedf
Colorful progress icons
MisRob Sep 16, 2021
f26416d
Show resources progress
MisRob Sep 17, 2021
8f0a1c4
Truncate cards titles
MisRob Oct 1, 2021
d1e89c6
Use useLearnerResources composable
MisRob Sep 30, 2021
85dfe6c
Fix loader on the home page and use API error handler
MisRob Oct 3, 2021
d8fbbb4
Add docstrings for card grid
MisRob Oct 7, 2021
8cd9545
Add Explore channels section to the home page
MisRob Oct 4, 2021
8d856e7
More precise tests for routing
MisRob Oct 14, 2021
a26c045
Redirect all types of learners to home
MisRob Oct 14, 2021
c78cd4d
Show resources not available on the home page
MisRob Oct 14, 2021
5850b8b
Do not fetch progress when there are no content nodes
MisRob Oct 14, 2021
1769002
Navigate back to the home page when channel visited from the home page
MisRob Oct 14, 2021
7a50ef2
Add auto text directionality for user content
MisRob Oct 18, 2021
bf853c1
Pass attributes to the inner div
MisRob Oct 18, 2021
91f439a
Fix automatic text directionality in KFixedGridItem
MisRob Oct 18, 2021
566c971
Make sure that home page is up-to-date
MisRob Oct 19, 2021
ee1f394
Fix bugs caused by not accepting 0 as a valid resource index
MisRob Oct 19, 2021
afc3e36
Fix criteria for displaying sections with non-classes content
MisRob Oct 19, 2021
b16ae62
Fix comments
MisRob Oct 25, 2021
83f51cf
Add a grid type validator
MisRob Oct 25, 2021
d16411b
Use text annotation token for collection name color
MisRob Oct 25, 2021
ad3f981
Fix missing quotes in style value
MisRob Oct 25, 2021
c771420
Fix bad property name
MisRob Oct 25, 2021
996f67d
Fix ellipsis character not being covered fully by white rectangle
MisRob Oct 26, 2021
da5e269
Fix channel thumbnails images overflowing container in IE
MisRob Oct 26, 2021
f07d662
Keep proper image ratio
MisRob Oct 26, 2021
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
4 changes: 2 additions & 2 deletions kolibri/core/assets/src/api-resources/contentNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ export default new Resource({
fetchRecommendationsFor(id, getParams) {
return this.fetchDetailCollection('recommendations_for', id, getParams);
},
fetchResume(getParams) {
return this.fetchDetailCollection('resume', Store.getters.currentUserId, getParams);
fetchResume(getParams, force) {
return this.fetchDetailCollection('resume', Store.getters.currentUserId, getParams, force);
},
fetchPopular(getParams) {
return this.fetchListCollection('popular', getParams);
Expand Down
12 changes: 10 additions & 2 deletions kolibri/core/assets/src/views/TextTruncatorCss.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@
of what truncating technique is used. Otherwise adding padding directly
would break when using technique (B) since text that should be truncated
would show in padding area.

Attributes are inherited by the inner `div` to emulate the same behavior
like if only one element would wrap the text to allow attributes be applied
as close as possible to the text element.
-->
<div>
<div :class="$computedClass(truncate)">
<div
v-bind="$attrs"
:class="$computedClass(truncate)"
>
{{ text }}
</div>
</div>
Expand All @@ -28,6 +35,7 @@
*/
export default {
name: 'TextTruncatorCss',
inheritAttrs: false,
props: {
text: {
type: String,
Expand Down Expand Up @@ -114,7 +122,7 @@
position: 'absolute',
right: 0,
width: ellipsisWidth,
height: '50%',
height: '100%',
background: 'white',
},
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* `useChannels` composable function mock.
*
* If default values are sufficient for tests,
* you only need call `jest.mock('<useChannels file path>')`
* at the top of a test file.
*
* If you need to override some default values from some tests,
* you can import a helper function `useChannelsMock` that accepts
* an object with values to be overriden and use it together
* with `mockImplementation` as follows:
*
* ```
* // eslint-disable-next-line import/named
* import useChannels, { useChannelsMock } from '<useChannels file path>';
*
* jest.mock('<useChannels file path>')
*
* it('test', () => {
* useChannels.mockImplementation(
* () => useChannelsMock({ channels: [{ id: 'channel-1' }] })
* );
* })
* ```
*
* You can reset your mock implementation back to default values
* for other tests by calling the following in `beforeEach`:
*
* ```
* useChannels.mockImplementation(() => useChannelsMock())
* ```
*/

const MOCK_DEFAULTS = {
channels: [],
fetchChannels: jest.fn(),
};

export function useChannelsMock(overrides = {}) {
return {
...MOCK_DEFAULTS,
...overrides,
};
}

export default jest.fn(() => useChannelsMock());
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,22 @@

const MOCK_DEFAULTS = {
classes: [],
activeClassesLessons: [],
activeClassesQuizzes: [],
resumableClassesQuizzes: [],
resumableClassesResources: [],
resumableNonClassesContentNodes: [],
learnerFinishedAllClasses: false,
getClass: jest.fn(),
getClassActiveLessons: jest.fn(),
getClassActiveQuizzes: jest.fn(),
getResumableContentNode: jest.fn(),
getResumableContentNodeProgress: jest.fn(),
getClassLessonLink: jest.fn(),
getClassQuizLink: jest.fn(),
getClassResourceLink: jest.fn(),
getTopicContentNodeLink: jest.fn(),
fetchClass: jest.fn(),
fetchClasses: jest.fn(),
fetchResumableContentNodes: jest.fn(),
};
Expand Down
Loading