feat(dashboard): add duplicate widget option#1503
Open
okxint wants to merge 2 commits intolmnr-ai:devfrom
Open
feat(dashboard): add duplicate widget option#1503okxint wants to merge 2 commits intolmnr-ai:devfrom
okxint wants to merge 2 commits intolmnr-ai:devfrom
Conversation
Member
|
@okxint thanks for your contribution! Please do the following:
|
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Adds a "Duplicate" option to the chart dropdown menu between "Edit" and "Delete". Clicking it creates a new chart with the same query, config, and a " (copy)" suffix on the name. The new chart is placed at the default position and the dashboard revalidates via SWR. Closes lmnr-ai#1498
31814ca to
47fe02b
Compare
Author
|
Rebased onto the latest CLA is signed. Will add a screenshot of the duplicate option in the dropdown menu shortly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
POST /api/projects/:projectId/dashboard-chartsendpoint to create a copy with the same query, config, and a " (copy)" suffix on the nameChanges
chart-header.tsx: Accept fullchartprop instead of justname/id, addCopyicon import, addhandleDuplicateChartcallback and "Duplicate" menu itemchart.tsx: Passchartobject toChartHeaderCloses #1498
Note
Low Risk
Low risk UI change that adds a new dashboard action calling an existing create-chart endpoint; main risk is cache consistency/optimistic update behavior and handling of API failures.
Overview
Adds a Duplicate action to the dashboard chart header menu, creating a new chart via
POST /api/projects/:projectId/dashboard-chartswith the samequeryandsettings.configand a" (copy)"name suffix, and updating the SWR cache (with revalidation) plus error toast on failure.Refactors
ChartHeaderto accept the fullchartobject (instead ofid/name) and updateschart.tsxto pass that object through.Written by Cursor Bugbot for commit 47fe02b. This will update automatically on new commits. Configure here.