From ae2ba4d102dae6375e3a35e1d2179ff83b26aa48 Mon Sep 17 00:00:00 2001 From: Vlada Gazizova Date: Wed, 15 Jan 2025 09:45:14 +0300 Subject: [PATCH] Fixed Bug 69929 - SDK. The drop-down list for creating PDF forms disappears when the frame width is 1000px --- .../client/src/store/ContextOptionsStore.js | 34 ++++++++----------- .../components/context-menu/ContextMenu.tsx | 8 +++-- .../context-menu/ContextMenu.types.ts | 1 + .../navigation/sub-components/PlusBtn.tsx | 4 +++ 4 files changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index 162938ab664..7ec4dea206e 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -87,11 +87,7 @@ import { isMobile, isMobileOnly, isTablet } from "react-device-detect"; import config from "PACKAGE_FILE"; import { toastr } from "@docspace/shared/components/toast"; import { combineUrl } from "@docspace/shared/utils/combineUrl"; -import { - isDesktop, - isLockedSharedRoom, - trimSeparator, -} from "@docspace/shared/utils"; +import { isLockedSharedRoom, trimSeparator } from "@docspace/shared/utils"; import { getDefaultAccessUser } from "@docspace/shared/utils/getDefaultAccessUser"; import { copyShareLink } from "@docspace/shared/utils/copy"; import { @@ -2573,21 +2569,19 @@ class ContextOptionsStore { }); } - const formActions = isDesktop() - ? [ - { - id: "personal_form-template", - icon: FormReactSvgUrl, - label: t("Translations:NewForm"), - key: "new-form-base", - items: [ - createTemplateForm, - createTemplateNewFormFile, - templateOformsGallery, - ], - }, - ] - : [createTemplateForm, createTemplateNewFormFile, templateOformsGallery]; + const formActions = [ + { + id: "personal_form-template", + icon: FormReactSvgUrl, + label: t("Translations:NewForm"), + key: "new-form-base", + items: [ + createTemplateForm, + createTemplateNewFormFile, + templateOformsGallery, + ], + }, + ]; const showUploadFolder = !(isMobile || isTablet); const options = isRoomsFolder diff --git a/packages/shared/components/context-menu/ContextMenu.tsx b/packages/shared/components/context-menu/ContextMenu.tsx index 693d741561f..e0cd7f3902e 100644 --- a/packages/shared/components/context-menu/ContextMenu.tsx +++ b/packages/shared/components/context-menu/ContextMenu.tsx @@ -108,6 +108,7 @@ const ContextMenu = React.forwardRef( withBackdrop, model: propsModel, badgeUrl, + headerOnlyMobile = false, } = props; const onMenuClick = () => { @@ -454,6 +455,7 @@ const ContextMenu = React.forwardRef( const withHeader = !!header?.title; const defaultIcon = !!header?.color; const isCoverExist = !!header?.cover; + const isHeaderMobileSubMenu = headerOnlyMobile && showMobileMenu; return ( ( articleWidth={articleWidth} isRoom={isRoom} fillIcon={fillIcon} - isIconExist={isIconExist} + isIconExist={isIconExist || isHeaderMobileSubMenu} data-testid="context-menu" isCoverExist={isCoverExist} > @@ -484,9 +486,9 @@ const ContextMenu = React.forwardRef( onClick={onMenuClick} onMouseEnter={onMenuMouseEnter} > - {changeView && withHeader && ( + {changeView && (withHeader || isHeaderMobileSubMenu) && (
- {isIconExist && + {(isIconExist || isHeaderMobileSubMenu) && (showMobileMenu ? ( ; badgeUrl?: string; + headerOnlyMobile?: boolean; } export type TContextMenuRef = { diff --git a/packages/shared/components/navigation/sub-components/PlusBtn.tsx b/packages/shared/components/navigation/sub-components/PlusBtn.tsx index 96248543938..a0b7136232e 100644 --- a/packages/shared/components/navigation/sub-components/PlusBtn.tsx +++ b/packages/shared/components/navigation/sub-components/PlusBtn.tsx @@ -31,6 +31,7 @@ import PlusReactSvgUrl from "PUBLIC_DIR/images/icons/17/plus.svg?url"; import { IconButton } from "../../icon-button"; import { ContextMenu, TContextMenuRef } from "../../context-menu"; import { IPlusButtonProps } from "../Navigation.types"; +import { isMobile } from "../../../utils"; const PlusButton = ({ className, @@ -85,6 +86,9 @@ const PlusButton = ({ scaled={false} // directionX="right" leftOffset={isFrame ? 190 : 150} + headerOnlyMobile + ignoreChangeView + withBackdrop={isMobile()} />
);