Merge branch 'feature/files' of github.com:ONLYOFFICE/AppServer into feature/files

This commit is contained in:
Artem Tarasov 2020-10-15 10:56:57 +03:00
commit 3ee236c25b
15 changed files with 149 additions and 197 deletions

View File

@ -93,7 +93,7 @@ namespace ASC.Core.Data
PaymentId = r.PaymentId,
Spam = r.Spam,
Status = r.Status,
StatusChangeDate = r.StatusChangedHack ?? DateTime.MinValue,
StatusChangeDate = r.StatusChangedHack,
TenantAlias = r.Alias,
TenantId = r.Id,
MappedDomain = r.MappedDomain,

View File

@ -30,7 +30,7 @@ namespace ASC.Core.Common.EF.Model
//hack for DateTime?
[NotMapped]
public DateTime? StatusChangedHack { get { return StatusChanged; } set { StatusChanged = value; } }
public DateTime StatusChangedHack { get { return StatusChanged ?? DateTime.MinValue; } set { StatusChanged = value; } }
public DateTime CreationDateTime { get; set; }
@ -186,7 +186,7 @@ namespace ASC.Core.Common.EF.Model
.HasColumnName("version")
.HasDefaultValueSql("'2'");
entity.Property(e => e.VersionChanged)
entity.Property(e => e.Version_Changed)
.HasColumnName("version_changed")
.HasColumnType("datetime");
});
@ -289,7 +289,7 @@ namespace ASC.Core.Common.EF.Model
.HasColumnName("version")
.HasDefaultValueSql("2");
entity.Property(e => e.VersionChanged).HasColumnName("version_changed");
entity.Property(e => e.Version_Changed).HasColumnName("version_changed");
});
}
}

View File

@ -1528,10 +1528,10 @@
"@svgr/plugin-svgo" "^4.3.1"
loader-utils "^1.2.3"
"@tanem/svg-injector@^8.0.71":
version "8.0.71"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.71.tgz#810e1b0de741c774d68722499a4a48fb61dfa9e9"
integrity sha512-JOlNQDnhWjWyR9g2P3cYA+CPiBstxS0rLoSFOFtHxavpwwPiQf2JtyqAqMVxgR8XV1USadLrTFUtk4fEq3Pxow==
"@tanem/svg-injector@^8.0.72":
version "8.0.72"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.72.tgz#d9ca8a6950492253c7ed4623ff20c59bc4743730"
integrity sha512-xBGrX4JyuboQsP1bbTIaEF1w0I8KlpXHIWfIkg2JXCgsKjrdf8QdI/9MGYeepiHbPL5I8em8hZm/kUcLREeopQ==
dependencies:
"@babel/runtime" "^7.11.2"
@ -2178,7 +2178,7 @@ asap@~2.0.6:
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
"asc-web-common@file:../../../packages/asc-web-common":
version "1.0.257"
version "1.0.258"
dependencies:
axios "^0.19.1"
history "4.10.1"
@ -2194,7 +2194,7 @@ asap@~2.0.6:
sjcl "^1.0.8"
"asc-web-components@file:../../../packages/asc-web-components":
version "1.0.460"
version "1.0.467"
dependencies:
email-addresses "^3.1.0"
html-to-react "^1.4.2"
@ -4237,9 +4237,9 @@ ejs@^2.6.1:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.571:
version "1.3.578"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz#e6671936f4571a874eb26e2e833aa0b2c0b776e0"
integrity sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==
version "1.3.579"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz#58bf17499de6edf697e1442017d8569bce0d301a"
integrity sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==
elliptic@^6.5.3:
version "6.5.3"
@ -9636,12 +9636,12 @@ react-scripts@3.4.3:
fsevents "2.1.2"
react-svg@^11.0.9:
version "11.0.43"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.43.tgz#6d100589cd1b3e5ab6418457cada753d7b80adb9"
integrity sha512-IklkiSvNrqygMTiY5yfUbUq1SDq+iinSnQ5ZlG+pcVMKT0vENNw52ee+GYIIw7x/usmY91b9gduq3nXykmEKbg==
version "11.0.44"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.44.tgz#a06b5262b8e427f132d6bde946134bed51bc25a6"
integrity sha512-bJdngg1F48/5/tallQUTQK3jVR5GyQ/jf+yX1MVyKf/oFA6/o5QUke5TERNc3vJHTd0K3vbID1s1ba9KCJWDTw==
dependencies:
"@babel/runtime" "^7.11.2"
"@tanem/svg-injector" "^8.0.71"
"@tanem/svg-injector" "^8.0.72"
prop-types "^15.7.2"
react-text-mask@^5.4.3:

View File

@ -112,14 +112,15 @@ namespace ASC.Web.Files.Services.WCFService
private DocumentServiceConnector DocumentServiceConnector { get; }
private FileSharing FileSharing { get; }
private NotifyClient NotifyClient { get; }
private FileOperationsManagerHelper FileOperationsManagerHelper { get; }
private UrlShortener UrlShortener { get; }
private IServiceProvider ServiceProvider { get; }
private FileSharingAceHelper<T> FileSharingAceHelper { get; }
private ConsumerFactory ConsumerFactory { get; }
public EncryptionKeyPairHelper EncryptionKeyPairHelper { get; }
public SettingsManager SettingsManager { get; }
public ILog Logger { get; set; }
private EncryptionKeyPairHelper EncryptionKeyPairHelper { get; }
private SettingsManager SettingsManager { get; }
private FileOperationsManager FileOperationsManager { get; }
private TenantManager TenantManager { get; }
private ILog Logger { get; set; }
public FileStorageService(
Global global,
@ -153,13 +154,14 @@ namespace ASC.Web.Files.Services.WCFService
DocumentServiceConnector documentServiceConnector,
FileSharing fileSharing,
NotifyClient notifyClient,
FileOperationsManagerHelper fileOperationsManagerHelper,
UrlShortener urlShortener,
IServiceProvider serviceProvider,
FileSharingAceHelper<T> fileSharingAceHelper,
ConsumerFactory consumerFactory,
EncryptionKeyPairHelper encryptionKeyPairHelper,
SettingsManager settingsManager)
SettingsManager settingsManager,
FileOperationsManager fileOperationsManager,
TenantManager tenantManager)
{
Global = global;
GlobalStore = globalStore;
@ -191,7 +193,6 @@ namespace ASC.Web.Files.Services.WCFService
DocumentServiceConnector = documentServiceConnector;
FileSharing = fileSharing;
NotifyClient = notifyClient;
FileOperationsManagerHelper = fileOperationsManagerHelper;
UrlShortener = urlShortener;
ServiceProvider = serviceProvider;
FileSharingAceHelper = fileSharingAceHelper;
@ -199,6 +200,8 @@ namespace ASC.Web.Files.Services.WCFService
EncryptionKeyPairHelper = encryptionKeyPairHelper;
SettingsManager = settingsManager;
Logger = optionMonitor.Get("ASC.Files");
FileOperationsManager = fileOperationsManager;
TenantManager = tenantManager;
}
public Folder<T> GetFolder(T folderId)
@ -1111,8 +1114,7 @@ namespace ASC.Web.Files.Services.WCFService
public ItemList<FileOperationResult> MarkAsRead(IEnumerable<JsonElement> foldersId, IEnumerable<JsonElement> filesId)
{
if (!foldersId.Any() && !filesId.Any()) return GetTasksStatuses();
return FileOperationsManagerHelper.MarkAsRead(foldersId, filesId);
return FileOperationsManager.MarkAsRead(AuthContext.CurrentAccount.ID, TenantManager.GetCurrentTenant(), foldersId, filesId);
}
public ItemList<ThirdPartyParams> GetThirdParty()
@ -1303,21 +1305,21 @@ namespace ASC.Web.Files.Services.WCFService
{
ErrorIf(!AuthContext.IsAuthenticated, FilesCommonResource.ErrorMassage_SecurityException);
return FileOperationsManagerHelper.GetOperationResults();
return FileOperationsManager.GetOperationResults(AuthContext.CurrentAccount.ID);
}
public ItemList<FileOperationResult> TerminateTasks()
{
ErrorIf(!AuthContext.IsAuthenticated, FilesCommonResource.ErrorMassage_SecurityException);
return FileOperationsManagerHelper.CancelOperations();
return FileOperationsManager.CancelOperations(AuthContext.CurrentAccount.ID);
}
public ItemList<FileOperationResult> BulkDownload(Dictionary<JsonElement, string> folders, Dictionary<JsonElement, string> files)
{
ErrorIf(!folders.Any() && !files.Any(), FilesCommonResource.ErrorMassage_BadRequest);
return FileOperationsManagerHelper.Download(folders, files, GetHttpHeaders());
return FileOperationsManager.Download(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, folders, files, GetHttpHeaders());
}
@ -1421,11 +1423,11 @@ namespace ASC.Web.Files.Services.WCFService
ItemList<FileOperationResult> result;
if (foldersId.Any() || filesId.Any())
{
result = FileOperationsManagerHelper.MoveOrCopy(foldersId, filesId, destFolderId, ic, resolve, !deleteAfter, GetHttpHeaders());
result = FileOperationsManager.MoveOrCopy(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, foldersId, filesId, destFolderId, ic, resolve, !deleteAfter, GetHttpHeaders());
}
else
{
result = FileOperationsManagerHelper.GetOperationResults();
result = FileOperationsManager.GetOperationResults(AuthContext.CurrentAccount.ID);
}
return result;
}
@ -1433,16 +1435,16 @@ namespace ASC.Web.Files.Services.WCFService
public ItemList<FileOperationResult> DeleteFile(string action, T fileId, bool ignoreException = false, bool deleteAfter = false, bool immediately = false)
{
return FileOperationsManagerHelper.DeleteFile(fileId, ignoreException, !deleteAfter, immediately, GetHttpHeaders());
return FileOperationsManager.Delete(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, new List<T>(), new List<T>() { fileId }, ignoreException, !deleteAfter, immediately, GetHttpHeaders());
}
public ItemList<FileOperationResult> DeleteFolder(string action, T folderId, bool ignoreException = false, bool deleteAfter = false, bool immediately = false)
{
return FileOperationsManagerHelper.DeleteFolder(folderId, ignoreException, !deleteAfter, immediately, GetHttpHeaders());
return FileOperationsManager.Delete(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, new List<T>() { folderId }, new List<T>(), ignoreException, !deleteAfter, immediately, GetHttpHeaders());
}
public ItemList<FileOperationResult> DeleteItems(string action, List<JsonElement> files, List<JsonElement> folders, bool ignoreException = false, bool deleteAfter = false, bool immediately = false)
{
return FileOperationsManagerHelper.Delete(folders, files, ignoreException, !deleteAfter, immediately, GetHttpHeaders());
return FileOperationsManager.Delete(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, folders, files, ignoreException, !deleteAfter, immediately, GetHttpHeaders());
}
public ItemList<FileOperationResult> EmptyTrash()
@ -1453,7 +1455,7 @@ namespace ASC.Web.Files.Services.WCFService
var foldersId = folderDao.GetFolders(trashId).Select(f => f.ID).ToList();
var filesId = fileDao.GetFiles(trashId).ToList();
return FileOperationsManagerHelper.Delete(foldersId, filesId, false, true, false, GetHttpHeaders());
return FileOperationsManager.Delete(AuthContext.CurrentAccount.ID, TenantManager.CurrentTenant, foldersId, filesId, false, true, false, GetHttpHeaders());
}
public ItemList<FileOperationResult> CheckConversion(ItemList<ItemList<string>> filesInfoJSON)
@ -2288,7 +2290,8 @@ namespace ASC.Web.Files.Services.WCFService
.AddDocumentServiceTrackerHelperService()
.AddSocketManagerService()
.AddFileOperationsManagerHelperService()
.AddFileSharingAceHelperService();
.AddFileSharingAceHelperService()
.AddTenantManagerService();
}
return services;

View File

@ -33,6 +33,7 @@ using System.Text.Json;
using ASC.Common;
using ASC.Common.Threading;
using ASC.Core;
using ASC.Core.Tenants;
using ASC.Files.Core.Resources;
using Microsoft.Extensions.Primitives;
@ -51,7 +52,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
ServiceProvider = serviceProvider;
}
public ItemList<FileOperationResult> GetOperationResults(AuthContext authContext)
public ItemList<FileOperationResult> GetOperationResults(Guid userId)
{
var operations = tasks.GetTasks();
var processlist = Process.GetProcesses();
@ -63,7 +64,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
tasks.RemoveTask(o.Id);
}
operations = operations.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == authContext.CurrentAccount.ID);
operations = operations.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == userId);
foreach (var o in operations.Where(o => o.Status > DistributedTaskStatus.Running))
{
o.SetProperty(FileOperation.PROGRESS, 100);
@ -88,33 +89,32 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
return new ItemList<FileOperationResult>(results);
}
public ItemList<FileOperationResult> CancelOperations(AuthContext authContext)
public ItemList<FileOperationResult> CancelOperations(Guid userId)
{
var operations = tasks.GetTasks()
.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == authContext.CurrentAccount.ID);
.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == userId);
foreach (var o in operations)
{
tasks.CancelTask(o.Id);
}
return GetOperationResults(authContext);
return GetOperationResults(userId);
}
public ItemList<FileOperationResult> MarkAsRead(AuthContext authContext, TenantManager tenantManager, IEnumerable<JsonElement> folderIds, IEnumerable<JsonElement> fileIds)
public ItemList<FileOperationResult> MarkAsRead(Guid userId, Tenant tenant, IEnumerable<JsonElement> folderIds, IEnumerable<JsonElement> fileIds)
{
var tenant = tenantManager.GetCurrentTenant();
var op1 = new FileMarkAsReadOperation<int>(ServiceProvider, new FileMarkAsReadOperationData<int>(folderIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), fileIds.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), tenant));
var op2 = new FileMarkAsReadOperation<string>(ServiceProvider, new FileMarkAsReadOperationData<string>(folderIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), fileIds.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), tenant));
var op = new FileMarkAsReadOperation(ServiceProvider, op2, op1);
return QueueTask(authContext, op);
return QueueTask(userId, op);
}
public ItemList<FileOperationResult> Download(AuthContext authContext, TenantManager tenantManager, Dictionary<JsonElement, string> folders, Dictionary<JsonElement, string> files, IDictionary<string, StringValues> headers)
public ItemList<FileOperationResult> Download(Guid userId, Tenant tenant, Dictionary<JsonElement, string> folders, Dictionary<JsonElement, string> files, IDictionary<string, StringValues> headers)
{
var operations = tasks.GetTasks()
.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == authContext.CurrentAccount.ID)
.Where(t => t.GetProperty<Guid>(FileOperation.OWNER) == userId)
.Where(t => t.GetProperty<FileOperationType>(FileOperation.OPERATION_TYPE) == FileOperationType.Download);
if (operations.Any(o => o.Status <= DistributedTaskStatus.Running))
@ -122,112 +122,48 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
throw new InvalidOperationException(FilesCommonResource.ErrorMassage_ManyDownloads);
}
var tenant = tenantManager.GetCurrentTenant();
var op1 = new FileDownloadOperation<int>(ServiceProvider, new FileDownloadOperationData<int>(folders.Where(r => r.Key.ValueKind == JsonValueKind.Number).ToDictionary(r => r.Key.GetInt32(), r => r.Value), files.Where(r => r.Key.ValueKind == JsonValueKind.Number).ToDictionary(r => r.Key.GetInt32(), r => r.Value), tenant, headers), false);
var op2 = new FileDownloadOperation<string>(ServiceProvider, new FileDownloadOperationData<string>(folders.Where(r => r.Key.ValueKind == JsonValueKind.String).ToDictionary(r => r.Key.GetString(), r => r.Value), files.Where(r => r.Key.ValueKind == JsonValueKind.String).ToDictionary(r => r.Key.GetString(), r => r.Value), tenant, headers), false);
var op = new FileDownloadOperation(ServiceProvider, op2, op1);
return QueueTask(authContext, op);
return QueueTask(userId, op);
}
public ItemList<FileOperationResult> MoveOrCopy(AuthContext authContext, TenantManager tenantManager, IEnumerable<JsonElement> folders, IEnumerable<JsonElement> files, JsonElement destFolderId, bool copy, FileConflictResolveType resolveType, bool holdResult, IDictionary<string, StringValues> headers)
public ItemList<FileOperationResult> MoveOrCopy(Guid userId, Tenant tenant, IEnumerable<JsonElement> folders, IEnumerable<JsonElement> files, JsonElement destFolderId, bool copy, FileConflictResolveType resolveType, bool holdResult, IDictionary<string, StringValues> headers)
{
var tenant = tenantManager.GetCurrentTenant();
var op1 = new FileMoveCopyOperation<int>(ServiceProvider, new FileMoveCopyOperationData<int>(folders.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), files.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), tenant, destFolderId, copy, resolveType, holdResult, headers));
var op2 = new FileMoveCopyOperation<string>(ServiceProvider, new FileMoveCopyOperationData<string>(folders.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), files.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), tenant, destFolderId, copy, resolveType, holdResult, headers));
var op = new FileMoveCopyOperation(ServiceProvider, op2, op1);
return QueueTask(authContext, op);
return QueueTask(userId, op);
}
public ItemList<FileOperationResult> Delete<T>(AuthContext authContext, TenantManager tenantManager, IEnumerable<T> folders, IEnumerable<T> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
public ItemList<FileOperationResult> Delete<T>(Guid userId, Tenant tenant, IEnumerable<T> folders, IEnumerable<T> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
var op = new FileDeleteOperation<T>(ServiceProvider, new FileDeleteOperationData<T>(folders, files, tenantManager.GetCurrentTenant(), holdResult, ignoreException, immediately, headers));
return QueueTask(authContext, op);
var op = new FileDeleteOperation<T>(ServiceProvider, new FileDeleteOperationData<T>(folders, files, tenant, holdResult, ignoreException, immediately, headers));
return QueueTask(userId, op);
}
public ItemList<FileOperationResult> Delete(AuthContext authContext, TenantManager tenantManager, IEnumerable<JsonElement> folders, IEnumerable<JsonElement> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
public ItemList<FileOperationResult> Delete(Guid userId, TenantManager tenantManager, IEnumerable<JsonElement> folders, IEnumerable<JsonElement> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
var op1 = new FileDeleteOperation<int>(ServiceProvider, new FileDeleteOperationData<int>(folders.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), files.Where(r => r.ValueKind == JsonValueKind.Number).Select(r => r.GetInt32()), tenantManager.GetCurrentTenant(), holdResult, ignoreException, immediately, headers));
var op2 = new FileDeleteOperation<string>(ServiceProvider, new FileDeleteOperationData<string>(folders.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), files.Where(r => r.ValueKind == JsonValueKind.String).Select(r => r.GetString()), tenantManager.GetCurrentTenant(), holdResult, ignoreException, immediately, headers));
var op = new FileDeleteOperation(ServiceProvider, op2, op1);
return QueueTask(authContext, op);
return QueueTask(userId, op);
}
private ItemList<FileOperationResult> QueueTask(AuthContext authContext, FileOperation op)
private ItemList<FileOperationResult> QueueTask(Guid userId, FileOperation op)
{
tasks.QueueTask(op.RunJob, op.GetDistributedTask());
return GetOperationResults(authContext);
return GetOperationResults(userId);
}
private ItemList<FileOperationResult> QueueTask<T, TId>(AuthContext authContext, FileOperation<T, TId> op) where T : FileOperationData<TId>
private ItemList<FileOperationResult> QueueTask<T, TId>(Guid userId, FileOperation<T, TId> op) where T : FileOperationData<TId>
{
tasks.QueueTask(op.RunJob, op.GetDistributedTask());
return GetOperationResults(authContext);
}
}
public class FileOperationsManagerHelper
{
private FileOperationsManager FileOperationsManager { get; }
private AuthContext AuthContext { get; }
private TenantManager TenantManager { get; }
public FileOperationsManagerHelper(
FileOperationsManager fileOperationsManager,
AuthContext authContext,
TenantManager tenantManager)
{
FileOperationsManager = fileOperationsManager;
AuthContext = authContext;
TenantManager = tenantManager;
}
public ItemList<FileOperationResult> GetOperationResults()
{
return FileOperationsManager.GetOperationResults(AuthContext);
}
public ItemList<FileOperationResult> CancelOperations()
{
return FileOperationsManager.CancelOperations(AuthContext);
}
public ItemList<FileOperationResult> MarkAsRead(IEnumerable<JsonElement> folderIds, IEnumerable<JsonElement> fileIds)
{
return FileOperationsManager.MarkAsRead(AuthContext, TenantManager, folderIds, fileIds);
}
public ItemList<FileOperationResult> Download(Dictionary<JsonElement, string> folders, Dictionary<JsonElement, string> files, IDictionary<string, StringValues> headers)
{
return FileOperationsManager.Download(AuthContext, TenantManager, folders, files, headers);
}
public ItemList<FileOperationResult> MoveOrCopy(IEnumerable<JsonElement> folders, IEnumerable<JsonElement> files, JsonElement destFolderId, bool copy, FileConflictResolveType resolveType, bool holdResult, IDictionary<string, StringValues> headers)
{
return FileOperationsManager.MoveOrCopy(AuthContext, TenantManager, folders, files, destFolderId, copy, resolveType, holdResult, headers);
}
public ItemList<FileOperationResult> Delete(List<JsonElement> folders, List<JsonElement> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
return FileOperationsManager.Delete(AuthContext, TenantManager, folders, files, ignoreException, holdResult, immediately, headers);
}
public ItemList<FileOperationResult> Delete<T>(List<T> folders, List<T> files, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
return FileOperationsManager.Delete(AuthContext, TenantManager, folders, files, ignoreException, holdResult, immediately, headers);
}
public ItemList<FileOperationResult> DeleteFile<T>(T file, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
return Delete(new List<T>(), new List<T>() { file }, ignoreException, holdResult, immediately, headers);
}
public ItemList<FileOperationResult> DeleteFolder<T>(T folder, bool ignoreException, bool holdResult, bool immediately, IDictionary<string, StringValues> headers)
{
return Delete(new List<T>() { folder }, new List<T>(), ignoreException, holdResult, immediately, headers);
return GetOperationResults(userId);
}
}
@ -235,23 +171,19 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
{
public static DIHelper AddFileOperationsManagerHelperService(this DIHelper services)
{
if (services.TryAddScoped<FileOperationsManagerHelper>())
{
services.TryAddSingleton<DistributedTaskCacheNotify>();
services.TryAddSingleton<FileOperationsManager>();
services.TryAddScoped<FileDeleteOperationScope>();
services.TryAddScoped<FileMarkAsReadOperationScope>();
services.TryAddScoped<FileMoveCopyOperationScope>();
services.TryAddScoped<FileOperationScope>();
services.TryAddScoped<FileDownloadOperationScope>();
services.TryAddSingleton<DistributedTaskCacheNotify>();
services.TryAddSingleton<FileOperationsManager>();
services.TryAddScoped<FileDeleteOperationScope>();
services.TryAddScoped<FileMarkAsReadOperationScope>();
services.TryAddScoped<FileMoveCopyOperationScope>();
services.TryAddScoped<FileOperationScope>();
services.TryAddScoped<FileDownloadOperationScope>();
return services
.AddAuthContextService()
.AddTenantManagerService()
;
}
return services;
return services
.AddAuthContextService()
.AddTenantManagerService()
;
}
}
}

View File

@ -192,7 +192,7 @@ class ProfileInfo extends React.PureComponent {
const selectedLanguage = languages.find((item) => item.key === language);
const workFromDate = new Date(workFrom).toLocaleDateString(language);
const birthDayDate = new Date(birthday).toLocaleDateString(language);
const formatedSex = capitalizeFirstLetter(sex);
const formatedSex = (sex === "male" && t("MaleSexStatus") ) || t("FemaleSexStatus");
const formatedDepartments = department && getFormattedDepartments(groups);
const supportEmail = "documentation@onlyoffice.com";
const tooltipLanguage = (
@ -213,7 +213,6 @@ class ProfileInfo extends React.PureComponent {
</Link>
</Text>
);
return (
<InfoContainer>
<InfoItem>

View File

@ -2,6 +2,8 @@
"UserType": "Type",
"Email": "Email",
"Sex": "Sex",
"MaleSexStatus": "Male",
"FemaleSexStatus": "Female",
"Birthdate": "Date of birth",
"Location": "Location",
"Language": "Language",

View File

@ -2,6 +2,8 @@
"UserType": "Тип",
"Email": "Email",
"Sex": "Пол",
"MaleSexStatus": "Мужской",
"FemaleSexStatus": "Женский",
"Birthdate": "Дата рождения",
"Location": "Местоположение",
"Language": "Язык",

View File

@ -1528,10 +1528,10 @@
"@svgr/plugin-svgo" "^4.3.1"
loader-utils "^1.2.3"
"@tanem/svg-injector@^8.0.71":
version "8.0.71"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.71.tgz#810e1b0de741c774d68722499a4a48fb61dfa9e9"
integrity sha512-JOlNQDnhWjWyR9g2P3cYA+CPiBstxS0rLoSFOFtHxavpwwPiQf2JtyqAqMVxgR8XV1USadLrTFUtk4fEq3Pxow==
"@tanem/svg-injector@^8.0.72":
version "8.0.72"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.72.tgz#d9ca8a6950492253c7ed4623ff20c59bc4743730"
integrity sha512-xBGrX4JyuboQsP1bbTIaEF1w0I8KlpXHIWfIkg2JXCgsKjrdf8QdI/9MGYeepiHbPL5I8em8hZm/kUcLREeopQ==
dependencies:
"@babel/runtime" "^7.11.2"
@ -2171,7 +2171,7 @@ asap@~2.0.6:
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
"asc-web-common@file:../../../packages/asc-web-common":
version "1.0.257"
version "1.0.258"
dependencies:
axios "^0.19.1"
history "4.10.1"
@ -2187,7 +2187,7 @@ asap@~2.0.6:
sjcl "^1.0.8"
"asc-web-components@file:../../../packages/asc-web-components":
version "1.0.460"
version "1.0.467"
dependencies:
email-addresses "^3.1.0"
html-to-react "^1.4.2"
@ -4230,9 +4230,9 @@ ejs@^2.6.1:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.571:
version "1.3.578"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz#e6671936f4571a874eb26e2e833aa0b2c0b776e0"
integrity sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==
version "1.3.579"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz#58bf17499de6edf697e1442017d8569bce0d301a"
integrity sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==
elliptic@^6.5.3:
version "6.5.3"
@ -9629,12 +9629,12 @@ react-scripts@3.4.3:
fsevents "2.1.2"
react-svg@^11.0.9:
version "11.0.43"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.43.tgz#6d100589cd1b3e5ab6418457cada753d7b80adb9"
integrity sha512-IklkiSvNrqygMTiY5yfUbUq1SDq+iinSnQ5ZlG+pcVMKT0vENNw52ee+GYIIw7x/usmY91b9gduq3nXykmEKbg==
version "11.0.44"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.44.tgz#a06b5262b8e427f132d6bde946134bed51bc25a6"
integrity sha512-bJdngg1F48/5/tallQUTQK3jVR5GyQ/jf+yX1MVyKf/oFA6/o5QUke5TERNc3vJHTd0K3vbID1s1ba9KCJWDTw==
dependencies:
"@babel/runtime" "^7.11.2"
"@tanem/svg-injector" "^8.0.71"
"@tanem/svg-injector" "^8.0.72"
prop-types "^15.7.2"
react-text-mask@^5.4.3:

View File

@ -1528,10 +1528,10 @@
"@svgr/plugin-svgo" "^4.3.1"
loader-utils "^1.2.3"
"@tanem/svg-injector@^8.0.71":
version "8.0.71"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.71.tgz#810e1b0de741c774d68722499a4a48fb61dfa9e9"
integrity sha512-JOlNQDnhWjWyR9g2P3cYA+CPiBstxS0rLoSFOFtHxavpwwPiQf2JtyqAqMVxgR8XV1USadLrTFUtk4fEq3Pxow==
"@tanem/svg-injector@^8.0.72":
version "8.0.72"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.72.tgz#d9ca8a6950492253c7ed4623ff20c59bc4743730"
integrity sha512-xBGrX4JyuboQsP1bbTIaEF1w0I8KlpXHIWfIkg2JXCgsKjrdf8QdI/9MGYeepiHbPL5I8em8hZm/kUcLREeopQ==
dependencies:
"@babel/runtime" "^7.11.2"
@ -2171,7 +2171,7 @@ asap@~2.0.6:
integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=
"asc-web-common@file:../../packages/asc-web-common":
version "1.0.257"
version "1.0.258"
dependencies:
axios "^0.19.1"
history "4.10.1"
@ -2187,7 +2187,7 @@ asap@~2.0.6:
sjcl "^1.0.8"
"asc-web-components@file:../../packages/asc-web-components":
version "1.0.460"
version "1.0.467"
dependencies:
email-addresses "^3.1.0"
html-to-react "^1.4.2"
@ -4223,9 +4223,9 @@ ejs@^2.6.1:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.378, electron-to-chromium@^1.3.571:
version "1.3.578"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz#e6671936f4571a874eb26e2e833aa0b2c0b776e0"
integrity sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==
version "1.3.579"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz#58bf17499de6edf697e1442017d8569bce0d301a"
integrity sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==
elliptic@^6.5.3:
version "6.5.3"
@ -9622,12 +9622,12 @@ react-scripts@3.4.3:
fsevents "2.1.2"
react-svg@^11.0.9:
version "11.0.43"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.43.tgz#6d100589cd1b3e5ab6418457cada753d7b80adb9"
integrity sha512-IklkiSvNrqygMTiY5yfUbUq1SDq+iinSnQ5ZlG+pcVMKT0vENNw52ee+GYIIw7x/usmY91b9gduq3nXykmEKbg==
version "11.0.44"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.44.tgz#a06b5262b8e427f132d6bde946134bed51bc25a6"
integrity sha512-bJdngg1F48/5/tallQUTQK3jVR5GyQ/jf+yX1MVyKf/oFA6/o5QUke5TERNc3vJHTd0K3vbID1s1ba9KCJWDTw==
dependencies:
"@babel/runtime" "^7.11.2"
"@tanem/svg-injector" "^8.0.71"
"@tanem/svg-injector" "^8.0.72"
prop-types "^15.7.2"
react-text-mask@^5.4.3:

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-common",
"version": "1.0.257",
"version": "1.0.258",
"description": "Ascensio System SIA common components and solutions library",
"license": "AGPL-3.0",
"files": [

View File

@ -89,7 +89,6 @@ class FilesFilter {
: null;
const dtoFilter = {
folder: folder,
count: pageCount,
startIndex: this.getStartIndex(),
page: page,

View File

@ -1,6 +1,7 @@
import { toastr as Toastr } from "asc-web-components";
import i18n from "./i18n";
import { LANGUAGE } from "../../constants";
import {changeLanguage } from "../../utils";
const toastr = {
clear: clear,
error: error,
@ -9,7 +10,9 @@ const toastr = {
warning: warning
};
const getTitleTranslation = title => {
const getTitleTranslation = (title) => {
const currentLng = localStorage.getItem(LANGUAGE)
if (i18n.language !== currentLng) changeLanguage(i18n, currentLng)
return(i18n.t(title))
}

View File

@ -2257,17 +2257,17 @@
"@svgr/plugin-svgo" "^5.4.0"
loader-utils "^2.0.0"
"@tanem/svg-injector@^8.0.71":
version "8.0.71"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.71.tgz#810e1b0de741c774d68722499a4a48fb61dfa9e9"
integrity sha512-JOlNQDnhWjWyR9g2P3cYA+CPiBstxS0rLoSFOFtHxavpwwPiQf2JtyqAqMVxgR8XV1USadLrTFUtk4fEq3Pxow==
"@tanem/svg-injector@^8.0.72":
version "8.0.72"
resolved "https://registry.yarnpkg.com/@tanem/svg-injector/-/svg-injector-8.0.72.tgz#d9ca8a6950492253c7ed4623ff20c59bc4743730"
integrity sha512-xBGrX4JyuboQsP1bbTIaEF1w0I8KlpXHIWfIkg2JXCgsKjrdf8QdI/9MGYeepiHbPL5I8em8hZm/kUcLREeopQ==
dependencies:
"@babel/runtime" "^7.11.2"
"@testing-library/dom@*":
version "7.25.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.25.0.tgz#f1cc5478ae1eb4cf93f7eed977776493dc78d940"
integrity sha512-wUp3k/LOQTRJjcebJreWp4CYUUoVo8r86M760Qxe6MY913LKBLEBH4kTGZozqX8zjZH5Tw2GogX/fQGlXYWOWQ==
version "7.26.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.26.0.tgz#da4d052dc426a4ccc916303369c6e7552126f680"
integrity sha512-fyKFrBbS1IigaE3FV21LyeC7kSGF84lqTlSYdKmGaHuK2eYQ/bXVPM5vAa2wx/AU1iPD6oQHsxy2QQ17q9AMCg==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.10.3"
@ -2275,6 +2275,7 @@
aria-query "^4.2.2"
chalk "^4.1.0"
dom-accessibility-api "^0.5.1"
lz-string "^1.4.4"
pretty-format "^26.4.2"
"@testing-library/dom@^6.15.0":
@ -3122,7 +3123,7 @@ arrify@^1.0.1:
integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=
"asc-web-components@file:../../packages/asc-web-components":
version "1.0.460"
version "1.0.467"
dependencies:
email-addresses "^3.1.0"
html-to-react "^1.4.2"
@ -5374,9 +5375,9 @@ ejs@^2.7.4:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.571:
version "1.3.578"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz#e6671936f4571a874eb26e2e833aa0b2c0b776e0"
integrity sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==
version "1.3.579"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz#58bf17499de6edf697e1442017d8569bce0d301a"
integrity sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==
element-resize-detector@^1.2.1:
version "1.2.1"
@ -8171,9 +8172,9 @@ jsprim@^1.2.2:
verror "1.10.0"
"jsx-ast-utils@^2.4.1 || ^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.0.0.tgz#0f49d5093bafa4b45d3fe02147d8b40ffc6c7438"
integrity sha512-sPuicm6EPKYI/UnWpOatvg4pI50qaBo4dSOMGUPutmJ26ttedFKXr0It0XXPk4HKnQ/1X0st4eSS2w2jhFk9Ow==
version "3.1.0"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.1.0.tgz#642f1d7b88aa6d7eb9d8f2210e166478444fa891"
integrity sha512-d4/UOjg+mxAWxCiF0c5UTSwyqbchkbqCvK87aBovhnh8GtysTjWmgC63tY0cJx/HzGgm9qnA147jVBdpOiQ2RA==
dependencies:
array-includes "^3.1.1"
object.assign "^4.1.1"
@ -8504,6 +8505,11 @@ lru-cache@^5.1.1:
dependencies:
yallist "^3.0.2"
lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=
magic-string@^0.25.2, magic-string@^0.25.7:
version "0.25.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"
@ -10765,12 +10771,12 @@ react-sizeme@^2.5.2, react-sizeme@^2.6.7:
throttle-debounce "^2.1.0"
react-svg@^11.0.9:
version "11.0.43"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.43.tgz#6d100589cd1b3e5ab6418457cada753d7b80adb9"
integrity sha512-IklkiSvNrqygMTiY5yfUbUq1SDq+iinSnQ5ZlG+pcVMKT0vENNw52ee+GYIIw7x/usmY91b9gduq3nXykmEKbg==
version "11.0.44"
resolved "https://registry.yarnpkg.com/react-svg/-/react-svg-11.0.44.tgz#a06b5262b8e427f132d6bde946134bed51bc25a6"
integrity sha512-bJdngg1F48/5/tallQUTQK3jVR5GyQ/jf+yX1MVyKf/oFA6/o5QUke5TERNc3vJHTd0K3vbID1s1ba9KCJWDTw==
dependencies:
"@babel/runtime" "^7.11.2"
"@tanem/svg-injector" "^8.0.71"
"@tanem/svg-injector" "^8.0.72"
prop-types "^15.7.2"
react-syntax-highlighter@^11.0.2:

View File

@ -2258,9 +2258,9 @@
loader-utils "^2.0.0"
"@testing-library/dom@*":
version "7.25.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.25.0.tgz#f1cc5478ae1eb4cf93f7eed977776493dc78d940"
integrity sha512-wUp3k/LOQTRJjcebJreWp4CYUUoVo8r86M760Qxe6MY913LKBLEBH4kTGZozqX8zjZH5Tw2GogX/fQGlXYWOWQ==
version "7.26.0"
resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-7.26.0.tgz#da4d052dc426a4ccc916303369c6e7552126f680"
integrity sha512-fyKFrBbS1IigaE3FV21LyeC7kSGF84lqTlSYdKmGaHuK2eYQ/bXVPM5vAa2wx/AU1iPD6oQHsxy2QQ17q9AMCg==
dependencies:
"@babel/code-frame" "^7.10.4"
"@babel/runtime" "^7.10.3"
@ -2268,6 +2268,7 @@
aria-query "^4.2.2"
chalk "^4.1.0"
dom-accessibility-api "^0.5.1"
lz-string "^1.4.4"
pretty-format "^26.4.2"
"@testing-library/dom@^6.15.0":
@ -5338,9 +5339,9 @@ ejs@^2.7.4:
integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==
electron-to-chromium@^1.3.247, electron-to-chromium@^1.3.571:
version "1.3.578"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.578.tgz#e6671936f4571a874eb26e2e833aa0b2c0b776e0"
integrity sha512-z4gU6dA1CbBJsAErW5swTGAaU2TBzc2mPAonJb00zqW1rOraDo2zfBMDRvaz9cVic+0JEZiYbHWPw/fTaZlG2Q==
version "1.3.579"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.579.tgz#58bf17499de6edf697e1442017d8569bce0d301a"
integrity sha512-9HaGm4UDxCtcmIqWWdv79pGgpRZWTqr+zg6kxp0MelSHfe1PNjrI8HXy1HgTSy4p0iQETGt8/ElqKFLW008BSA==
element-resize-detector@^1.2.1:
version "1.2.1"
@ -8094,9 +8095,9 @@ jsprim@^1.2.2:
verror "1.10.0"
"jsx-ast-utils@^2.4.1 || ^3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.0.0.tgz#0f49d5093bafa4b45d3fe02147d8b40ffc6c7438"
integrity sha512-sPuicm6EPKYI/UnWpOatvg4pI50qaBo4dSOMGUPutmJ26ttedFKXr0It0XXPk4HKnQ/1X0st4eSS2w2jhFk9Ow==
version "3.1.0"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.1.0.tgz#642f1d7b88aa6d7eb9d8f2210e166478444fa891"
integrity sha512-d4/UOjg+mxAWxCiF0c5UTSwyqbchkbqCvK87aBovhnh8GtysTjWmgC63tY0cJx/HzGgm9qnA147jVBdpOiQ2RA==
dependencies:
array-includes "^3.1.1"
object.assign "^4.1.1"
@ -8422,6 +8423,11 @@ lru-cache@^5.1.1:
dependencies:
yallist "^3.0.2"
lz-string@^1.4.4:
version "1.4.4"
resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.4.4.tgz#c0d8eaf36059f705796e1e344811cf4c498d3a26"
integrity sha1-wNjq82BZ9wV5bh40SBHPTEmNOiY=
magic-string@^0.25.2, magic-string@^0.25.7:
version "0.25.7"
resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051"