US579 commented on code in PR #30888:
URL: https://github.com/apache/superset/pull/30888#discussion_r1944498662
##########
superset-frontend/src/features/alerts/AlertReportModal.tsx:
##########
@@ -826,11 +826,19 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
})
.then(response => {
const { tab_tree: tabTree, all_tabs: allTabs } =
response.json.result;
- tabTree.push({
- title: 'All Tabs',
- // select tree only works with string value
- value: JSON.stringify(Object.keys(allTabs)),
- });
+ const allTabsWithOrder = tabTree.map(
+ (tab: { value: string }) => tab.value,
+ );
+
+ // Only show all tabs when there are more than one tab
+ if (allTabsWithOrder.length > 1) {
+ tabTree.push({
+ title: 'All Tabs',
+ // select tree only works with string value
+ value: JSON.stringify(allTabsWithOrder),
+ });
+ }
Review Comment:
this will not affect pdf generation, just dropdown UI
when there is only one tab, the all tab option will not be showed up
--
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]