Skip to content

Commit

Permalink
Fixed Bug 69929 - SDK. The drop-down list for creating PDF forms disa…
Browse files Browse the repository at this point in the history
…ppears when the frame width is 1000px
  • Loading branch information
gazizova-vlada committed Jan 15, 2025
1 parent 75798eb commit ae2ba4d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
34 changes: 14 additions & 20 deletions packages/client/src/store/ContextOptionsStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions packages/shared/components/context-menu/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ const ContextMenu = React.forwardRef<ContextMenuRefType, ContextMenuProps>(
withBackdrop,
model: propsModel,
badgeUrl,
headerOnlyMobile = false,
} = props;

const onMenuClick = () => {
Expand Down Expand Up @@ -454,14 +455,15 @@ const ContextMenu = React.forwardRef<ContextMenuRefType, ContextMenuProps>(
const withHeader = !!header?.title;
const defaultIcon = !!header?.color;
const isCoverExist = !!header?.cover;
const isHeaderMobileSubMenu = headerOnlyMobile && showMobileMenu;

return (
<StyledContextMenu
changeView={changeView}
articleWidth={articleWidth}
isRoom={isRoom}
fillIcon={fillIcon}
isIconExist={isIconExist}
isIconExist={isIconExist || isHeaderMobileSubMenu}
data-testid="context-menu"
isCoverExist={isCoverExist}
>
Expand All @@ -484,9 +486,9 @@ const ContextMenu = React.forwardRef<ContextMenuRefType, ContextMenuProps>(
onClick={onMenuClick}
onMouseEnter={onMenuMouseEnter}
>
{changeView && withHeader && (
{changeView && (withHeader || isHeaderMobileSubMenu) && (
<div className="contextmenu-header">
{isIconExist &&
{(isIconExist || isHeaderMobileSubMenu) &&
(showMobileMenu ? (
<IconButton
className="edit_icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export interface ContextMenuProps {
isArchive?: boolean;
ref?: React.RefObject<HTMLDivElement>;
badgeUrl?: string;
headerOnlyMobile?: boolean;
}

export type TContextMenuRef = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -85,6 +86,9 @@ const PlusButton = ({
scaled={false}
// directionX="right"
leftOffset={isFrame ? 190 : 150}
headerOnlyMobile
ignoreChangeView
withBackdrop={isMobile()}
/>
</div>
);
Expand Down

0 comments on commit ae2ba4d

Please sign in to comment.