Skip to content

[Improvement-17947][ui] Improve delete confirmation to show workflow name#18029

Open
asadjan4611 wants to merge 2 commits intoapache:devfrom
asadjan4611:Feature-17947
Open

[Improvement-17947][ui] Improve delete confirmation to show workflow name#18029
asadjan4611 wants to merge 2 commits intoapache:devfrom
asadjan4611:Feature-17947

Conversation

@asadjan4611
Copy link
Contributor

Description

Enhance the workflow delete confirmation to display the workflow name and an irreversible-action warning to reduce accidental deletions.

Changes

  • dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx
    • Show workflow name inside the existing NPopconfirm
    • Display irreversibility warning in red
  • dolphinscheduler-ui/src/locales/en_US/project.ts
    • Add delete_irreversible key
  • dolphinscheduler-ui/src/locales/zh_CN/project.ts
    • Add delete_irreversible key

Why

Users couldn’t see which workflow they'd delete; adding the name and clear warning improves safety and UX for destructive actions.

How to test

  1. In UI: Project → Workflows → Definitions
  2. Click the delete (trash) icon for a workflow
  3. Verify the popconfirm shows the workflow name and the irreversibility warning
  4. Cancel closes the dialog; Confirm deletes the workflow

Related

Closes #17947

…on (apache#17947)

Show the workflow name and an irreversible-action warning inside the existing NPopconfirm to reduce accidental deletions.
@github-actions github-actions bot added the UI ui and front end related label Mar 6, 2026
@asadjan4611 asadjan4611 changed the title [IMPROVEMENT][UI] Show workflow name and irreversible warning in delete confirmation (#17947) [Improvement-17947][ui] Improve delete confirmation to show workflow name Mar 6, 2026
jieguangzhou
jieguangzhou previously approved these changes Mar 7, 2026
Copy link
Member

@jieguangzhou jieguangzhou left a comment

Choose a reason for hiding this comment

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

LGTM. This change only updates the workflow delete popconfirm copy and locale entries. No blocking issues found.

@jieguangzhou jieguangzhou added this to the 3.4.2 milestone Mar 7, 2026
@asadjan4611
Copy link
Contributor Author

Thanks for the review @jieguangzhou .
The Mergeable: milestone-label-check is still failing even though milestone 3.4.2 is set, because this workflow also requires at least one valid type label:
feature, bug, improvement, document, chore, DSIP, CI&CD, or revert.
This PR currently has ui label, but ui is not in the required label set.
Could you please add the improvement label to this PR?

Thank you!

@jieguangzhou jieguangzhou added the improvement make more easy to user or prompt friendly label Mar 8, 2026
@SbloodyS SbloodyS requested a review from Copilot March 9, 2026 02:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enhances the workflow definition delete confirmation popover to provide more context (workflow name) and a clear irreversibility warning to reduce accidental deletions.

Changes:

  • Updated the workflow definition table delete NPopconfirm content to include the workflow name and an irreversible-action warning.
  • Added a new i18n key delete_irreversible to both English and Chinese locale bundles.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
dolphinscheduler-ui/src/views/projects/workflow/definition/components/table-action.tsx Renders a richer delete confirmation message (workflow name + warning).
dolphinscheduler-ui/src/locales/en_US/project.ts Adds English translation for the irreversible delete warning.
dolphinscheduler-ui/src/locales/zh_CN/project.ts Adds Chinese translation for the irreversible delete warning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +277 to +279
{`${t('project.workflow.delete_confirm')} "${
this.row?.name || ''
}"`}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The confirmation title is built by concatenating a translated fragment (delete_confirm) with the workflow name. This is hard to localize correctly (word order/punctuation differ by language) and can read awkwardly (e.g., Delete? "name"). Consider introducing a dedicated i18n key that includes a placeholder for the name (e.g., delete_confirm_with_name) and render using that single translation.

Suggested change
{`${t('project.workflow.delete_confirm')} "${
this.row?.name || ''
}"`}
{t('project.workflow.delete_confirm_with_name', {
name: this.row?.name || ''
})}

Copilot uses AI. Check for mistakes.
Comment on lines +281 to +283
<div style={{ color: '#ff4d4f' }}>
{t('project.workflow.delete_irreversible') ||
'This action cannot be undone. The workflow and its associated data will be permanently deleted.'}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

Avoid hard-coding #ff4d4f for the warning text color. The app defines theme-specific errorColor (e.g., dark theme uses a different value), so this will look wrong in dark mode. Prefer using a theme token (CSS variable) or a Naive UI component like NText with type='error' so it adapts to the active theme.

Copilot uses AI. Check for mistakes.
Comment on lines +282 to +283
{t('project.workflow.delete_irreversible') ||
'This action cannot be undone. The workflow and its associated data will be permanently deleted.'}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

t('project.workflow.delete_irreversible') || '...' is effectively dead code: t() returns a non-empty string even when the key is missing (typically the key itself), so the hard-coded English fallback will never be used. Also, embedding a raw English sentence here bypasses i18n. Prefer relying on the i18n key only (and ensure it exists in all locale files) or handle missing keys via the i18n layer.

Suggested change
{t('project.workflow.delete_irreversible') ||
'This action cannot be undone. The workflow and its associated data will be permanently deleted.'}
{t('project.workflow.delete_irreversible')}

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

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

Labels

improvement make more easy to user or prompt friendly UI ui and front end related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

3 participants