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

Replace KResponseWindow with useKResponseWindow in Learn plugin #11366

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f7e2bea
MyDownloads page done
rtibbles Nov 1, 2023
280d135
ActivityFilter done
thesujai Oct 7, 2023
d01a016
SortFilter done
thesujai Oct 7, 2023
1522a2d
View Folder resources
rtibbles Nov 1, 2023
dfc75e0
BookmarkPage done
thesujai Oct 7, 2023
ac13460
ContentPage done
thesujai Oct 7, 2023
0954f0a
resolved conflict in LearningActivityBars
thesujai Oct 7, 2023
8f211cd
Library page done
thesujai Oct 7, 2023
6fc2fc3
search result grid done
thesujai Oct 7, 2023
1bcf3c1
Assesment wrapper done
thesujai Oct 7, 2023
833a397
LessonMasteryBar done
thesujai Oct 7, 2023
0262062
CardGrid view done
thesujai Oct 7, 2023
a44c548
LessonPlaylistPage done
thesujai Oct 7, 2023
c545a87
CompletionModalSection done
thesujai Oct 7, 2023
d21ca04
ExamPage done
thesujai Oct 7, 2023
36d2de7
bug fix
thesujai Oct 7, 2023
d251479
QuizRenderer
thesujai Oct 7, 2023
cc2a390
category search model done
thesujai Oct 7, 2023
3431b16
CardList view done
thesujai Oct 7, 2023
2856706
conflict resolved TopicsPage
thesujai Oct 7, 2023
70090d8
contenet grid done
thesujai Oct 7, 2023
4a060de
All conflict resolved
thesujai Oct 7, 2023
49ac0d2
for completion modal
rtibbles Nov 1, 2023
cd0d6ba
SidePanel modal
thesujai Oct 7, 2023
eb2af49
regression fixed
thesujai Oct 7, 2023
d7897ae
resolved
rtibbles Nov 1, 2023
d1d96cf
ActivityFilter done
thesujai Oct 7, 2023
82fb368
lLibrary page done
thesujai Oct 7, 2023
d86b19b
search result grid done
thesujai Oct 7, 2023
b7f9309
regression fixed
thesujai Oct 7, 2023
0e05f90
fixes while rebasing
thesujai Oct 9, 2023
880f23e
Fix tests.
rtibbles Nov 1, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,19 @@
import pickBy from 'lodash/pickBy';
import { LearningActivities } from 'kolibri.coreVue.vuex.constants';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import useLearningActivities from '../../../composables/useLearningActivities';

export default {
name: 'ActivityFilter',
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { getLearningActivityLabel, getLearningActivityIcon } = useLearningActivities();

const { windowIsLarge } = useKResponsiveWindow();
return {
getLearningActivityLabel,
getLearningActivityIcon,
windowIsLarge,
};
},
data() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,17 @@

import pickBy from 'lodash/pickBy';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';

export default {
name: 'SortFilter',
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsLarge } = useKResponsiveWindow();
return {
windowIsLarge,
};
},
data() {
return {
sortOptions: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import AppBarPage from 'kolibri.coreVue.components.AppBarPage';
import { computed, getCurrentInstance } from 'kolibri.lib.vueCompositionApi';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import plugin_data from 'plugin_data';
import useDownloadRequests from '../../composables/useDownloadRequests';
import useDevices from '../../composables/useDevices';
Expand All @@ -73,7 +72,7 @@
ActivityFilter,
SortFilter,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const {
downloadRequestMap,
Expand Down
5 changes: 3 additions & 2 deletions kolibri/plugins/learn/assets/src/views/AlsoInThis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
import isBoolean from 'lodash/isBoolean';
import TextTruncatorCss from 'kolibri.coreVue.components.TextTruncatorCss';
import TimeDuration from 'kolibri.coreVue.components.TimeDuration';
import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import MissingResourceAlert from 'kolibri-common/components/MissingResourceAlert';
import useContentNodeProgress from '../composables/useContentNodeProgress';
import useContentLink from '../composables/useContentLink';
Expand All @@ -113,17 +113,18 @@
TimeDuration,
MissingResourceAlert,
},
mixins: [KResponsiveWindowMixin],
setup() {
const { contentNodeProgressMap } = useContentNodeProgress();
const {
genContentLinkKeepCurrentBackLink,
genContentLinkKeepPreviousBackLink,
} = useContentLink();
const { windowIsSmall } = useKResponsiveWindow();
return {
contentNodeProgressMap,
genContentLinkKeepCurrentBackLink,
genContentLinkKeepPreviousBackLink,
windowIsSmall,
};
},
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,21 @@
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import BaseToolbar from 'kolibri.coreVue.components.BaseToolbar';
import TextTruncatorCss from 'kolibri.coreVue.components.TextTruncatorCss';
import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';

export default {
name: 'LessonMasteryBar',
components: {
BaseToolbar,
TextTruncatorCss,
},
mixins: [KResponsiveWindowMixin, commonCoreStrings],
mixins: [commonCoreStrings],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return {
windowBreakpoint,
};
},
props: {
// typically this would be "m" from "m of n" mastery model
requiredCorrectAnswers: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ oriented data synchronization.
import { MasteryModelGenerators } from 'kolibri.coreVue.vuex.constants';
import shuffled from 'kolibri.utils.shuffled';
import UiAlert from 'kolibri-design-system/lib/keen/UiAlert';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import BottomAppBar from 'kolibri.coreVue.components.BottomAppBar';
import CoreInfoIcon from 'kolibri.coreVue.components.CoreInfoIcon';
import { createTranslator, defaultLanguage } from 'kolibri.utils.i18n';
Expand Down Expand Up @@ -176,7 +176,13 @@ oriented data synchronization.
LessonMasteryBar,
CoreInfoIcon,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
props: {
lang: {
type: Object,
Expand Down
12 changes: 9 additions & 3 deletions kolibri/plugins/learn/assets/src/views/BookmarkPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

import { mapActions } from 'vuex';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import { ContentNodeResource } from 'kolibri.resources';
import client from 'kolibri.client';
import urls from 'kolibri.urls';
Expand Down Expand Up @@ -117,12 +117,18 @@
LearnAppBarPage,
HybridLearningFooter,
},
mixins: [commonCoreStrings, commonLearnStrings, responsiveWindowMixin],
mixins: [commonCoreStrings, commonLearnStrings],
setup() {
const { canDownloadExternally } = useCoreLearn();
const { fetchContentNodeProgress } = useContentNodeProgress();
const { genContentLinkBackLinkCurrentPage } = useContentLink();
return { canDownloadExternally, fetchContentNodeProgress, genContentLinkBackLinkCurrentPage };
const { windowIsSmall } = useKResponsiveWindow();
return {
canDownloadExternally,
fetchContentNodeProgress,
genContentLinkBackLinkCurrentPage,
windowIsSmall,
};
},
data() {
return {
Expand Down
6 changes: 4 additions & 2 deletions kolibri/plugins/learn/assets/src/views/CardList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
import { now } from 'kolibri.utils.serverClock';
import { ContentLevels, Categories } from 'kolibri.coreVue.vuex.constants';
import camelCase from 'lodash/camelCase';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import useChannels from '../composables/useChannels';
import LearningActivityLabel from './LearningActivityLabel';
import LearningActivityDuration from './LearningActivityDuration';
Expand All @@ -118,12 +118,14 @@
LearningActivityLabel,
LearningActivityDuration,
},
mixins: [responsiveWindowMixin, commonLearnStrings, commonCoreStrings],
mixins: [commonLearnStrings, commonCoreStrings],
setup() {
const { getChannelThumbnail, getChannelTitle } = useChannels();
const { windowIsLarge } = useKResponsiveWindow();
return {
getChannelThumbnail,
getChannelTitle,
windowIsLarge,
};
},
props: {
Expand Down
9 changes: 7 additions & 2 deletions kolibri/plugins/learn/assets/src/views/ChannelCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

import { mapGetters } from 'vuex';
import { validateLinkObject } from 'kolibri.utils.validators';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import CoachContentLabel from 'kolibri.coreVue.components.CoachContentLabel';
import TextTruncatorCss from 'kolibri.coreVue.components.TextTruncatorCss';
import ChannelThumbnail from './ChannelThumbnail';
Expand All @@ -94,7 +94,12 @@
CoachContentLabel,
TextTruncatorCss,
},
mixins: [responsiveWindowMixin],
setup() {
const { windowGutter } = useKResponsiveWindow();
return {
windowGutter,
};
},
props: {
title: {
type: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@

<script>

import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';

/**
* A responsive section of the completion modal.
Expand All @@ -94,7 +94,12 @@
*/
export default {
name: 'CompletionModalSection',
mixins: [KResponsiveWindowMixin],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return {
windowBreakpoint,
};
},
props: {
title: {
type: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@

<script>

import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import UiAlert from 'kolibri-design-system/lib/keen/UiAlert';
import { MaxPointsPerContent } from 'kolibri.coreVue.vuex.constants';
import FocusTrap from 'kolibri.coreVue.components.FocusTrap';
Expand Down Expand Up @@ -178,17 +178,21 @@
ResourceItem,
UiAlert,
},
mixins: [KResponsiveWindowMixin, commonLearnStrings, commonCoreStrings],
mixins: [commonLearnStrings, commonCoreStrings],
setup() {
const { canAccessUnassignedContent } = useDeviceSettings();
const { fetchLesson } = useLearnerResources();
const { genContentLinkKeepCurrentBackLink } = useContentLink();
const { baseurl } = currentDeviceData();
const { windowBreakpoint, windowHeight, windowWidth } = useKResponsiveWindow();
return {
baseurl,
canAccessUnassignedContent,
fetchLesson,
genContentLinkKeepCurrentBackLink,
windowBreakpoint,
windowHeight,
windowWidth,
};
},
props: {
Expand Down
7 changes: 4 additions & 3 deletions kolibri/plugins/learn/assets/src/views/ContentPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
import { mapState, mapGetters } from 'vuex';
import { ref } from 'kolibri.lib.vueCompositionApi';
import { ContentNodeResource } from 'kolibri.resources';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import router from 'kolibri.coreVue.router';
import Modalities from 'kolibri-constants/Modalities';
import { setContentNodeProgress } from '../composables/useContentNodeProgress';
Expand Down Expand Up @@ -135,7 +135,7 @@
QuizRenderer,
MarkAsCompleteModal,
},
mixins: [commonLearnStrings, responsiveWindowMixin],
mixins: [commonLearnStrings],
setup() {
const {
progress,
Expand All @@ -158,7 +158,7 @@
}
return Promise.resolve();
};

const { windowIsSmall } = useKResponsiveWindow();
return {
errored,
progress,
Expand All @@ -173,6 +173,7 @@
startTracking: startTrackingProgress,
stopTracking: stopTrackingProgress,
genContentLinkKeepCurrentBackLink,
windowIsSmall,
};
},
props: {
Expand Down
8 changes: 6 additions & 2 deletions kolibri/plugins/learn/assets/src/views/ExamPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
import BottomAppBar from 'kolibri.coreVue.components.BottomAppBar';
import UiAlert from 'kolibri-design-system/lib/keen/UiAlert';
import UiIconButton from 'kolibri.coreVue.components.UiIconButton';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import SuggestedTime from 'kolibri.coreVue.components.SuggestedTime';
import TimeDuration from 'kolibri.coreVue.components.TimeDuration';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
Expand Down Expand Up @@ -210,7 +210,7 @@
ImmersivePage,
ResourceSyncingUiAlert,
},
mixins: [responsiveWindowMixin, commonCoreStrings],
mixins: [commonCoreStrings],
setup() {
const {
pastattempts,
Expand All @@ -220,13 +220,17 @@
startTrackingProgress,
stopTrackingProgress,
} = useProgressTracking();
const { windowBreakpoint, windowIsLarge, windowIsSmall } = useKResponsiveWindow();
return {
pastattempts,
time_spent,
initContentSession,
updateContentSession,
startTrackingProgress,
stopTrackingProgress,
windowBreakpoint,
windowIsLarge,
windowIsSmall,
};
},
data() {
Expand Down
10 changes: 8 additions & 2 deletions kolibri/plugins/learn/assets/src/views/LearningActivityBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@

<script>

import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import CoachContentLabel from 'kolibri.coreVue.components.CoachContentLabel';
import CoreMenu from 'kolibri.coreVue.components.CoreMenu';
import { ContentNodeKinds } from 'kolibri.coreVue.vuex.constants';
Expand Down Expand Up @@ -208,7 +208,13 @@
return value;
},
},
mixins: [KResponsiveWindowMixin, commonLearnStrings, commonCoreStrings],
mixins: [commonLearnStrings, commonCoreStrings],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return {
windowBreakpoint,
};
},
/**
* Emits the following events:
* - `navigateBack` on back button click
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<script>

import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import useContentLink from '../composables/useContentLink';
import CardGrid from './cards/CardGrid';
import ResourceCard from './cards/ResourceCard';
Expand All @@ -50,14 +50,17 @@
ResourceCard,
},

mixins: [responsiveWindowMixin],

setup() {
const {
genContentLinkBackLinkCurrentPage,
genContentLinkKeepCurrentBackLink,
} = useContentLink();
return { genContentLinkBackLinkCurrentPage, genContentLinkKeepCurrentBackLink };
const { windowIsSmall } = useKResponsiveWindow();
return {
genContentLinkBackLinkCurrentPage,
genContentLinkKeepCurrentBackLink,
windowIsSmall,
};
},

props: {
Expand Down
Loading