-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Implement contextual actions for the workflows #8814
Conversation
…extual-actions-for-the-workflows
There was a problem hiding this 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
.../src/modules/action-menu/actions/record-actions/components/RecordActionMenuEntriesSetter.tsx
Outdated
Show resolved
Hide resolved
...ules/action-menu/actions/record-actions/multiple-records/hooks/useMultipleRecordsActions.tsx
Outdated
Show resolved
Hide resolved
...ules/action-menu/actions/record-actions/multiple-records/hooks/useMultipleRecordsActions.tsx
Show resolved
Hide resolved
...n-menu/actions/record-actions/single-record/components/SingleRecordActionMenuEntrySetter.tsx
Outdated
Show resolved
Hide resolved
...n-menu/actions/record-actions/single-record/components/SingleRecordActionMenuEntrySetter.tsx
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
Outdated
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/hooks/useActiveWorkflowVersion.ts
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx
Show resolved
Hide resolved
packages/twenty-front/src/modules/workflow/hooks/useRunWorkflowVersion.tsx
Show resolved
Hide resolved
…extual-actions-for-the-workflows
…ub.com:twentyhq/twenty into implement-contextual-actions-for-the-workflows
There was a problem hiding this 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
.../src/modules/action-menu/actions/record-actions/components/RecordActionMenuEntriesSetter.tsx
Outdated
Show resolved
Hide resolved
.../src/modules/action-menu/actions/record-actions/components/RecordActionMenuEntriesSetter.tsx
Outdated
Show resolved
Hide resolved
...n-menu/actions/record-actions/single-record/components/SingleRecordActionMenuEntrySetter.tsx
Show resolved
Hide resolved
.../workflow-actions/hooks/useActivateWorkflowLastPublishedVersionWorkflowSingleRecordAction.ts
Show resolved
Hide resolved
...ions/single-record/workflow-actions/hooks/useDeactivateWorkflowWorkflowSingleRecordAction.ts
Outdated
Show resolved
Hide resolved
...rd-actions/single-record/workflow-actions/hooks/useDiscardDraftWorkflowSingleRecordAction.ts
Show resolved
Hide resolved
...s/single-record/workflow-actions/hooks/useSeeWorkflowExecutionsWorkflowSingleRecordAction.ts
Outdated
Show resolved
Hide resolved
...s/single-record/workflow-actions/hooks/useSeeWorkflowExecutionsWorkflowSingleRecordAction.ts
Outdated
Show resolved
Hide resolved
...rd-actions/single-record/workflow-actions/hooks/useTestWorkflowWorkflowSingleRecordAction.ts
Outdated
Show resolved
Hide resolved
.../src/modules/action-menu/actions/record-actions/components/RecordActionMenuEntriesSetter.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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]>
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
Implemented the following actions for the workflows:
And the following actions for the workflow versions:
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.