From 68aacb7d45b15842906e9034d61320a93ca65913 Mon Sep 17 00:00:00 2001 From: Case Delst Date: Thu, 17 Oct 2024 14:28:49 -0700 Subject: [PATCH] Add toast for successful sync and warning for failure --- internal/dev_server/ui/dist/index.html | 50 +++++++++++++------------- internal/dev_server/ui/src/Sync.tsx | 3 ++ internal/dev_server/ui/src/main.tsx | 2 ++ 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/internal/dev_server/ui/dist/index.html b/internal/dev_server/ui/dist/index.html index c0c2d7b8..2db3e210 100644 --- a/internal/dev_server/ui/dist/index.html +++ b/internal/dev_server/ui/dist/index.html @@ -5,7 +5,7 @@ LaunchDevly - diff --git a/internal/dev_server/ui/src/Sync.tsx b/internal/dev_server/ui/src/Sync.tsx index 050084b0..a687f4c9 100644 --- a/internal/dev_server/ui/src/Sync.tsx +++ b/internal/dev_server/ui/src/Sync.tsx @@ -3,6 +3,7 @@ import { Tooltip, TooltipTrigger, ProgressBar, + ToastQueue, } from '@launchpad-ui/components'; import { apiRoute, sortFlags } from './util.ts'; import { LDFlagSet } from 'launchdarkly-js-client-sdk'; @@ -49,8 +50,10 @@ const SyncButton = ({ setAvailableVariations(result.availableVariations); setFlags(sortFlags(result.flagsState)); } catch (error) { + ToastQueue.warning('Sync failed'); console.error('Sync failed:', error); } finally { + ToastQueue.success('Sync successful'); setIsLoading(false); } }; diff --git a/internal/dev_server/ui/src/main.tsx b/internal/dev_server/ui/src/main.tsx index 269dccc5..d207bc5a 100644 --- a/internal/dev_server/ui/src/main.tsx +++ b/internal/dev_server/ui/src/main.tsx @@ -2,6 +2,7 @@ import React, { useEffect } from 'react'; import ReactDOM from 'react-dom/client'; import App from './App.tsx'; import { IconProvider } from './IconProvider.tsx'; +import { ToastContainer } from '@launchpad-ui/components'; const Root = () => { useEffect(() => { @@ -28,6 +29,7 @@ const Root = () => { + );