Repository navigation
fix: workflow variable aggregation node keyname validate - #8217
Conversation
| :rules="{ whitespace: true, required: true, message: t('workflow.variableAggregation.key.requiredMessage'), trigger: 'blur' }" | ||
| > | ||
| <el-input v-model="item.key" :placeholder="t('workflow.variableAggregation.key.placeholder')" maxlength="256" /> | ||
| </el-form-item> |
There was a problem hiding this comment.
Review of the diff
This diff removes a per-item validation rule for key from an <el-form-item> inside a nested v-for loop. Everything else in the snippet is unchanged.
Potential issues
-
Likely behavioral regression (validation removed)
The removed rule was{ whitespace: true, required: true, message: ..., trigger: 'blur' }. Unless this rule was moved to another place (e.g., added dynamically viasetRules, a parent-level array of rules, or handled by a custom validator), thekeyfield will no longer be validated at all. This is the most important thing to verify. -
Dynamic prop path + rules removed
The:prop="\group_list.${gIndex}.variable_list.${vIndex}.key`"` is still there, so the form model path is intact — but without rules it's effectively a no-op (unless validation is driven elsewhere). -
Loss of
whitespace: true
Even ifrequiredis enforced elsewhere, droppingwhitespace: truemeans a key consisting only of spaces could pass. If whitespace-only keys are invalid, this check must be preserved somewhere. -
No new source of truth shown in the diff
If the intent was to centralize/refactor validation logic, the corresponding change is not visible here. Please confirm one of:- Rules were added at the
<el-form :rules="...">level (with matching dynamic property names), or - A validator function now handles this field, or
- A
formData-level validation runs before submit.
- Rules were added at the
-
Localized message reference removed
Thet('workflow.variableAggregation.key.requiredMessage')string may now be orphaned (unused i18n key). Consider cleaning it up — or verify it's reused elsewhere in the codebase. -
Test coverage
Confirm that e2e/unit tests cover "empty key" and "whitespace-only key" cases; otherwise this regression may go unnoticed.
Suggestion
If the goal was to remove the inline rule, ensure the same constraints (required + whitespace) are enforced through a single authoritative mechanism, e.g.:
const rules = computed(() => ({
// ...
}));
// or a custom validator on the el-formand add a test asserting that an empty/whitespace key blocks submission.
Bottom line: The change is not obviously broken syntactically, but it silently drops required/whitespace validation on variable_list[*].key. Verify that validation is still enforced elsewhere before merging.
【【智能体】变量聚合节点的group中键名设置为不填了,这不应该是必填项】
https://www.tapd.cn/tapd_fe/45245355/bug/detail/1145245355001080694