feat: add tab select with save chart to dashboard
User description
SUMMARY
Users can now select a specific tab when saving a chart to a dashboard. This allows for more precise control over chart placement in complex dashboards with multiple tabs.
Add the ability to select a tab in the chart save modal window when placing it on a dashboard:
- Load and display available tabs when an existing dashboard is selected
- Allow users to choose a specific tab for the new chart
- Automatically position the chart on the selected tab
Added TreeSelect from Ant Design for tab selection
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
run test src/explore/components/SaveModal.test.jsx
ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [x] Changes UI
- [ ] Includes DB Migration (follow approval process in SIP-59)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
CodeAnt-AI Description
Let users pick a dashboard tab when saving a chart
What Changed
- When using "Save as..." and choosing a dashboard, a tab selector appears so the chart can be assigned to a specific tab
- Newly saved charts are added directly onto the selected dashboard tab; if this fails, the chart is still saved and a warning is shown
- When redirecting to the dashboard after saving, the page now opens on the chosen tab instead of the default tab
Impact
✅ Easier chart placement on multi-tab dashboards
✅ Quicker access to newly saved charts
✅ Clearer feedback when tab placement fails
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
@codeant-ai ask: Your question here
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
@codeant-ai ask: Can you suggest a safer alternative to storing this secret?
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
@codeant-ai: Your feedback here
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
@codeant-ai: Do not flag unused imports.
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
@codeant-ai: review
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
⚠️ DEPRECATED WORKFLOW ⚠️
@SBIN2010 This workflow is deprecated! Please use the new Superset Showtime system instead:
- Replace "testenv-up" label with "🎪 trigger-start"
- Better reliability and easier management
- See https://github.com/mistercrunch/superset-showtime for details
Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments
@SBIN2010 Ephemeral environment spinning up at http://34.221.129.14:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
I LOVE THIS FEATURE!
Lots of copilot suggestions... I committed a couple of the "no-brainer" ones on your behalf, but I'm curious what you think of the rest.
CodeAnt AI is reviewing your PR.
Nitpicks 🔍
| 🔒 No security issues identified |
⚡ Recommended areas for review
|
CodeAnt AI finished reviewing your PR.
🎪 Showtime deployed environment on GHA for 8642a16
• Environment: http://44.250.241.142:8080 (admin/admin) • Lifetime: 48h auto-cleanup • Updates: New commits create fresh environments automatically
⚠️ DEPRECATED WORKFLOW ⚠️
@EnxDev This workflow is deprecated! Please use the new Superset Showtime system instead:
- Replace "testenv-up" label with "🎪 trigger-start"
- Better reliability and easier management
- See https://github.com/mistercrunch/superset-showtime for details
Processing your ephemeral environment request here. Action: up. More information on how to use or configure ephemeral environments
@EnxDev Ephemeral environment spinning up at http://54.213.160.155:8080. Credentials are 'admin'/'admin'. Please allow several minutes for bootstrapping and startup.
CodeAnt AI is running Incremental review
- In this case, the chart is already saved inside the Sales Dashboard. When I try to save it, the “Add to tabs” field is still disabled. To enable it, I have to select another dashboard and then come back to the Sales Dashboard.
I just noticed this myself. And I've already fixed it.🤝
- In this case, the chart is already saved inside the Sales Dashboard. When I try to save it, the “Add to tabs” field is still disabled. To enable it, I have to select another dashboard and then come back to the Sales Dashboard.
I just noticed this myself. And I've already fixed it.🤝
Okay, I'm currently testing on your branch with the latest changes pushed, and I’m seeing the same behavior I described earlier. You probably still have some changes to push if you’ve already fixed it.
I'm also wondering whether we should place the new chart in the same row as the last one if there’s available space, instead of creating a new row; @SBIN2010 what do you think about that?
@SBIN2010 this is the current behavior after my changes
Probably we should set the first tab as a default value inside "Add to tabs" field
https://github.com/user-attachments/assets/40d9b7d4-d295-4608-90f4-39b4daeb37ea
CodeAnt AI is running Incremental review
CodeAnt AI is running Incremental review
CodeAnt AI is running Incremental review
CodeAnt AI is running Incremental review
Hey @SBIN2010 how about this?
should we add "Out of tab" property as a default insted of the first tab?
CodeAnt AI is running Incremental review
Hey @SBIN2010 how about this?
should we add
"Out of tab"property as a default insted of the first tab?
I added the 'Out of tab' option, but only for those cases where tabs are not pages and all tabs are placed on the first page.