()
@@ -58,6 +57,7 @@ const VariableModal = ({
return notify({ type: 'error', message: 'value can not be empty' })
// Add check for duplicate name when editing
+ const envList = workflowStore.getState().environmentVariables
if (env && env.name !== name && envList.some(e => e.name === name))
return notify({ type: 'error', message: 'name is existed' })
// Original check for create new variable
@@ -78,10 +78,11 @@ const VariableModal = ({
if (env) {
setType(env.value_type)
setName(env.name)
+ const envSecrets = workflowStore.getState().envSecrets
setValue(env.value_type === 'secret' ? envSecrets[env.id] : env.value)
setDescription(env.description)
}
- }, [env, envSecrets])
+ }, [env, workflowStore])
return (
({
useWorkflowStore: () => ({
getState: () => ({
deleteAllInspectVars: vi.fn(),
+ setShowWorkflowVersionHistoryPanel: vi.fn(),
+ setCurrentVersion: mockSetCurrentVersion,
}),
setState: vi.fn(),
}),
diff --git a/web/eslint-suppressions.json b/web/eslint-suppressions.json
index 5ffd2b8772..86b7095f2b 100644
--- a/web/eslint-suppressions.json
+++ b/web/eslint-suppressions.json
@@ -518,7 +518,7 @@
},
"app/components/app/configuration/prompt-value-panel/index.spec.tsx": {
"ts/no-explicit-any": {
- "count": 3
+ "count": 2
}
},
"app/components/app/configuration/prompt-value-panel/utils.ts": {
@@ -619,11 +619,6 @@
"count": 1
}
},
- "app/components/app/switch-app-modal/index.spec.tsx": {
- "ts/no-explicit-any": {
- "count": 1
- }
- },
"app/components/app/switch-app-modal/index.tsx": {
"react-hooks-extra/no-direct-set-state-in-use-effect": {
"count": 1
@@ -675,7 +670,7 @@
},
"app/components/apps/list.spec.tsx": {
"ts/no-explicit-any": {
- "count": 9
+ "count": 5
}
},
"app/components/apps/list.tsx": {