From 452096f4b2b54ca7f05400643765405d0f57c41d Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Mon, 12 Aug 2024 15:50:21 +0530 Subject: [PATCH] feat: Replace `rtlMixin` to a composable (#9924) This PR will replace the usage of `rtlMixin` to the `useUISettings` composable, and moved the method to component itself. --- app/javascript/dashboard/App.vue | 10 ++---- .../widgets/conversation/ReplyBox.vue | 5 ++- .../contacts/components/ContactsTable.vue | 24 +++++++------ .../components/NotificationPanel.vue | 9 ++--- .../settings/reports/components/CsatTable.vue | 11 +++--- .../components/overview/AgentTable.vue | 12 ++++--- .../dashboard/store/modules/accounts.js | 8 +++++ .../modules/specs/account/getters.spec.js | 34 +++++++++++++++++++ app/javascript/shared/mixins/rtlMixin.js | 27 --------------- .../shared/mixins/specs/rtlMixin.spec.js | 29 ---------------- 10 files changed, 74 insertions(+), 95 deletions(-) delete mode 100644 app/javascript/shared/mixins/rtlMixin.js delete mode 100644 app/javascript/shared/mixins/specs/rtlMixin.spec.js diff --git a/app/javascript/dashboard/App.vue b/app/javascript/dashboard/App.vue index efb89f489..da169d61f 100644 --- a/app/javascript/dashboard/App.vue +++ b/app/javascript/dashboard/App.vue @@ -10,7 +10,6 @@ import PaymentPendingBanner from './components/app/PaymentPendingBanner.vue'; import PendingEmailVerificationBanner from './components/app/PendingEmailVerificationBanner.vue'; import vueActionCable from './helper/actionCable'; import WootSnackbarBox from './components/SnackbarContainer.vue'; -import rtlMixin from 'shared/mixins/rtlMixin'; import { setColorTheme } from './helper/themeHelper'; import { isOnOnboardingView } from 'v3/helpers/RouteHelper'; import { @@ -32,9 +31,6 @@ export default { UpgradeBanner, PendingEmailVerificationBanner, }, - - mixins: [rtlMixin], - data() { return { showAddAccountModal: false, @@ -46,6 +42,7 @@ export default { computed: { ...mapGetters({ getAccount: 'accounts/getAccount', + isRTL: 'accounts/isRTL', currentUser: 'getCurrentUser', authUIFlags: 'getAuthUIFlags', accountUIFlags: 'accounts/getUIFlags', @@ -102,7 +99,6 @@ export default { this.getAccount(this.currentAccountId); const { pubsub_token: pubsubToken } = this.currentUser || {}; this.setLocale(locale); - this.updateRTLDirectionView(locale); this.latestChatwootVersion = latestChatwootVersion; vueActionCable.init(pubsubToken); this.reconnectService = new ReconnectService(this.$store, router); @@ -124,8 +120,8 @@ export default { v-if="!authUIFlags.isFetching && !accountUIFlags.isFetchingItem" id="app" class="flex-grow-0 w-full h-full min-h-0 app-wrapper" - :class="{ 'app-rtl--wrapper': isRTLView }" - :dir="isRTLView ? 'rtl' : 'ltr'" + :class="{ 'app-rtl--wrapper': isRTL }" + :dir="isRTL ? 'rtl' : 'ltr'" >