Skip to content

Commit fb845a9

Browse files
committed
render run all inside v2editor
1 parent efb0ffc commit fb845a9

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

apps/web/src/components/PrivateDocumentPage.tsx

+2-11
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ function PrivateDocumentPageInner(
352352
>
353353
<div className="w-full relative flex">
354354
<V2Editor
355+
key={selectedSidebar?._tag}
355356
document={props.document}
356357
dataSources={dataSources}
357358
isPublicViewer={false}
@@ -372,17 +373,7 @@ function PrivateDocumentPageInner(
372373
isSyncing={syncing}
373374
onOpenFiles={onToggleFiles}
374375
onSchemaExplorer={onToggleSchemaExplorerSQLBlock}
375-
>
376-
{!isViewer && (
377-
<RunAllV2
378-
disabled={false}
379-
yDoc={yDoc}
380-
primary={props.isApp}
381-
userId={props.user.id}
382-
executionQueue={executionQueue}
383-
/>
384-
)}
385-
</V2Editor>
376+
/>
386377

387378
<Comments
388379
workspaceId={props.workspaceId}

apps/web/src/components/RunAllV2.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function RunAllV2(props: Props) {
6060
'bg-red-200 hover:bg-red-300':
6161
!props.disabled && loading && status !== 'aborting',
6262
},
63-
'flex items-center rounded-sm px-3 py-1 text-sm gap-x-1.5 fixed mt-3 right-8 z-10'
63+
'flex items-center rounded-sm px-3 py-1 text-sm gap-x-1.5 absolute top-3 right-8 z-10'
6464
)}
6565
onClick={onClick}
6666
disabled={props.disabled}

apps/web/src/components/v2Editor/index.tsx

+12-1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ import {
112112
PlayIcon,
113113
} from '@heroicons/react/24/outline'
114114
import { useOnClickOutside } from '@/hooks/useOnClickOutside'
115+
import RunAllV2 from '../RunAllV2'
115116

116117
// The react-dnd package does not export this...
117118
type Identifier = string | symbol
@@ -1667,7 +1668,7 @@ const Editor = (props: Props) => {
16671668
const lastUpdatedAt = useLastUpdatedAt(props.yDoc)
16681669

16691670
return (
1670-
<div className="editor-v2 flex flex-col flex-grow justify-center font-primary subpixel-antialiased h-full w-full">
1671+
<div className="editor-v2 flex flex-col flex-grow justify-center font-primary subpixel-antialiased h-full w-full relative">
16711672
{props.isDeleted && (
16721673
<div className="bg-yellow-50 py-6 border-b border-yellow-200">
16731674
<div className="flex justify-center">
@@ -1689,6 +1690,16 @@ const Editor = (props: Props) => {
16891690
</div>
16901691
)}
16911692

1693+
{props.role !== 'viewer' && props.userId && (
1694+
<RunAllV2
1695+
disabled={false}
1696+
yDoc={props.yDoc}
1697+
primary={props.isApp}
1698+
userId={props.userId}
1699+
executionQueue={props.executionQueue}
1700+
/>
1701+
)}
1702+
16921703
<div
16931704
id="editor-scrollview"
16941705
ref={props.scrollViewRef}

0 commit comments

Comments
 (0)