Merge branch 'release/v1.0.0' of https://github.com/ONLYOFFICE/DocSpace into release/v1.0.0

This commit is contained in:
Tatiana Lopaeva 2023-03-14 09:48:28 +03:00
commit a0b92eb114
17 changed files with 245 additions and 128 deletions

View File

@ -428,7 +428,6 @@ public enum MessageAction
FolderCopied = 5022,
FolderCopiedWithOverwriting = 5023,
FolderMoved = 5024,
FolderMovedFrom = 5067,
FolderMovedWithOverwriting = 5025,
FolderMovedToTrash = 5026,
FolderDeleted = 5027,
@ -469,10 +468,13 @@ public enum MessageAction
RoomArchived = 5072,
RoomUnarchived = 5073,
RoomDeleted = 5074,
RoomUpdateAccessForUser = 5075,
RoomRemoveUser = 5084,
RoomCreateUser = 5085,// last
RoomLinkUpdate = 5082,
RoomLinkUpdated = 5082,
RoomLinkCreated = 5086,
RoomLinkDeleted = 5087,
TagCreated = 5076,
TagsDeleted = 5077,

View File

@ -87,7 +87,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room: {0}. Added Tags: [{1}].
/// Looks up a localized string similar to Added tags: [{1}].
/// </summary>
public static string AddedRoomTags {
get {
@ -1140,7 +1140,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room: {0}. Deleted Tags: [{1}].
/// Looks up a localized string similar to Deleted tags: [{1}].
/// </summary>
public static string DeletedRoomTags {
get {
@ -3327,7 +3327,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Archived: {0}.
/// Looks up a localized string similar to Room archived.
/// </summary>
public static string RoomArchived {
get {
@ -3336,7 +3336,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Created: {0}.
/// Looks up a localized string similar to Room created.
/// </summary>
public static string RoomCreated {
get {
@ -3345,7 +3345,16 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Deleted: {0}.
/// Looks up a localized string similar to Added user: {0}. Role: {1}.
/// </summary>
public static string RoomCreateUser {
get {
return ResourceManager.GetString("RoomCreateUser", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Room deleted.
/// </summary>
public static string RoomDeleted {
get {
@ -3354,16 +3363,34 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room {0}. Link Update Access: {1}.
/// Looks up a localized string similar to Link created. Role: {1}.
/// </summary>
public static string RoomLinkUpdate {
public static string RoomLinkCreated {
get {
return ResourceManager.GetString("RoomLinkUpdate", resourceCulture);
return ResourceManager.GetString("RoomLinkCreated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Room Logo Created: {0}.
/// Looks up a localized string similar to Link deleted.
/// </summary>
public static string RoomLinkDeleted {
get {
return ResourceManager.GetString("RoomLinkDeleted", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Link updated. Role: {1}.
/// </summary>
public static string RoomLinkUpdated {
get {
return ResourceManager.GetString("RoomLinkUpdated", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Logo created.
/// </summary>
public static string RoomLogoCreated {
get {
@ -3372,7 +3399,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Logo Deleted: {0}.
/// Looks up a localized string similar to Logo deleted.
/// </summary>
public static string RoomLogoDeleted {
get {
@ -3381,7 +3408,16 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Renamed: {0}.
/// Looks up a localized string similar to Deleted user: {0}.
/// </summary>
public static string RoomRemoveUser {
get {
return ResourceManager.GetString("RoomRemoveUser", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Room renamed: {0}.
/// </summary>
public static string RoomRenamed {
get {
@ -3390,7 +3426,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Room Unarchived: {0}.
/// Looks up a localized string similar to Room unarchived.
/// </summary>
public static string RoomUnarchived {
get {
@ -3399,11 +3435,11 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to {0} appointed {1}.
/// Looks up a localized string similar to {0} appointed: {1}.
/// </summary>
public static string RoomUpdateAccess {
public static string RoomUpdateAccessForUser {
get {
return ResourceManager.GetString("RoomUpdateAccess", resourceCulture);
return ResourceManager.GetString("RoomUpdateAccessForUser", resourceCulture);
}
}
@ -3552,7 +3588,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Tag Created: {0}.
/// Looks up a localized string similar to Tag created: {0}.
/// </summary>
public static string TagCreated {
get {
@ -3561,7 +3597,7 @@ namespace ASC.AuditTrail {
}
/// <summary>
/// Looks up a localized string similar to Tags Deleted: {0}.
/// Looks up a localized string similar to Tags deleted: {0}.
/// </summary>
public static string TagsDeleted {
get {

View File

@ -1397,42 +1397,54 @@
<value>Website Contact Form Key Updated</value>
</data>
<data name="RoomCreated" xml:space="preserve">
<value>Room Created: {0}</value>
<value>Room created</value>
</data>
<data name="RoomArchived" xml:space="preserve">
<value>Room Archived: {0}</value>
<value>Room archived</value>
</data>
<data name="RoomUnarchived" xml:space="preserve">
<value>Room Unarchived: {0}</value>
<value>Room unarchived</value>
</data>
<data name="RoomRenamed" xml:space="preserve">
<value>Room Renamed: {0}</value>
<value>Room renamed: {0}</value>
</data>
<data name="RoomLogoCreated" xml:space="preserve">
<value>Room Logo Created: {0}</value>
<value>Logo created</value>
</data>
<data name="RoomLogoDeleted" xml:space="preserve">
<value>Room Logo Deleted: {0}</value>
<value>Logo deleted</value>
</data>
<data name="RoomUpdateAccess" xml:space="preserve">
<value>{0} appointed {1}</value>
<data name="RoomUpdateAccessForUser" xml:space="preserve">
<value>{0} appointed: {1}</value>
</data>
<data name="RoomLinkUpdate" xml:space="preserve">
<value>Room {0}. Link Update Access: {1}</value>
<data name="RoomLinkUpdated" xml:space="preserve">
<value>Link updated. Role: {1}</value>
</data>
<data name="RoomDeleted" xml:space="preserve">
<value>Room Deleted: {0}</value>
<value>Room deleted</value>
</data>
<data name="AddedRoomTags" xml:space="preserve">
<value>Room: {0}. Added Tags: [{1}]</value>
<value>Added tags: [{1}]</value>
</data>
<data name="DeletedRoomTags" xml:space="preserve">
<value>Room: {0}. Deleted Tags: [{1}]</value>
<value>Deleted tags: [{1}]</value>
</data>
<data name="TagCreated" xml:space="preserve">
<value>Tag Created: {0}</value>
<value>Tag created: {0}</value>
</data>
<data name="TagsDeleted" xml:space="preserve">
<value>Tags Deleted: {0}</value>
<value>Tags deleted: {0}</value>
</data>
<data name="RoomCreateUser" xml:space="preserve">
<value>Added user: {0}. Role: {1}</value>
</data>
<data name="RoomRemoveUser" xml:space="preserve">
<value>Deleted user: {0}</value>
</data>
<data name="RoomLinkCreated" xml:space="preserve">
<value>Link created. Role: {1}</value>
</data>
<data name="RoomLinkDeleted" xml:space="preserve">
<value>Link deleted</value>
</data>
</root>

View File

@ -120,7 +120,7 @@ internal class FoldersActionMapper : IModuleActionMapper
EntryType.Folder, EntryType.Folder, new Dictionary<ActionType, MessageAction[]>()
{
{ ActionType.Copy, new[] { MessageAction.FolderCopied, MessageAction.FolderCopiedWithOverwriting } },
{ ActionType.Move, new[] { MessageAction.FolderMoved, MessageAction.FolderMovedFrom, MessageAction.FolderMovedWithOverwriting } },
{ ActionType.Move, new[] { MessageAction.FolderMoved, MessageAction.FolderMovedWithOverwriting } },
}
},
};
@ -151,8 +151,12 @@ internal class RoomsActionMapper : IModuleActionMapper
MessageAction.DeletedRoomTags,
MessageAction.RoomLogoCreated,
MessageAction.RoomLogoDeleted,
MessageAction.RoomCreateUser,
MessageAction.RoomUpdateAccessForUser,
MessageAction.RoomLinkUpdate,
MessageAction.RoomRemoveUser,
MessageAction.RoomLinkCreated,
MessageAction.RoomLinkUpdated,
MessageAction.RoomLinkDeleted
}
},
{

View File

@ -24,7 +24,7 @@ map $request_uri $header_x_frame_options {
map $request_uri $cache_control {
default "no-cache, no-store, no-transform";
~*\/(filehandler\.ashx\?action=thumb)|\/(storage\/room_logos\/root\/|storage\/userPhotos\/root\/) "must-revalidate, no-transform, immutable, max-age=31536000";
~*\/(filehandler\.ashx\?action=(thumb|preview))|\/(storage\/room_logos\/root\/|storage\/userPhotos\/root\/) "must-revalidate, no-transform, immutable, max-age=31536000";
~*\/(api\/2\.0.*|storage|login\.ashx|filehandler\.ashx|ChunkedUploader.ashx|ThirdPartyAppHandler|apisystem|sh|remoteEntry\.js|debuginfo\.md|static\/scripts.*) "no-cache, no-store, no-transform";
~*\/(images|favicon.ico.*)|\.(js|woff|woff2|css)|(locales.*\.json) "must-revalidate, no-transform, immutable, max-age=31536000";
}

View File

@ -14,7 +14,6 @@
"ByCreation": "Created",
"ByErasure": "Erasure",
"ByLastModified": "Modified",
"ByOwner": "Owner",
"CollaborationRooms": "Collaboration",
"ContainsSpecCharacter": "The title can't contain any of the following characters: *+:\"<>?|/",
"Convert": "Convert",

View File

@ -14,7 +14,6 @@
"ByCreation": "Создан",
"ByErasure": "Стирание",
"ByLastModified": "Изменен",
"ByOwner": "владелец",
"CollaborationRooms": "Совместное редактирование",
"ContainsSpecCharacter": "Название не должно содержать следующих символов: *+:\"<>?|/",
"Convert": "Конвертация",

View File

@ -79,9 +79,9 @@ const ArticleBodyContent = (props) => {
const filesSection = window.location.pathname.indexOf("/filter") > 0;
if (filesSection) {
loadTimeout = setTimeout(() => {
setIsLoading(true);
}, 200);
// loadTimeout = setTimeout(() => {
setIsLoading(true);
// }, 200);
} else {
showLoader();
}

View File

@ -58,7 +58,7 @@ class FilesTableHeader extends React.Component {
},
{
key: "Owner",
title: t("ByOwner"),
title: t("Common:Owner"),
enable: this.props.roomColumnOwnerIsEnabled,
resizable: true,
sortBy: "Author",

View File

@ -1506,7 +1506,7 @@ internal class FolderDao : AbstractDao, IFolderDao<int>
{
var rootFolderType = fileEntry.RootFolderType;
if (rootFolderType != FolderType.VirtualRooms)
if (rootFolderType != FolderType.VirtualRooms && rootFolderType != FolderType.Archive)
{
return (-1,"");
}
@ -1519,26 +1519,14 @@ internal class FolderDao : AbstractDao, IFolderDao<int>
return (-1, "");
}
var parentId = Convert.ToInt32(fileEntry.ParentId);
var folderId = Convert.ToInt32(fileEntry.ParentId);
using var filesDbContext = _dbContextFactory.CreateDbContext();
if (rootFolderId == parentId)
if (rootFolderId == folderId)
{
return (entryId, fileEntry.Title);
}
int folderId;
var entryType = fileEntry.FileEntryType;
if (entryType == FileEntryType.File)
{
folderId = parentId;
}
else
{
folderId = entryId;
}
using var filesDbContext = _dbContextFactory.CreateDbContext();
var parentFolders = await filesDbContext.Tree
.Join(filesDbContext.Folders, r => r.ParentId, s => s.Id, (t, f) => new { Tree = t, Folders = f })
@ -1547,7 +1535,7 @@ internal class FolderDao : AbstractDao, IFolderDao<int>
.Select(r => new { r.Tree.ParentId, r.Folders.Title})
.ToListAsync();
if(parentFolders.Count() > 1)
if (parentFolders.Count > 1)
{
return (parentFolders[1].ParentId, parentFolders[1].Title);
}

View File

@ -2664,6 +2664,22 @@ public class FileStorageService<T> //: IFileStorageService
var folderDao = GetFolderDao();
var room = (await folderDao.GetFolderAsync(roomId)).NotFoundIfNull();
var messageAction = MessageAction.RoomLinkCreated;
if (share == FileShare.None)
{
messageAction = MessageAction.RoomLinkDeleted;
}
else
{
var linkExist = (await _fileSecurity.GetSharesAsync(room))
.Any(r => r.Subject == linkId && r.SubjectType == SubjectType.InvitationLink);
if (linkExist)
{
messageAction = MessageAction.RoomLinkUpdated;
}
}
var aces = new List<AceWrapper>
{
@ -2685,7 +2701,7 @@ public class FileStorageService<T> //: IFileStorageService
var (changed, _) = await _fileSharingAceHelper.SetAceObjectAsync(aces, room, false, null, null);
if (changed)
{
_ = _filesMessageService.Send(room, GetHttpHeaders(), MessageAction.RoomLinkUpdate, room.Title, GetAccessString(share));
_ = _filesMessageService.Send(room, GetHttpHeaders(), messageAction, room.Title, GetAccessString(share));
}
}
catch (Exception e)
@ -3391,6 +3407,7 @@ public class FileStorageService<T> //: IFileStorageService
case FileShare.Restrict:
case FileShare.RoomAdmin:
case FileShare.Editing:
case FileShare.Collaborator:
case FileShare.None:
return FilesCommonResource.ResourceManager.GetString("AceStatusEnum_" + fileShare.ToStringFast());
default:

View File

@ -120,13 +120,20 @@ public class FilesMessageService
SendHeadersMessage(headers, action, _messageTarget.Create(entry.Id), description);
}
public void Send<T1, T2>(FileEntry<T1> entry1, FileEntry<T2> entry2, IDictionary<string, StringValues> headers, MessageAction action, params string[] description)
public async Task Send<T1, T2>(FileEntry<T1> entry1, FileEntry<T2> entry2, IDictionary<string, StringValues> headers, MessageAction action, params string[] description)
{
if (entry1 == null || entry2 == null)
{
return;
}
var additionalParams = await GetAdditionalNotificationParamAsync(entry1, action);
if (!string.IsNullOrEmpty(additionalParams))
{
description = description.Append(additionalParams).ToArray();
}
SendHeadersMessage(headers, action, _messageTarget.CreateFromGroupValues(new[] { entry1.Id.ToString(), entry2.Id.ToString() }), description);
}
@ -203,12 +210,6 @@ public class FilesMessageService
private async Task<string> GetAdditionalNotificationParamAsync<T>(FileEntry<T> entry, MessageAction action, string oldTitle = null, Guid userid = default(Guid), FileShare userRole = FileShare.None)
{
if (!StudioWhatsNewNotify.DailyActions.Contains(action)
&& !StudioWhatsNewNotify.RoomsActivityActions.Contains(action))
{
return "";
}
var folderDao = _daoFactory.GetFolderDao<int>();
var roomInfo = await folderDao.GetParentRoomInfoFromFileEntryAsync(entry);
@ -242,4 +243,4 @@ public class FilesMessageService
return serializedParam;
}
}
}

View File

@ -26,6 +26,12 @@
using System;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using static Dropbox.Api.UsersCommon.AccountType;
using Image = SixLabors.ImageSharp.Image;
using JsonException = System.Text.Json.JsonException;
using MimeMapping = ASC.Common.Web.MimeMapping;
@ -190,7 +196,10 @@ public class FileHandlerService
await DifferenceFile(context);
break;
case "thumb":
await ThumbnailFile(context);
await ThumbnailFile(context, false);
break;
case "preview":
await ThumbnailFile(context, true);
break;
case "track":
await TrackFile(context);
@ -1011,21 +1020,21 @@ public class FileHandlerService
}
}
private async Task ThumbnailFile(HttpContext context)
private async Task ThumbnailFile(HttpContext context, bool force)
{
var q = context.Request.Query[FilesLinkUtility.FileId];
if (int.TryParse(q, out var id))
{
await ThumbnailFile(context, id);
await ThumbnailFile(context, id, force);
}
else
{
await ThumbnailFileFromThirdparty(context, q.FirstOrDefault() ?? "");
await ThumbnailFileFromThirdparty(context, q.FirstOrDefault() ?? "", force);
}
}
private async Task ThumbnailFile(HttpContext context, int id)
private async Task ThumbnailFile(HttpContext context, int id, bool force)
{
try
{
@ -1072,20 +1081,45 @@ public class FileHandlerService
return;
}
if (file.ThumbnailStatus != Thumbnail.Created)
if (file.ThumbnailStatus != Thumbnail.Created && !force)
{
context.Response.StatusCode = (int)HttpStatusCode.NoContent;
return;
}
context.Response.Headers.Add("Content-Disposition", ContentDispositionUtil.GetHeaderValue("." + _global.ThumbnailExtension));
context.Response.ContentType = MimeMapping.GetMimeMapping("." + _global.ThumbnailExtension);
using (var stream = await _globalStore.GetStore().GetReadStreamAsync(fileDao.GetUniqThumbnailPath(file, width, height)))
if (force)
{
context.Response.Headers.Add("Content-Length", stream.Length.ToString(CultureInfo.InvariantCulture));
await stream.CopyToAsync(context.Response.Body);
context.Response.ContentType = MimeMapping.GetMimeMapping(".jpeg");
context.Response.Headers.Add("Content-Disposition", ContentDispositionUtil.GetHeaderValue(".jpeg", true));
using (var stream = await fileDao.GetFileStreamAsync(file))
{
var processedImage = await Image.LoadAsync(stream);
processedImage.Mutate(x => x.Resize(new ResizeOptions
{
Size = new Size(width, height),
Mode = ResizeMode.Crop
}));
// save as jpeg more fast, then webp
await processedImage.SaveAsJpegAsync(context.Response.Body);
}
}
else
{
context.Response.ContentType = MimeMapping.GetMimeMapping("." + _global.ThumbnailExtension);
context.Response.Headers.Add("Content-Disposition", ContentDispositionUtil.GetHeaderValue("." + _global.ThumbnailExtension));
var thumbnailFilePath = fileDao.GetUniqThumbnailPath(file, width, height);
using (var stream = await _globalStore.GetStore().GetReadStreamAsync(thumbnailFilePath))
{
context.Response.Headers.Add("Content-Length", stream.Length.ToString(CultureInfo.InvariantCulture));
await stream.CopyToAsync(context.Response.Body);
}
}
}
catch (FileNotFoundException ex)
{
@ -1113,7 +1147,7 @@ public class FileHandlerService
}
}
private async Task ThumbnailFileFromThirdparty(HttpContext context, string id)
private async Task ThumbnailFileFromThirdparty(HttpContext context, string id, bool force)
{
try
{

View File

@ -68,6 +68,15 @@ namespace ASC.Files.Core.Resources {
}
}
/// <summary>
/// Looks up a localized string similar to Collaborator.
/// </summary>
public static string AceStatusEnum_Collaborator {
get {
return ResourceManager.GetString("AceStatusEnum_Collaborator", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Comment.
/// </summary>

View File

@ -469,4 +469,7 @@ Highest compatibility with docx, xlsx, pptx. </value>
<data name="RoleEnum_Collaborator" xml:space="preserve">
<value>Collaborator</value>
</data>
<data name="AceStatusEnum_Collaborator" xml:space="preserve">
<value>Collaborator</value>
</data>
</root>

View File

@ -319,7 +319,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
else
{
newFolder = await FolderDao.CopyFolderAsync(folder.Id, toFolderId, CancellationToken);
filesMessageService.Send(newFolder, toFolder, _headers, MessageAction.FolderCopied, newFolder.Title, toFolder.Title);
_ = filesMessageService.Send(newFolder, toFolder, _headers, MessageAction.FolderCopied, newFolder.Title, toFolder.Title);
if (isToFolder)
{
@ -366,7 +366,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
{
newFolder = await FolderDao.CopyFolderAsync(folder.Id, toFolderId, CancellationToken);
newFolderId = newFolder.Id;
filesMessageService.Send(newFolder, toFolder, _headers, MessageAction.FolderCopiedWithOverwriting, newFolder.Title, toFolder.Title);
_ = filesMessageService.Send(newFolder, toFolder, _headers, MessageAction.FolderCopiedWithOverwriting, newFolder.Title, toFolder.Title);
if (isToFolder)
{
@ -392,7 +392,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
newFolderId = await FolderDao.MoveFolderAsync(folder.Id, toFolderId, CancellationToken);
newFolder = await folderDao.GetFolderAsync(newFolderId);
filesMessageService.Send(folder, toFolder, _headers, MessageAction.FolderMovedWithOverwriting, folder.Title, toFolder.Title);
_ = filesMessageService.Send(folder, toFolder, _headers, MessageAction.FolderMovedWithOverwriting, folder.Title, toFolder.Title);
if (isToFolder)
{
@ -477,7 +477,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
}
else
{
filesMessageService.Send(folder, toFolder, _headers, MessageAction.FolderMovedFrom, folder.Title, parentFolder.Title, toFolder.Title);
_ = filesMessageService.Send(folder, toFolder, _headers, MessageAction.FolderMoved, folder.Title, parentFolder.Title, toFolder.Title);
}
@ -586,7 +586,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
try
{
newFile = await FileDao.CopyFileAsync(file.Id, toFolderId); //Stream copy will occur inside dao
filesMessageService.Send(newFile, toFolder, _headers, MessageAction.FileCopied, newFile.Title, parentFolder.Title, toFolder.Title);
_ = filesMessageService.Send(newFile, toFolder, _headers, MessageAction.FileCopied, newFile.Title, parentFolder.Title, toFolder.Title);
if (Equals(newFile.ParentId.ToString(), _daoFolderId))
{
@ -623,7 +623,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
var newFileId = await FileDao.MoveFileAsync(file.Id, toFolderId);
newFile = await fileDao.GetFileAsync(newFileId);
filesMessageService.Send(file, toFolder, _headers, MessageAction.FileMoved, file.Title, parentFolder.Title, toFolder.Title);
_ = filesMessageService.Send(file, toFolder, _headers, MessageAction.FileMoved, file.Title, parentFolder.Title, toFolder.Title);
if (file.RootFolderType == FolderType.TRASH && newFile.ThumbnailStatus == Thumbnail.NotRequired)
{
@ -711,7 +711,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
if (copy)
{
filesMessageService.Send(newFile, toFolder, _headers, MessageAction.FileCopiedWithOverwriting, newFile.Title, parentFolder.Title, toFolder.Title);
_ = filesMessageService.Send(newFile, toFolder, _headers, MessageAction.FileCopiedWithOverwriting, newFile.Title, parentFolder.Title, toFolder.Title);
if (ProcessedFile(fileId))
{
sb.Append($"file_{newFile.Id}{SplitChar}");
@ -738,7 +738,7 @@ class FileMoveCopyOperation<T> : FileOperation<FileMoveCopyOperationData<T>, T>
await LinkDao.DeleteAllLinkAsync(file.Id.ToString());
filesMessageService.Send(file, toFolder, _headers, MessageAction.FileMovedWithOverwriting, file.Title, parentFolder.Title, toFolder.Title);
_ = filesMessageService.Send(file, toFolder, _headers, MessageAction.FileMovedWithOverwriting, file.Title, parentFolder.Title, toFolder.Title);
await socketManager.DeleteFile(file);

View File

@ -1,32 +1,32 @@
// (c) Copyright Ascensio System SIA 2010-2022
//
// 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
namespace ASC.Web.Api.ApiModel.ResponseDto;
public class AuditEventDto
// (c) Copyright Ascensio System SIA 2010-2022
//
// 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
namespace ASC.Web.Api.ApiModel.ResponseDto;
public class AuditEventDto
{
public int Id { get; set; }
@ -57,13 +57,14 @@ public class AuditEventDto
public IEnumerable<string> Target { get; set; }
public IEnumerable<EntryType> Entries { get; set; }
public AuditEventDto(AuditTrail.Models.AuditEventDto auditEvent, AuditActionMapper auditActionMapper)
{
Id = auditEvent.Id;
Date = new ApiDateTime(auditEvent.Date, TimeSpan.Zero);
public string Room { get; set; }
public AuditEventDto(AuditTrail.Models.AuditEventDto auditEvent, AuditActionMapper auditActionMapper)
{
Id = auditEvent.Id;
Date = new ApiDateTime(auditEvent.Date, TimeSpan.Zero);
User = auditEvent.UserName;
UserId = auditEvent.UserId;
UserId = auditEvent.UserId;
Action = auditEvent.ActionText;
ActionId = (MessageAction)auditEvent.Action;
IP = auditEvent.IP;
@ -94,6 +95,18 @@ public class AuditEventDto
if (auditEvent.Target != null)
{
Target = auditEvent.Target.GetItems();
}
}
}
if (maps.ProductType == ProductType.Documents)
{
var rawNotificationInfo = auditEvent.Description.LastOrDefault();
if (!string.IsNullOrEmpty(rawNotificationInfo) && rawNotificationInfo.StartsWith('{') && rawNotificationInfo.EndsWith('}'))
{
var notificationInfo = JsonSerializer.Deserialize<AdditionalNotificationInfo>(rawNotificationInfo);
Room = auditEvent.Action == (int)MessageAction.RoomRenamed ? notificationInfo?.RoomOldTitle : notificationInfo?.RoomTitle;
}
}
}
}