From db42abe538cb11e94ae91cf3b2537c434612314a Mon Sep 17 00:00:00 2001 From: BrunoQuaresma Date: Thu, 4 May 2023 18:11:47 +0000 Subject: [PATCH] feat(site): Show update confirmation dialog --- 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 7f249c74c590b..9ca0b36f9c352 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 d6207952a4ac8..19fc2d96a0d06 100644 --- a/site/src/components/WorkspaceActions/Buttons.tsx +++ b/site/src/components/WorkspaceActions/Buttons.tsx @@ -21,6 +21,7 @@ export const UpdateButton: FC> = ({ return (