fix(web): change http body key name#888
Merged
shuqinzhao merged 1 commit intorelease/v0.3.0from Apr 14, 2026
Merged
Conversation
Contributor
审阅者指南(在小型 PR 上折叠)审阅者指南在可编辑表格 UI 和工作流图配置转换逻辑中,将 HTTP 请求 body 字段标识符从 HTTP Header 键/值编辑流程的时序图sequenceDiagram
actor User
participant EditableTable
participant Form
participant useWorkflowGraph
participant WorkflowConfig
User->>EditableTable: Edit HTTP header key and value
EditableTable->>Form: Bind inputs to fields [index, key] and [index, value]
User->>Form: Submit HTTP request node configuration
Form->>useWorkflowGraph: Submit config with headers as array of { key, value }
useWorkflowGraph->>WorkflowConfig: Transform array to object using vo.key as property name
WorkflowConfig-->>useWorkflowGraph: Persisted config.headers as object { key: value }
useWorkflowGraph-->>EditableTable: When loading, map Object.entries(headers) to array of { key, value }
EditableTable-->>User: Display header rows with key and value columns
HTTP Header 项与配置转换的类图classDiagram
class HeaderItem {
+string key
+string value
}
class HttpRequestConfigObject {
+Record~string,string~ headers
+Record~string,string~ params
}
class HttpRequestConfigArray {
+HeaderItem[] headers
+HeaderItem[] params
}
class NodeLibraryConfigEntry {
+any defaultValue
}
class NodeLibraryConfig {
+NodeLibraryConfigEntry headers
+NodeLibraryConfigEntry params
}
class UseWorkflowGraph {
+toArrayConfig(configObject HttpRequestConfigObject) HttpRequestConfigArray
+toObjectConfig(configArray HttpRequestConfigArray) HttpRequestConfigObject
}
UseWorkflowGraph --> HttpRequestConfigObject : reads and writes
UseWorkflowGraph --> HttpRequestConfigArray : reads and writes
NodeLibraryConfigEntry o-- HttpRequestConfigArray : defaultValue uses HeaderItem[]
HttpRequestConfigArray "1" o-- "*" HeaderItem : contains
HttpRequestConfigObject ..> HeaderItem : keys correspond to HeaderItem.key values
文件级变更
提示与命令与 Sourcery 交互
自定义你的体验访问你的 控制面板 以:
获取帮助Original review guide in EnglishReviewer's guide (collapsed on small PRs)Reviewer's GuideRenames the HTTP request body field identifier from Sequence diagram for HTTP header key/value editing flowsequenceDiagram
actor User
participant EditableTable
participant Form
participant useWorkflowGraph
participant WorkflowConfig
User->>EditableTable: Edit HTTP header key and value
EditableTable->>Form: Bind inputs to fields [index, key] and [index, value]
User->>Form: Submit HTTP request node configuration
Form->>useWorkflowGraph: Submit config with headers as array of { key, value }
useWorkflowGraph->>WorkflowConfig: Transform array to object using vo.key as property name
WorkflowConfig-->>useWorkflowGraph: Persisted config.headers as object { key: value }
useWorkflowGraph-->>EditableTable: When loading, map Object.entries(headers) to array of { key, value }
EditableTable-->>User: Display header rows with key and value columns
Class diagram for HTTP header item and config transformationclassDiagram
class HeaderItem {
+string key
+string value
}
class HttpRequestConfigObject {
+Record~string,string~ headers
+Record~string,string~ params
}
class HttpRequestConfigArray {
+HeaderItem[] headers
+HeaderItem[] params
}
class NodeLibraryConfigEntry {
+any defaultValue
}
class NodeLibraryConfig {
+NodeLibraryConfigEntry headers
+NodeLibraryConfigEntry params
}
class UseWorkflowGraph {
+toArrayConfig(configObject HttpRequestConfigObject) HttpRequestConfigArray
+toObjectConfig(configArray HttpRequestConfigArray) HttpRequestConfigObject
}
UseWorkflowGraph --> HttpRequestConfigObject : reads and writes
UseWorkflowGraph --> HttpRequestConfigArray : reads and writes
NodeLibraryConfigEntry o-- HttpRequestConfigArray : defaultValue uses HeaderItem[]
HttpRequestConfigArray "1" o-- "*" HeaderItem : contains
HttpRequestConfigObject ..> HeaderItem : keys correspond to HeaderItem.key values
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - 我在这里给出了一些高层次的反馈:
- 在
useWorkflowGraph中,headers/params分支里的map(([key, value]) => ({ key, value }))会遮蔽外层作用域中的key变量,这可能会让人困惑;建议重命名内部解构出来的key(例如改为[entryKey, value])。 - 在构建
itemConfig[key]时访问vo.key和vo.value的地方,建议为这些表格行定义并使用一个带类型的接口,而不是使用any,以保证新key属性的使用是类型安全的。
给 AI Agent 的提示
Please address the comments from this code review:
## Overall Comments
- In `useWorkflowGraph`, the `map(([key, value]) => ({ key, value }))` within the `headers/params` branch shadows the outer `key` variable from the enclosing scope, which can be confusing; consider renaming the inner destructured `key` (e.g., `[entryKey, value]`).
- Where you access `vo.key` and `vo.value` when building `itemConfig[key]`, consider defining and using a typed interface for these table rows instead of `any` to make the new `key` property usage type-safe.帮我变得更有用!请对每条评论点 👍 或 👎,我会根据你的反馈改进后续的代码审查。
Original comment in English
Hey - I've left some high level feedback:
- In
useWorkflowGraph, themap(([key, value]) => ({ key, value }))within theheaders/paramsbranch shadows the outerkeyvariable from the enclosing scope, which can be confusing; consider renaming the inner destructuredkey(e.g.,[entryKey, value]). - Where you access
vo.keyandvo.valuewhen buildingitemConfig[key], consider defining and using a typed interface for these table rows instead ofanyto make the newkeyproperty usage type-safe.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `useWorkflowGraph`, the `map(([key, value]) => ({ key, value }))` within the `headers/params` branch shadows the outer `key` variable from the enclosing scope, which can be confusing; consider renaming the inner destructured `key` (e.g., `[entryKey, value]`).
- Where you access `vo.key` and `vo.value` when building `itemConfig[key]`, consider defining and using a typed interface for these table rows instead of `any` to make the new `key` property usage type-safe.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
使 HTTP 请求配置处理方式与更新后的请求条目键名保持一致。
Bug Fixes:
name改为使用key。key属性。Original summary in English
Summary by Sourcery
Align HTTP request configuration handling with updated key naming for request entries.
Bug Fixes: