Browse Source

style: improve pointer event handling in PublishToast and Workflow components

tags/2.0.0-beta.2
twwu 1 month ago
parent
commit
f7d4e17ae1

+ 2
- 2
web/app/components/rag-pipeline/components/publish-toast.tsx View File

return null return null


return ( return (
<div className='absolute bottom-[45px] left-0 right-0 z-10 flex justify-center'>
<div className='pointer-events-none absolute bottom-[45px] left-0 right-0 z-10 flex justify-center'>
<div <div
className='relative flex w-[420px] space-x-1 overflow-hidden rounded-xl border border-components-panel-border bg-components-panel-bg-blur p-3 shadow-lg' className='relative flex w-[420px] space-x-1 overflow-hidden rounded-xl border border-components-panel-border bg-components-panel-bg-blur p-3 shadow-lg'
> >
</div> </div>
</div> </div>
<div <div
className='flex h-6 w-6 cursor-pointer items-center justify-center'
className='pointer-events-auto flex h-6 w-6 cursor-pointer items-center justify-center'
onClick={() => setHideToast(true)} onClick={() => setHideToast(true)}
> >
<RiCloseLine className='h-4 w-4 text-text-tertiary' /> <RiCloseLine className='h-4 w-4 text-text-tertiary' />

+ 9
- 8
web/app/components/workflow/index.tsx View File

import useMatchSchemaType from './nodes/_base/components/variable/use-match-schema-type' import useMatchSchemaType from './nodes/_base/components/variable/use-match-schema-type'
import type { VarInInspect } from '@/types/workflow' import type { VarInInspect } from '@/types/workflow'
import { fetchAllInspectVars } from '@/service/workflow' import { fetchAllInspectVars } from '@/service/workflow'
import cn from '@/utils/classnames'


const Confirm = dynamic(() => import('@/app/components/base/confirm'), { const Confirm = dynamic(() => import('@/app/components/base/confirm'), {
ssr: false, ssr: false,
const [vars, setVars] = useState<VarInInspect[]>([]) const [vars, setVars] = useState<VarInInspect[]>([])
useEffect(() => { useEffect(() => {
(async () => { (async () => {
if(!configsMap?.flowType || !configsMap?.flowId)
if (!configsMap?.flowType || !configsMap?.flowId)
return return
const data = await fetchAllInspectVars(configsMap.flowType, configsMap.flowId) const data = await fetchAllInspectVars(configsMap.flowType, configsMap.flowId)
setVars(data) setVars(data)
})() })()
}, [configsMap?.flowType, configsMap?.flowId]) }, [configsMap?.flowType, configsMap?.flowId])
useEffect(() => { useEffect(() => {
if(schemaTypeDefinitions && isLoadedVars) {
if (schemaTypeDefinitions && isLoadedVars) {
fetchInspectVars({ fetchInspectVars({
passInVars: true, passInVars: true,
vars, vars,
return ( return (
<div <div
id='workflow-container' id='workflow-container'
className={`
relative h-full w-full min-w-[960px]
${workflowReadOnly && 'workflow-panel-animation'}
${nodeAnimation && 'workflow-node-animation'}
`}
className={cn(
'relative h-full w-full min-w-[960px]',
workflowReadOnly && 'workflow-panel-animation',
nodeAnimation && 'workflow-node-animation',
)}
ref={workflowContainerRef} ref={workflowContainerRef}
> >
<SyncingDataModal /> <SyncingDataModal />
<CandidateNode /> <CandidateNode />
<div <div
className='absolute left-0 top-0 z-10 flex w-12 items-center justify-center p-1 pl-2'
className='pointer-events-none absolute left-0 top-0 z-10 flex w-12 items-center justify-center p-1 pl-2'
style={{ height: controlHeight }} style={{ height: controlHeight }}
> >
<Control /> <Control />

+ 1
- 1
web/app/components/workflow/operator/control.tsx View File

} }


return ( return (
<div className='flex flex-col items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 text-text-tertiary shadow-lg'>
<div className='pointer-events-auto flex flex-col items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 text-text-tertiary shadow-lg'>
<AddBlock /> <AddBlock />
<TipPopup title={t('workflow.nodes.note.addNote')}> <TipPopup title={t('workflow.nodes.note.addNote')}>
<div <div

Loading…
Cancel
Save