Client: created ReorderIndexDialog
This commit is contained in:
parent
8a8ed799fb
commit
ff514b79d3
@ -76,6 +76,7 @@ import LeaveRoomDialog from "../dialogs/LeaveRoomDialog";
|
||||
import ChangeRoomOwnerPanel from "../panels/ChangeRoomOwnerPanel";
|
||||
import { CreatedPDFFormDialog } from "../dialogs/CreatedPDFFormDialog";
|
||||
import { PDFFormEditingDialog } from "../dialogs/PDFFormEditingDialog";
|
||||
import ReorderIndexDialog from "../dialogs/ReorderIndexDialog";
|
||||
|
||||
const Panels = (props) => {
|
||||
const {
|
||||
@ -130,6 +131,7 @@ const Panels = (props) => {
|
||||
shareFolderDialogVisible,
|
||||
pdfFormEditVisible,
|
||||
selectFileFormRoomOpenRoot,
|
||||
reorderDialogVisible,
|
||||
} = props;
|
||||
|
||||
const [createPDFFormFile, setCreatePDFFormFile] = useState({
|
||||
@ -310,6 +312,7 @@ const Panels = (props) => {
|
||||
<ChangeRoomOwnerPanel key="change-room-owner" />
|
||||
),
|
||||
shareFolderDialogVisible && <ShareFolderDialog key="share-folder-dialog" />,
|
||||
reorderDialogVisible && <ReorderIndexDialog key="reorder-index-dialog" />,
|
||||
createPDFFormFile.visible && (
|
||||
<CreatedPDFFormDialog
|
||||
key="created-pdf-form-dialog"
|
||||
@ -377,6 +380,7 @@ export default inject(
|
||||
shareFolderDialogVisible,
|
||||
pdfFormEditVisible,
|
||||
selectFileFormRoomOpenRoot,
|
||||
reorderDialogVisible,
|
||||
} = dialogsStore;
|
||||
|
||||
const { preparationPortalDialogVisible } = backup;
|
||||
@ -444,6 +448,7 @@ export default inject(
|
||||
shareFolderDialogVisible,
|
||||
pdfFormEditVisible,
|
||||
selectFileFormRoomOpenRoot,
|
||||
reorderDialogVisible,
|
||||
};
|
||||
},
|
||||
)(observer(Panels));
|
||||
|
@ -0,0 +1,97 @@
|
||||
// (c) Copyright Ascensio System SIA 2009-2024
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
import React from "react";
|
||||
import { inject, observer } from "mobx-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { ModalDialog } from "@docspace/shared/components/modal-dialog";
|
||||
import { Text } from "@docspace/shared/components/text";
|
||||
import { Button } from "@docspace/shared/components/button";
|
||||
import { isMobile } from "react-device-detect";
|
||||
|
||||
const ReorderIndexDialog = ({
|
||||
visible,
|
||||
setIsVisible,
|
||||
reorder,
|
||||
selectedFolder,
|
||||
}) => {
|
||||
const { t, ready } = useTranslation(["Files", "Common"]);
|
||||
|
||||
const onClose = () => {
|
||||
setIsVisible(false);
|
||||
};
|
||||
|
||||
const onReorder = () => {
|
||||
reorder(selectedFolder?.id);
|
||||
setIsVisible(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalDialog isLarge isLoading={!ready} visible={visible} onClose={onClose}>
|
||||
<ModalDialog.Header>{t("Common:Warning")}</ModalDialog.Header>
|
||||
<ModalDialog.Body>
|
||||
<Text fontSize="13px" fontWeight={400} noSelect>
|
||||
{t("Files:ReorderIndex")}
|
||||
</Text>
|
||||
</ModalDialog.Body>
|
||||
<ModalDialog.Footer>
|
||||
<Button
|
||||
id="create-room"
|
||||
key="OkButton"
|
||||
label={t("Files:Reorder")}
|
||||
size="normal"
|
||||
primary
|
||||
onClick={onReorder}
|
||||
scale={isMobile}
|
||||
/>
|
||||
<Button
|
||||
id="cancel-share-folder"
|
||||
key="CancelButton"
|
||||
label={t("Common:CancelButton")}
|
||||
size="normal"
|
||||
onClick={onClose}
|
||||
scale={isMobile}
|
||||
/>
|
||||
</ModalDialog.Footer>
|
||||
</ModalDialog>
|
||||
);
|
||||
};
|
||||
|
||||
export default inject(
|
||||
({ dialogsStore, filesActionsStore, selectedFolderStore }) => {
|
||||
const { reorderDialogVisible, setReorderDialogVisible } = dialogsStore;
|
||||
const selectedFolder = selectedFolderStore.getSelectedFolder();
|
||||
const { reorder } = filesActionsStore;
|
||||
|
||||
return {
|
||||
visible: reorderDialogVisible,
|
||||
setIsVisible: setReorderDialogVisible,
|
||||
reorder,
|
||||
selectedFolder,
|
||||
};
|
||||
},
|
||||
)(observer(ReorderIndexDialog));
|
@ -232,6 +232,7 @@ const SectionHeaderContent = (props) => {
|
||||
setRestoreAllPanelVisible,
|
||||
isGracePeriod,
|
||||
setInviteUsersWarningDialogVisible,
|
||||
setReorderDialogVisible,
|
||||
setRestoreAllArchive,
|
||||
setRestoreRoomDialogVisible,
|
||||
onCopyLink,
|
||||
@ -854,8 +855,7 @@ const SectionHeaderContent = (props) => {
|
||||
const tableIndexHeaderProps = {
|
||||
setIsIndexEditingMode,
|
||||
t,
|
||||
reorder,
|
||||
selectedFolder,
|
||||
setReorderDialogVisible,
|
||||
};
|
||||
|
||||
if (isAccountsPage && !(isGroupsPage && isRoomAdmin)) {
|
||||
@ -952,7 +952,9 @@ const SectionHeaderContent = (props) => {
|
||||
<Consumer key="header">
|
||||
{(context) => (
|
||||
<StyledContainer isRecycleBinFolder={isRecycleBinFolder}>
|
||||
{isMobile && isIndexEditingMode && <TableIndexHeader {...tableIndexHeaderProps} />}
|
||||
{isMobile && isIndexEditingMode && (
|
||||
<TableIndexHeader {...tableIndexHeaderProps} />
|
||||
)}
|
||||
{tableGroupMenuVisible ? (
|
||||
<TableGroupMenu {...tableGroupMenuProps} withComboBox />
|
||||
) : isIndexEditingMode && !isMobile ? (
|
||||
@ -1125,6 +1127,7 @@ export default inject(
|
||||
setLeaveRoomDialogVisible,
|
||||
setSelectFileFormRoomDialogVisible,
|
||||
setShareFolderDialogVisible,
|
||||
setReorderDialogVisible,
|
||||
} = dialogsStore;
|
||||
|
||||
const {
|
||||
@ -1295,6 +1298,7 @@ export default inject(
|
||||
setSharingPanelVisible,
|
||||
setMoveToPanelVisible,
|
||||
setCopyPanelVisible,
|
||||
setReorderDialogVisible,
|
||||
setBufferSelection,
|
||||
setIsFolderActions,
|
||||
deleteAction,
|
||||
|
@ -33,8 +33,7 @@ import { StyledTableIndexMenu } from "./StyledIndexHeader";
|
||||
const TableIndexHeader = ({
|
||||
setIsIndexEditingMode,
|
||||
t,
|
||||
reorder,
|
||||
selectedFolder,
|
||||
setReorderDialogVisible,
|
||||
}) => {
|
||||
return (
|
||||
<StyledTableIndexMenu>
|
||||
@ -46,7 +45,7 @@ const TableIndexHeader = ({
|
||||
<div className="table-header_index-separator" />
|
||||
<div
|
||||
className="table-header_reorder-container"
|
||||
onClick={() => reorder(selectedFolder?.id)}
|
||||
onClick={() => setReorderDialogVisible(true)}
|
||||
>
|
||||
<IconButton
|
||||
className="table-header_reorder-icon"
|
||||
@ -57,7 +56,7 @@ const TableIndexHeader = ({
|
||||
isClickable={false}
|
||||
/>
|
||||
<Text fontSize="12px" lineHeight="16px" fontWeight={600}>
|
||||
{t("Common:Reorder")}
|
||||
{t("Files:Reorder")}
|
||||
</Text>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,6 +43,7 @@ class DialogsStore {
|
||||
ownerPanelVisible = false;
|
||||
moveToPanelVisible = false;
|
||||
restorePanelVisible = false;
|
||||
reorderDialogVisible = false;
|
||||
copyPanelVisible = false;
|
||||
deleteThirdPartyDialogVisible = false;
|
||||
connectDialogVisible = false;
|
||||
@ -521,6 +522,10 @@ class DialogsStore {
|
||||
this.pdfFormEditVisible = visible;
|
||||
this.pdfFormEditData = data;
|
||||
};
|
||||
|
||||
setReorderDialogVisible = (visible) => {
|
||||
this.reorderDialogVisible = visible;
|
||||
};
|
||||
}
|
||||
|
||||
export default DialogsStore;
|
||||
|
Loading…
Reference in New Issue
Block a user