diff --git a/ASC.Web.slnf b/ASC.Web.slnf index d063ecf2d7..89db64b9d1 100644 --- a/ASC.Web.slnf +++ b/ASC.Web.slnf @@ -6,6 +6,7 @@ "common\\ASC.Common\\ASC.Common.csproj", "common\\ASC.Core.Common\\ASC.Core.Common.csproj", "common\\ASC.Data.Backup.Core\\ASC.Data.Backup.Core.csproj", + "common\\ASC.Data.Encryption\\ASC.Data.Encryption.csproj", "common\\ASC.Data.Reassigns\\ASC.Data.Reassigns.csproj", "common\\ASC.Data.Storage\\ASC.Data.Storage.csproj", "common\\ASC.FederatedLogin\\ASC.FederatedLogin.csproj", diff --git a/build/buildAndDeploy.PERSONAL.bat b/build/buildAndDeploy.PERSONAL.bat index d89a6d053a..5d043ecbd9 100644 --- a/build/buildAndDeploy.PERSONAL.bat +++ b/build/buildAndDeploy.PERSONAL.bat @@ -1,3 +1,5 @@ +@echo off + echo "##########################################################" echo "######### Start build and deploy Personal ##############" echo "##########################################################" @@ -6,6 +8,7 @@ echo. PUSHD %~dp0 call runasadmin.bat "%~dpnx0" + if %errorlevel% == 0 ( call start\stop.bat nopause @@ -18,7 +21,11 @@ call build\build.static.bat nopause personal echo "BACK-END" call build\build.backend.bat nopause -start /b call build\start\start.bat nopause +PUSHD %~dp0 + +call start\start.bat nopause + +echo. pause ) \ No newline at end of file diff --git a/build/install/docker/docker-entrypoint.sh b/build/install/docker/docker-entrypoint.sh index ffa6ff1e79..838aceea1a 100755 --- a/build/install/docker/docker-entrypoint.sh +++ b/build/install/docker/docker-entrypoint.sh @@ -74,4 +74,6 @@ sed -i "s!\"Threads\".*!\"Threads\": \"${ELK_THREADS}\"!g" ${PATH_TO_CONF}/elast sed -i "s!\"subfolder\".*!\"subfolder\": \"server\",!g" ${PATH_TO_CONF}/appsettings.services.json sed -i "s!\"BootstrapServers\".*!\"BootstrapServers\": \"${KAFKA_HOST}\"!g" ${PATH_TO_CONF}/kafka.${APP_DOTNET_ENV}.json +sed -i "s!\"path\".*!\"path\": \"../../ASC.Socket.IO\"!g" ${PATH_TO_CONF}/socket.${APP_DOTNET_ENV}.json + dotnet ${DOTNET_RUN} --urls=${URLS} --ENVIRONMENT=${APP_DOTNET_ENV} --'$STORAGE_ROOT'=${APP_STORAGE_ROOT} --pathToConf=${PATH_TO_CONF} --log:dir=${LOG_DIR} --log:name=${DOTNET_LOG_NAME} ${PARAMETERS} diff --git a/build/install/win/Apache Kafka.aip b/build/install/win/Apache Kafka.aip index 117fdc8e45..731c6efca2 100644 --- a/build/install/win/Apache Kafka.aip +++ b/build/install/win/Apache Kafka.aip @@ -1,5 +1,5 @@ - + @@ -11,7 +11,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -84,12 +84,12 @@ - - - - - - + + + + + + @@ -193,11 +193,11 @@ - - - - - + + + + + diff --git a/build/install/win/Apache ZooKeeper.aip b/build/install/win/Apache ZooKeeper.aip index dd628c7f37..07f73daf62 100644 --- a/build/install/win/Apache ZooKeeper.aip +++ b/build/install/win/Apache ZooKeeper.aip @@ -1,5 +1,5 @@ - + @@ -10,7 +10,7 @@ - + @@ -47,11 +47,11 @@ - + - + @@ -147,10 +147,10 @@ - - - - + + + + diff --git a/build/install/win/build-batch.bat b/build/install/win/build-batch.bat index 1ef7d11794..69ab3b82da 100644 --- a/build/install/win/build-batch.bat +++ b/build/install/win/build-batch.bat @@ -1,5 +1,5 @@ REM echo ######## Set variables ######## -set "msbuild4="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"" +set "publisher="Ascensio System SIA"" REM echo ######## Extracting and preparing files to build ######## %sevenzip% x build\install\win\nginx-1.21.1.zip -o"build\install\win\Files" -y @@ -29,7 +29,7 @@ del /f /q "build\install\win\kafka-zookeeper\zookeeper\conf\zoo_sample.cfg" rmdir build\install\win\publish /s /q REM echo ######## Build Utils ######## -%msbuild4% build\install\win\CustomActions\C#\Utils\Utils.csproj +%msbuild% build\install\win\CustomActions\C#\Utils\Utils.csproj copy build\install\win\CustomActions\C#\Utils\bin\Debug\Utils.CA.dll build\install\win\Utils.CA.dll /y rmdir build\install\win\CustomActions\C#\Utils\bin /s /q rmdir build\install\win\CustomActions\C#\Utils\obj /s /q @@ -80,7 +80,7 @@ copy "build\install\win\publish\Apache ZooKeeper.msi" "build\install\win\Apache copy "build\install\win\publish\Apache Kafka.msi" "build\install\win\Apache Kafka.msi" /y REM echo ######## Build MySQL Server Installer ######## -iscc "build\install\win\MySQL Server Installer Runner.iss" +iscc /Qp /S"byparam="signtool" sign /a /n "%publisher%" /t http://timestamp.digicert.com $f" "build\install\win\MySQL Server Installer Runner.iss" REM echo ######## Build AppServer package ######## %AdvancedInstaller% /edit build\install\win\AppServer.aip /SetVersion %BUILD_VERSION%.%BUILD_NUMBER% diff --git a/common/ASC.Api.Core/ASC.Api.Core.csproj b/common/ASC.Api.Core/ASC.Api.Core.csproj index da346a0610..14937240f7 100644 --- a/common/ASC.Api.Core/ASC.Api.Core.csproj +++ b/common/ASC.Api.Core/ASC.Api.Core.csproj @@ -11,7 +11,7 @@ - + diff --git a/common/ASC.Api.Core/Core/CustomHealthCheck.cs b/common/ASC.Api.Core/Core/CustomHealthCheck.cs index 29b56aa66d..9803d49ca0 100644 --- a/common/ASC.Api.Core/Core/CustomHealthCheck.cs +++ b/common/ASC.Api.Core/Core/CustomHealthCheck.cs @@ -50,24 +50,24 @@ namespace ASC.Api.Core.Core name: "kafka", tags: new string[] { "kafka" }); - } - - - var elasticSettings = configuration.GetSection("elastic"); - - if (elasticSettings != null && elasticSettings.GetChildren().Any()) - { - var host = elasticSettings.GetSection("Host").Value ?? "localhost"; - var scheme = elasticSettings.GetSection("Scheme").Value ?? "http"; - var port = elasticSettings.GetSection("Port").Value ?? "9200"; - var elasticSearchUri = $"{scheme}://{host}:{port}"; - - if (Uri.IsWellFormedUriString(elasticSearchUri, UriKind.Absolute)) - { - hcBuilder.AddElasticsearch(elasticSearchUri, - name: "elasticsearch", - tags: new string[] { "elasticsearch" }); - } + } + + + var elasticSettings = configuration.GetSection("elastic"); + + if (elasticSettings != null && elasticSettings.GetChildren().Any()) + { + var host = elasticSettings.GetSection("Host").Value ?? "localhost"; + var scheme = elasticSettings.GetSection("Scheme").Value ?? "http"; + var port = elasticSettings.GetSection("Port").Value ?? "9200"; + var elasticSearchUri = $"{scheme}://{host}:{port}"; + + if (Uri.IsWellFormedUriString(elasticSearchUri, UriKind.Absolute)) + { + hcBuilder.AddElasticsearch(elasticSearchUri, + name: "elasticsearch", + tags: new string[] { "elasticsearch" }); + } } return services; diff --git a/common/ASC.Api.Core/Model/EmployeeWraperFull.cs b/common/ASC.Api.Core/Model/EmployeeWraperFull.cs index 8110809f39..36521781d0 100644 --- a/common/ASC.Api.Core/Model/EmployeeWraperFull.cs +++ b/common/ASC.Api.Core/Model/EmployeeWraperFull.cs @@ -98,7 +98,9 @@ namespace ASC.Web.Api.Models public bool IsSSO { get; set; } - public new static EmployeeWraperFull GetSample() + public DarkThemeSettingsEnum? Theme { get; set; } + + public static new EmployeeWraperFull GetSample() { return new EmployeeWraperFull { diff --git a/common/ASC.Core.Common/Context/Impl/UserManager.cs b/common/ASC.Core.Common/Context/Impl/UserManager.cs index e30e6b035d..79315c0ee9 100644 --- a/common/ASC.Core.Common/Context/Impl/UserManager.cs +++ b/common/ASC.Core.Common/Context/Impl/UserManager.cs @@ -175,7 +175,7 @@ namespace ASC.Core public UserInfo GetUserBySid(string sid) { return GetUsersInternal() - .FirstOrDefault(u => u.Sid != null && string.Equals(u.Sid , sid, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser; + .FirstOrDefault(u => u.Sid != null && string.Equals(u.Sid, sid, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser; } public UserInfo GetSsoUserByNameId(string nameId) @@ -518,6 +518,11 @@ namespace ASC.Core { var group = UserService.GetGroup(Tenant.TenantId, groupID); + if (group == null) + { + group = ToGroup(Constants.BuildinGroups.FirstOrDefault(r => r.ID == groupID)); + } + return new GroupInfo { ID = group.Id, diff --git a/common/ASC.Core.Common/Notify/Signalr/SignalrServiceClient.cs b/common/ASC.Core.Common/Notify/Signalr/SignalrServiceClient.cs index 72e9dc58d3..5a1c95335f 100644 --- a/common/ASC.Core.Common/Notify/Signalr/SignalrServiceClient.cs +++ b/common/ASC.Core.Common/Notify/Signalr/SignalrServiceClient.cs @@ -321,11 +321,11 @@ namespace ASC.Core.Notify.Signalr } } - public void StopEdit(T fileId, string room, string data) + public void StopEdit(T fileId, string room) { try { - MakeRequest("stop-edit", new { room, fileId, data }); + MakeRequest("stop-edit", new { room, fileId }); } catch (Exception error) { diff --git a/common/ASC.Core.Common/Security/EmailValidationKeyProvider.cs b/common/ASC.Core.Common/Security/EmailValidationKeyProvider.cs index 6c1abbaf44..650ceca620 100644 --- a/common/ASC.Core.Common/Security/EmailValidationKeyProvider.cs +++ b/common/ASC.Core.Common/Security/EmailValidationKeyProvider.cs @@ -275,9 +275,14 @@ namespace ASC.Security.Cryptography case ConfirmType.PhoneAuth: case ConfirmType.TfaActivation: case ConfirmType.TfaAuth: + case ConfirmType.Auth: checkKeyResult = Provider.ValidateEmailKey(email + type, key, Provider.ValidAuthKeyInterval); break; + case ConfirmType.PortalContinue: + checkKeyResult = Provider.ValidateEmailKey(email + type, key); + break; + default: checkKeyResult = Provider.ValidateEmailKey(email + type, key, Provider.ValidEmailKeyInterval); break; diff --git a/common/ASC.Core.Common/Users/DarkThemeSettings.cs b/common/ASC.Core.Common/Users/DarkThemeSettings.cs new file mode 100644 index 0000000000..e5c2050a6a --- /dev/null +++ b/common/ASC.Core.Common/Users/DarkThemeSettings.cs @@ -0,0 +1,61 @@ +// (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 + + +using System; +using System.Text.Json.Serialization; + +using ASC.Core.Common.Settings; + +namespace ASC.Web.Core.Users; + +[Serializable] +public class DarkThemeSettings : ISettings +{ + [JsonIgnore] + public Guid ID + { + get { return new Guid("{38362061-066D-4C57-A23E-8953CF34EFC3}"); } + } + + public DarkThemeSettingsEnum Theme { get; set; } + + public ISettings GetDefault(IServiceProvider serviceProvider) + { + return new DarkThemeSettings + { + Theme = DarkThemeSettingsEnum.Base, + }; + } +} + +[JsonConverter(typeof(JsonStringEnumConverter))] +public enum DarkThemeSettingsEnum +{ + Base, + Dark, + System +} diff --git a/common/ASC.IPSecurity/IPRestrictionsService.cs b/common/ASC.IPSecurity/IPRestrictionsService.cs index 3f459bf4df..928128ad3d 100644 --- a/common/ASC.IPSecurity/IPRestrictionsService.cs +++ b/common/ASC.IPSecurity/IPRestrictionsService.cs @@ -43,7 +43,7 @@ namespace ASC.IPSecurity public IPRestrictionsServiceCache(ICacheNotify notify, ICache cache) { Cache = cache; - notify.Subscribe((r) => Cache.Remove(GetCacheKey(r.TenantId)), CacheNotifyAction.Any); + notify.Subscribe((r) => Cache.Remove(GetCacheKey(r.TenantId)), CacheNotifyAction.InsertOrUpdate); Notify = notify; } diff --git a/common/ASC.Socket.IO/app/hubs/files.js b/common/ASC.Socket.IO/app/hubs/files.js index 053b1dd0f3..8da1b1a079 100644 --- a/common/ASC.Socket.IO/app/hubs/files.js +++ b/common/ASC.Socket.IO/app/hubs/files.js @@ -101,9 +101,9 @@ filesIO.to(room).emit("s:start-edit-file", fileId); } - function stopEdit({ fileId, room, data } = {}) { + function stopEdit({ fileId, room } = {}) { logger.info(`stop edit file ${fileId} in room ${room}`); - filesIO.to(room).emit("s:stop-edit-file", fileId, data); + filesIO.to(room).emit("s:stop-edit-file", fileId); } function modifyFolder(room, cmd, id, type, data) { diff --git a/common/services/ASC.ElasticSearch/Engine/BaseIndexer.cs b/common/services/ASC.ElasticSearch/Engine/BaseIndexer.cs index 1e9e85a881..e374fc87df 100644 --- a/common/services/ASC.ElasticSearch/Engine/BaseIndexer.cs +++ b/common/services/ASC.ElasticSearch/Engine/BaseIndexer.cs @@ -554,7 +554,8 @@ namespace ASC.ElasticSearch while (!string.IsNullOrEmpty(name = TryGetName(expression, out var member))) { - sourceExprText = "." + name + sourceExprText; + sourceExprText = "." + name + sourceExprText; + expression = member.Expression; } if (isList) diff --git a/config/appsettings.json b/config/appsettings.json index 0e4ae5e01b..76da0a7967 100644 --- a/config/appsettings.json +++ b/config/appsettings.json @@ -53,18 +53,18 @@ }, "files": { "thirdparty": { - "enable": [ "box", "dropboxv2", "docusign", "google", "onedrive", "sharepoint", "nextcloud", "owncloud", "webdav", "kdrive", "yandex" ] + "enable": [ "box", "dropboxv2", "docusign", "google", "onedrive", "sharepoint", "nextcloud", "owncloud", "webdav", "kdrive", "yandex" ] }, "docservice": { - "coauthor-docs": [ ".pptx", ".ppsx", ".xlsx", ".csv", ".docx", ".docxf", ".oform", ".txt" ], - "commented-docs": [ ".docx", ".docxf", ".xlsx", ".pptx" ], - "convert-docs": [ ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".rtf" ], - "edited-docs": [ ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".csv", ".docx", ".docxf", ".oform", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".txt", ".rtf", ".mht", ".html", ".htm" ], - "encrypted-docs": [ ".docx", ".docxf", ".xlsx", ".pptx", ".oform" ], - "formfilling-docs": [ ".oform" ], - "customfilter-docs": [ ".xlsx" ], - "reviewed-docs": [ ".docx", ".docxf" ], - "viewed-docs": [ ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".gslides", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".gsheet", ".csv", ".docx", ".docxf", ".oform", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".gdoc", ".txt", ".rtf", ".mht", ".html", ".htm", ".epub", ".pdf", ".djvu", ".xps" ], + "coauthor-docs": [ ".pptx", ".ppsx", ".xlsx", ".csv", ".docx", ".docxf", ".oform", ".txt" ], + "commented-docs": [ ".docx", ".docxf", ".xlsx", ".pptx" ], + "convert-docs": [ ".pptm", ".ppt", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".rtf" ], + "edited-docs": [ ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".csv", ".docx", ".docxf", ".oform", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".txt", ".rtf", ".mht", ".html", ".htm" ], + "encrypted-docs": [ ".docx", ".docxf", ".xlsx", ".pptx", ".oform" ], + "formfilling-docs": [ ".oform" ], + "customfilter-docs": [ ".xlsx" ], + "reviewed-docs": [ ".docx", ".docxf" ], + "viewed-docs": [ ".pptx", ".pptm", ".ppt", ".ppsx", ".ppsm", ".pps", ".potx", ".potm", ".pot", ".odp", ".fodp", ".otp", ".gslides", ".xlsx", ".xlsm", ".xls", ".xltx", ".xltm", ".xlt", ".ods", ".fods", ".ots", ".gsheet", ".csv", ".docx", ".docxf", ".oform", ".docm", ".doc", ".dotx", ".dotm", ".dot", ".odt", ".fodt", ".ott", ".gdoc", ".txt", ".rtf", ".mht", ".html", ".htm", ".epub", ".pdf", ".djvu", ".xps" ], "secret": { "value": "", "header": "" @@ -77,15 +77,20 @@ }, "ffmpeg": { "value": "", - "exts": [ "avi", "mpeg", "mpg", "wmv" ] + "exts": [ "avi", "mpeg", "mpg", "wmv" ] }, "uploader": { "chunk-size": 10485760, "url": "products/files/" }, - "viewed-images": [ ".bmp", ".gif", ".jpeg", ".jpg", ".png", ".ico", ".tif", ".tiff", ".webp" ], - "viewed-media": [ ".aac", ".flac", ".m4a", ".mp3", ".oga", ".ogg", ".wav", ".f4v", ".m4v", ".mov", ".mp4", ".ogv", ".webm" ], - "index": [ ".pptx", ".xlsx", ".docx" ] + "viewed-images": [ ".bmp", ".gif", ".jpeg", ".jpg", ".png", ".ico", ".tif", ".tiff", ".webp" ], + "viewed-media": [ ".aac", ".flac", ".m4a", ".mp3", ".oga", ".ogg", ".wav", ".f4v", ".m4v", ".mov", ".mp4", ".ogv", ".webm" ], + "index": [ ".pptx", ".xlsx", ".docx" ], + "oform": { + "url": "https://oforms.onlyoffice.com/data/reqdata.json", + "period": 60, + "ext": ".oform" + } }, "web": { "api": "api/2.0", diff --git a/config/kafka.json b/config/kafka.json index 02fa6e1afb..67a89013af 100644 --- a/config/kafka.json +++ b/config/kafka.json @@ -1,5 +1,4 @@ { - "kafka": { - "BootstrapServers": "localhost:9092" - } + "kafka": { + } } diff --git a/lerna.json b/lerna.json index 6b9ad74f46..5d100c7a8a 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.2.0", "npmClient": "yarn", "packages": [ "packages/asc-web-components", diff --git a/package.json b/package.json index 7bc1b04eba..89695ad573 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ ], "scripts": { "build": "lerna run build --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc", - "build:personal": "lerna run build --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor}", + "build:personal": "lerna run build:personal --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor}", "build:test": "lerna run build:test --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc --ignore @appserver/debug-info", "build:test.translation": "lerna run build:test.translation --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc --ignore @appserver/debug-info", "bump": "lerna version --no-push --no-git-tag-version", @@ -23,7 +23,7 @@ "deploy:personal": "shx rm -rf build/deploy/products && shx rm -rf build/deploy/public && shx rm -rf build/deploy/studio && lerna run deploy --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor} && shx cp -r public build/deploy", "serve": "lerna run serve --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc", "start": "lerna run start --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc", - "start:personal": "lerna run start --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor}", + "start:personal": "lerna run start:personal --parallel --scope {@appserver/studio,@appserver/people,@appserver/files,@appserver/editor}", "start-prod": "lerna run start-prod --parallel --ignore @appserver/common --ignore @appserver/components --ignore @appserver/browserslist-config-asc", "storybook": "yarn workspace @appserver/components storybook", "storybook-build": "yarn workspace @appserver/components run storybook-build", diff --git a/packages/asc-web-common/api/files/index.js b/packages/asc-web-common/api/files/index.js index 14ac5b471c..0486d6c16c 100644 --- a/packages/asc-web-common/api/files/index.js +++ b/packages/asc-web-common/api/files/index.js @@ -3,6 +3,7 @@ import axios from "axios"; import FilesFilter from "./filter"; import { FolderType } from "../../constants"; import find from "lodash/find"; +import { getFolderOptions } from "../../utils"; export function openEdit(fileId, version, doc, view) { const params = []; // doc ? `?doc=${doc}` : ""; @@ -48,19 +49,7 @@ export function getFolderPath(folderId) { } export function getFolder(folderId, filter) { - if (folderId && typeof folderId === "string") { - folderId = encodeURIComponent(folderId.replace(/\\\\/g, "\\")); - } - - const params = - filter && filter instanceof FilesFilter - ? `${folderId}?${filter.toApiUrlParams()}` - : folderId; - const options = { - method: "get", - url: `/files/${params}`, - }; - + const options = getFolderOptions(folderId, filter); return request(options); } @@ -181,6 +170,38 @@ export function getFoldersTree() { ); } +export function getCommonFoldersTree() { + const index = 1; + return request({ method: "get", url: "/files/@common" }).then( + (commonFolders) => { + return [ + { + id: commonFolders.current.id, + key: `0-${index}`, + parentId: commonFolders.current.parentId, + title: commonFolders.current.title, + rootFolderType: +commonFolders.current.rootFolderType, + rootFolderName: "@common", + pathParts: commonFolders.pathParts, + foldersCount: commonFolders.current.foldersCount, + newItems: commonFolders.new, + }, + ]; + } + ); +} + +export function getThirdPartyCommonFolderTree() { + return request({ method: "get", url: "/files/thirdparty/common" }).then( + (commonThirdPartyArray) => { + commonThirdPartyArray.map((currentValue, index) => { + commonThirdPartyArray[index].key = `0-${index}`; + }); + return commonThirdPartyArray; + } + ); +} + export function getMyFolderList(filter = FilesFilter.getDefault()) { const options = { method: "get", @@ -277,8 +298,8 @@ export function deleteFolder(folderId, deleteAfter, immediately) { return request(options); } -export function createFile(folderId, title, templateId) { - const data = { title, templateId }; +export function createFile(folderId, title, templateId, formId) { + const data = { title, templateId, formId }; const options = { method: "post", url: `/files/${folderId}/file`, diff --git a/packages/asc-web-common/api/people/index.js b/packages/asc-web-common/api/people/index.js index f9323a7d44..cb26736c34 100644 --- a/packages/asc-web-common/api/people/index.js +++ b/packages/asc-web-common/api/people/index.js @@ -303,3 +303,13 @@ export function getSelectorUserList() { url: "/people/filter.json?fields=id,displayName,groups", }); } + +export function changeTheme(key) { + const data = { Theme: key }; + + return request({ + method: "put", + url: `/people/theme.json`, + data, + }); +} diff --git a/packages/asc-web-common/api/settings/index.js b/packages/asc-web-common/api/settings/index.js index ec05b3f6da..ecedbfcaf2 100644 --- a/packages/asc-web-common/api/settings/index.js +++ b/packages/asc-web-common/api/settings/index.js @@ -1,4 +1,5 @@ import { request } from "../client"; +import axios from "axios"; export function getSettings() { return request({ @@ -436,13 +437,6 @@ export function validateTfaCode(code) { }); } -export function getCommonThirdPartyList() { - const options = { - method: "get", - url: "/files/thirdparty/common", - }; - return request(options); -} export function getBackupStorage() { const options = { method: "get", @@ -482,3 +476,7 @@ export function toggleTipsSubscription() { }; return request(options); } + +export function getOforms(url) { + return axios.get(url); +} diff --git a/packages/asc-web-common/components/AdvancedSelector/AdvancedSelector.js b/packages/asc-web-common/components/AdvancedSelector/AdvancedSelector.js index 9213025559..e21e793518 100644 --- a/packages/asc-web-common/components/AdvancedSelector/AdvancedSelector.js +++ b/packages/asc-web-common/components/AdvancedSelector/AdvancedSelector.js @@ -12,8 +12,8 @@ import Backdrop from "@appserver/components/backdrop"; const mobileView = css` top: 64px; - width: 100vw !important; - height: calc(100vh - 64px) !important; + width: 100% !important; + height: calc(100% - 64px) !important; `; const StyledBlock = styled.div` @@ -22,8 +22,8 @@ const StyledBlock = styled.div` right: 0; width: 480px; - max-width: 100vw; - height: 100vh; + max-width: 100%; + height: 100%; z-index: 400; diff --git a/packages/asc-web-common/components/AdvancedSelector/sub-components/Selector.js b/packages/asc-web-common/components/AdvancedSelector/sub-components/Selector.js index ce5be1492f..1a778cbaf2 100644 --- a/packages/asc-web-common/components/AdvancedSelector/sub-components/Selector.js +++ b/packages/asc-web-common/components/AdvancedSelector/sub-components/Selector.js @@ -136,7 +136,11 @@ const Selector = (props) => { const newGroupList = groupList; - newGroupList.find((group) => group.key === groupHeader.key).total = total; + if (newGroupList.length > 0) { + newGroupList.find( + (group) => group.key === groupHeader.key + ).total = total; + } setGroupList(newGroupList); } @@ -334,7 +338,7 @@ const Selector = (props) => { isDisabled={isDisabled} placeholder={searchPlaceHolderLabel} value={searchValue} - onChange={onSearchChange} + onSearchChange={onSearchChange} onClearSearch={onSearchReset} />
diff --git a/packages/asc-web-common/components/AdvancedSelector/sub-components/StyledFooter.js b/packages/asc-web-common/components/AdvancedSelector/sub-components/StyledFooter.js index bec9763106..0ce551ca38 100644 --- a/packages/asc-web-common/components/AdvancedSelector/sub-components/StyledFooter.js +++ b/packages/asc-web-common/components/AdvancedSelector/sub-components/StyledFooter.js @@ -7,6 +7,9 @@ const StyledFooter = styled.div` padding: 16px; height: 69px; + display: flex; + align-items: center; + ${(props) => props.withEmbeddedComponent && css` @@ -18,6 +21,16 @@ const StyledFooter = styled.div` css` display: none; `} + + button { + min-height: 40px; + } + + .embedded_combo-box { + .combo-button { + min-height: 42px; + } + } `; StyledFooter.defaultProps = { theme: Base }; diff --git a/packages/asc-web-common/components/Article/index.js b/packages/asc-web-common/components/Article/index.js index 81770240c9..a06e92ab7c 100644 --- a/packages/asc-web-common/components/Article/index.js +++ b/packages/asc-web-common/components/Article/index.js @@ -31,7 +31,7 @@ const Article = ({ toggleShowText, toggleArticleOpen, setIsMobileArticle, - isLoading, + isLoadedPage, children, ...rest }) => { @@ -107,7 +107,12 @@ const Article = ({ return ( <> - + @@ -128,7 +133,7 @@ const Article = ({ {articleMainButtonContent.props.children} ) : null} - + {articleBodyContent ? articleBodyContent.props.children : null} diff --git a/packages/asc-web-common/components/Article/styled-article.js b/packages/asc-web-common/components/Article/styled-article.js index 246309a5e3..c382907951 100644 --- a/packages/asc-web-common/components/Article/styled-article.js +++ b/packages/asc-web-common/components/Article/styled-article.js @@ -36,36 +36,31 @@ const StyledArticle = styled.article` @media ${mobile} { display: ${(props) => (props.articleOpen ? "flex" : "none")}; - min-width: 100vw; - width: 100vw; - height: calc(100vh - 64px) !important; + min-width: 100%; + width: 100%; + position: fixed; + + height: calc(100% - 64px) !important; margin: 0; + margin-top: 16px; padding: 0; - padding-bottom: 0px; } ${isMobileOnly && css` display: ${(props) => (props.articleOpen ? "flex" : "none")} !important; - min-width: 100vw !important; - width: 100vw; + min-width: 100% !important; + width: 100%; position: fixed; + margin-top: 64px !important; - height: calc(100vh - 64px) !important; + height: calc(100% - 64px) !important; margin: 0; padding: 0; - padding-bottom: 0px; `} - @media ${mobile} { - position: fixed; - margin-top: 16px; - height: calc(100vh - 64px) !important; - z-index: 400; - } - z-index: ${(props) => - props.showText && (isMobileOnly || isMobileUtils()) ? "205" : "100"}; + props.showText && (isMobileOnly || isMobileUtils()) ? "230" : "100"}; .resizable-block { overflow: hidden; @@ -97,12 +92,11 @@ const StyledArticle = styled.article` @media ${mobile} { display: ${(props) => (props.articleOpen ? "flex" : "none")}; - min-width: 100vw; - width: 100vw; - height: calc(100vh - 64px) !important; + min-width: 100%; + width: 100%; + margin: 0; padding: 0; - padding-bottom: 0px; } ${isMobile && @@ -117,18 +111,25 @@ const StyledArticle = styled.article` ${isMobileOnly && css` display: ${(props) => (props.articleOpen ? "flex" : "none")}; - min-width: 100vw !important; - width: 100vw; - height: calc(100vh - 64px) !important; + min-width: 100% !important; + width: 100%; margin: 0; padding: 0; - padding-bottom: 0px; `} } .article-body__scrollbar { .scroll-body { padding-right: 0px !important; + + @media ${mobile} { + padding-bottom: 20px; + } + + ${isMobileOnly && + css` + padding-bottom: 20px; + `} } } `; diff --git a/packages/asc-web-common/components/Article/sub-components/article-backdrop.js b/packages/asc-web-common/components/Article/sub-components/article-backdrop.js index 8fbba4951d..b426fb1c39 100644 --- a/packages/asc-web-common/components/Article/sub-components/article-backdrop.js +++ b/packages/asc-web-common/components/Article/sub-components/article-backdrop.js @@ -11,7 +11,12 @@ const ArticleBackdrop = ({ onClick, ...rest }) => { - + ); }; diff --git a/packages/asc-web-common/components/Article/sub-components/article-body.js b/packages/asc-web-common/components/Article/sub-components/article-body.js index 66320eb02c..7e2bbb5397 100644 --- a/packages/asc-web-common/components/Article/sub-components/article-body.js +++ b/packages/asc-web-common/components/Article/sub-components/article-body.js @@ -1,10 +1,8 @@ import React from "react"; import Scrollbar from "@appserver/components/scrollbar"; -import LoaderArticleBody from "./article-body-loader"; -const ArticleBody = ({ children, isLoading = false }) => { - return isLoading ? ( - - ) : ( + +const ArticleBody = ({ children }) => { + return ( {children} diff --git a/packages/asc-web-common/components/Article/sub-components/article-header.js b/packages/asc-web-common/components/Article/sub-components/article-header.js index 501b7211ee..aa7f7c579a 100644 --- a/packages/asc-web-common/components/Article/sub-components/article-header.js +++ b/packages/asc-web-common/components/Article/sub-components/article-header.js @@ -1,9 +1,10 @@ -import React from "react"; +import React, { useEffect } from "react"; import PropTypes from "prop-types"; +import { useLocation } from "react-router"; import Loaders from "@appserver/common/components/Loaders"; import { isTablet as isTabletUtils } from "@appserver/components/utils/device"; import { isTablet } from "react-device-detect"; - +import { inject, observer } from "mobx-react"; import { StyledArticleHeader, StyledHeading, @@ -15,12 +16,29 @@ const ArticleHeader = ({ showText, children, onClick, - isLoading = false, + isLoadedPage, + isLoaded, + tReady, + setIsLoadedArticleHeader, ...rest }) => { + const location = useLocation(); + + const isLoadedSetting = isLoaded; + + const commonSettings = + location.pathname.includes("common/customization") || + location.pathname === "/settings"; + + useEffect(() => { + if (isLoadedSetting) setIsLoadedArticleHeader(isLoadedSetting); + }, [isLoadedSetting]); + const heightLoader = isTabletUtils() || isTablet ? "20px" : "32px"; - return isLoading ? ( + const showLoader = commonSettings ? !isLoadedPage : false; + + return showLoader ? ( @@ -45,4 +63,11 @@ ArticleHeader.propTypes = { ArticleHeader.displayName = "Header"; -export default React.memo(ArticleHeader); +export default inject(({ common }) => { + const { isLoaded, setIsLoadedArticleHeader } = common; + + return { + isLoaded, + setIsLoadedArticleHeader, + }; +})(observer(ArticleHeader)); diff --git a/packages/asc-web-common/components/FilterInput/index.js b/packages/asc-web-common/components/FilterInput/index.js index 5a94aa689b..1c86d9245f 100644 --- a/packages/asc-web-common/components/FilterInput/index.js +++ b/packages/asc-web-common/components/FilterInput/index.js @@ -80,7 +80,8 @@ const FilterInput = React.memo( !isMobile && viewSelectorVisible && !isMobileUtils() && - !isTabletUtils() ? ( + !isTabletUtils() && + viewAs !== "row" ? ( ) : ( <> - {(isMobile || isTabletUtils() || isMobileUtils()) && ( + {(isMobile || + isTabletUtils() || + isMobileUtils() || + viewAs === "row") && ( - {filterData.map((item) => { - return ( - - ); - })} +
+ + {filterData.map((item) => { + return ( + + ); + })} + +
@@ -109,6 +113,8 @@ FieldContainer.propTypes = { id: PropTypes.string, /** Accepts css style */ style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]), + offsetRight: PropTypes.number, + tooltipMaxWidth: PropTypes.string, }; FieldContainer.defaultProps = { @@ -116,6 +122,7 @@ FieldContainer.defaultProps = { labelVisible: true, maxLabelWidth: "110px", errorMessageWidth: "293px", + offsetRight: 0, }; export default FieldContainer; diff --git a/packages/asc-web-components/help-button/index.js b/packages/asc-web-components/help-button/index.js index 0f7616ad44..879b5f6d3c 100644 --- a/packages/asc-web-components/help-button/index.js +++ b/packages/asc-web-components/help-button/index.js @@ -106,6 +106,7 @@ class HelpButton extends React.Component { offsetLeft={offsetLeft} afterShow={this.afterShow} afterHide={this.afterHide} + maxWidth={tooltipMaxWidth} > {tooltipContent} diff --git a/packages/asc-web-components/link-with-dropdown/styled-link-with-dropdown.js b/packages/asc-web-components/link-with-dropdown/styled-link-with-dropdown.js index 3ba4dc34aa..96e10da4f2 100644 --- a/packages/asc-web-components/link-with-dropdown/styled-link-with-dropdown.js +++ b/packages/asc-web-components/link-with-dropdown/styled-link-with-dropdown.js @@ -84,7 +84,8 @@ const StyledLinkWithDropdown = styled(SimpleLinkWithDropdown)` text-decoration: none; user-select: none; position: relative; - display: inline-grid; + display: flex; + align-items: center; padding-right: ${(props) => props.theme.linkWithDropdown.paddingRight}; diff --git a/packages/asc-web-components/main-button-mobile/index.js b/packages/asc-web-components/main-button-mobile/index.js index ec3aa665dd..8e1fb3b3b8 100644 --- a/packages/asc-web-components/main-button-mobile/index.js +++ b/packages/asc-web-components/main-button-mobile/index.js @@ -16,7 +16,7 @@ import IconButton from "../icon-button"; import Button from "../button"; import Text from "../text"; import Scrollbar from "@appserver/components/scrollbar"; -import { isMobile, isTablet } from "react-device-detect"; +import { isMobile } from "react-device-detect"; import Backdrop from "../backdrop"; const ProgressBarMobile = ({ @@ -98,7 +98,7 @@ const MainButtonMobile = (props) => { const [isOpen, setIsOpen] = useState(opened); const [isUploading, setIsUploading] = useState(false); - const [height, setHeight] = useState("90vh"); + const [height, setHeight] = useState("calc(100% - 48px)"); const divRef = useRef(); @@ -111,7 +111,10 @@ const MainButtonMobile = (props) => { useEffect(() => { let height = divRef?.current?.getBoundingClientRect()?.height || window.innerHeight; - height >= window.innerHeight ? setHeight("90vh") : setHeight(height + "px"); + + height >= window.innerHeight + ? setHeight("calc(100% - 48px)") + : setHeight(height + "px"); }, [isOpen, isOpenButton, window.innerHeight, isUploading]); const ref = useRef(); @@ -127,7 +130,6 @@ const MainButtonMobile = (props) => { }; const onMainButtonClick = (e) => { - if (isOpen && ref.current.contains(e.target)) return; toggle(!isOpen); }; @@ -191,8 +193,8 @@ const MainButtonMobile = (props) => { /> ))} - - {isOpenButton && buttonOptions + + {buttonOptions ? buttonOptions.map((option) => option.isSeparator ? (
@@ -213,20 +215,6 @@ const MainButtonMobile = (props) => { ) : ""} - {withButton && ( - -
); }; @@ -249,13 +237,15 @@ const MainButtonMobile = (props) => { manualWidth={manualWidth || "400px"} directionY="top" directionX="right" - isMobile={isMobile || isTablet} + isMobile={isMobile} + fixedDirection={true} heightProp={height} sectionWidth={sectionWidth} isDefaultMode={false} > - {isMobile || isTablet ? ( + {isMobile ? ( props.theme.mainButtonMobile.buttonColor} !important; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + .circle__mask + div { display: flex; align-items: center; @@ -56,7 +58,9 @@ const StyledFloatingButton = styled(FloatingButton)` StyledFloatingButton.defaultProps = { theme: Base }; const mobileDropDown = css` - width: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.width}; + @media (max-width: 428px) { + width: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.width}; + } right: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.right}; bottom: ${(props) => props.theme.mainButtonMobile.dropDown.mobile.bottom}; @@ -65,7 +69,7 @@ const mobileDropDown = css` const StyledDropDown = styled(DropDown)` position: ${(props) => props.theme.mainButtonMobile.dropDown.position}; width: ${(props) => props.theme.mainButtonMobile.dropDown.width}; - max-width: calc(100vw - 64px); + max-width: calc(100vw - 48px); right: ${(props) => props.theme.mainButtonMobile.dropDown.right}; bottom: ${(props) => props.theme.mainButtonMobile.dropDown.bottom}; @@ -134,7 +138,6 @@ const StyledDropDownItem = styled(DropDownItem)` `; const StyledButtonOptions = styled.div` - display: ${(props) => !props.isOpenButton && "none"}; padding: 16px 0; background-color: ${(props) => props.theme.mainButtonMobile.buttonOptions.backgroundColor}; diff --git a/packages/asc-web-components/modal-dialog/index.js b/packages/asc-web-components/modal-dialog/index.js index 37d5328696..85c7cc3148 100644 --- a/packages/asc-web-components/modal-dialog/index.js +++ b/packages/asc-web-components/modal-dialog/index.js @@ -81,6 +81,10 @@ class ModalDialog extends React.Component { componentDidMount() { window.addEventListener("resize", this.throttledResize); window.addEventListener("keyup", this.onKeyPress); + + window.onpopstate = () => { + this.props.onClose(); + }; } componentWillUnmount() { @@ -163,21 +167,29 @@ class ModalDialog extends React.Component { ) : ( <> - - - {header ? header.props.children : null} - - {!withoutCloseButton && ( - - )} - + {header && ( + + + {header ? header.props.children : null} + + {!withoutCloseButton && ( + + )} + + )} {body ? body.props.children : null} - {footer ? footer.props.children : null} + + {footer ? footer.props.children : null} + )} diff --git a/packages/asc-web-components/package.json b/packages/asc-web-components/package.json index f452ef4630..6c704f0f8b 100644 --- a/packages/asc-web-components/package.json +++ b/packages/asc-web-components/package.json @@ -1,6 +1,6 @@ { "name": "@appserver/components", - "version": "1.1.1", + "version": "1.2.0", "private": true, "scripts": { "build": "echo 'skip it'", diff --git a/packages/asc-web-components/public/static/images/code.react.svg b/packages/asc-web-components/public/static/images/code.react.svg new file mode 100644 index 0000000000..eef997bdff --- /dev/null +++ b/packages/asc-web-components/public/static/images/code.react.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/packages/asc-web-components/public/static/images/copy.react.svg b/packages/asc-web-components/public/static/images/copy.react.svg index ea6ff819ed..366df0d4a8 100644 --- a/packages/asc-web-components/public/static/images/copy.react.svg +++ b/packages/asc-web-components/public/static/images/copy.react.svg @@ -1,3 +1,3 @@ - + diff --git a/packages/asc-web-components/radio-button-group/index.js b/packages/asc-web-components/radio-button-group/index.js index ef88be7097..a92ee893b8 100644 --- a/packages/asc-web-components/radio-button-group/index.js +++ b/packages/asc-web-components/radio-button-group/index.js @@ -108,7 +108,6 @@ RadioButtonGroup.defaultProps = { selected: undefined, spacing: "15px", orientation: "horizontal", - width: "100%", }; export default RadioButtonGroup; diff --git a/packages/asc-web-components/radio-button-group/styled-radio-button-group.js b/packages/asc-web-components/radio-button-group/styled-radio-button-group.js index 6186a069f5..d3f26ee767 100644 --- a/packages/asc-web-components/radio-button-group/styled-radio-button-group.js +++ b/packages/asc-web-components/radio-button-group/styled-radio-button-group.js @@ -17,7 +17,7 @@ const StyledDiv = styled(ClearDiv)` `) || (props.orientation === "vertical" && css` - display: block; + display: inline-block; `)}; width: ${(props) => props.width}; diff --git a/packages/asc-web-components/save-cancel-buttons/index.js b/packages/asc-web-components/save-cancel-buttons/index.js index 301dedcdb9..92e618e62f 100644 --- a/packages/asc-web-components/save-cancel-buttons/index.js +++ b/packages/asc-web-components/save-cancel-buttons/index.js @@ -47,6 +47,7 @@ class SaveCancelButtons extends React.Component { isFirstWelcomePageSettings, className, id, + isSaving, } = this.props; const cancelButtonDisabled = @@ -69,11 +70,12 @@ class SaveCancelButtons extends React.Component { onClick={onSaveClick} label={saveButtonLabel} minwidth={displaySettings && "auto"} + isLoading={isSaving} />