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 Device plugin #11349

Merged
10 changes: 8 additions & 2 deletions kolibri/plugins/device/assets/src/views/DeviceInfoPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
import { mapGetters, mapState } from 'vuex';
import TechnicalTextBlock from 'kolibri-common/components/AppError/TechnicalTextBlock';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import DeviceAppBarPage from './DeviceAppBarPage';
import { deviceString } from './commonDeviceStrings';
import DeviceNameModal from './DeviceNameModal';
Expand All @@ -98,7 +98,13 @@
DeviceNameModal,
TechnicalTextBlock,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const windowIsSmall = useKResponsiveWindow();
return {
windowIsSmall,
};
},
data() {
return {
advancedShown: false,
Expand Down
10 changes: 8 additions & 2 deletions kolibri/plugins/device/assets/src/views/FacilitiesPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<script>

import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import commonSyncElements from 'kolibri.coreVue.mixins.commonSyncElements';
import CoreTable from 'kolibri.coreVue.components.CoreTable';
import { FacilityResource } from 'kolibri.resources';
Expand Down Expand Up @@ -230,7 +230,13 @@
SyncAllFacilitiesModal,
TasksBar,
},
mixins: [commonCoreStrings, commonSyncElements, facilityTaskQueue, responsiveWindowMixin],
mixins: [commonCoreStrings, commonSyncElements, facilityTaskQueue],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return {
windowIsSmall,
};
},
data() {
return {
showSyncAllModal: false,
Expand Down
9 changes: 7 additions & 2 deletions kolibri/plugins/device/assets/src/views/HeaderWithOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@

<script>

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

export default {
name: 'HeaderWithOptions',
mixins: [responsiveWindowMixin],
setup() {
const windowIsSmall = useKResponsiveWindow();
return {
windowIsSmall,
};
},
props: {
headerText: {
type: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
import differenceBy from 'lodash/differenceBy';
import unionBy from 'lodash/unionBy';
import uniqBy from 'lodash/uniqBy';
import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin';
import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow';
import FilterTextbox from 'kolibri.coreVue.components.FilterTextbox';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';

Expand All @@ -70,7 +70,13 @@
components: {
FilterTextbox,
},
mixins: [KResponsiveWindowMixin, commonCoreStrings],
mixins: [commonCoreStrings],
setup() {
const windowIsLarge = useKResponsiveWindow();
return {
windowIsLarge,
};
},
props: {
channels: {
type: Array,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>

<div class="task-panel" :class="{ 'task-panel-sm': windowIsSmall }">
<div class="task-panel" :class="{ 'task-panel-sm': windowWidth<600 }">
thesujai marked this conversation as resolved.
Show resolved Hide resolved
<div class="icon">
<transition mode="out-in">
<KIcon
Expand Down Expand Up @@ -89,7 +89,7 @@
// Displays a single Task and its metadata, and provides buttons
// to cancel or clear it.

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

Expand Down Expand Up @@ -130,7 +130,13 @@

export default {
name: 'TaskPanel',
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const {windowWidth} = useKResponsiveWindow();
return {
windowWidth,
};
},
props: {
task: {
type: Object,
Expand Down