From be6bc88f804a2aa675aa1df733d8db1f625cfa0a Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 24 Jun 2025 12:38:05 +0530 Subject: [PATCH 1/2] fix: Translation issue in reports table headers on reload (#11793) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Pull Request Template ## Description This PR fixes the translation inconsistency in the reports pages, where table-column headers reverted to English after a page reload. **Cause** The components defined the columns array statically, so header labels were translated only once during component creation. On reload, the table showed the default system language (English) until the user’s locale finished loading. **Solution** Replaced the static columns array with a computed property and passed it to `Tanstack useVueTable` via a getter. This makes the headers reactive, ensuring they automatically update whenever the locale changes and remain translated after every reload. Fixes https://linear.app/chatwoot/issue/CW-4539/translation-issue-in-reports-page-table-header-on-reload ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] 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 - [ ] 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 --- app/javascript/dashboard/components/table/Table.vue | 2 +- .../settings/reports/components/SummaryReports.vue | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/app/javascript/dashboard/components/table/Table.vue b/app/javascript/dashboard/components/table/Table.vue index 81edc4840..3e274f683 100644 --- a/app/javascript/dashboard/components/table/Table.vue +++ b/app/javascript/dashboard/components/table/Table.vue @@ -21,7 +21,7 @@ const props = defineProps({ const isRelaxed = computed(() => props.type === 'relaxed'); const headerClass = computed(() => isRelaxed.value - ? 'first:rounded-bl-lg first:rounded-tl-lg last:rounded-br-lg last:rounded-tr-lg' + ? 'ltr:first:rounded-bl-lg ltr:first:rounded-tl-lg ltr:last:rounded-br-lg ltr:last:rounded-tr-lg rtl:first:rounded-br-lg rtl:first:rounded-tr-lg rtl:last:rounded-bl-lg rtl:last:rounded-tl-lg' : '' ); diff --git a/app/javascript/dashboard/routes/dashboard/settings/reports/components/SummaryReports.vue b/app/javascript/dashboard/routes/dashboard/settings/reports/components/SummaryReports.vue index 7e0b9be8f..9b966c8fe 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/reports/components/SummaryReports.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/reports/components/SummaryReports.vue @@ -59,7 +59,7 @@ const defaulSpanRender = cellProps => cellProps.getValue() ); -const columns = [ +const columns = computed(() => [ columnHelper.accessor('name', { header: t(`SUMMARY_REPORTS.${props.type.toUpperCase()}`), width: 300, @@ -90,7 +90,7 @@ const columns = [ width: 200, cell: defaulSpanRender, }), -]; +]); const renderAvgTime = value => (value ? formatTime(value) : '--'); @@ -142,7 +142,9 @@ const table = useVueTable({ get data() { return tableData.value; }, - columns, + get columns() { + return columns.value; + }, enableSorting: false, getCoreRowModel: getCoreRowModel(), }); From 9edfb1e902b0e463d130f726f92c399d66687318 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Tue, 24 Jun 2025 13:31:39 +0530 Subject: [PATCH 2/2] fix: Disable push notifications (#11786) # Pull Request Template ## Description Fixes [CW-4512](https://linear.app/chatwoot/issue/CW-4512/cant-turn-off-push-notification-toggle) https://github.com/chatwoot/chatwoot/issues/11760 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) ## Checklist: - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my code - [ ] 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 - [ ] 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 --- .../profile/NotificationPreferences.vue | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue index 215b46923..6ab2b34d4 100644 --- a/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue +++ b/app/javascript/dashboard/routes/dashboard/settings/profile/NotificationPreferences.vue @@ -75,10 +75,34 @@ export default { onRegistrationSuccess() { this.hasEnabledPushPermissions = true; }, - onRequestPermissions() { - requestPushPermissions({ - onSuccess: this.onRegistrationSuccess, - }); + onRequestPermissions(value) { + if (value) { + // Enable / re-enable push notifications + requestPushPermissions({ + onSuccess: this.onRegistrationSuccess, + }); + } else { + // Disable push notifications + this.disablePushPermissions(); + } + }, + disablePushPermissions() { + verifyServiceWorkerExistence(registration => + registration.pushManager + .getSubscription() + .then(subscription => { + if (subscription) { + return subscription.unsubscribe(); + } + return null; + }) + .finally(() => { + this.hasEnabledPushPermissions = false; + }) + .catch(() => { + // error + }) + ); }, getPushSubscription() { verifyServiceWorkerExistence(registration =>