diff --git a/CHANGELOG-update-workspace-toast.md b/CHANGELOG-update-workspace-toast.md new file mode 100644 index 0000000000..e2ca2c99f2 --- /dev/null +++ b/CHANGELOG-update-workspace-toast.md @@ -0,0 +1 @@ +- Update language and add an action button to toasts for successful workspace creation. \ No newline at end of file diff --git a/context/app/static/js/components/workspaces/WorkspaceLaunchSuccessToast.tsx b/context/app/static/js/components/workspaces/WorkspaceLaunchSuccessToast.tsx new file mode 100644 index 0000000000..3efc448a37 --- /dev/null +++ b/context/app/static/js/components/workspaces/WorkspaceLaunchSuccessToast.tsx @@ -0,0 +1,20 @@ +import React from 'react'; +import Stack from '@mui/material/Stack'; +import Typography from '@mui/material/Typography'; +import Button from '@mui/material/Button'; + +function WorkspaceLaunchSuccessToast(id: number) { + return ( + + + Workspace successfully launched in a new tab. If the tab didn't open, please check your pop-up blocker + settings and relaunch your workspace. + + + + ); +} + +export default WorkspaceLaunchSuccessToast; diff --git a/context/app/static/js/components/workspaces/hooks.ts b/context/app/static/js/components/workspaces/hooks.ts index d41d909957..33d3d37e7f 100644 --- a/context/app/static/js/components/workspaces/hooks.ts +++ b/context/app/static/js/components/workspaces/hooks.ts @@ -1,5 +1,6 @@ import { useCallback, useMemo } from 'react'; import { KeyedMutator, useSWRConfig } from 'swr'; + import { useSnackbarActions } from 'js/shared-styles/snackbars'; import { useLaunchWorkspaceStore } from 'js/stores/useWorkspaceModalStore'; import { useAppContext } from 'js/components/Contexts'; @@ -28,6 +29,7 @@ import { } from './api'; import { MergedWorkspace, Workspace, CreateTemplatesResponse } from './types'; import { useWorkspaceTemplates } from './NewWorkspaceDialog/hooks'; +import WorkspaceLaunchSuccessToast from './WorkspaceLaunchSuccessToast'; interface UseWorkspacesListTypes { workspaces: Workspace[]; @@ -271,7 +273,8 @@ export function useCreateAndLaunchWorkspace() { toastError('Failed to create workspace.'); return; } - toastSuccess('Workspace successfully created.'); + + toastSuccess(WorkspaceLaunchSuccessToast(workspace.id)); try { await startNewWorkspace({ workspace, jobTypeId: body.default_job_type, templatePath });