Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/editor history #477

Merged
merged 32 commits into from
Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6d96855
Web: Editor: Added list of history and possibility to close history.
TatianaLopaeva Aug 2, 2021
475dd92
Web: Editor: Fixed history information.
TatianaLopaeva Aug 2, 2021
feb48c0
Files: moved from feature/editor-version-history
pavelbannov Dec 8, 2021
317750f
Web: Added api methods.
TatianaLopaeva Sep 8, 2021
e3eb043
Web: Editor: Added new api method for RequestHistory method.
TatianaLopaeva Sep 8, 2021
5fa436e
Web: Editor: Fixed getting information of difference of file.
TatianaLopaeva Sep 22, 2021
c6265a9
Web: Editor: Fixed getting name and id of user for history.
TatianaLopaeva Sep 22, 2021
7fd1452
Web: Editor: Fixed current version of document.
TatianaLopaeva Sep 22, 2021
a6deb7f
Web: Editor: Fixed display of editing date.
TatianaLopaeva Sep 22, 2021
fcb4e43
Web: Editor: Removed side effect - changes of array length.
TatianaLopaeva Sep 22, 2021
a79db0f
Web: Editor: Added version to the history data.
TatianaLopaeva Sep 22, 2021
d5b2b2a
Web: Editor: Added error handler for history data.
TatianaLopaeva Sep 22, 2021
d20f833
Web: Editor: Renaming.
TatianaLopaeva Sep 22, 2021
70cc67b
Web: Editor: Refactoring.
TatianaLopaeva Sep 22, 2021
bc8a7f3
Web: Editor: Removed revisions from versions list.
TatianaLopaeva Sep 22, 2021
30bd96a
Web: Editor: Fixed opening of revisions.
TatianaLopaeva Sep 23, 2021
71aa1eb
Web: Editor: Added restore option.
TatianaLopaeva Sep 23, 2021
944591c
Web: Editor: Added error handler for history function.
TatianaLopaeva Sep 23, 2021
1983d60
Web: Editor: Moved the functionality of converting history and gettin…
TatianaLopaeva Sep 23, 2021
a3c4577
Web: Editor: Refactoring.
TatianaLopaeva Sep 23, 2021
17129ad
Erb: Editor: Renaming.
TatianaLopaeva Sep 23, 2021
3937082
Web: Editor: Fixed object parameters of history data.
TatianaLopaeva Sep 23, 2021
aeb5121
Web: Editor: Fixed displaying info.
TatianaLopaeva Oct 4, 2021
d5a7737
Web: Editor: Added api method for restore document version.
TatianaLopaeva Oct 4, 2021
51b7921
Web: Edit: Added doc property to api methods for history versions.
TatianaLopaeva Oct 4, 2021
3b17a90
Web: Editor: Fixed after cherry picking.
TatianaLopaeva Dec 8, 2021
e771000
Web: Editor: Deleted useless code.
TatianaLopaeva Dec 8, 2021
c419370
Web: Editor: Added a condition for showing the history restore function.
TatianaLopaeva Dec 8, 2021
3921fa7
Web: Editor: Deleted useless imports.
TatianaLopaeva Dec 8, 2021
2afce47
Web: Common: Removed useless code.
TatianaLopaeva Dec 10, 2021
00ab712
Merge branch 'release/v1.1.0' into feature/editor-history
TatianaLopaeva Dec 10, 2021
6e6a12f
Merge branch 'release/v1.1.0' into feature/editor-history
TatianaLopaeva Dec 10, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions packages/asc-web-common/api/files/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -809,3 +809,26 @@ export function fileCopyAs(fileId, destTitle, destFolderId, enableExternalExt) {
},
});
}

export function getEditHistory(fileId, doc) {
return request({
method: "get",
url: `files/file/${fileId}/edit/history?doc=${doc}`,
});
}

export function getEditDiff(fileId, version, doc) {
return request({
method: "get",
url: `files/file/${fileId}/edit/diff?version=${version}&doc=${doc}`,
});
}

export function restoreDocumentsVersion(fileId, version, doc) {
const options = {
method: "get",
url: `files/file/${fileId}/restoreversion?version=${version}&doc=${doc}`,
};

return request(options);
}
2 changes: 1 addition & 1 deletion products/ASC.Files/Core/Core/Dao/TeamlabDao/DaoFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void Register(DIHelper services)

services.TryAdd<ILinkDao, LinkDao>();

// AddSharpBoxDaoSelectorService
services.TryAdd<EditHistory>();
}
}
}
4 changes: 1 addition & 3 deletions products/ASC.Files/Core/Core/Dao/TeamlabDao/FileDao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1202,14 +1202,12 @@ public List<EditHistory> GetEditHistory(DocumentServiceHelper documentServiceHel
.Select(r =>
{
var item = ServiceProvider.GetService<EditHistory>();
var editHistoryAuthor = ServiceProvider.GetService<EditHistoryAuthor>();

editHistoryAuthor.Id = r.ModifiedBy;
item.ID = r.Id;
item.Version = r.Version;
item.VersionGroup = r.VersionGroup;
item.ModifiedOn = TenantUtil.DateTimeFromUtc(r.ModifiedOn);
item.ModifiedBy = editHistoryAuthor;
item.ModifiedBy = r.ModifiedBy;
item.ChangesString = r.Changes;
item.Key = documentServiceHelper.GetDocKey(item.ID, item.Version, TenantUtil.DateTimeFromUtc(r.CreateOn));

Expand Down
Loading