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

Added "Select an option" as default none selector on Workflow Visualizer #7867

Conversation

AndrewHamal
Copy link
Contributor

What does this PR do?

Shows "Select an option" as a default selector on the select component for the trigger step in the workflow visualizer

Fixes #7432

Screenshot 2024-10-20 at 12 48 39 AM Screenshot 2024-10-20 at 12 48 50 AM

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

This PR adds a default 'Select an option' value to the select components in the Workflow Visualizer's trigger step.

  • Added SELECT_AN_OPTION constant in WorkflowEditTriggerForm.tsx
  • Updated options prop for both Select components to include the default option
  • Modified onChange handlers to handle empty option selection
  • Improved UX by providing a clear initial state for select fields
  • Ensures compatibility with existing workflow logic by handling undefined values

1 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

@lucasbordeau
Copy link
Contributor

@Bonapara I think we want something like No value in our select field type ?

@Bonapara
Copy link
Member

Bonapara commented Oct 21, 2024

It doesn't really make sense to have a trigger without an object, but we can use No value indeed.

@AndrewHamal
Copy link
Contributor Author

@Bonapara you mean with out anything remove "Select an option" and have empty nothing selected at first?

@Bonapara
Copy link
Member

After further thought, I think it's okay to have the empty state only when no object has been selected "Select an Option", and to only have the ability to switch between objects without the option to reset to null/select an Option when one gets selected.

@Devessier
Copy link
Contributor

Hello @AndrewHamal, I pushed an update to your code to use pre-existing solutions I didn't know about when I created the issue. You will get the OSS points. Thanks for your contribution.

@Devessier Devessier force-pushed the fix/empty-default-value-to-workflow-visualizer branch from b25fb3c to e5a514d Compare October 24, 2024 08:34
@Devessier Devessier self-requested a review October 24, 2024 08:54
Copy link
Contributor

@Devessier Devessier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge.

@Devessier Devessier merged commit 1f84e61 into twentyhq:main Oct 24, 2024
16 checks passed
Copy link

oss-gg bot commented Oct 24, 2024

Awarding AndrewHamal: 150 points 🕹️ Well done! Check out your new contribution on oss.gg/AndrewHamal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an empty default value to the select components for trigger step in workflow visualizer
4 participants