From 713b89e4dea5a13eb80ada4895c2c68f573429c2 Mon Sep 17 00:00:00 2001 From: Kristina Fefelova Date: Wed, 21 Aug 2024 14:35:45 +0400 Subject: [PATCH 1/2] Move inner pushs Signed-off-by: Kristina Fefelova --- packages/ui/src/components/notifications/Notification.svelte | 1 + packages/ui/src/components/notifications/Notifications.svelte | 4 +++- packages/ui/src/utils.ts | 2 +- 3 files changed, 5 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 From 217b1e1ad8e88d571d9af31c39308f93647aa48e Mon Sep 17 00:00:00 2001 From: Kristina Fefelova Date: Wed, 21 Aug 2024 16:50:24 +0400 Subject: [PATCH 2/2] Try fix qms-tests Signed-off-by: Kristina Fefelova --- 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 ++++ 5 files changed, 20 insertions(+) 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" } ] }