onSelect && onSelect(item)}>
+
onSelect?.(item)}>
{renderItem(item)}
))
diff --git a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
index 29da0ffc0c..291ba013f7 100644
--- a/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
+++ b/web/app/components/header/account-setting/model-provider-page/provider-added-card/model-load-balancing-configs.tsx
@@ -49,7 +49,7 @@ const ModelLoadBalancingConfigs = ({
provider,
model,
configurationMethod,
- currentCustomConfigurationModelFixedFields,
+ currentCustomConfigurationModelFixedFields: _currentCustomConfigurationModelFixedFields,
withSwitch = false,
className,
modelCredential,
diff --git a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
index 3c79acb653..10c28507f7 100644
--- a/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/app-selector/app-picker.tsx
@@ -33,7 +33,7 @@ type Props = {
}
const AppPicker: FC
= ({
- scope,
+ scope: _scope,
disabled,
trigger,
placement = 'right-start',
@@ -90,7 +90,7 @@ const AppPicker: FC = ({
}
// Set up MutationObserver to watch DOM changes
- mutationObserver = new MutationObserver((mutations) => {
+ mutationObserver = new MutationObserver((_mutations) => {
if (observerTarget.current) {
setupIntersectionObserver()
mutationObserver?.disconnect()
diff --git a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
index fb4c99e1e4..873f187e8f 100644
--- a/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
+++ b/web/app/components/plugins/plugin-detail-panel/model-selector/index.tsx
@@ -148,7 +148,7 @@ const ModelParameterModal: FC = ({
})
}
}
- catch (e) {
+ catch {
Toast.notify({ type: 'error', message: t('common.error') })
}
}
diff --git a/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts b/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts
index d5c0797c9b..376894b1bb 100644
--- a/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts
+++ b/web/app/components/rag-pipeline/components/panel/input-field/field-list/hooks.ts
@@ -51,7 +51,7 @@ export const useFieldList = ({
const handleListSortChange = useCallback((list: SortableItem[]) => {
const newInputFields = list.map((item) => {
- const { id, chosen, selected, ...filed } = item
+ const { id: _id, chosen: _chosen, selected: _selected, ...filed } = item
return filed
})
handleInputFieldsChange(newInputFields)
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/header.tsx b/web/app/components/rag-pipeline/components/panel/test-run/header.tsx
index 16291f868b..a536f66137 100644
--- a/web/app/components/rag-pipeline/components/panel/test-run/header.tsx
+++ b/web/app/components/rag-pipeline/components/panel/test-run/header.tsx
@@ -15,7 +15,8 @@ const Header = () => {
isPreparingDataSource,
setIsPreparingDataSource,
} = workflowStore.getState()
- isPreparingDataSource && setIsPreparingDataSource?.(false)
+ if (isPreparingDataSource)
+ setIsPreparingDataSource?.(false)
handleCancelDebugAndPreviewPanel()
}, [workflowStore])
diff --git a/web/app/components/rag-pipeline/hooks/use-nodes-sync-draft.ts b/web/app/components/rag-pipeline/hooks/use-nodes-sync-draft.ts
index 86e44dced7..ad757f36a7 100644
--- a/web/app/components/rag-pipeline/hooks/use-nodes-sync-draft.ts
+++ b/web/app/components/rag-pipeline/hooks/use-nodes-sync-draft.ts
@@ -104,7 +104,7 @@ export const useNodesSyncDraft = () => {
const res = await syncWorkflowDraft(postParams)
setSyncWorkflowDraftHash(res.hash)
setDraftUpdatedAt(res.updated_at)
- callback?.onSuccess && callback.onSuccess()
+ callback?.onSuccess?.()
}
catch (error: any) {
if (error && error.json && !error.bodyUsed) {
@@ -113,10 +113,10 @@ export const useNodesSyncDraft = () => {
handleRefreshWorkflowDraft()
})
}
- callback?.onError && callback.onError()
+ callback?.onError?.()
}
finally {
- callback?.onSettled && callback.onSettled()
+ callback?.onSettled?.()
}
}
}, [getPostParams, getNodesReadOnly, workflowStore, handleRefreshWorkflowDraft])
diff --git a/web/app/components/share/text-generation/index.tsx b/web/app/components/share/text-generation/index.tsx
index da5b09b065..98804c7311 100644
--- a/web/app/components/share/text-generation/index.tsx
+++ b/web/app/components/share/text-generation/index.tsx
@@ -363,7 +363,8 @@ const TextGeneration: FC = ({
(async () => {
if (!appData || !appParams)
return
- !isWorkflow && fetchSavedMessage()
+ if (!isWorkflow)
+ fetchSavedMessage()
const { app_id: appId, site: siteInfo, custom_config } = appData
setAppId(appId)
setSiteInfo(siteInfo as SiteInfo)
diff --git a/web/app/components/swr-initializer.tsx b/web/app/components/swr-initializer.tsx
index 0a873400d6..fd9432fdd8 100644
--- a/web/app/components/swr-initializer.tsx
+++ b/web/app/components/swr-initializer.tsx
@@ -62,8 +62,10 @@ const SwrInitializer = ({
return
}
if (searchParams.has('access_token') || searchParams.has('refresh_token')) {
- consoleToken && localStorage.setItem('console_token', consoleToken)
- refreshToken && localStorage.setItem('refresh_token', refreshToken)
+ if (consoleToken)
+ localStorage.setItem('console_token', consoleToken)
+ if (refreshToken)
+ localStorage.setItem('refresh_token', refreshToken)
const redirectUrl = resolvePostLoginRedirect(searchParams)
if (redirectUrl)
location.replace(redirectUrl)
diff --git a/web/app/components/workflow-app/hooks/use-nodes-sync-draft.ts b/web/app/components/workflow-app/hooks/use-nodes-sync-draft.ts
index 654977fb15..5705deb0c0 100644
--- a/web/app/components/workflow-app/hooks/use-nodes-sync-draft.ts
+++ b/web/app/components/workflow-app/hooks/use-nodes-sync-draft.ts
@@ -124,7 +124,7 @@ export const useNodesSyncDraft = () => {
const res = await syncWorkflowDraft(postParams)
setSyncWorkflowDraftHash(res.hash)
setDraftUpdatedAt(res.updated_at)
- callback?.onSuccess && callback.onSuccess()
+ callback?.onSuccess?.()
}
catch (error: any) {
if (error && error.json && !error.bodyUsed) {
@@ -133,10 +133,10 @@ export const useNodesSyncDraft = () => {
handleRefreshWorkflowDraft()
})
}
- callback?.onError && callback.onError()
+ callback?.onError?.()
}
finally {
- callback?.onSettled && callback.onSettled()
+ callback?.onSettled?.()
}
}
}, [workflowStore, getPostParams, getNodesReadOnly, handleRefreshWorkflowDraft])
diff --git a/web/app/components/workflow/block-selector/tool/tool.tsx b/web/app/components/workflow/block-selector/tool/tool.tsx
index 6004bb119a..30d3e218d2 100644
--- a/web/app/components/workflow/block-selector/tool/tool.tsx
+++ b/web/app/components/workflow/block-selector/tool/tool.tsx
@@ -73,7 +73,7 @@ const Tool: FC = ({
if (isHovering && !isAllSelected) {
return (
{
+ onClick={() => {
onSelectMultiple?.(BlockEnum.Tool, actions.filter(action => !getIsDisabled(action)).map((tool) => {
const params: Record = {}
if (tool.parameters) {
diff --git a/web/app/components/workflow/hooks/use-shortcuts.ts b/web/app/components/workflow/hooks/use-shortcuts.ts
index b2d71555d7..a744fefd50 100644
--- a/web/app/components/workflow/hooks/use-shortcuts.ts
+++ b/web/app/components/workflow/hooks/use-shortcuts.ts
@@ -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 },
diff --git a/web/app/components/workflow/hooks/use-workflow.ts b/web/app/components/workflow/hooks/use-workflow.ts
index 02a2f09d63..3f9f8106cf 100644
--- a/web/app/components/workflow/hooks/use-workflow.ts
+++ b/web/app/components/workflow/hooks/use-workflow.ts
@@ -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,
diff --git a/web/app/components/workflow/nodes/_base/components/retry/utils.ts b/web/app/components/workflow/nodes/_base/components/retry/utils.ts
index e69de29bb2..336ce12bb9 100644
--- a/web/app/components/workflow/nodes/_base/components/retry/utils.ts
+++ b/web/app/components/workflow/nodes/_base/components/retry/utils.ts
@@ -0,0 +1 @@
+export {}
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
index 273e100f8e..ba27d023e7 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-picker.tsx
@@ -407,7 +407,10 @@ const VarReferencePicker: FC = ({
{
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 = ({
onClick={() => {
if (readonly)
return
- !isConstant ? setOpen(!open) : setControlFocus(Date.now())
+ if (!isConstant)
+ setOpen(!open)
+ else
+ setControlFocus(Date.now())
}}
className='h-full grow'
>
diff --git a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
index 067dbf8652..e70cfed97c 100644
--- a/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
+++ b/web/app/components/workflow/nodes/_base/components/variable/var-reference-vars.tsx
@@ -137,7 +137,7 @@ const Item: FC = ({
const isHovering = isItemHovering || isChildrenHovering
const open = (isObj || isStructureOutput) && isHovering
useEffect(() => {
- onHovering && onHovering(isHovering)
+ onHovering?.(isHovering)
}, [isHovering])
const handleChosen = (e: React.MouseEvent) => {
e.stopPropagation()
diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/index.tsx b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/index.tsx
index 06962389c9..b26dd74714 100644
--- a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/index.tsx
+++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/index.tsx
@@ -25,12 +25,12 @@ type Props = {
} & Partial
const LastRun: FC = ({
- appId,
+ appId: _appId,
nodeId,
canSingleRun,
isRunAfterSingleRun,
updateNodeRunningStatus,
- nodeInfo,
+ nodeInfo: _nodeInfo,
runningStatus: oneStepRunRunningStatus,
onSingleRunClicked,
singleRunResult,
diff --git a/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx b/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx
index 789e24835f..99ee0d25b5 100644
--- a/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx
+++ b/web/app/components/workflow/nodes/knowledge-base/components/option-card.tsx
@@ -88,7 +88,8 @@ const OptionCard = memo(({
)}
onClick={(e) => {
e.stopPropagation()
- !readonly && enableSelect && id && onClick?.(id)
+ if (!readonly && enableSelect && id)
+ onClick?.(id)
}}
>
= ({
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))
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx
index ae72d494d1..1db31cd470 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/edit-card/index.tsx
@@ -87,8 +87,10 @@ const EditCard: FC
= ({
})
useSubscribe('fieldChangeSuccess', () => {
- isAddingNewField && setIsAddingNewField(false)
- advancedEditing && setAdvancedEditing(false)
+ if (isAddingNewField)
+ setIsAddingNewField(false)
+ if (advancedEditing)
+ setAdvancedEditing(false)
})
const emitPropertyNameChange = useCallback(() => {
diff --git a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts
index 8256a3c862..4f7e1e6f00 100644
--- a/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts
+++ b/web/app/components/workflow/nodes/llm/components/json-schema-config-modal/visual-editor/hooks.ts
@@ -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)
diff --git a/web/app/components/workflow/nodes/loop/components/condition-value.tsx b/web/app/components/workflow/nodes/loop/components/condition-value.tsx
index 922cff4a61..2f011f870a 100644
--- a/web/app/components/workflow/nodes/loop/components/condition-value.tsx
+++ b/web/app/components/workflow/nodes/loop/components/condition-value.tsx
@@ -22,7 +22,7 @@ type ConditionValueProps = {
}
const ConditionValue = ({
variableSelector,
- labelName,
+ labelName: _labelName,
operator,
value,
}: ConditionValueProps) => {
diff --git a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
index 07eb79a269..9d19b61093 100644
--- a/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
+++ b/web/app/components/workflow/panel/chat-variable-panel/components/variable-modal-trigger.tsx
@@ -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 = ({
>
{
setOpen(v => !v)
- open && onClose()
+ if (open)
+ onClose()
}}>