diff --git a/app/portainer/user-activity/index.js b/app/portainer/user-activity/index.js index d45c307e4..201b03a25 100644 --- a/app/portainer/user-activity/index.js +++ b/app/portainer/user-activity/index.js @@ -36,5 +36,8 @@ function config($stateRegistryProvider) { component: 'notifications', }, }, + params: { + id: '', + }, }); } diff --git a/app/react/components/PageHeader/HeaderTitle.module.css b/app/react/components/PageHeader/HeaderTitle.module.css index 862032b64..62b04d651 100644 --- a/app/react/components/PageHeader/HeaderTitle.module.css +++ b/app/react/components/PageHeader/HeaderTitle.module.css @@ -21,6 +21,8 @@ box-shadow: 0 6px 12px rgb(0 0 0 / 18%); @apply th-dark:!border-none; @apply th-highcontrast:!border-none; + z-index: 9999; + position: relative; } .menu-link { diff --git a/app/react/components/PageHeader/NotificationsMenu.module.css b/app/react/components/PageHeader/NotificationsMenu.module.css index d905d743a..60c5cba00 100644 --- a/app/react/components/PageHeader/NotificationsMenu.module.css +++ b/app/react/components/PageHeader/NotificationsMenu.module.css @@ -1,3 +1,7 @@ +.root { + width: 500px; +} + .badge { position: absolute; top: 8px; @@ -23,6 +27,16 @@ margin-left: auto; } +.notifications { + max-height: 80vh; + overflow-y: auto; +} + +.notification { + border-bottom: 1px solid var(--ui-gray-3); + border-radius: 0; +} + .container { display: flex; } @@ -31,12 +45,23 @@ width: 5rem; } .notificationBody { - flex-basis: 30rem; + flex-basis: 80rem; } .deleteButton { flex-basis: 5rem; } +.notification-details { + word-break: break-all; + white-space: normal; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 5; + line-clamp: 5; + -webkit-box-orient: vertical; +} + .container > div { padding: 0px 10px; margin: auto; diff --git a/app/react/components/PageHeader/NotificationsMenu.tsx b/app/react/components/PageHeader/NotificationsMenu.tsx index afa36b33d..879416216 100644 --- a/app/react/components/PageHeader/NotificationsMenu.tsx +++ b/app/react/components/PageHeader/NotificationsMenu.tsx @@ -34,6 +34,13 @@ export function NotificationsMenu() { (state) => state.userNotifications[user.Id] ); + if (userNotifications && userNotifications.length > 1) { + userNotifications.sort( + (a, b) => + new Date(b.timeStamp).getTime() - new Date(a.timeStamp).getTime() + ); + } + const [badge, setBadge] = useState(false); useEffect(() => { @@ -63,21 +70,26 @@ export function NotificationsMenu() { )} > - +
-
+

Notifications

-
+
{userNotifications?.length > 0 && (