From 164146c462bcf565c3ac374b8a25c23573629910 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Thu, 4 May 2023 15:40:41 -0300 Subject: [PATCH] feat(site): Show update confirmation dialog (#7420) --- site/src/components/Dialogs/Dialog.tsx | 1 + site/src/components/Resources/AgentRow.tsx | 4 +- .../components/WorkspaceActions/Buttons.tsx | 1 + .../WorkspaceBuildPage.test.tsx | 7 +-- .../WorkspacePage/WorkspacePage.test.tsx | 54 ++++++++++++------- .../WorkspacePage/WorkspaceReadyPage.tsx | 17 +++++- site/src/testHelpers/entities.ts | 33 ++++++++++++ site/src/testHelpers/handlers.ts | 8 +++ 8 files changed, 98 insertions(+), 27 deletions(-) diff --git a/site/src/components/Dialogs/Dialog.tsx b/site/src/components/Dialogs/Dialog.tsx index 7f249c74c5..9ca0b36f9c 100644 --- a/site/src/components/Dialogs/Dialog.tsx +++ b/site/src/components/Dialogs/Dialog.tsx @@ -65,6 +65,7 @@ export const DialogActionButtons: React.FC = ({ {onConfirm && ( = ({ useEffect(() => { // We only want to fetch logs when they are actually shown, // otherwise we can make a lot of requests that aren't necessary. - if (showStartupLogs) { + if (showStartupLogs && logsMachine.can("FETCH_STARTUP_LOGS")) { sendLogsEvent("FETCH_STARTUP_LOGS") } - }, [sendLogsEvent, showStartupLogs]) + }, [logsMachine, sendLogsEvent, showStartupLogs]) const logListRef = useRef(null) const logListDivRef = useRef(null) const startupLogs = useMemo(() => { diff --git a/site/src/components/WorkspaceActions/Buttons.tsx b/site/src/components/WorkspaceActions/Buttons.tsx index d6207952a4..19fc2d96a0 100644 --- a/site/src/components/WorkspaceActions/Buttons.tsx +++ b/site/src/components/WorkspaceActions/Buttons.tsx @@ -21,6 +21,7 @@ export const UpdateButton: FC> = ({ return (