GitHub user dosubot[bot] added a comment to the discussion: superset 6
<!-- Answer --> The pivoted excel/csv download options are **not appearing** for your custom plugin because Superset uses a **hardcoded array check** based on the `viz_type` string, not plugin registration. The [`VIZ_TYPES_PIVOTABLE` array](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx#L72) only contains `'pivot_table_v2'`: ```javascript const VIZ_TYPES_PIVOTABLE = [VizType.PivotTable]; ``` Your `'smsrc-custom-pivot'` plugin isn't in this array, so the UI doesn't show the pivoted download options. **To fix this, you need to modify two files:** **1. Explore View** - Edit `superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx` [line 72](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx#L72): ```javascript const VIZ_TYPES_PIVOTABLE = [VizType.PivotTable, 'smsrc-custom-pivot']; ``` **2. Dashboard View** - Edit `superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx` [line 456](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx#L456): ```javascript const isPivotTable = slice.viz_type === VizType.PivotTable || slice.viz_type === 'smsrc-custom-pivot'; ``` After these changes, rebuild the frontend and your custom pivot plugin will have the same pivoted export options as the built-in pivot table. This allows you to keep both plugins in your project with the download functionality working for each. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=brand-link).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=great_response&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=irrelevant_answer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=incorrect_sources&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=too_verbose&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4a a1-9dbe-c3ed44d02a05?feedback_type=hallucination&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=bug_report&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-bug_report) | [Other](https://app.dosu.dev/response-feedback/5f5dd077-3d83-4aa1-9dbe-c3ed44d02a05?feedback_type=other&utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=feedback-other)</sup> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=chat-badge) [](https://cursor.com/link/prompt?text=The%20pivoted%20excel/csv%20download%20options%20are%20%2A%2Anot%20appearing%2A%2A%20for%20your%20custom%20plugin%20because%20Superset%20uses%20a%20%2A%2Ahardcoded%20array%20check%2A%2A%20based%20on%20the%20%60viz_type%60%20string%2C%20not%20plugin%20registration.%0A%0AThe%20%5B%60VIZ_TYPES_PIVOTABLE%60%20array%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx%23L72%29%20only%20contains%20%60%27pivot_table_v2%27%60%3A%0A%0A%60%60%60javascript%0Aconst%20VIZ_TYPES_PIVOTABLE%20%3D%20%5BVizType.PivotTable%5D%3B%0A%60%60%60%0A%0AYour%20%60%27smsrc-custom-pivot%27 %60%20plugin%20isn%27t%20in%20this%20array%2C%20so%20the%20UI%20doesn%27t%20show%20the%20pivoted%20download%20options.%0A%0A%2A%2ATo%20fix%20this%2C%20you%20need%20to%20modify%20two%20files%3A%2A%2A%0A%0A%2A%2A1.%20Explore%20View%2A%2A%20-%20Edit%20%60superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx%60%20%5Bline%2072%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx%23L72%29%3A%0A%0A%60%60%60javascript%0Aconst%20VIZ_TYPES_PIVOTABLE%20%3D%20%5BVizType.PivotTable%2C%20%27smsrc-custom-pivot%27%5D%3B%0A%60%60%60%0A%0A%2A%2A2.%20Dashboard%20View%2A%2A%20-%20Edit%20%60superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx%60%20%5Bline%20456%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx%23L456%29%3A%0A%0A%6 0%60%60javascript%0Aconst%20isPivotTable%20%3D%20%0A%20%20slice.viz_type%20%3D%3D%3D%20VizType.PivotTable%20%7C%7C%20%0A%20%20slice.viz_type%20%3D%3D%3D%20%27smsrc-custom-pivot%27%3B%0A%60%60%60%0A%0AAfter%20these%20changes%2C%20rebuild%20the%20frontend%20and%20your%20custom%20pivot%20plugin%20will%20have%20the%20same%20pivoted%20export%20options%20as%20the%20built-in%20pivot%20table.%20This%20allows%20you%20to%20keep%20both%20plugins%20in%20your%20project%20with%20the%20download%20functionality%20working%20for%20each.) [](https://go.dosu.dev/discord-bot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-assistant&utm_content=join-discord) [](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/discussions/38578) GitHub link: https://github.com/apache/superset/discussions/38578#discussioncomment-16082259 ---- This is an automatically sent email for [email protected]. To unsubscribe, please send an email to: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
