Skip to content

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

Merged
rusackas merged 2 commits into
apache:masterfrom
suvankardas216:fix-duplicate-button-disabled
Jul 24, 2026
Merged

rusackas merged 2 commits into
apache:masterfrom
suvankardas216:fix-duplicate-button-disabled

Conversation

@suvankardas216

Copy link
Copy Markdown
Contributor

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 [email protected].

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 (bd59f00).
⚠️ Report is 130 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42217   +/-   ##
=======================================
  Coverage   65.19%   65.19%           
=======================================
  Files        2768     2768           
  Lines      156081   156084    +3     
  Branches    35719    35720    +1     
=======================================
+ Hits       101754   101757    +3     
  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 ;)

@rusackas

Copy link
Copy Markdown
Member

Happy to push a commit to fix that last part if you don't mind me doing so.

onPressEnter fired onDuplicate unconditionally, so hitting Enter in the
empty name field bypassed the disabled Duplicate button. Guard the
handler on the same disabled state and add a regression test.

Co-Authored-By: Claude Fable 5 <[email protected]>
@pull-request-size pull-request-size Bot added size/M and removed size/S labels Jul 24, 2026
@rusackas

Copy link
Copy Markdown
Member

Went ahead and pushed that Enter-key guard (plus a regression test) to keep this moving... hope you don't mind! CI 🤞

@netlify

netlify Bot commented Jul 24, 2026

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit bd59f00
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a62f363074b920008fbf8f6
😎 Deploy Preview https://deploy-preview-42217--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@rusackas
rusackas merged commit a1142b0 into apache:master Jul 24, 2026
74 checks passed
@bito-code-review

Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

niteshpurohit added a commit to HiMamaInc/superset that referenced this pull request Jul 24, 2026
* refactor(mcp): dedupe list-tool schemas and delete dead middleware (apache#41923)

* fix(ag-grid-table): respect row limit with server pagination (apache#41346)

Co-authored-by: Claude Opus 4.8 <[email protected]>

* feat(table/pivot-table): correct non-additive totals/subtotals via DB rollup [SIP-216] (apache#41184)

Co-authored-by: Superset Dev <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Amin Ghadersohi <[email protected]>

* feat(datasets): add RLS filter indicator badge to dataset list and explore view (apache#38807)

Co-authored-by: Evan <[email protected]>

* fix(chart): updates counties of kenya map (apache#38019)

Co-authored-by: Zack Adams <[email protected]>
Co-authored-by: Claude Sonnet 4.6 <[email protected]>
Co-authored-by: Evan <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>

* chore(deps): bump actions/setup-go from 6.5.0 to 7.0.0 (apache#42303)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump nanoid from 5.0.9 to 6.0.0 in /superset-frontend (apache#42230)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: hainenber <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <[email protected]>
Co-authored-by: Joe Li <[email protected]>
Co-authored-by: Evan <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>

* test(dashboard): migrate dashboard load smoke test to Playwright (apache#41432)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>

* fix(superset_app_root): when used with oauth (apache#38033)

Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

* refactor: engine enforce SQLAlchemy 2.0 (apache#42277)

* fix(ag-grid-table): avoid ambiguous build query import (apache#42313)

* fix: Revert "chore(deps): bump echarts from 5.6.0 to 6.1.0 in /superset-frontend" (apache#42314)

Co-authored-by: Claude Opus 4.8 <[email protected]>

* adding circleci config

* fix(plugin-chart-echarts): import the -obj locale build so time axes render (apache#42317)

Co-authored-by: Claude Opus 4.8 <[email protected]>

* fix(pandas_postprocessing): avoid FutureWarning for max/min in boxplot MINMAX (apache#42272)

* fix(heatmap): correct tooltip axis value lookup and percentage calculations and add tests (apache#41864)

Signed-off-by: yousoph <[email protected]>
Co-authored-by: Kamil Gabryjelski <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>

* fix(forecast): resolve time grain robustly for Prophet forecasting (apache#42145)

Co-authored-by: Claude Opus 4.8 <[email protected]>

* fix: Added PostgreSQL 17.X to the supported database versions table in (apache#42280)

* fix(helm): add MCP HTTPRoute configuration (apache#42219)

* fix(dashboard): offer Exit edit mode when there is nothing to discard (apache#42208)

Co-authored-by: Claude Code <[email protected]>

* chore(deps): bump actions/labeler from 6.2.0 to 7.0.0 (apache#42332)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/analyze from 4.37.0 to 4.37.1 (apache#42331)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump github/codeql-action/init from 4.37.0 to 4.37.1 (apache#42334)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump @formatjs/intl-durationformat from 0.10.17 to 0.10.18 in /superset-frontend (apache#42337)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump caniuse-lite from 1.0.30001805 to 1.0.30001806 in /docs (apache#42333)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump echarts to 6.1.0 with locale and containLabel guards (apache#42315) (apache#42321)

Co-authored-by: Claude Code <[email protected]>
Co-authored-by: Amin Ghadersohi <[email protected]>

* docs: add pattern to the list of organisations using superset (apache#42341)

* chore(deps): bump ag-grid from 36.0.0 to 36.0.1 in /superset-frontend (apache#42338)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: hainenber <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <[email protected]>

* fix(mcp): trust dataset is_dttm flag when applying time_grain to VARCHAR temporal columns (apache#42288)

* chore(deps-dev): update taos-ws-py requirement from >=0.6.9 to >=0.7.0 (apache#42344)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump the storybook group in /superset-frontend with 5 updates (apache#42355)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(native-filters): keep filter value input caret at inline start (apache#42323)

Co-authored-by: Claude Opus 4.8 <[email protected]>

* fix(mcp): truncate query-tool responses instead of hard-failing (apache#42244)

* chore(deps): bump nh3 from 0.3.5 to 0.3.6 (apache#42349)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>

* chore(deps): bump pydantic from 2.11.7 to 2.13.4 (apache#42350)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>

* chore(deps): bump sqlalchemy-continuum from 1.6.0 to 1.7.0 (apache#42351)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>

* fix(embedded): stop rejecting guest chart data built from control-specific params keys (apache#42295)

Co-authored-by: Claude Code <[email protected]>

* fix(explore): show the beginning date on time-series x-axis line charts (apache#42046)

* fix(api): add example to get_export_ids_schema so Swagger "Try it out" pre-fills a valid array (apache#42265)

* chore: SQLAlchemy User cascade backref warnings are irrelevant (apache#42360)

* fix(charts): handle async (202) chart-data responses in StatefulChart (apache#42157)

Co-authored-by: Claude Sonnet 4.5 <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>

* feat(KustoKQL): Add support for NULL / IS NOT NULL operator (apache#37890)

Co-authored-by: ag-ramachandran <[email protected]>
Co-authored-by: Joe Li <[email protected]>

* chore(deps): bump pillow from 12.2.0 to 12.3.0 (apache#42348)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>

* chore(deps): bump flask-compress from 1.17 to 1.24 (apache#42346)

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>

* chore(deps-dev): bump databricks-sql-connector from 4.2.6 to 4.3.0 (apache#42347)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joe Li <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>

* fix(native-filters): use FILTER_STATE_CACHE_CONFIG timeout for dynamic filter option queries (apache#38910)

* fix(explore): render Jinja before validating legacy chart filters (apache#41996)

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

Co-authored-by: AS-MAC-1123 <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
Co-authored-by: Claude Fable 5 <[email protected]>

* docs(gunicorn): correct dead links in values.yaml (apache#42385)

* chore(deps): bump @deck.gl/mapbox from 9.3.6 to 9.3.7 in /superset-frontend in the deckgl group (apache#42377)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump actions/checkout from 7.0.0 to 7.0.1 (apache#42376)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump immer from 11.1.11 to 11.1.15 in /superset-frontend (apache#42378)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump body-parser from 1.20.5 to 1.20.6 in /docs (apache#42370)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps-dev): bump brace-expansion from 1.1.15 to 1.1.16 in /superset-embedded-sdk (apache#42369)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* fix(security): bump pyasn1 from 0.6.3 to 0.6.4 (apache#42363)

* fix(security): bump pillow from 12.2.0 to 12.3.0 (apache#42362)

* docs(map-tiles): add Yandex Maps Tiles API configuration (apache#42375)

* ci: improve conditional checks for lillio tests and build

---------

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: hainenber <[email protected]>
Signed-off-by: Grégoire Bellon-Gervais <[email protected]>
Signed-off-by: yousoph <[email protected]>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Amin Ghadersohi <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>
Co-authored-by: Superset Dev <[email protected]>
Co-authored-by: SkinnyPigeon <[email protected]>
Co-authored-by: Zack <[email protected]>
Co-authored-by: Zack Adams <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hainenber <[email protected]>
Co-authored-by: Joe Li <[email protected]>
Co-authored-by: Grégoire <[email protected]>
Co-authored-by: Hans Yu <[email protected]>
Co-authored-by: Elizabeth Thompson <[email protected]>
Co-authored-by: yousoph <[email protected]>
Co-authored-by: Kamil Gabryjelski <[email protected]>
Co-authored-by: Amitesh Gupta <[email protected]>
Co-authored-by: David <[email protected]>
Co-authored-by: Yash Shrivastava <[email protected]>
Co-authored-by: JUST.in DO IT <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: jesperct <[email protected]>
Co-authored-by: Abdul Rehman <[email protected]>
Co-authored-by: jenwitteng <[email protected]>
Co-authored-by: Ramachandran A G <[email protected]>
Co-authored-by: ag-ramachandran <[email protected]>
Co-authored-by: Ujjwal Jain <[email protected]>
Co-authored-by: Jean Massucatto <[email protected]>
Co-authored-by: suvankardas216 <[email protected]>
Co-authored-by: AS-MAC-1123 <[email protected]>
Co-authored-by: Alejandro Solares <[email protected]>
Co-authored-by: ViktorGo86 <[email protected]>
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/M

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