dolphinscheduler icon indicating copy to clipboard operation
dolphinscheduler copied to clipboard

[Improvement][UI] Add confirmation dialog before deleting workflow definitions to prevent accidental deletions

Open asadjan4611 opened this issue 9 months ago • 11 comments

Search before asking

  • [x] I had searched in the issues and found no similar feature requirement.

Description

Current Problem

When deleting workflow definitions in DolphinScheduler, the current confirmation dialog (NPopconfirm) is minimal and doesn't provide sufficient context to prevent accidental deletions. While there is a basic confirmation dialog, it lacks:

  1. Workflow name display: Users cannot see which specific workflow they are about to delete
  2. Irreversibility warning: No clear indication that the deletion is permanent (unless version history exists)
  3. Enhanced confirmation: The current dialog may not be prominent enough for critical operations

This creates a risk of accidental data loss, especially when:

  • Users are working quickly and may click without reading
  • Multiple workflows are visible and users might delete the wrong one
  • UI lag causes unintended double-clicks
  • Users are managing many workflows and lose track of which one they selected

Proposed Improvement

Enhance the delete confirmation dialog to include:

  1. Workflow identification: Display the workflow name prominently in the confirmation message (e.g., "Are you sure you want to delete workflow 'My Important Workflow'?")

  2. Clear warning message: Add a warning about the action being irreversible, with information about recovery options if available (e.g., "This action cannot be undone. The workflow will be permanently deleted.")

  3. Enhanced visual design: Make the confirmation dialog more prominent with:

    • Warning icon or color scheme
    • Clear distinction between "Cancel" and "Delete" buttons
    • Possibly require typing the workflow name for critical workflows (optional enhancement)
  4. Consistency: Ensure the same enhanced confirmation pattern is applied to:

    • Single workflow deletion
    • Batch workflow deletion (if applicable)
    • All workflow-related delete operations

Benefits

  • Prevents accidental deletions: Users will have clear context about what they're deleting
  • Improves user confidence: Users can safely manage workflows without fear of mistakes
  • Follows UX best practices: Aligns with modern web application patterns for destructive actions
  • Reduces support burden: Fewer requests for workflow recovery
  • Better enterprise readiness: Critical for production environments where workflows represent important business processes

Implementation Approach

  1. Enhance the existing NPopconfirm component in table-action.tsx to include workflow name in the confirmation message
  2. Update the confirmation text to include irreversibility warning
  3. Consider using a more prominent modal dialog (n-modal) for critical deletions
  4. Ensure consistent implementation across all delete operations
  5. Update i18n translations for the enhanced messages

Related Code Locations

  • dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx (line 276-297)
  • dolphinscheduler-ui/src/views/projects/workflow/definition/use-table.ts (deleteWorkflow function)
  • dolphinscheduler-ui/src/components/modal/index.tsx (if using custom modal)

Example Implementation

The confirmation dialog should display something like:

⚠️ Delete Workflow

Are you sure you want to delete the workflow "My Important Workflow"?

This action cannot be undone. The workflow and all its associated data will be permanently deleted.

[Cancel]  [Delete Workflow]

Note: This improvement follows the same pattern as other confirmation dialogs in the codebase (like the release/offline confirmation) but enhances them with better context and warnings for destructive operations.


Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

asadjan4611 avatar Feb 04 '26 09:02 asadjan4611

I think we don't need this since we've already have a mechanism to delete two confirmations.

SbloodyS avatar Feb 06 '26 01:02 SbloodyS

I think we don't need this since we've already have a mechanism to delete two confirmations.

But from a user point of view, I was thinking that showing the workflow name in the confirmation dialog could help avoid confusion and prevent accidental deletions, especially when many workflows are listed together.

Please correct me if I’m wrong.

iampratap7997-dot avatar Feb 06 '26 15:02 iampratap7997-dot

@SbloodyS Thanks for the feedback.

I understand there are already two confirmation steps. My proposal is a small UX improvement on top of that: include the workflow name in the confirm content (e.g., “Delete ‘xxx’?”) so users can verify they picked the right one when many rows are shown.

If you still feel it’s unnecessary, I’m happy to close the issue. Otherwise I can submit a small PR limited to i18n + the confirm text only (no behavior change).

asadjan4611 avatar Feb 16 '26 08:02 asadjan4611

But from a user point of view, I was thinking that showing the workflow name in the confirmation dialog could help avoid confusion and prevent accidental deletions, especially when many workflows are listed together.

Please correct me if I’m wrong.

Yes. Showing workflow name in the confirmation dialog is a better approach.

SbloodyS avatar Mar 02 '26 07:03 SbloodyS

I’d like to work on this issue if it’s not assigned. Also, tell me if i should provide translations separately in both English and Chinese, or is it acceptable to use the English text in both the locale files?

iampratap7997-dot avatar Mar 02 '26 13:03 iampratap7997-dot

@SbloodyS okay can you please assign this issue to me? I wanna to work on it.

asadjan4611 avatar Mar 02 '26 14:03 asadjan4611

I’ve actually prepared a PR that adds the workflow name to the confirmation dialog (i18n + UI text only).

If @asadjan4611 would still like to work on this issue, I’m completely fine with that. I can either submit my PR or we can coordinate — whatever the maintainers prefer.

iampratap7997-dot avatar Mar 02 '26 14:03 iampratap7997-dot

Sorry @iampratap7997-dot, I already created a solution when I first raised this issue. At this point, I only need to update my solution. @SbloodyS, the rest is up to you.

asadjan4611 avatar Mar 02 '26 14:03 asadjan4611

Thanks for clarifying. I’ll leave it to you. If any other changes or help are needed, I’d be happy to help.

iampratap7997-dot avatar Mar 02 '26 14:03 iampratap7997-dot

okay Thanks @iampratap7997-dot , if any need i'll take help from you

asadjan4611 avatar Mar 02 '26 14:03 asadjan4611

I've assigned to you. @asadjan4611

SbloodyS avatar Mar 05 '26 06:03 SbloodyS