From dd8abe975cd37b23c69ea0cd9b8140d60b7b9bf5 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:56:30 +0530 Subject: [PATCH] feat: Rewrite `configMixin` to a composable (#9921) # Pull Request Template ## Description This PR will replace the usage of `configMixin` with the `useConfig` composable. **Files updated** 1. dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue 2. dashboard/components/widgets/conversation/MessagesView.vue 3. dashboard/routes/dashboard/settings/inbox/Settings.vue **(Not used)** 4. dashboard/routes/dashboard/settings/inbox/FinishSetup.vue **(Not used)** 5. dashboard/routes/dashboard/settings/inbox/settingsPage/CollaboratorsPage.vue 6. dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue **(Not used)** 7. dashboard/routes/dashboard/settings/profile/AudioNotifications.vue **(Not used)** 8. dashboard/routes/dashboard/settings/sla/Index.vue **(Not used)** 9. dashboard/routes/dashboard/settings/account/Index.vue 10. survey/views/Response.vue **(Not used)** Fixes https://linear.app/chatwoot/issue/CW-3464/rewrite-configmixin-mixin-to-a-composable ## Type of change - [x] New feature (non-breaking change which adds functionality) ## How Has This Been Tested? Test in the component related pages ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [x] I have commented on my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged and published in downstream modules --- .../sidebarComponents/SecondaryNavItem.vue | 5 +- .../widgets/conversation/MessagesView.vue | 6 ++- .../composables/spec/useConfig.spec.js | 51 +++++++++++++++++++ .../dashboard/composables/useConfig.js | 46 +++++++++++++++++ .../dashboard/settings/account/Index.vue | 6 +-- .../dashboard/settings/inbox/FinishSetup.vue | 10 ++-- .../dashboard/settings/inbox/Settings.vue | 3 +- .../inbox/settingsPage/CollaboratorsPage.vue | 7 +-- .../settings/profile/AudioNotifications.vue | 2 - .../profile/NotificationPreferences.vue | 2 - .../routes/dashboard/settings/sla/Index.vue | 2 - app/javascript/shared/mixins/configMixin.js | 20 -------- app/javascript/survey/views/Response.vue | 3 -- 13 files changed, 116 insertions(+), 47 deletions(-) create mode 100644 app/javascript/dashboard/composables/spec/useConfig.spec.js create mode 100644 app/javascript/dashboard/composables/useConfig.js delete mode 100644 app/javascript/shared/mixins/configMixin.js diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue index 2132ffc9e..be013c069 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/SecondaryNavItem.vue @@ -1,7 +1,7 @@