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

   ### SUMMARY
   After analyzing the source code, a variable is set to `true` by default in 
the Table chart 
(`superset/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx`) 
but not in the Pivot Table 
(`superset/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx`).
 The variable in question is `allowRenderHtml` in the function `export default 
function TableChart<D extends DataRecord = DataRecord>` or `export default 
function PivotTableChart(props: PivotTableProps)`.
   
   The goal is to make this value configurable via a feature flag. Therefore, a 
new feature flag needs to be declared in the file 
`superset/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts`
 as follows:
   `AllowPivotTableHtml = 'ALLOW_PIVOT_TABLE_HTML'`.
   
   Then, retrieve this feature flag in the source code of the Pivot Table like 
this:
   `allowRenderHtml = isFeatureEnabled(FeatureFlag.AllowPivotTableHtml)`
   
   Finally, declare the new feature flag in the superset_config.py file and set 
it to true as follows:
   ```
   FEATURE_FLAGS = {
       "ALLOW_PIVOT_TABLE_HTML": True,
   }
   ```
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   ![Capture d'écran 17 12 2024 à 15 03 50 
PM](https://github.com/user-attachments/assets/13cb9e43-b87b-4d58-9aa5-d3ac838722aa)
   ![Capture d'écran 17 12 2024 à 15 04 10 
PM](https://github.com/user-attachments/assets/fa25808c-e592-4191-8823-75690e2c652f)
   
   
   ### TESTING INSTRUCTIONS
   Set the feature flag ALLOW_PIVOT_TABLE_HTML to "True" in your 
superset_config.py and look if your html is formated or not in the Pivot Table.
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [x] Required feature flags: ALLOW_PIVOT_TABLE_HTML
   - [ ] 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