From e02d0c716bff0e12cd4999238f7b62500e02b28a Mon Sep 17 00:00:00 2001 From: Kristina Date: Wed, 21 Aug 2024 18:51:12 +0400 Subject: [PATCH] Move inner pushes (#6364) --- packages/ui/src/components/notifications/Notification.svelte | 1 + packages/ui/src/components/notifications/Notifications.svelte | 4 +++- packages/ui/src/utils.ts | 2 +- qms-tests/sanity/storage-dev.json | 4 ++++ qms-tests/sanity/storage.json | 4 ++++ qms-tests/sanity/storageQaraManager.json | 4 ++++ qms-tests/sanity/storageSecond-dev.json | 4 ++++ qms-tests/sanity/storageSecond.json | 4 ++++ 8 files changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/components/notifications/Notification.svelte b/packages/ui/src/components/notifications/Notification.svelte index 84ae630fa54..9a7831e32e1 100644 --- a/packages/ui/src/components/notifications/Notification.svelte +++ b/packages/ui/src/components/notifications/Notification.svelte @@ -20,6 +20,7 @@ } onDestroy(() => { + removeNotificationHandler() if (closeTimeout && timeout) { clearTimeout(timeout) } diff --git a/packages/ui/src/components/notifications/Notifications.svelte b/packages/ui/src/components/notifications/Notifications.svelte index f0678be64f5..2252d7dcbdb 100644 --- a/packages/ui/src/components/notifications/Notifications.svelte +++ b/packages/ui/src/components/notifications/Notifications.svelte @@ -9,13 +9,15 @@ 'top-left': NotificationPosition.TopLeft, 'top-right': NotificationPosition.TopRight } + + const maxVisibleNotifications = 3
{#each Object.entries(positionByClassName) as [className, position]}
- {#each $store as notification (notification.id)} + {#each $store.slice(0, maxVisibleNotifications) as notification (notification.id)} {#if notification.position === position} {/if} diff --git a/packages/ui/src/utils.ts b/packages/ui/src/utils.ts index 34a29cbb7e7..1165a279119 100644 --- a/packages/ui/src/utils.ts +++ b/packages/ui/src/utils.ts @@ -110,7 +110,7 @@ export function addNotification ( title, subTitle, severity, - position: NotificationPosition.BottomRight, + position: NotificationPosition.TopRight, component, closeTimeout, params diff --git a/qms-tests/sanity/storage-dev.json b/qms-tests/sanity/storage-dev.json index 4281c93edd0..ba511f7bccd 100644 --- a/qms-tests/sanity/storage-dev.json +++ b/qms-tests/sanity/storage-dev.json @@ -27,6 +27,10 @@ { "name": "flagOpenInDesktopApp", "value": "true" + }, + { + "name": "#platform.notification.timeout", + "value": "0" } ] } diff --git a/qms-tests/sanity/storage.json b/qms-tests/sanity/storage.json index 65a8911bb00..38fcfc911bb 100644 --- a/qms-tests/sanity/storage.json +++ b/qms-tests/sanity/storage.json @@ -27,6 +27,10 @@ { "name": "flagOpenInDesktopApp", "value": "true" + }, + { + "name": "#platform.notification.timeout", + "value": "0" } ] } diff --git a/qms-tests/sanity/storageQaraManager.json b/qms-tests/sanity/storageQaraManager.json index 5b998b9b6c2..9ce6e5658d7 100644 --- a/qms-tests/sanity/storageQaraManager.json +++ b/qms-tests/sanity/storageQaraManager.json @@ -27,6 +27,10 @@ { "name": "flagOpenInDesktopApp", "value": "true" + }, + { + "name": "#platform.notification.timeout", + "value": "0" } ] } diff --git a/qms-tests/sanity/storageSecond-dev.json b/qms-tests/sanity/storageSecond-dev.json index ba2fd969ee3..25185393d1d 100644 --- a/qms-tests/sanity/storageSecond-dev.json +++ b/qms-tests/sanity/storageSecond-dev.json @@ -27,6 +27,10 @@ { "name": "flagOpenInDesktopApp", "value": "true" + }, + { + "name": "#platform.notification.timeout", + "value": "0" } ] } diff --git a/qms-tests/sanity/storageSecond.json b/qms-tests/sanity/storageSecond.json index ed4819a0695..f9793383022 100644 --- a/qms-tests/sanity/storageSecond.json +++ b/qms-tests/sanity/storageSecond.json @@ -27,6 +27,10 @@ { "name": "flagOpenInDesktopApp", "value": "true" + }, + { + "name": "#platform.notification.timeout", + "value": "0" } ] }