Skip to content

fix(dataset): disable duplicate button when name is empty#42217

Open
suvankardas216 wants to merge 1 commit into
apache:masterfrom
suvankardas216:fix-duplicate-button-disabled
Open

fix(dataset): disable duplicate button when name is empty#42217
suvankardas216 wants to merge 1 commit into
apache:masterfrom
suvankardas216:fix-duplicate-button-disabled

Conversation

@suvankardas216

Copy link
Copy Markdown

Fixes #40405

Summary

This PR fixes an issue where the Duplicate button is enabled when the Duplicate Dataset modal is first opened, even though the dataset name is empty.

Root Cause

disableSave was initialized to false, and the modal's useEffect reset the dataset name but did not reset the disabled state. As a result, the Duplicate button could remain enabled with an empty input.

Changes

  • Initialize disableSave to true
  • Reset disableSave inside useEffect whenever the modal opens
  • Add a regression test to verify the Duplicate button is disabled on initial render

Testing

Executed:

npm test -- src/features/datasets/DuplicateDatasetModal.test.tsx

Result:

  • Test Suites: 1 passed
  • Tests: 10 passed

@dosubot dosubot Bot added change:frontend Requires changing the frontend data:dataset Related to dataset configurations labels Jul 19, 2026
@bito-code-review

bito-code-review Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #be40f2

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 099345d..099345d
    • superset-frontend/src/features/datasets/DuplicateDatasetModal.test.tsx
    • superset-frontend/src/features/datasets/DuplicateDatasetModal.tsx
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.19%. Comparing base (42a2aed) to head (099345d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42217   +/-   ##
=======================================
  Coverage   65.19%   65.19%           
=======================================
  Files        2768     2768           
  Lines      156081   156082    +1     
  Branches    35719    35719           
=======================================
+ Hits       101754   101755    +1     
  Misses      52365    52365           
  Partials     1962     1962           
Flag Coverage Δ
javascript 70.83% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rusackas rusackas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @suvankardas216, LGTM!

One thing worth a look: onPressEnter still fires onDuplicate unconditionally, so hitting Enter in the empty field bypasses the disabled button. Same bug through a different door. Happy to see it fixed here or in a follow-up, though this does seem like a good time to handle it ;)

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

Labels

change:frontend Requires changing the frontend data:dataset Related to dataset configurations size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] DuplicateDatasetModal: "Duplicate" button is enabled on initial render with empty name field

2 participants