Compare commits
3 Commits
master
...
feature/re
Author | SHA1 | Date | |
---|---|---|---|
|
e2df5f2816 | ||
|
e20bf63ca2 | ||
|
18cc3b357e |
4
packages/client/public/locales/en/RestoreDialog.json
Normal file
4
packages/client/public/locales/en/RestoreDialog.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"ConfirmationRestoreFile": "Are you sure you want to restore this file?",
|
||||
"ConfirmationRestoreMultipleFiles": "You are about to restore these items to their original location. Are you sure you want to continue?"
|
||||
}
|
@ -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 { RestoreDialog } from "../dialogs/RestoreDialog";
|
||||
|
||||
const Panels = (props) => {
|
||||
const {
|
||||
@ -130,6 +131,7 @@ const Panels = (props) => {
|
||||
shareFolderDialogVisible,
|
||||
pdfFormEditVisible,
|
||||
selectFileFormRoomOpenRoot,
|
||||
restoreDialogVisible,
|
||||
} = props;
|
||||
|
||||
const [createPDFFormFile, setCreatePDFFormFile] = useState({
|
||||
@ -317,6 +319,7 @@ const Panels = (props) => {
|
||||
/>
|
||||
),
|
||||
pdfFormEditVisible && <PDFFormEditingDialog key="pdf-form-edit-dialog" />,
|
||||
restoreDialogVisible && <RestoreDialog key="restore-dialog" />,
|
||||
];
|
||||
};
|
||||
|
||||
@ -377,6 +380,7 @@ export default inject(
|
||||
shareFolderDialogVisible,
|
||||
pdfFormEditVisible,
|
||||
selectFileFormRoomOpenRoot,
|
||||
restoreDialogVisible,
|
||||
} = dialogsStore;
|
||||
|
||||
const { preparationPortalDialogVisible } = backup;
|
||||
@ -393,6 +397,7 @@ export default inject(
|
||||
} = pluginStore;
|
||||
|
||||
return {
|
||||
restoreDialogVisible,
|
||||
preparationPortalDialogVisible,
|
||||
uploadPanelVisible,
|
||||
ownerPanelVisible,
|
||||
|
@ -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, { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { observer, inject } from "mobx-react";
|
||||
|
||||
import {
|
||||
ModalDialog,
|
||||
ModalDialogType,
|
||||
} from "@docspace/shared/components/modal-dialog";
|
||||
import { Button, ButtonSize } from "@docspace/shared/components/button";
|
||||
import { RestoreDialogProps } from "./RestoreDialog.types";
|
||||
|
||||
export const RestoreDialog = inject<TStore>(({ dialogsStore, filesStore }) => {
|
||||
const { setRestoreDialogVisible } = dialogsStore;
|
||||
|
||||
const { selection, bufferSelection } = filesStore;
|
||||
|
||||
const items = selection.length > 0 ? selection : [bufferSelection];
|
||||
|
||||
return { setRestoreDialogVisible, items };
|
||||
})(
|
||||
observer(({ setRestoreDialogVisible, items }: RestoreDialogProps) => {
|
||||
const { t } = useTranslation(["RestoreDialog", "Common"]);
|
||||
|
||||
const onClose = () => {
|
||||
setRestoreDialogVisible?.(false);
|
||||
};
|
||||
|
||||
const onSubmit = () => {
|
||||
// TODO!
|
||||
onClose();
|
||||
};
|
||||
|
||||
const description = useMemo(
|
||||
() =>
|
||||
t(
|
||||
items.length > 1
|
||||
? "RestoreDialog:ConfirmationRestoreMultipleFiles"
|
||||
: "RestoreDialog:ConfirmationRestoreFile",
|
||||
),
|
||||
[items.length, t],
|
||||
);
|
||||
|
||||
return (
|
||||
<ModalDialog
|
||||
visible
|
||||
autoMaxHeight
|
||||
onClose={onClose}
|
||||
displayType={ModalDialogType.modal}
|
||||
>
|
||||
<ModalDialog.Header>{t("Common:Restore")}</ModalDialog.Header>
|
||||
<ModalDialog.Body>{description}</ModalDialog.Body>
|
||||
<ModalDialog.Footer>
|
||||
<Button
|
||||
scale
|
||||
primary
|
||||
tabIndex={0}
|
||||
size={ButtonSize.normal}
|
||||
label={t("Common:Restore")}
|
||||
onClick={onSubmit}
|
||||
/>
|
||||
<Button
|
||||
scale
|
||||
tabIndex={0}
|
||||
onClick={onClose}
|
||||
size={ButtonSize.normal}
|
||||
label={t("Common:Cancel")}
|
||||
/>
|
||||
</ModalDialog.Footer>
|
||||
</ModalDialog>
|
||||
);
|
||||
}),
|
||||
);
|
@ -0,0 +1,32 @@
|
||||
// (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
|
||||
|
||||
import type { TFile } from "@docspace/shared/api/files/types";
|
||||
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
export interface RestoreDialogProps
|
||||
extends Partial<Pick<TStore["dialogsStore"], "setRestoreDialogVisible">> {
|
||||
items: TFile[];
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
// (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
|
||||
export { RestoreDialog } from "./RestoreDialog";
|
@ -304,8 +304,10 @@ class ContextOptionsStore {
|
||||
onRestoreAction = () => {
|
||||
const { setIsMobileHidden } = this.infoPanelStore;
|
||||
setIsMobileHidden(true);
|
||||
console.log("Click");
|
||||
this.dialogsStore.setRestorePanelVisible(true);
|
||||
|
||||
this.dialogsStore.setRestoreDialogVisible(true);
|
||||
|
||||
// this.dialogsStore.setRestorePanelVisible(true);
|
||||
};
|
||||
|
||||
onCopyAction = () => {
|
||||
|
@ -119,6 +119,8 @@ class DialogsStore {
|
||||
selectFileFormRoomFilterParam = FilesSelectorFilterTypes.DOCX;
|
||||
selectFileFormRoomOpenRoot = false;
|
||||
|
||||
restoreDialogVisible = false;
|
||||
|
||||
constructor(
|
||||
authStore,
|
||||
treeFoldersStore,
|
||||
@ -521,6 +523,10 @@ class DialogsStore {
|
||||
this.pdfFormEditVisible = visible;
|
||||
this.pdfFormEditData = data;
|
||||
};
|
||||
|
||||
setRestoreDialogVisible = (visible) => {
|
||||
this.restoreDialogVisible = visible;
|
||||
};
|
||||
}
|
||||
|
||||
export default DialogsStore;
|
||||
|
Loading…
Reference in New Issue
Block a user