Client: disabled the section context menu in index editing mode

This commit is contained in:
Dmitry Sychugov 2024-06-26 15:17:05 +05:00
parent 643b92a49f
commit ce8aebc6a4
4 changed files with 11 additions and 1 deletions

View File

@ -115,6 +115,7 @@ const PureHome = (props) => {
isPrivacyFolder,
isRecycleBinFolder,
isErrorRoomNotAvailable,
isIndexEditingMode,
primaryProgressDataPercent,
primaryProgressDataIcon,
@ -351,6 +352,7 @@ const PureHome = (props) => {
sectionProps.secondaryProgressBarIcon = secondaryProgressDataStoreIcon;
sectionProps.showSecondaryButtonAlert = secondaryProgressDataStoreAlert;
sectionProps.getContextModel = getContextModel;
sectionProps.isIndexEditingMode = isIndexEditingMode;
return (
<>
@ -439,6 +441,7 @@ export default inject(
currentTariffStatusStore,
settingsStore,
contextOptionsStore,
indexingStore,
}) => {
const { setSelectedFolder, security: folderSecurity } = selectedFolderStore;
const {
@ -605,6 +608,7 @@ export default inject(
isErrorRoomNotAvailable,
isRoomsFolder,
isArchiveFolder,
isIndexEditingMode: indexingStore.isIndexEditingMode,
disableDrag,

View File

@ -66,6 +66,7 @@ export interface SectionBodyProps {
settingsStudio: boolean;
isFormGallery?: boolean;
isDesktop?: boolean;
isIndexEditingMode?: boolean;
currentDeviceType?: DeviceType;
getContextModel?: () => ContextMenuModel[];
}
@ -144,4 +145,5 @@ export interface SectionProps {
anotherDialogOpen?: boolean;
isDesktop?: boolean;
getContextModel?: () => ContextMenuModel[];
isIndexEditingMode?: boolean;
}

View File

@ -117,6 +117,7 @@ const Section = (props: SectionProps) => {
canDisplay,
anotherDialogOpen,
getContextModel,
isIndexEditingMode,
} = props;
const [sectionSize, setSectionSize] = React.useState<{
@ -243,6 +244,7 @@ const Section = (props: SectionProps) => {
isFormGallery={isFormGallery}
currentDeviceType={currentDeviceType}
getContextModel={getContextModel}
isIndexEditingMode={isIndexEditingMode}
>
{isSectionHeaderAvailable &&
currentDeviceType === DeviceType.mobile && (

View File

@ -51,6 +51,7 @@ const SectionBody = React.memo(
isDesktop,
settingsStudio = false,
getContextModel,
isIndexEditingMode,
}: SectionBodyProps) => {
const focusRef = React.useRef<HTMLDivElement | null>(null);
const cmRef = React.useRef<null | {
@ -65,6 +66,7 @@ const SectionBody = React.memo(
const onContextMenu = React.useCallback(
(e: MouseEvent | React.MouseEvent<Element, MouseEvent>) => {
if (isIndexEditingMode) return;
const bodyElem = document.getElementsByClassName(
"section-body",
)[0] as HTMLDivElement;
@ -89,7 +91,7 @@ const SectionBody = React.memo(
setIsOpen(!isOpen);
}
},
[getContextModel, isOpen],
[getContextModel, isOpen, isIndexEditingMode],
);
const onHide = () => {