Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Rename Group Name in Workflow Iteration Node due to Validation Error on Last Letter Deletion #5767

Open
5 tasks done
Edison-A-N opened this issue Jun 30, 2024 · 1 comment
Labels
🌊 feat:workflow Workflow related stuff.

Comments

@Edison-A-N
Copy link

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

eab0ac3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Navigate to the Workflow Iteration node in [Specify the specific tool or environment].
  2. Attempt to rename a group name in Variable Aggregator.
  3. Delete the last letter of the group name.
  4. Observe the validation error preventing the deletion due to a non-nullable constraint.

image

✔️ Expected Behavior

Users should be able to rename group names freely within the Workflow Iteration node without encountering validation errors when deleting the last letter.

❌ Actual Behavior

No response

@dosubot dosubot bot added the 🌊 feat:workflow Workflow related stuff. label Jun 30, 2024
Copy link

dosubot bot commented Jun 30, 2024

@Edison-A-N Hello there! I'm here to help you with bug reports, answer questions, and guide you on becoming a contributor. Let me know how I can assist you while we wait for a human maintainer.

To resolve the validation error that occurs when deleting the last letter of a group name in the Workflow Iteration node's Variable Aggregator, you need to ensure that the handleVarGroupNameChange function correctly updates the group name and handles the renaming of the output variable. The function should be updated to handle the renaming process properly.

Here is the relevant code snippet that handles the group name change:

const handleVarGroupNameChange = useCallback((groupId: string) => {
  return (name: string) => {
    const index = inputs.advanced_settings.groups.findIndex(item => item.groupId === groupId)
    const newInputs = produce(inputs, (draft) => {
      draft.advanced_settings.groups[index].group_name = name
    })
    handleOutVarRenameChange(id, [id, inputs.advanced_settings.groups[index].group_name, 'output'], [id, name, 'output'])
    setInputs(newInputs)
  }
}, [handleOutVarRenameChange, id, inputs, setInputs])

This function finds the group by groupId, updates the group name, and then calls handleOutVarRenameChange to update the output variable name accordingly. This should resolve the validation error when deleting the last letter of a group name [1].

To continue talking to Dosu, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌊 feat:workflow Workflow related stuff.
Projects
None yet
Development

No branches or pull requests

1 participant