mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
This commit is contained in:
parent
f2523b26fa
commit
d0305445b2
@ -114,12 +114,12 @@ export const useExploreAdditionalActionsMenu = (
|
|||||||
onOpenPropertiesModal,
|
onOpenPropertiesModal,
|
||||||
ownState,
|
ownState,
|
||||||
dashboards,
|
dashboards,
|
||||||
|
...rest
|
||||||
) => {
|
) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { addDangerToast, addSuccessToast } = useToasts();
|
const { addDangerToast, addSuccessToast } = useToasts();
|
||||||
const [showReportSubMenu, setShowReportSubMenu] = useState(null);
|
const [showReportSubMenu, setShowReportSubMenu] = useState(null);
|
||||||
const [isDropdownVisible, setIsDropdownVisible] = useState(false);
|
const [isDropdownVisible, setIsDropdownVisible] = useState(false);
|
||||||
const [openSubmenus, setOpenSubmenus] = useState([]);
|
|
||||||
const chart = useSelector(
|
const chart = useSelector(
|
||||||
state => state.charts?.[getChartKey(state.explore)],
|
state => state.charts?.[getChartKey(state.explore)],
|
||||||
);
|
);
|
||||||
@ -204,23 +204,19 @@ export const useExploreAdditionalActionsMenu = (
|
|||||||
case MENU_KEYS.EXPORT_TO_CSV:
|
case MENU_KEYS.EXPORT_TO_CSV:
|
||||||
exportCSV();
|
exportCSV();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.EXPORT_TO_CSV_PIVOTED:
|
case MENU_KEYS.EXPORT_TO_CSV_PIVOTED:
|
||||||
exportCSVPivoted();
|
exportCSVPivoted();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.EXPORT_TO_JSON:
|
case MENU_KEYS.EXPORT_TO_JSON:
|
||||||
exportJson();
|
exportJson();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.EXPORT_TO_XLSX:
|
case MENU_KEYS.EXPORT_TO_XLSX:
|
||||||
exportExcel();
|
exportExcel();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.DOWNLOAD_AS_IMAGE:
|
case MENU_KEYS.DOWNLOAD_AS_IMAGE:
|
||||||
downloadAsImage(
|
downloadAsImage(
|
||||||
@ -230,21 +226,17 @@ export const useExploreAdditionalActionsMenu = (
|
|||||||
true,
|
true,
|
||||||
)(domEvent);
|
)(domEvent);
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.COPY_PERMALINK:
|
case MENU_KEYS.COPY_PERMALINK:
|
||||||
copyLink();
|
copyLink();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.EMBED_CODE:
|
case MENU_KEYS.EMBED_CODE:
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.SHARE_BY_EMAIL:
|
case MENU_KEYS.SHARE_BY_EMAIL:
|
||||||
shareByEmail();
|
shareByEmail();
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
setOpenSubmenus([]);
|
|
||||||
break;
|
break;
|
||||||
case MENU_KEYS.VIEW_QUERY:
|
case MENU_KEYS.VIEW_QUERY:
|
||||||
setIsDropdownVisible(false);
|
setIsDropdownVisible(false);
|
||||||
@ -272,12 +264,7 @@ export const useExploreAdditionalActionsMenu = (
|
|||||||
|
|
||||||
const menu = useMemo(
|
const menu = useMemo(
|
||||||
() => (
|
() => (
|
||||||
<Menu
|
<Menu onClick={handleMenuClick} selectable={false} {...rest}>
|
||||||
onClick={handleMenuClick}
|
|
||||||
selectable={false}
|
|
||||||
openKeys={openSubmenus}
|
|
||||||
onOpenChange={setOpenSubmenus}
|
|
||||||
>
|
|
||||||
<>
|
<>
|
||||||
{slice && (
|
{slice && (
|
||||||
<Menu.Item key={MENU_KEYS.EDIT_PROPERTIES}>
|
<Menu.Item key={MENU_KEYS.EDIT_PROPERTIES}>
|
||||||
@ -423,7 +410,6 @@ export const useExploreAdditionalActionsMenu = (
|
|||||||
handleMenuClick,
|
handleMenuClick,
|
||||||
isDropdownVisible,
|
isDropdownVisible,
|
||||||
latestQueryFormData,
|
latestQueryFormData,
|
||||||
openSubmenus,
|
|
||||||
showReportSubMenu,
|
showReportSubMenu,
|
||||||
slice,
|
slice,
|
||||||
theme.gridUnit,
|
theme.gridUnit,
|
||||||
|
@ -114,6 +114,7 @@ export default function HeaderReportDropDown({
|
|||||||
setShowReportSubMenu,
|
setShowReportSubMenu,
|
||||||
setIsDropdownVisible,
|
setIsDropdownVisible,
|
||||||
isDropdownVisible,
|
isDropdownVisible,
|
||||||
|
...rest
|
||||||
}: HeaderReportProps) {
|
}: HeaderReportProps) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const report = useSelector<any, AlertObject>(state => {
|
const report = useSelector<any, AlertObject>(state => {
|
||||||
@ -214,7 +215,7 @@ export default function HeaderReportDropDown({
|
|||||||
|
|
||||||
const textMenu = () =>
|
const textMenu = () =>
|
||||||
isEmpty(report) ? (
|
isEmpty(report) ? (
|
||||||
<Menu selectable={false} css={onMenuHover}>
|
<Menu selectable={false} {...rest} css={onMenuHover}>
|
||||||
<Menu.Item onClick={handleShowMenu}>
|
<Menu.Item onClick={handleShowMenu}>
|
||||||
{DropdownItemExtension ? (
|
{DropdownItemExtension ? (
|
||||||
<StyledDropdownItemWithIcon>
|
<StyledDropdownItemWithIcon>
|
||||||
|
Loading…
Reference in New Issue
Block a user