fix: correct graph_enabled logic in process configuration

- Updated the logic for `graph_enabled` in `UploadConfirmDialog.vue` to require both `nodeExtractConfig.enabled` and `graphEnabled` to be true.
- Added a new test case in `knowledge_process_config_test.go` to ensure that `GraphEnabled` is false when `ExtractConfig.Enabled` is false.
- Adjusted the `ResolveProcessConfig` function to reflect the updated dependency between graph and extract configurations, ensuring proper behavior in the process configuration resolution.
This commit is contained in:
wizardchen
2026-06-09 18:29:22 +08:00
committed by lyingbug
parent ed9e780c8c
commit 76dc23226d
3 changed files with 20 additions and 5 deletions
@@ -43,6 +43,19 @@ func TestResolveProcessConfig_GraphDisabled(t *testing.T) {
require.False(t, eff.GraphEnabled)
}
func TestResolveProcessConfig_GraphRequiresExtractEnabled(t *testing.T) {
t.Parallel()
kb := testKBWithGraphEnabled(true)
overrides := &types.KnowledgeProcessOverrides{
GraphEnabled: processConfigBoolPtr(true),
ExtractConfig: &types.ExtractConfig{Enabled: false},
}
eff := ResolveProcessConfig(kb, overrides)
require.False(t, eff.ExtractConfig.Enabled)
require.False(t, eff.GraphEnabled)
}
func TestResolveProcessConfig_NilOverridesUsesKBDefaults(t *testing.T) {
t.Parallel()
@@ -155,7 +168,8 @@ func TestResolveProcessConfig_ExtractConfigFieldMerge(t *testing.T) {
}
overrides := &types.KnowledgeProcessOverrides{
ExtractConfig: &types.ExtractConfig{
Tags: []string{"override-tag"},
Enabled: true,
Tags: []string{"override-tag"},
},
}
eff := ResolveProcessConfig(kb, overrides)