diff --git a/packages/client/src/components/GlobalEvents/EditRoomEvent.js b/packages/client/src/components/GlobalEvents/EditRoomEvent.js index 33246c66e6..32454553d8 100644 --- a/packages/client/src/components/GlobalEvents/EditRoomEvent.js +++ b/packages/client/src/components/GlobalEvents/EditRoomEvent.js @@ -87,7 +87,7 @@ const EditRoomEvent = ({ return updateFolder(index, newRoom); } - setFolder(room); + setFolder(newRoom); }; const onSave = async (roomParams) => { diff --git a/packages/client/src/pages/Wizard/StyledWizard.js b/packages/client/src/pages/Wizard/StyledWizard.js index f92f483fff..0a3e911360 100644 --- a/packages/client/src/pages/Wizard/StyledWizard.js +++ b/packages/client/src/pages/Wizard/StyledWizard.js @@ -1,6 +1,7 @@ import styled, { css } from "styled-components"; import { tablet, hugeMobile } from "@docspace/components/utils/device"; import { isIOS, isFirefox, isMobileOnly } from "react-device-detect"; +import BackgroundPatternReactSvgUrl from "PUBLIC_DIR/images/background.pattern.react.svg?url"; export const Wrapper = styled.div` height: ${isIOS && !isFirefox ? "calc(var(--vh, 1vh) * 100)" : "100vh"}; @@ -17,7 +18,7 @@ export const Wrapper = styled.div` width: 100%; `} - background-image: url("/static/images/background.pattern.react.svg"); + background-image: url("${BackgroundPatternReactSvgUrl}"); background-repeat: no-repeat; background-attachment: fixed; background-size: 100% 100%; diff --git a/packages/client/src/pages/Wizard/index.js b/packages/client/src/pages/Wizard/index.js index f61ff68206..0834dc7efd 100644 --- a/packages/client/src/pages/Wizard/index.js +++ b/packages/client/src/pages/Wizard/index.js @@ -35,6 +35,7 @@ import { StyledAcceptTerms, } from "./StyledWizard"; import DocspaceLogo from "SRC_DIR/DocspaceLogo"; +import RefreshReactSvgUrl from "PUBLIC_DIR/images/refresh.react.svg?url"; const emailSettings = new EmailSettings(); emailSettings.allowDomainPunycode = true; @@ -299,7 +300,7 @@ const Wizard = (props) => { diff --git a/packages/common/components/Article/styled-article.js b/packages/common/components/Article/styled-article.js index 8a8b2c8fd3..c154550764 100644 --- a/packages/common/components/Article/styled-article.js +++ b/packages/common/components/Article/styled-article.js @@ -80,7 +80,8 @@ const StyledArticle = styled.article` .scroll-body { overflow-x: hidden !important; - height: calc(100% - 200px); + height: ${(props) => + `calc(100% - ${props.$withMainButton ? "200px" : "150px"})`}; padding: 0 20px !important; @media ${tablet} { diff --git a/packages/common/components/Article/sub-components/article-body.js b/packages/common/components/Article/sub-components/article-body.js index 3bd2a4fea6..738e8d9f48 100644 --- a/packages/common/components/Article/sub-components/article-body.js +++ b/packages/common/components/Article/sub-components/article-body.js @@ -1,7 +1,7 @@ import React from "react"; import Scrollbar from "@docspace/components/scrollbar"; -const ArticleBody = ({ children }) => { +const ArticleBody = ({ children, className }) => { return ( {children} diff --git a/packages/common/custom.scss b/packages/common/custom.scss index 6f07f62fb8..76df8882c9 100644 --- a/packages/common/custom.scss +++ b/packages/common/custom.scss @@ -7,6 +7,7 @@ html, body { height: 100%; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + overscroll-behavior: none; } #root { min-height: 100%; diff --git a/packages/editor/src/client/components/GlobalStyle.js b/packages/editor/src/client/components/GlobalStyle.js index b38593eba3..3144baae84 100644 --- a/packages/editor/src/client/components/GlobalStyle.js +++ b/packages/editor/src/client/components/GlobalStyle.js @@ -7,6 +7,7 @@ const GlobalStyle = createGlobalStyle` ${(props) => props?.fonts} font-family: 'Open Sans', sans-serif, Arial; font-size: 13px; + overscroll-behavior: none; } #root { diff --git a/packages/login/src/client/components/GlobalStyle.ts b/packages/login/src/client/components/GlobalStyle.ts index d214c21c54..de02bbf7f0 100644 --- a/packages/login/src/client/components/GlobalStyle.ts +++ b/packages/login/src/client/components/GlobalStyle.ts @@ -11,6 +11,7 @@ const GlobalStyle = createGlobalStyle` ${(props: IGlobalStyleProps) => props?.fonts} font-family: 'Open Sans', sans-serif, Arial; font-size: 13px; + overscroll-behavior: none; } #root { diff --git a/products/ASC.Files/Core/ApiModels/RequestDto/AutoCleanupRequestDto.cs b/products/ASC.Files/Core/ApiModels/RequestDto/AutoCleanupRequestDto.cs new file mode 100644 index 0000000000..9849c70b11 --- /dev/null +++ b/products/ASC.Files/Core/ApiModels/RequestDto/AutoCleanupRequestDto.cs @@ -0,0 +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.Files.Core.ApiModels.RequestDto; +public class AutoCleanupRequestDto +{ + public bool Set { get; set; } + public DateToAutoCleanUp Gap { get; set; } +} diff --git a/products/ASC.Files/Core/Core/FileStorageService.cs b/products/ASC.Files/Core/Core/FileStorageService.cs index a7f51e55fa..e68c848cab 100644 --- a/products/ASC.Files/Core/Core/FileStorageService.cs +++ b/products/ASC.Files/Core/Core/FileStorageService.cs @@ -2090,6 +2090,11 @@ public class FileStorageService //: IFileStorageService return _fileOperationsManager.Delete(_authContext.CurrentAccount.ID, _tenantManager.GetCurrentTenant(), folders, files, ignoreException, !deleteAfter, immediately, GetHttpHeaders()); } + public List DeleteItems(string action, List files, List folders, bool ignoreException = false, bool deleteAfter = false, bool immediately = false) + { + return _fileOperationsManager.Delete(_authContext.CurrentAccount.ID, _tenantManager.GetCurrentTenant(), folders, files, ignoreException, !deleteAfter, immediately, GetHttpHeaders()); + } + public async Task> EmptyTrashAsync() { var folderDao = GetFolderDao(); diff --git a/products/ASC.Files/Server/Api/SettingsController.cs b/products/ASC.Files/Server/Api/SettingsController.cs index cc756180a6..419c048326 100644 --- a/products/ASC.Files/Server/Api/SettingsController.cs +++ b/products/ASC.Files/Server/Api/SettingsController.cs @@ -214,9 +214,15 @@ public class SettingsController : ApiControllerBase } [HttpPut("settings/autocleanup")] - public AutoCleanUpData ChangeAutomaticallyCleanUp(bool set, DateToAutoCleanUp gap) + public AutoCleanUpData ChangeAutomaticallyCleanUp(AutoCleanupRequestDto inDto) { - return _fileStorageServiceString.ChangeAutomaticallyCleanUp(set, gap); + return _fileStorageServiceString.ChangeAutomaticallyCleanUp(inDto.Set, inDto.Gap); + } + + [HttpGet("settings/autocleanup")] + public AutoCleanUpData GetAutomaticallyCleanUp() + { + return _fileStorageServiceString.GetSettingsAutomaticallyCleanUp(); } [HttpPut("settings/dafaultaccessrights")] diff --git a/products/ASC.Files/Service/Cleanup/Worker.cs b/products/ASC.Files/Service/Cleanup/Worker.cs index f7ab0864cd..b997e24d70 100644 --- a/products/ASC.Files/Service/Cleanup/Worker.cs +++ b/products/ASC.Files/Service/Cleanup/Worker.cs @@ -33,13 +33,11 @@ namespace ASC.Files.AutoCleanUp; [Singletone] public class Worker { - private readonly TimeSpan _period; private readonly ILogger _logger; private readonly IServiceScopeFactory _serviceScopeFactory; public Worker(IConfiguration configuration, ILogger logger, IServiceScopeFactory serviceScopeFactory) { - _period = TimeSpan.Parse(configuration.GetValue("files:autoCleanUp:period") ?? "0:5:0"); _logger = logger; _serviceScopeFactory = serviceScopeFactory; } @@ -61,7 +59,6 @@ public class Worker if (!activeTenantsUsers.Any()) { - _logger.InfoWaitingForData(_period); return; } @@ -82,13 +79,14 @@ public class Worker await using (var scope = _serviceScopeFactory.CreateAsyncScope()) { var tenantManager = scope.ServiceProvider.GetRequiredService(); + tenantManager.SetCurrentTenant(tenantUser.TenantId); + var authManager = scope.ServiceProvider.GetRequiredService(); var securityContext = scope.ServiceProvider.GetRequiredService(); var daoFactory = scope.ServiceProvider.GetRequiredService(); var fileStorageService = scope.ServiceProvider.GetRequiredService>(); var fileDateTime = scope.ServiceProvider.GetRequiredService(); - tenantManager.SetCurrentTenant(tenantUser.TenantId); var userAccount = authManager.GetAccountByID(tenantUser.TenantId, tenantUser.UserId); if (userAccount == ASC.Core.Configuration.Constants.Guest) @@ -102,18 +100,18 @@ public class Worker var folderDao = daoFactory.GetFolderDao(); var now = DateTime.UtcNow; - var filesList = new List(); - var foldersList = new List(); + var filesList = new List(); + var foldersList = new List(); var trashId = await folderDao.GetFolderIDTrashAsync(false, tenantUser.UserId); foldersList.AddRange((await folderDao.GetFoldersAsync(trashId).ToListAsync()) .Where(x => fileDateTime.GetModifiedOnWithAutoCleanUp(x.ModifiedOn, tenantUser.Setting, true) < now) - .Select(f => JsonDocument.Parse(JsonSerializer.Serialize(f.Id)).RootElement)); + .Select(f => f.Id)); filesList.AddRange((await fileDao.GetFilesAsync(trashId, null, default(FilterType), false, Guid.Empty, string.Empty, false).ToListAsync()) .Where(x => fileDateTime.GetModifiedOnWithAutoCleanUp(x.ModifiedOn, tenantUser.Setting, true) < now) - .Select(y => JsonDocument.Parse(JsonSerializer.Serialize(y.Id)).RootElement)); + .Select(y => y.Id)); _logger.InfoCleanUp(tenantUser.TenantId, trashId); @@ -130,7 +128,7 @@ public class Worker break; } - Thread.Sleep(100); + await Task.Delay(100); } _logger.InfoCleanUpFinish(tenantUser.TenantId, trashId); @@ -150,7 +148,7 @@ public class Worker .Join(dbContext.WebstudioSettings, a => a.Id, b => b.TenantId, (tenants, settings) => new { tenants, settings }) .Where(x => x.tenants.Status == TenantStatus.Active && x.settings.Id == filesSettingsId && - JsonExtensions.JsonValue(nameof(x.settings.Data).ToLower(), "AutomaticallyCleanUp.IsAutoCleanUp") == "true") + Convert.ToBoolean(JsonExtensions.JsonValue(nameof(x.settings.Data).ToLower(), "AutomaticallyCleanUp.IsAutoCleanUp")) == true) .Select(r => new TenantUserSettings() { TenantId = r.tenants.Id, diff --git a/products/ASC.Files/Service/GlobalUsings.cs b/products/ASC.Files/Service/GlobalUsings.cs index 504017d550..cf561badf4 100644 --- a/products/ASC.Files/Service/GlobalUsings.cs +++ b/products/ASC.Files/Service/GlobalUsings.cs @@ -41,9 +41,11 @@ global using ASC.Core.Common; global using ASC.Core.Common.EF; global using ASC.Core.Common.Hosting; global using ASC.Core.Common.Hosting.Interfaces; +global using ASC.Core.Common.Quota; +global using ASC.Core.Common.Quota.Features; global using ASC.Core.Notify.Socket; -global using ASC.Core.Users; global using ASC.Core.Tenants; +global using ASC.Core.Users; global using ASC.ElasticSearch; global using ASC.ElasticSearch.Service; global using ASC.EventBus.Abstractions; @@ -54,6 +56,7 @@ global using ASC.Feed.Core; global using ASC.Feed.Data; global using ASC.Files.AutoCleanUp; global using ASC.Files.Core; +global using ASC.Files.Core.Core; global using ASC.Files.Core.Core.Entries; global using ASC.Files.Core.EF; global using ASC.Files.Core.Helpers; @@ -62,6 +65,8 @@ global using ASC.Files.Core.Log; global using ASC.Files.Core.Resources; global using ASC.Files.Core.Security; global using ASC.Files.Expired; +global using ASC.Files.Service; +global using ASC.Files.Service.Extension; global using ASC.Files.Service.Log; global using ASC.Files.ThumbnailBuilder; global using ASC.Thumbnail.IntegrationEvents.EventHandling; @@ -71,6 +76,7 @@ global using ASC.Web.Files.Classes; global using ASC.Web.Files.Core.Search; global using ASC.Web.Files.Services.DocumentService; global using ASC.Web.Files.Services.FFmpegService; +global using ASC.Web.Files.Services.WCFService; global using ASC.Web.Files.Utils; global using ASC.Web.Studio.Core; @@ -81,6 +87,5 @@ global using Microsoft.Extensions.Hosting.WindowsServices; global using Microsoft.Extensions.Logging; global using SixLabors.ImageSharp; -global using ASC.Files.Service.Extension; + global using static ASC.Files.Core.Helpers.DocumentService; -global using ASC.Files.Service; diff --git a/products/ASC.Files/Service/Startup.cs b/products/ASC.Files/Service/Startup.cs index 6282ac71ad..bafb0b60d2 100644 --- a/products/ASC.Files/Service/Startup.cs +++ b/products/ASC.Files/Service/Startup.cs @@ -23,7 +23,7 @@ // 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.Files.Service; public class Startup : BaseWorkerStartup { @@ -35,8 +35,8 @@ public class Startup : BaseWorkerStartup { _configuration = configuration; _hostEnvironment = hostEnvironment; - } - + } + public override void ConfigureServices(IServiceCollection services) { base.ConfigureServices(services); @@ -91,7 +91,20 @@ public class Startup : BaseWorkerStartup DIHelper.TryAdd(); DIHelper.TryAdd(); DIHelper.TryAdd(); - DIHelper.TryAdd(); + DIHelper.TryAdd(); + DIHelper.TryAdd>(); + + services.AddScoped(); + services.AddScoped(); + + services.AddScoped, CountRoomCheckerStatistic>(); + services.AddScoped(); + + services.AddScoped(); + + services.AddScoped, UsersInRoomStatistic>(); + services.AddScoped(); + services.AddBaseDbContextPool();