fix oxlint warnings (#26634)
This commit is contained in:
@@ -73,7 +73,7 @@ const Tool: FC<Props> = ({
|
||||
if (isHovering && !isAllSelected) {
|
||||
return (
|
||||
<span className='system-xs-regular text-components-button-secondary-accent-text'
|
||||
onClick={(e) => {
|
||||
onClick={() => {
|
||||
onSelectMultiple?.(BlockEnum.Tool, actions.filter(action => !getIsDisabled(action)).map((tool) => {
|
||||
const params: Record<string, string> = {}
|
||||
if (tool.parameters) {
|
||||
|
||||
@@ -107,7 +107,8 @@ export const useShortcuts = (): void => {
|
||||
const { showDebugAndPreviewPanel } = workflowStore.getState()
|
||||
if (shouldHandleShortcut(e) && !showDebugAndPreviewPanel) {
|
||||
e.preventDefault()
|
||||
workflowHistoryShortcutsEnabled && handleHistoryBack()
|
||||
if (workflowHistoryShortcutsEnabled)
|
||||
handleHistoryBack()
|
||||
}
|
||||
}, { exactMatch: true, useCapture: true })
|
||||
|
||||
@@ -116,7 +117,8 @@ export const useShortcuts = (): void => {
|
||||
(e) => {
|
||||
if (shouldHandleShortcut(e)) {
|
||||
e.preventDefault()
|
||||
workflowHistoryShortcutsEnabled && handleHistoryForward()
|
||||
if (workflowHistoryShortcutsEnabled)
|
||||
handleHistoryForward()
|
||||
}
|
||||
},
|
||||
{ exactMatch: true, useCapture: true },
|
||||
|
||||
@@ -354,7 +354,7 @@ export const useWorkflow = () => {
|
||||
return startNodes
|
||||
}, [nodesMap, getRootNodesById])
|
||||
|
||||
const isValidConnection = useCallback(({ source, sourceHandle, target }: Connection) => {
|
||||
const isValidConnection = useCallback(({ source, sourceHandle: _sourceHandle, target }: Connection) => {
|
||||
const {
|
||||
edges,
|
||||
getNodes,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export {}
|
||||
|
||||
@@ -407,7 +407,10 @@ const VarReferencePicker: FC<Props> = ({
|
||||
<WrapElem onClick={() => {
|
||||
if (readonly)
|
||||
return
|
||||
!isConstant ? setOpen(!open) : setControlFocus(Date.now())
|
||||
if (!isConstant)
|
||||
setOpen(!open)
|
||||
else
|
||||
setControlFocus(Date.now())
|
||||
}} className='group/picker-trigger-wrap relative !flex'>
|
||||
<>
|
||||
{isAddBtnTrigger
|
||||
@@ -457,7 +460,10 @@ const VarReferencePicker: FC<Props> = ({
|
||||
onClick={() => {
|
||||
if (readonly)
|
||||
return
|
||||
!isConstant ? setOpen(!open) : setControlFocus(Date.now())
|
||||
if (!isConstant)
|
||||
setOpen(!open)
|
||||
else
|
||||
setControlFocus(Date.now())
|
||||
}}
|
||||
className='h-full grow'
|
||||
>
|
||||
|
||||
@@ -137,7 +137,7 @@ const Item: FC<ItemProps> = ({
|
||||
const isHovering = isItemHovering || isChildrenHovering
|
||||
const open = (isObj || isStructureOutput) && isHovering
|
||||
useEffect(() => {
|
||||
onHovering && onHovering(isHovering)
|
||||
onHovering?.(isHovering)
|
||||
}, [isHovering])
|
||||
const handleChosen = (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
|
||||
@@ -25,12 +25,12 @@ type Props = {
|
||||
} & Partial<ResultPanelProps>
|
||||
|
||||
const LastRun: FC<Props> = ({
|
||||
appId,
|
||||
appId: _appId,
|
||||
nodeId,
|
||||
canSingleRun,
|
||||
isRunAfterSingleRun,
|
||||
updateNodeRunningStatus,
|
||||
nodeInfo,
|
||||
nodeInfo: _nodeInfo,
|
||||
runningStatus: oneStepRunRunningStatus,
|
||||
onSingleRunClicked,
|
||||
singleRunResult,
|
||||
|
||||
@@ -88,7 +88,8 @@ const OptionCard = memo(({
|
||||
)}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
!readonly && enableSelect && id && onClick?.(id)
|
||||
if (!readonly && enableSelect && id)
|
||||
onClick?.(id)
|
||||
}}
|
||||
>
|
||||
<div className={cn(
|
||||
|
||||
@@ -139,8 +139,10 @@ const JsonSchemaConfig: FC<JsonSchemaConfigProps> = ({
|
||||
const handleResetDefaults = useCallback(() => {
|
||||
if (currentTab === SchemaView.VisualEditor) {
|
||||
setHoveringProperty(null)
|
||||
advancedEditing && setAdvancedEditing(false)
|
||||
isAddingNewField && setIsAddingNewField(false)
|
||||
if (advancedEditing)
|
||||
setAdvancedEditing(false)
|
||||
if (isAddingNewField)
|
||||
setIsAddingNewField(false)
|
||||
}
|
||||
setJsonSchema(DEFAULT_SCHEMA)
|
||||
setJson(JSON.stringify(DEFAULT_SCHEMA, null, 2))
|
||||
|
||||
@@ -87,8 +87,10 @@ const EditCard: FC<EditCardProps> = ({
|
||||
})
|
||||
|
||||
useSubscribe('fieldChangeSuccess', () => {
|
||||
isAddingNewField && setIsAddingNewField(false)
|
||||
advancedEditing && setAdvancedEditing(false)
|
||||
if (isAddingNewField)
|
||||
setIsAddingNewField(false)
|
||||
if (advancedEditing)
|
||||
setAdvancedEditing(false)
|
||||
})
|
||||
|
||||
const emitPropertyNameChange = useCallback(() => {
|
||||
|
||||
@@ -45,8 +45,10 @@ export const useSchemaNodeOperations = (props: VisualEditorProps) => {
|
||||
onChange(backupSchema)
|
||||
setBackupSchema(null)
|
||||
}
|
||||
isAddingNewField && setIsAddingNewField(false)
|
||||
advancedEditing && setAdvancedEditing(false)
|
||||
if (isAddingNewField)
|
||||
setIsAddingNewField(false)
|
||||
if (advancedEditing)
|
||||
setAdvancedEditing(false)
|
||||
setHoveringProperty(null)
|
||||
})
|
||||
|
||||
@@ -221,7 +223,8 @@ export const useSchemaNodeOperations = (props: VisualEditorProps) => {
|
||||
})
|
||||
|
||||
useSubscribe('addField', (params) => {
|
||||
advancedEditing && setAdvancedEditing(false)
|
||||
if (advancedEditing)
|
||||
setAdvancedEditing(false)
|
||||
setBackupSchema(jsonSchema)
|
||||
const { path } = params as AddEventParams
|
||||
setIsAddingNewField(true)
|
||||
|
||||
@@ -22,7 +22,7 @@ type ConditionValueProps = {
|
||||
}
|
||||
const ConditionValue = ({
|
||||
variableSelector,
|
||||
labelName,
|
||||
labelName: _labelName,
|
||||
operator,
|
||||
value,
|
||||
}: ConditionValueProps) => {
|
||||
|
||||
@@ -35,7 +35,8 @@ const VariableModalTrigger = ({
|
||||
open={open}
|
||||
onOpenChange={() => {
|
||||
setOpen(v => !v)
|
||||
open && onClose()
|
||||
if (open)
|
||||
onClose()
|
||||
}}
|
||||
placement='left-start'
|
||||
offset={{
|
||||
@@ -45,7 +46,8 @@ const VariableModalTrigger = ({
|
||||
>
|
||||
<PortalToFollowElemTrigger onClick={() => {
|
||||
setOpen(v => !v)
|
||||
open && onClose()
|
||||
if (open)
|
||||
onClose()
|
||||
}}>
|
||||
<Button variant='primary'>
|
||||
<RiAddLine className='mr-1 h-4 w-4' />
|
||||
|
||||
@@ -33,7 +33,8 @@ const VariableTrigger = ({
|
||||
open={open}
|
||||
onOpenChange={() => {
|
||||
setOpen(v => !v)
|
||||
open && onClose()
|
||||
if (open)
|
||||
onClose()
|
||||
}}
|
||||
placement='left-start'
|
||||
offset={{
|
||||
@@ -43,7 +44,8 @@ const VariableTrigger = ({
|
||||
>
|
||||
<PortalToFollowElemTrigger onClick={() => {
|
||||
setOpen(v => !v)
|
||||
open && onClose()
|
||||
if (open)
|
||||
onClose()
|
||||
}}>
|
||||
<Button variant='primary'>
|
||||
<RiAddLine className='mr-1 h-4 w-4' />
|
||||
|
||||
@@ -81,9 +81,12 @@ const RunPanel: FC<RunProps> = ({
|
||||
|
||||
const switchTab = async (tab: string) => {
|
||||
setCurrentTab(tab)
|
||||
if (tab === 'RESULT')
|
||||
runDetailUrl && await getResult()
|
||||
tracingListUrl && await getTracingList()
|
||||
if (tab === 'RESULT') {
|
||||
if (runDetailUrl)
|
||||
await getResult()
|
||||
}
|
||||
if (tracingListUrl)
|
||||
await getTracingList()
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { useNodeLoopInteractions } from './hooks'
|
||||
|
||||
const Node: FC<NodeProps<LoopNodeType>> = ({
|
||||
id,
|
||||
data,
|
||||
data: _data,
|
||||
}) => {
|
||||
const { zoom } = useViewport()
|
||||
const nodesInitialized = useNodesInitialized()
|
||||
|
||||
Reference in New Issue
Block a user