From aa59dc1821444f596d124e83002341ff69c42060 Mon Sep 17 00:00:00 2001 From: Andrea Misuraca <38749880+andreamisuraca@users.noreply.github.com> Date: Mon, 9 Oct 2023 19:32:31 +0200 Subject: [PATCH] Replace KResponsiveWindow mixin by useKResponsiveWindow composable in Facility plugin (#11346) * AnMi: Replaced KResponsiveWindow mixin by useKResponsiveWindow composable in Facility plugin * AnMi: Added setup method to the components * AnMi: Fixed unit test by adding missing mock * AnMi: Replaced wrong composable --- .../plugins/facility/assets/src/views/ClassEnrollForm.vue | 3 +-- .../plugins/facility/assets/src/views/DataPage/index.vue | 8 ++++++-- .../assets/src/views/FacilityConfigPage/index.vue | 8 ++++++-- .../facility/assets/src/views/IdentifierTextbox.vue | 8 ++++++-- .../assets/test/views/facility-config-page.spec.js | 8 ++++++++ 5 files changed, 27 insertions(+), 8 deletions(-) diff --git a/kolibri/plugins/facility/assets/src/views/ClassEnrollForm.vue b/kolibri/plugins/facility/assets/src/views/ClassEnrollForm.vue index ccf93336ad..2f7da371ef 100644 --- a/kolibri/plugins/facility/assets/src/views/ClassEnrollForm.vue +++ b/kolibri/plugins/facility/assets/src/views/ClassEnrollForm.vue @@ -39,7 +39,6 @@ import { mapState } from 'vuex'; import pickBy from 'lodash/pickBy'; import debounce from 'lodash/debounce'; - import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin'; import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings'; import FilterTextbox from 'kolibri.coreVue.components.FilterTextbox'; import UserTable from 'kolibri.coreVue.components.UserTable'; @@ -54,7 +53,7 @@ UserTable, FilterTextbox, }, - mixins: [commonCoreStrings, responsiveWindowMixin], + mixins: [commonCoreStrings], props: { pageType: { type: String, diff --git a/kolibri/plugins/facility/assets/src/views/DataPage/index.vue b/kolibri/plugins/facility/assets/src/views/DataPage/index.vue index 751c0b1b30..66f1924cd2 100644 --- a/kolibri/plugins/facility/assets/src/views/DataPage/index.vue +++ b/kolibri/plugins/facility/assets/src/views/DataPage/index.vue @@ -188,7 +188,7 @@ import urls from 'kolibri.urls'; import { FacilityResource } from 'kolibri.resources'; import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings'; - import KResponsiveWindowMixin from 'kolibri-design-system/lib/KResponsiveWindowMixin'; + import useKResponsiveWindow from 'kolibri-design-system/lib/useKResponsiveWindow'; import validationConstants from 'kolibri-design-system/lib/KDateRange/validationConstants'; import { currentLanguage } from 'kolibri.utils.i18n'; import { now } from 'kolibri.utils.serverClock'; @@ -218,7 +218,11 @@ LearnMoreModal, KDateRange, }, - mixins: [commonCoreStrings, KResponsiveWindowMixin], + mixins: [commonCoreStrings], + setup() { + const { windowIsMedium, windowIsSmall } = useKResponsiveWindow(); + return { windowIsMedium, windowIsSmall }; + }, data() { return { showLearnMoreSummaryModal: false, diff --git a/kolibri/plugins/facility/assets/src/views/FacilityConfigPage/index.vue b/kolibri/plugins/facility/assets/src/views/FacilityConfigPage/index.vue index 1f130e81e0..ea2501a95e 100644 --- a/kolibri/plugins/facility/assets/src/views/FacilityConfigPage/index.vue +++ b/kolibri/plugins/facility/assets/src/views/FacilityConfigPage/index.vue @@ -213,7 +213,7 @@