From 48389d69d8463e9c7204c289f49e745db5dc6f8e Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 25 Mar 2022 19:02:45 +0530 Subject: [PATCH] feat: New notification panel for unread notifications (#4061) Fixes: #4052 --- .../dashboard/components/layout/Sidebar.vue | 4 + .../sidebarComponents/NotificationBell.vue | 57 +++- .../layout/sidebarComponents/Primary.vue | 5 +- .../specs/NotificationBell.spec.js | 36 ++- .../i18n/locale/en/generalSettings.json | 7 + .../dashboard/routes/dashboard/Dashboard.vue | 14 + .../components/NotificationPanel.vue | 274 ++++++++++++++++++ .../components/NotificationPanelList.vue | 219 ++++++++++++++ .../components/NotificationTable.vue | 11 +- 9 files changed, 606 insertions(+), 21 deletions(-) create mode 100644 app/javascript/dashboard/routes/dashboard/notifications/components/NotificationPanel.vue create mode 100644 app/javascript/dashboard/routes/dashboard/notifications/components/NotificationPanelList.vue diff --git a/app/javascript/dashboard/components/layout/Sidebar.vue b/app/javascript/dashboard/components/layout/Sidebar.vue index 826d766df..c7fda74f1 100644 --- a/app/javascript/dashboard/components/layout/Sidebar.vue +++ b/app/javascript/dashboard/components/layout/Sidebar.vue @@ -8,6 +8,7 @@ :active-menu-item="activePrimaryMenu.key" @toggle-accounts="toggleAccountModal" @key-shortcut-modal="toggleKeyShortcutModal" + @open-notification-panel="openNotificationPanel" /> diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/NotificationBell.vue b/app/javascript/dashboard/components/layout/sidebarComponents/NotificationBell.vue index 82d858b30..375cd6ffa 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/NotificationBell.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/NotificationBell.vue @@ -1,19 +1,21 @@ @@ -37,4 +48,32 @@ export default { .notifications-link { margin-bottom: var(--space-small); } + +.badge { + position: absolute; + right: var(--space-minus-smaller); + top: var(--space-minus-smaller); +} +.notifications-link--button { + display: flex; + position: relative; + border-radius: var(--border-radius-large); + border: 1px solid transparent; + color: var(--s-600); + margin: var(--space-small) 0; + + &:hover { + background: var(--w-50); + color: var(--s-600); + } + + &:focus { + border-color: var(--w-500); + } + + &.is-active { + background: var(--w-50); + color: var(--w-500); + } +} diff --git a/app/javascript/dashboard/components/layout/sidebarComponents/Primary.vue b/app/javascript/dashboard/components/layout/sidebarComponents/Primary.vue index 002f371bf..956daa5eb 100644 --- a/app/javascript/dashboard/components/layout/sidebarComponents/Primary.vue +++ b/app/javascript/dashboard/components/layout/sidebarComponents/Primary.vue @@ -16,7 +16,7 @@ />