Skip to content

Commit

Permalink
AnMi: Added setup method to the components
Browse files Browse the repository at this point in the history
  • Loading branch information
andreamisuraca committed Oct 4, 2023
1 parent bbecf85 commit 046e8dc
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -54,7 +53,7 @@
UserTable,
FilterTextbox,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
props: {
pageType: {
type: String,
Expand Down
7 changes: 5 additions & 2 deletions kolibri/plugins/facility/assets/src/views/DataPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@
KDateRange,
},
mixins: [commonCoreStrings],
setup() {
const { windowIsLarge, windowIsSmall } = useKResponsiveWindow();
return { windowIsLarge, windowIsSmall };
},
data() {
return {
showLearnMoreSummaryModal: false,
Expand Down Expand Up @@ -249,8 +253,7 @@
return this.$route.name === PageNames.DATA_EXPORT_PAGE;
},
windowSizeStyle() {
const { windowIsMedium, windowIsSmall } = useKResponsiveWindow();
if (windowIsMedium || windowIsSmall) {
if (this.windowIsMedium || this.windowIsSmall) {
return 'section-buttons-flex';
}
return {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
<script>
import { mapActions, mapGetters, mapState } from 'vuex';
import responsiveWindowMixin from 'kolibri.coreVue.mixins.responsiveWindowMixin';
import useKResponsiveWindow from 'kolibri.coreVue.composables.useKResponsiveWindow';
import { createTranslator } from 'kolibri.utils.i18n';
import camelCase from 'lodash/camelCase';
Expand Down Expand Up @@ -273,7 +273,11 @@
ChangePinModal,
RemovePinModal,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return { windowIsSmall };
},
data() {
return {
showModal: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,18 @@
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.coreVue.composables.useKResponsiveWindow';
export default {
name: 'IdentifierTextbox',
components: {
CoreInfoIcon,
},
mixins: [commonCoreStrings, responsiveWindowMixin],
mixins: [commonCoreStrings],
setup() {
const { windowIsSmall } = useKResponsiveWindow();
return { windowIsSmall };
},
props: {
value: {
type: String,
Expand Down

0 comments on commit 046e8dc

Please sign in to comment.