feat(draftworkflow): improve workflow error displaying (#16572)#16757
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the draft workflow “Publish” UX so that when the workflow definition is invalid, users can click “Publish” to get validation feedback as a Filigran-style toaster (Snackbar/Alert) instead of relying on a non-matching panel/tooltip UI.
Changes:
- Make the “Publish” button clickable even when validation errors exist, and show a toaster on click instead of blocking via a disabled button.
- Add a custom toaster content component that groups workflow validation errors by type and renders details (message + optional affected entities).
- Update unit tests to reflect the new clickable behavior and assert click handling.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/Workflow.tsx | Triggers MESSAGING$.notifyError(...) with a React toast content component when publish is clicked while validation errors exist. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/PublishButton.tsx | Changes the “has validation errors” publish button from disabled-with-tooltip to clickable-with-tooltip, delegating error display to the click handler. |
| opencti-platform/opencti-front/src/private/components/settings/sub_types/workflow/PublishButton.test.tsx | Updates expectations for the red state to be enabled and adds a click test for the new behavior. |
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (7.69%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #16757 +/- ##
========================================
Coverage 24.09% 24.09%
========================================
Files 3271 3271
Lines 173266 173357 +91
Branches 42956 43104 +148
========================================
+ Hits 41744 41768 +24
- Misses 131522 131589 +67
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Proposed changes
Related issues
How to test this PR
Checklist