Skip to content

Commit

Permalink
implement review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
austenem committed Aug 23, 2024
1 parent 2e63220 commit e62dd5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,20 @@ import Stack from '@mui/material/Stack';
import Typography from '@mui/material/Typography';
import Button from '@mui/material/Button';

function WorkspaceToastSuccessMessage(id: number) {
function WorkspaceLaunchSuccessToast(id: number) {
return (
<Stack sx={{ maxWidth: '22rem' }}>
<Typography>
Workspace successfully launched in a new tab. If the tab didn&apos;t open, please check your pop-up blocker
settings and relaunch your workspace.
</Typography>
<Stack direction="row" justifyContent="flex-end" marginTop={1}>
<Button
href={`/workspaces/${id}`}
variant="contained"
sx={{
backgroundColor: 'transparent',
boxShadow: 'none',
':hover': { backgroundColor: 'transparent', boxShadow: 'none' },
}}
>
<Typography variant="button">View Workspace Detail Page</Typography>
<Button href={`/workspaces/${id}`} variant="text" color="inherit">
View Workspace Detail Page
</Button>
</Stack>
</Stack>
);
}

export default WorkspaceToastSuccessMessage;
export default WorkspaceLaunchSuccessToast;
4 changes: 2 additions & 2 deletions context/app/static/js/components/workspaces/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
} from './api';
import { MergedWorkspace, Workspace, CreateTemplatesResponse } from './types';
import { useWorkspaceTemplates } from './NewWorkspaceDialog/hooks';
import WorkspaceToastSuccessMessage from './WorkspaceToastSuccessMessage';
import WorkspaceLaunchSuccessToast from './WorkspaceLaunchSuccessToast';

interface UseWorkspacesListTypes<T> {
workspaces: Workspace[];
Expand Down Expand Up @@ -274,7 +274,7 @@ export function useCreateAndLaunchWorkspace() {
return;
}

toastSuccess(WorkspaceToastSuccessMessage(workspace.id));
toastSuccess(WorkspaceLaunchSuccessToast(workspace.id));

try {
await startNewWorkspace({ workspace, jobTypeId: body.default_job_type, templatePath });
Expand Down

0 comments on commit e62dd5b

Please sign in to comment.