From 590e17dfb7361817dde2791a040b9c926cae5853 Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Thu, 13 Aug 2026 11:49:44 +0530 Subject: [PATCH] chore: remove the legacy notifications page (#15426) --- .../sidebar/SidebarNotificationBell.vue | 40 ---- .../components/NetworkNotification.vue | 5 +- .../commands/useGoToCommandHotKeys.js | 8 - .../helper/AnalyticsHelper/events.js | 3 - .../dashboard/helper/ReconnectService.js | 3 - .../dashboard/helper/routeHelpers.js | 3 - .../helper/specs/ReconnectService.spec.js | 9 - .../i18n/locale/en/generalSettings.json | 32 --- .../routes/dashboard/dashboard.routes.js | 2 - .../components/NotificationTable.vue | 211 ------------------ .../components/NotificationsView.vue | 79 ------- .../routes/dashboard/notifications/routes.js | 21 -- .../store/modules/notifications/actions.js | 16 -- .../store/modules/notifications/getters.js | 3 - .../specs/notifications/actions.spec.js | 32 --- .../specs/notifications/getters.spec.js | 15 -- 16 files changed, 1 insertion(+), 481 deletions(-) delete mode 100644 app/javascript/dashboard/components-next/sidebar/SidebarNotificationBell.vue delete mode 100644 app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue delete mode 100644 app/javascript/dashboard/routes/dashboard/notifications/components/NotificationsView.vue delete mode 100644 app/javascript/dashboard/routes/dashboard/notifications/routes.js diff --git a/app/javascript/dashboard/components-next/sidebar/SidebarNotificationBell.vue b/app/javascript/dashboard/components-next/sidebar/SidebarNotificationBell.vue deleted file mode 100644 index 94f3dd6bd..000000000 --- a/app/javascript/dashboard/components-next/sidebar/SidebarNotificationBell.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - diff --git a/app/javascript/dashboard/components/NetworkNotification.vue b/app/javascript/dashboard/components/NetworkNotification.vue index eb7785bc6..2506789f4 100644 --- a/app/javascript/dashboard/components/NetworkNotification.vue +++ b/app/javascript/dashboard/components/NetworkNotification.vue @@ -7,7 +7,6 @@ import { BUS_EVENTS } from 'shared/constants/busEvents'; import { isAConversationRoute, isAInboxViewRoute, - isNotificationRoute, } from 'dashboard/helper/routeHelpers'; import { useEventListener } from '@vueuse/core'; @@ -47,9 +46,7 @@ const closeNotification = () => { const isInAnyOfTheRoutes = routeName => { return ( - isAConversationRoute(routeName, true) || - isAInboxViewRoute(routeName, true) || - isNotificationRoute(routeName, true) + isAConversationRoute(routeName, true) || isAInboxViewRoute(routeName, true) ); }; diff --git a/app/javascript/dashboard/composables/commands/useGoToCommandHotKeys.js b/app/javascript/dashboard/composables/commands/useGoToCommandHotKeys.js index d3b8636b3..922bac001 100644 --- a/app/javascript/dashboard/composables/commands/useGoToCommandHotKeys.js +++ b/app/javascript/dashboard/composables/commands/useGoToCommandHotKeys.js @@ -4,7 +4,6 @@ import { useMapGetter } from 'dashboard/composables/store'; import { useRouter } from 'vue-router'; import { usePolicy } from 'dashboard/composables/usePolicy'; import { - ICON_BELL, ICON_BLOCKS, ICON_BOT, ICON_BRIEFCASE, @@ -262,13 +261,6 @@ const GO_TO_COMMANDS = [ icon: ICON_USER_PEN, routeName: 'profile_settings_index', }, - { - id: 'open_notifications', - title: 'COMMAND_BAR.COMMANDS.GO_TO_NOTIFICATIONS', - section: SECTION_SETTINGS, - icon: ICON_BELL, - routeName: 'notifications_index', - }, ]; export function useGoToCommandHotKeys(isPaywalled = ref(false)) { diff --git a/app/javascript/dashboard/helper/AnalyticsHelper/events.js b/app/javascript/dashboard/helper/AnalyticsHelper/events.js index 9e1b932b0..1bcca9f9c 100644 --- a/app/javascript/dashboard/helper/AnalyticsHelper/events.js +++ b/app/javascript/dashboard/helper/AnalyticsHelper/events.js @@ -19,9 +19,6 @@ export const ACCOUNT_EVENTS = Object.freeze({ ADDED_A_CUSTOM_ATTRIBUTE: 'Added a custom attribute', ADDED_AN_INBOX: 'Added an inbox', OPEN_MESSAGE_CONTEXT_MENU: 'Opened message context menu', - OPENED_NOTIFICATIONS: 'Opened notifications', - MARK_AS_READ_NOTIFICATIONS: 'Marked notifications as read', - OPEN_CONVERSATION_VIA_NOTIFICATION: 'Opened conversation via notification', }); export const LABEL_EVENTS = Object.freeze({ diff --git a/app/javascript/dashboard/helper/ReconnectService.js b/app/javascript/dashboard/helper/ReconnectService.js index 3a5598d24..1161c6894 100644 --- a/app/javascript/dashboard/helper/ReconnectService.js +++ b/app/javascript/dashboard/helper/ReconnectService.js @@ -4,7 +4,6 @@ import { differenceInSeconds } from 'date-fns'; import { isAConversationRoute, isAInboxViewRoute, - isNotificationRoute, } from 'dashboard/helper/routeHelpers'; const MAX_DISCONNECT_SECONDS = 10800; @@ -122,8 +121,6 @@ class ReconnectService { await this.fetchNotificationsOnReconnect( this.store.getters['notifications/getNotificationFilters'] ); - } else if (isNotificationRoute(currentRoute)) { - await this.fetchNotificationsOnReconnect(); } }; diff --git a/app/javascript/dashboard/helper/routeHelpers.js b/app/javascript/dashboard/helper/routeHelpers.js index b9511d212..d05a4aaea 100644 --- a/app/javascript/dashboard/helper/routeHelpers.js +++ b/app/javascript/dashboard/helper/routeHelpers.js @@ -148,9 +148,6 @@ export const isAInboxViewRoute = (routeName, includeBase = false) => { return routeNames.includes(routeName); }; -export const isNotificationRoute = routeName => - routeName === 'notifications_index'; - export const isUpgradePageBypassRoute = routeName => [ 'billing_settings_index', diff --git a/app/javascript/dashboard/helper/specs/ReconnectService.spec.js b/app/javascript/dashboard/helper/specs/ReconnectService.spec.js index 60bd825ee..a6fba0d11 100644 --- a/app/javascript/dashboard/helper/specs/ReconnectService.spec.js +++ b/app/javascript/dashboard/helper/specs/ReconnectService.spec.js @@ -4,7 +4,6 @@ import { differenceInSeconds } from 'date-fns'; import { isAConversationRoute, isAInboxViewRoute, - isNotificationRoute, } from 'dashboard/helper/routeHelpers'; import ReconnectService from 'dashboard/helper/ReconnectService'; @@ -23,7 +22,6 @@ vi.mock('date-fns', () => ({ vi.mock('dashboard/helper/routeHelpers', () => ({ isAConversationRoute: vi.fn(), isAInboxViewRoute: vi.fn(), - isNotificationRoute: vi.fn(), })); const storeMock = { @@ -296,13 +294,6 @@ describe('ReconnectService', () => { await reconnectService.handleRouteSpecificFetch(); expect(spy).toHaveBeenCalled(); }); - - it('should fetch notifications if current route is a notification route', async () => { - isNotificationRoute.mockReturnValue(true); - const spy = vi.spyOn(reconnectService, 'fetchNotificationsOnReconnect'); - await reconnectService.handleRouteSpecificFetch(); - expect(spy).toHaveBeenCalled(); - }); }); describe('setConversationLastMessageId', () => { diff --git a/app/javascript/dashboard/i18n/locale/en/generalSettings.json b/app/javascript/dashboard/i18n/locale/en/generalSettings.json index 967cf952c..715aa1ae8 100644 --- a/app/javascript/dashboard/i18n/locale/en/generalSettings.json +++ b/app/javascript/dashboard/i18n/locale/en/generalSettings.json @@ -139,37 +139,6 @@ "SELECT": "Select" } }, - "NOTIFICATIONS_PAGE": { - "HEADER": "Notifications", - "MARK_ALL_DONE": "Mark All Done", - "DELETE_TITLE": "deleted", - "UNREAD_NOTIFICATION": { - "TITLE": "Unread Notifications", - "ALL_NOTIFICATIONS": "View all notifications", - "LOADING_UNREAD_MESSAGE": "Loading unread notifications...", - "EMPTY_MESSAGE": "You have no unread notifications" - }, - "LIST": { - "LOADING_MESSAGE": "Loading notifications...", - "404": "No Notifications", - "TABLE_HEADER": [ - "Name", - "Phone Number", - "Conversations", - "Last Contacted" - ] - }, - "TYPE_LABEL": { - "conversation_creation": "New conversation", - "conversation_assignment": "Conversation Assigned", - "assigned_conversation_new_message": "New Message", - "participating_conversation_new_message": "New Message", - "conversation_mention": "Mention", - "sla_missed_first_response": "SLA Missed", - "sla_missed_next_response": "SLA Missed", - "sla_missed_resolution": "SLA Missed" - } - }, "NETWORK": { "NOTIFICATION": { "OFFLINE": "Offline", @@ -232,7 +201,6 @@ "GO_TO_SETTINGS_BILLING": "Go to Billing", "GO_TO_SETTINGS_ACCOUNT": "Go to Account Settings", "GO_TO_SETTINGS_PROFILE": "Go to Profile Settings", - "GO_TO_NOTIFICATIONS": "Go to Notifications", "ADD_LABELS_TO_CONVERSATION": "Add label to the conversation", "ASSIGN_AN_AGENT": "Assign an agent", "AI_ASSIST": "AI Assist", diff --git a/app/javascript/dashboard/routes/dashboard/dashboard.routes.js b/app/javascript/dashboard/routes/dashboard/dashboard.routes.js index 4611aad38..a4acf76e7 100644 --- a/app/javascript/dashboard/routes/dashboard/dashboard.routes.js +++ b/app/javascript/dashboard/routes/dashboard/dashboard.routes.js @@ -4,7 +4,6 @@ import { routes as searchRoutes } from '../../modules/search/search.routes'; import { routes as callRoutes } from './calls/routes'; import { routes as contactRoutes } from './contacts/routes'; import { routes as companyRoutes } from './companies/routes'; -import { routes as notificationRoutes } from './notifications/routes'; import { routes as inboxRoutes } from './inbox/routes'; import { frontendURL } from '../../helper/URLHelper'; import helpcenterRoutes from './helpcenter/helpcenter.routes'; @@ -30,7 +29,6 @@ export default { ...contactRoutes, ...companyRoutes, ...searchRoutes, - ...notificationRoutes, ...helpcenterRoutes.routes, ...campaignsRoutes.routes, ], diff --git a/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue b/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue deleted file mode 100644 index 7f5d3ce20..000000000 --- a/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationTable.vue +++ /dev/null @@ -1,211 +0,0 @@ - - - - - diff --git a/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationsView.vue b/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationsView.vue deleted file mode 100644 index 67805e0e3..000000000 --- a/app/javascript/dashboard/routes/dashboard/notifications/components/NotificationsView.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - diff --git a/app/javascript/dashboard/routes/dashboard/notifications/routes.js b/app/javascript/dashboard/routes/dashboard/notifications/routes.js deleted file mode 100644 index fd16475ba..000000000 --- a/app/javascript/dashboard/routes/dashboard/notifications/routes.js +++ /dev/null @@ -1,21 +0,0 @@ -/* eslint arrow-body-style: 0 */ -import { frontendURL } from '../../../helper/URLHelper'; -import SettingsWrapper from '../settings/SettingsWrapper.vue'; -import NotificationsView from './components/NotificationsView.vue'; - -export const routes = [ - { - path: frontendURL('accounts/:accountId/notifications'), - component: SettingsWrapper, - children: [ - { - path: '', - name: 'notifications_index', - component: NotificationsView, - meta: { - permissions: ['administrator', 'agent', 'custom_role'], - }, - }, - ], - }, -]; diff --git a/app/javascript/dashboard/store/modules/notifications/actions.js b/app/javascript/dashboard/store/modules/notifications/actions.js index 36e953c5d..36f68d508 100644 --- a/app/javascript/dashboard/store/modules/notifications/actions.js +++ b/app/javascript/dashboard/store/modules/notifications/actions.js @@ -2,22 +2,6 @@ import types from '../../mutation-types'; import NotificationsAPI from '../../../api/notifications'; export const actions = { - get: async ({ commit }, { page = 1 } = {}) => { - commit(types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: true }); - try { - const { - data: { - data: { payload, meta }, - }, - } = await NotificationsAPI.get({ page }); - commit(types.CLEAR_NOTIFICATIONS); - commit(types.SET_NOTIFICATIONS, payload); - commit(types.SET_NOTIFICATIONS_META, meta); - commit(types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: false }); - } catch (error) { - commit(types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: false }); - } - }, index: async ({ commit }, { page = 1, status, type, sortOrder } = {}) => { commit(types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: true }); try { diff --git a/app/javascript/dashboard/store/modules/notifications/getters.js b/app/javascript/dashboard/store/modules/notifications/getters.js index 8af1d0360..0b4e81c2e 100644 --- a/app/javascript/dashboard/store/modules/notifications/getters.js +++ b/app/javascript/dashboard/store/modules/notifications/getters.js @@ -2,9 +2,6 @@ import { sortComparator } from './helpers'; import camelcaseKeys from 'camelcase-keys'; export const getters = { - getNotifications($state) { - return Object.values($state.records).sort((n1, n2) => n2.id - n1.id); - }, getFilteredNotifications: $state => filters => { const sortOrder = filters.sortOrder === 'desc' ? 'newest' : 'oldest'; const sortedNotifications = Object.values($state.records).sort((n1, n2) => diff --git a/app/javascript/dashboard/store/modules/specs/notifications/actions.spec.js b/app/javascript/dashboard/store/modules/specs/notifications/actions.spec.js index b81d9c68d..fc6384f26 100644 --- a/app/javascript/dashboard/store/modules/specs/notifications/actions.spec.js +++ b/app/javascript/dashboard/store/modules/specs/notifications/actions.spec.js @@ -6,38 +6,6 @@ global.axios = axios; vi.mock('axios'); describe('#actions', () => { - describe('#get', () => { - it('sends correct actions if API is success', async () => { - axios.get.mockResolvedValue({ - data: { - data: { - payload: [{ id: 1 }], - meta: { count: 3, current_page: 1, unread_count: 2 }, - }, - }, - }); - await actions.get({ commit }); - expect(commit.mock.calls).toEqual([ - [types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: true }], - [types.CLEAR_NOTIFICATIONS], - [types.SET_NOTIFICATIONS, [{ id: 1 }]], - [ - types.SET_NOTIFICATIONS_META, - { count: 3, current_page: 1, unread_count: 2 }, - ], - [types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: false }], - ]); - }); - it('sends correct actions if API is error', async () => { - axios.get.mockRejectedValue({ message: 'Incorrect header' }); - await actions.get({ commit }); - expect(commit.mock.calls).toEqual([ - [types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: true }], - [types.SET_NOTIFICATIONS_UI_FLAG, { isFetching: false }], - ]); - }); - }); - describe('#index', () => { it('sends correct actions if API is success', async () => { axios.get.mockResolvedValue({ diff --git a/app/javascript/dashboard/store/modules/specs/notifications/getters.spec.js b/app/javascript/dashboard/store/modules/specs/notifications/getters.spec.js index 580a3df00..7e8c87042 100644 --- a/app/javascript/dashboard/store/modules/specs/notifications/getters.spec.js +++ b/app/javascript/dashboard/store/modules/specs/notifications/getters.spec.js @@ -1,21 +1,6 @@ import { getters } from '../../notifications/getters'; describe('#getters', () => { - it('getNotifications', () => { - const state = { - records: { - 1: { id: 1 }, - 2: { id: 2 }, - 3: { id: 3 }, - }, - }; - expect(getters.getNotifications(state)).toEqual([ - { id: 3 }, - { id: 2 }, - { id: 1 }, - ]); - }); - it('getFilteredNotifications', () => { const state = { records: {