DamianPendrak opened a new pull request, #30821:
URL: https://github.com/apache/superset/pull/30821

   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   Fixes [#30370](https://github.com/apache/superset/issues/30370)
   
   ### SUMMARY
   The `createAxisTitleControl` and `createAxisControl` functions use the 
`visibility` prop to hide controls. This caused an issue where controls with 
duplicate names were stashed from the form data if one of them had `visibility` 
set to `false` and was rendered later than the visible one.
   
   #### Solution
   To resolve this, I introduced a new prop `disableStash`, to the `Control` 
component, which prevents stashing for the control where it is applied.
   Additionally, I set the `resetOnHide` prop to `false` to prevent the axis 
titles from disappearing on the chart when changing the orientation.
   
   #### Hidden prop bug
   Initially, I considered replacing `visibility` with a `hidden` prop in the 
Bar chart controls. However, this approach led to issues with refreshing hidden 
control values and I decided to keep the `visibility` prop for a less invasive 
change.
   While working with the `hidden` prop, I discovered a bug where 
`{...restProps}` overwrote the `hidden` prop's intended value, so `() => false` 
value was hiding the control. I plan to address this in a separate issue. The 
first commit reflects this initial approach, but I reverted it in the following 
commit to keep this PR focused on the `visibility` prop and `disableStash` 
solution.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   #### Before
   
https://github.com/user-attachments/assets/79d349fd-d86d-4320-be88-9b74e3ce7e76
   
   #### After
   
https://github.com/user-attachments/assets/51013344-3e61-474a-9795-312c8f5f51fa
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   1. Open an existing bar chart in Superset or create a new one.
   2. Enter the edit mode for the chart.
   3. Change the X-axis title and/or margin to a new value.
   4. Switch between horizontal and vertical orientation and edit values again
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: 
[#30370](https://github.com/apache/superset/issues/30370)
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to