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

Replaced KResponsiveWindow mixin by useKResponsiveWindow composable - Core #11335 #11427

Merged
merged 3 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,4 @@ If you have contributed to Kolibri, feel free to add your name and Github accoun
| Vikramaditya Singh | Ghat0tkach |
| Kris Katkus | katkuskris |
| Garvit Singhal | GarvitSinghal47 |
| Adars T S | a6ar55 |
3 changes: 1 addition & 2 deletions kolibri/core/assets/src/views/AttemptLogList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@
<script>

import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import AttemptLogItem from './AttemptLogItem';

export default {
name: 'AttemptLogList',
components: {
AttemptLogItem,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
props: {
attemptLogs: {
type: Array,
Expand Down
9 changes: 7 additions & 2 deletions kolibri/core/assets/src/views/BottomAppBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@

<script>

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

export default {
name: 'BottomAppBar',
mixins: [responsiveWindowMixin],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
};

</script>
Expand Down
10 changes: 8 additions & 2 deletions kolibri/core/assets/src/views/ExamReport/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
import find from 'lodash/find';
import MultiPaneLayout from 'kolibri.coreVue.components.MultiPaneLayout';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import { MasteryLogResource } from 'kolibri.resources';
import { now } from 'kolibri.utils.serverClock';
import MissingResourceAlert from 'kolibri-common/components/MissingResourceAlert';
Expand All @@ -184,7 +184,13 @@
CurrentTryOverview,
MissingResourceAlert,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
props: {
// Unique identifier of the item for the report
// this will be used to filter for previous tries
Expand Down
10 changes: 8 additions & 2 deletions kolibri/core/assets/src/views/MultiPaneLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@

<script>

import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import responsiveElementMixin from 'kolibri.coreVue.mixins.responsiveElementMixin';

export default {
name: 'MultiPaneLayout',
mixins: [responsiveWindowMixin, responsiveElementMixin],
mixins: [responsiveElementMixin],
setup() {
const { windowHeight } = useKResponsiveWindow();
return {
windowHeight,
};
},
computed: {
styles() {
return {
Expand Down
7 changes: 5 additions & 2 deletions kolibri/core/assets/src/views/SideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
import { mapGetters, mapState } from 'vuex';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import { UserKinds, NavComponentSections } from 'kolibri.coreVue.vuex.constants';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import responsiveElementMixin from 'kolibri.coreVue.mixins.responsiveElementMixin';
import CoreMenu from 'kolibri.coreVue.components.CoreMenu';
import CoreMenuOption from 'kolibri.coreVue.components.CoreMenuOption';
Expand Down Expand Up @@ -288,11 +288,14 @@
LogoutSideNavEntry,
BottomNavigationBar,
},
mixins: [commonCoreStrings, responsiveWindowMixin, responsiveElementMixin, navComponentsMixin],
mixins: [commonCoreStrings, responsiveElementMixin, navComponentsMixin],
setup() {
const { windowIsSmall, windowIsLarge } = useKResponsiveWindow();
const { isLearnerOnlyImport } = useUser();
const { status, lastSynced } = useUserSyncStatus();
return {
windowIsLarge,
windowIsSmall,
isLearnerOnlyImport,
themeConfig,
userSyncStatus: status,
Expand Down
2 changes: 0 additions & 2 deletions kolibri/core/assets/src/views/TotalPoints.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
<script>

import { mapGetters, mapActions } from 'vuex';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import PointsIcon from 'kolibri.coreVue.components.PointsIcon';

export default {
name: 'TotalPoints',
components: {
PointsIcon,
},
mixins: [responsiveWindowMixin],
computed: {
...mapGetters(['totalPoints', 'currentUserId', 'isUserLoggedIn']),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<script>

import { availableLanguages, currentLanguage } from 'kolibri.utils.i18n';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import { compareLanguages } from 'kolibri.utils.sortLanguages';
import languageSwitcherMixin from './mixin';
import LanguageSwitcherModal from './LanguageSwitcherModal';
Expand All @@ -55,7 +55,13 @@
components: {
LanguageSwitcherModal,
},
mixins: [responsiveWindowMixin, languageSwitcherMixin],
mixins: [languageSwitcherMixin],
setup() {
const { windowBreakpoint } = useKResponsiveWindow();
return {
windowBreakpoint,
};
},
data() {
return {
showLanguageModal: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,21 @@
<script>

import { currentLanguage } from 'kolibri.utils.i18n';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import FocusTrap from 'kolibri.coreVue.components.FocusTrap';
import languageSwitcherMixin from './mixin';

export default {
name: 'LanguageSwitcherModal',
components: { FocusTrap },
mixins: [commonCoreStrings, languageSwitcherMixin, responsiveWindowMixin],
mixins: [commonCoreStrings, languageSwitcherMixin],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
data() {
return {
selectedLanguage: currentLanguage,
Expand Down
10 changes: 8 additions & 2 deletions kolibri/core/assets/src/views/sync/FacilityTaskPanelDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,20 @@

<script>

import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import commonTaskStrings from 'kolibri.coreVue.mixins.commonTaskStrings';
import { TaskStatuses, TaskTypes } from '../../utils/syncTaskUtils';

export default {
name: 'FacilityTaskPanelDetails',
mixins: [commonCoreStrings, responsiveWindowMixin, commonTaskStrings],
mixins: [commonCoreStrings, commonTaskStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
props: {
task: {
type: Object,
Expand Down
10 changes: 8 additions & 2 deletions kolibri/core/assets/src/views/userAccounts/BirthYearSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import { now } from 'kolibri.utils.serverClock';
import CoreInfoIcon from 'kolibri.coreVue.components.CoreInfoIcon';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import { DemographicConstants } from 'kolibri.coreVue.vuex.constants';

const { NOT_SPECIFIED } = DemographicConstants;
Expand All @@ -43,7 +43,13 @@
components: {
CoreInfoIcon,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
props: {
value: {
type: String,
Expand Down