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

Implement contextual actions for the workflows #8814

Merged
merged 51 commits into from
Dec 3, 2024

Conversation

bosiraphael
Copy link
Contributor

@bosiraphael bosiraphael commented Nov 29, 2024

Implemented the following actions for the workflows:

  • Test Workflow
  • Discard Draft
  • Activate Draft
  • Activate Workflow Last Published Version
  • Deactivate Workflow
  • See Workflow Executions
  • See Workflow Active Version
  • See Workflow Versions History

And the following actions for the workflow versions:

  • Use As Draft
  • See Workflow Versions History
  • See Workflow Executions

Video example:

Enregistrement.de.l.ecran.2024-11-29.a.16.38.20.mov

A few of these actions are links to the relations of the workflow object (link to a filtered table). To generalize this behavior, I will create an hook named useSeeRelationsActionSingleRecordAction to automatically generate links to a showPage if the relation is a Many To One or to a filtered table if the relation is a One to Many for all the record types.
I will also create actions which will allow to create a relation.

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 implements comprehensive workflow management functionality through contextual actions in the action menu system. Here's a summary of the key changes:

  • Added workflow-specific actions (test, activate/deactivate, draft management) with proper state handling and user feedback
  • Implemented workflow version management actions (use as draft, view history, executions) with navigation support
  • Created new hooks for workflow operations with proper cleanup and state management
  • Added confirmation modals for destructive actions like discarding drafts
  • Added success notifications with icons for workflow execution status

Key points to review:

  • Error handling is missing in several workflow action hooks
  • Potential race conditions in state management between workflow and version loading
  • Some hooks have inconsistent logic in onClick handlers (e.g., deactivate workflow)
  • No loading states implemented for async operations
  • Position parameters could benefit from centralized constants instead of hardcoded values

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

Copy link
Contributor

@martmull martmull left a comment

Choose a reason for hiding this comment

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

Very nice, some comments

Copy link
Contributor

@martmull martmull left a comment

Choose a reason for hiding this comment

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

LGTM

@bosiraphael bosiraphael merged commit 32194a8 into main Dec 3, 2024
19 checks passed
@bosiraphael bosiraphael deleted the implement-contextual-actions-for-the-workflows branch December 3, 2024 11:09
mdrazak2001 pushed a commit to mdrazak2001/twenty that referenced this pull request Dec 4, 2024
Implemented the following actions for the workflows:
- Test Workflow
- Discard Draft
- Activate Draft
- Activate Workflow Last Published Version
- Deactivate Workflow
- See Workflow Executions
- See Workflow Active Version
- See Workflow Versions History

And the following actions for the workflow versions:
- Use As Draft
- See Workflow Versions History
- See Workflow Executions

Video example:


https://github.com/user-attachments/assets/016956a6-6f2e-4de5-9605-d6e14526cbb3

A few of these actions are links to the relations of the workflow object
(link to a filtered table). To generalize this behavior, I will create
an hook named `useSeeRelationsActionSingleRecordAction` to automatically
generate links to a showPage if the relation is a Many To One or to a
filtered table if the relation is a One to Many for all the record
types.
I will also create actions which will allow to create a relation.

---------

Co-authored-by: Charles Bochet <[email protected]>
Copy link

sentry-io bot commented Dec 11, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ Error: Object metadata item not found for id e2e9bdde-68e5-455f-8459-5c34ef3b7223 /verify View Issue

Did you find this useful? React with a 👍 or 👎

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

Successfully merging this pull request may close these issues.

4 participants