overleaf/services
M Fahru 0648b8aa6c Implement deleted file restore for history react (#12753)
* Add strikethrough to deleted file tree item in history file tree

* Add "restore file" button on toolbar if the selected file have a `removed` operation.

* Implement "restore file" functionality on removed file:

- Refactor the `Selection` object in history context value since we need the `deletedAtV` data which currently is not passed through the state.
- Refactor and clean up file tree type system to support passing through the whole `FileDiff` object for getting the `deletedAtV` data which only appear on `removed` operation
- Implement `postJSON` with file restoration API and pass it on restore file onClick handler at toolbar

* Implement loading behaviour while restoring file is inflight:

- Add `loadingRestoreFile` to `LoadingState`
- Change restore file button to `Restoring...` when in loading state.

* Refactor:

- Rename `DiffOperation` to `FileOperation`
- Extract `isFileRemoved` and `isFileRenamed` to its own file
- Extract `Toolbar` components into small files

GitOrigin-RevId: 2e32ebd2165f73fc6533ff282a9c084162efd682
2023-04-28 08:04:59 +00:00
..
chat Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
clsi Merge pull request #12824 from overleaf/jpa-clsi-pipe 2023-04-28 08:04:01 +00:00
contacts Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
docstore Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
document-updater
filestore Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
git-bridge Merge pull request #12671 from overleaf/em-git-bridge-delete-project 2023-04-25 08:06:30 +00:00
history-v1
notifications Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
project-history
real-time Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
spelling
track-changes Merge pull request #12723 from overleaf/jpa-revert-node-18-upgrade 2023-04-21 08:03:22 +00:00
web Implement deleted file restore for history react (#12753) 2023-04-28 08:04:59 +00:00