From fb922f04d6057e89413a21437aaaea773249c5c4 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 3 Aug 2021 16:01:31 +0300 Subject: [PATCH 1/8] Web: Client: change About translations --- web/ASC.Web.Client/public/locales/en/About.json | 16 ++++++++-------- web/ASC.Web.Client/public/locales/ru/About.json | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/web/ASC.Web.Client/public/locales/en/About.json b/web/ASC.Web.Client/public/locales/en/About.json index 424945cdf9..ec88055669 100644 --- a/web/ASC.Web.Client/public/locales/en/About.json +++ b/web/ASC.Web.Client/public/locales/en/About.json @@ -1,9 +1,9 @@ { - "AboutCompanyAddressTitle": "address", - "AboutCompanyEmailTitle": "email", - "AboutCompanyLicensor": "Copyright", - "AboutCompanyTelTitle": "tel.", - "AllRightsReservedCustomMode": "<0>Ascensio System SIA. <1>All rights reserved.", - "LicensedUnder": "This software is licensed under: <1>{{license}}", - "SourceCode": "Source code is available on" -} \ No newline at end of file + "AboutHeader": "About this program", + "DocumentManagement": "Document management", + "OnlineEditors": "Online editors", + "SoftwareLicense": "Software license", + "AboutCompanyAddressTitle": "Address", + "AboutCompanyEmailTitle": "Email", + "AboutCompanyTelTitle": "Phone" +} diff --git a/web/ASC.Web.Client/public/locales/ru/About.json b/web/ASC.Web.Client/public/locales/ru/About.json index 7dc990c20c..8e95dcf618 100644 --- a/web/ASC.Web.Client/public/locales/ru/About.json +++ b/web/ASC.Web.Client/public/locales/ru/About.json @@ -1,9 +1,9 @@ { - "AboutCompanyAddressTitle": "адрес", - "AboutCompanyEmailTitle": "email", - "AboutCompanyLicensor": "АВТОРСКИЕ ПРАВА", - "AboutCompanyTelTitle": "тел.", - "AllRightsReservedCustomMode": "<0>Ascensio System SIA. <1>All rights reserved.", - "LicensedUnder": "Программа распространяется под лицензией: {{license}}", - "SourceCode": "Исходный код программы доступен по cсылке" -} \ No newline at end of file + "AboutHeader": "Об этой программе", + "DocumentManagement": "Управление документами", + "OnlineEditors": "Онлайн редакторы", + "SoftwareLicense": "Лицензия на ПО", + "AboutCompanyAddressTitle": "Адрес", + "AboutCompanyEmailTitle": "Email", + "AboutCompanyTelTitle": "Телефон" +} From d2fbca0a27a70fddd3d4c184fae13949a3611c92 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Tue, 3 Aug 2021 16:01:56 +0300 Subject: [PATCH 2/8] Web: Client: rewrite about page --- .../src/components/pages/About/index.js | 223 +++++++----------- 1 file changed, 79 insertions(+), 144 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/About/index.js b/web/ASC.Web.Client/src/components/pages/About/index.js index 161274ff83..4aeb309aed 100644 --- a/web/ASC.Web.Client/src/components/pages/About/index.js +++ b/web/ASC.Web.Client/src/components/pages/About/index.js @@ -4,7 +4,7 @@ import Link from "@appserver/components/link"; import PageLayout from "@appserver/common/components/PageLayout"; import { I18nextProvider, Trans, withTranslation } from "react-i18next"; import styled from "styled-components"; -import { isMobile } from "react-device-detect"; +import { isMobileOnly } from "react-device-detect"; import { setDocumentTitle } from "../../../helpers/utils"; import i18n from "./i18n"; import withLoader from "../Confirm/withLoader"; @@ -12,101 +12,43 @@ import { inject, observer } from "mobx-react"; import { ReactSVG } from "react-svg"; const BodyStyle = styled.div` - margin-top: ${isMobile ? "80px" : "24px"}; + width: 100%; + padding: ${isMobileOnly ? "48px 0 0" : "80px 147px 0"}; .avatar { - text-align: center; - margin: 0px; + margin-top: 32px; + margin-bottom: 16px; } - .text-about { - margin-top: 4px; + .row { + display: flex; + flex-direction: row; } - .text-license { - margin-top: 20px; - } - - .text_style { - text-align: center; - } - - .logo-img { - text-align: center; - max-width: 216px; - max-height: 35px; - } - - .hidden-text { - height: 0; - visibility: hidden; - margin: 0; - } - - .copyright-line { - display: grid; - grid-template-columns: 1fr max-content 1fr; - grid-column-gap: 24px; - padding-bottom: 15px; - text-align: center; - - :before { - background-color: #e1e1e1; - content: ""; - height: 2px; - margin-top: 9px; - float: right; - } - - :after { - background-color: #e1e1e1; - content: ""; - height: 2px; - margin-top: 9px; - float: left; - } + .copyright { + margin-top: 16px; } `; -const Style = styled.div` - margin-top: 8px; - text-align: center; -`; - -const VersionStyle = styled.div` - padding: 8px 0px 20px 0px; -`; - -const Body = ({ t, personal, version }) => { +const Body = ({ t, personal, versionAppServer }) => { useEffect(() => { setDocumentTitle(t("Common:About")); }, [t]); - const gitHub = "GitHub"; + const versionEditor = "6.3.1"; const license = "AGPL-3.0"; - const link = "www.onlyoffice.com"; + const link = "https://github.com/ONLYOFFICE"; const phone = "+371 660-16425"; - const supportLink = "support@onlyoffice.com"; + const email = "support@onlyoffice.com"; const address = "20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050"; - const licenseContent = ( - - - "This software is licensed under:" - - {{ license }} - - - - ); return ( + + {t("AboutHeader")} + +
{personal ? ( @@ -121,83 +63,76 @@ const Body = ({ t, personal, version }) => { )}
- - - {`${t("Common:Version")}: ${version}`} - - - - - {t("AboutCompanyLicensor")} - - - - - Ascensio System SIA -

All rights reserved.

-
-
- - +
+ {t("SoftwareLicense")}: + + {license} + +
+ + + © Ascensio System SIA + + +
+ {t("AboutCompanyAddressTitle")}: + {address} +
+ +
+ {t("AboutCompanyTelTitle")}: + {phone} +
+
+ {t("AboutCompanyEmailTitle")}: + + {email} + +
); }; const BodyWrapper = inject(({ auth }) => ({ personal: auth.settingsStore, - version: auth.settingsStore.version, + versionAppServer: auth.settingsStore.version, }))(withTranslation(["About", "Common"])(withLoader(observer(Body)))); const About = (props) => { From c2bd00506c6195e7304f46bc40b9652a59242823 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 3 Aug 2021 17:05:49 +0300 Subject: [PATCH 3/8] fix Bug 51447 --- common/ASC.Data.Storage/StorageHandler.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/common/ASC.Data.Storage/StorageHandler.cs b/common/ASC.Data.Storage/StorageHandler.cs index 64a65d16e7..b6b09b3ba9 100644 --- a/common/ASC.Data.Storage/StorageHandler.cs +++ b/common/ASC.Data.Storage/StorageHandler.cs @@ -122,10 +122,6 @@ namespace ASC.Data.Storage.DiscStorage path += ".gz"; encoding = "gzip"; } - using (var stream = storage.GetReadStream(_domain, path)) - { - await stream.CopyToAsync(context.Response.Body); - } var headersToCopy = new List { "Content-Disposition", "Cache-Control", "Content-Encoding", "Content-Language", "Content-Type", "Expires" }; foreach (var h in headers) @@ -145,7 +141,15 @@ namespace ASC.Data.Storage.DiscStorage //} if (encoding != null) - context.Response.Headers["Content-Encoding"] = encoding; + context.Response.Headers["Content-Encoding"] = encoding; + + using (var stream = storage.GetReadStream(_domain, path)) + { + await stream.CopyToAsync(context.Response.Body); + } + + await context.Response.Body.FlushAsync(); + await context.Response.CompleteAsync(); string GetRouteValue(string name) { From 67106638e1c886d7beae5d689628c1f9ed3ef22e Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 3 Aug 2021 22:03:20 +0300 Subject: [PATCH 4/8] fixed download as archive --- .../FileOperations/FileDownloadOperation.cs | 199 +++++++++--------- .../FileOperations/FileOperationsManager.cs | 4 +- 2 files changed, 103 insertions(+), 100 deletions(-) diff --git a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileDownloadOperation.cs b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileDownloadOperation.cs index 8233020ca9..545a528ba6 100644 --- a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileDownloadOperation.cs +++ b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileDownloadOperation.cs @@ -28,7 +28,6 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Threading; using ASC.Common; @@ -49,9 +48,6 @@ using ASC.Web.Studio.Core; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Primitives; -using SharpCompress.Common; -using SharpCompress.Writers.Zip; - namespace ASC.Web.Files.Services.WCFService.FileOperations { internal class FileDownloadOperationData : FileOperationData @@ -89,21 +85,23 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations using var scope = ThirdPartyOperation.CreateScope(); var scopeClass = scope.ServiceProvider.GetService(); - var (zip, globalStore, filesLinkUtility, _, _, _) = scopeClass; - using var stream = TempStream.Create(); - - var writerOptions = new ZipWriterOptions(CompressionType.Deflate); - writerOptions.ArchiveEncoding.Default = Encoding.UTF8; - writerOptions.DeflateCompressionLevel = SharpCompress.Compressors.Deflate.CompressionLevel.Level3; - - zip.SetStream(stream); - (ThirdPartyOperation as FileDownloadOperation).CompressToZip(zip, stream, scope); - (DaoOperation as FileDownloadOperation).CompressToZip(zip, stream, scope); + var (globalStore, filesLinkUtility, _, _, _) = scopeClass; + var stream = TempStream.Create(); + + (ThirdPartyOperation as FileDownloadOperation).CompressToZip(stream, scope); + (DaoOperation as FileDownloadOperation).CompressToZip(stream, scope); if (stream != null) { + var archiveExtension = ""; + + using(var zip = scope.ServiceProvider.GetService()) + { + archiveExtension = zip.ArchiveExtension; + } + stream.Position = 0; - string fileName = FileConstant.DownloadTitle + zip.ArchiveExtension; + string fileName = FileConstant.DownloadTitle + archiveExtension; var store = globalStore.GetStore(); var path = string.Format(@"{0}\{1}", ((IAccount)Thread.CurrentPrincipal.Identity).ID, fileName); @@ -118,7 +116,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations stream, MimeMapping.GetMimeMapping(path), "attachment; filename=\"" + fileName + "\""); - Result = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, zip.ArchiveExtension); + Result = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, archiveExtension); } FillDistributedTask(); @@ -239,114 +237,121 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations return entriesPathId; } - internal void CompressToZip(ICompress compressTo, Stream stream, IServiceScope scope) + internal void CompressToZip(Stream stream, IServiceScope scope) { if (entriesPathId == null) return; var scopeClass = scope.ServiceProvider.GetService(); - var (_, _, _, _, fileConverter, filesMessageService) = scopeClass; + var (_, _, _, fileConverter, filesMessageService) = scopeClass; var FileDao = scope.ServiceProvider.GetService>(); - foreach (var path in entriesPathId.AllKeys) + using (var compressTo = scope.ServiceProvider.GetService()) { - var counter = 0; - foreach (var entryId in entriesPathId[path]) + compressTo.SetStream(stream); + + foreach (var path in entriesPathId.AllKeys) { - if (CancellationToken.IsCancellationRequested) + var counter = 0; + foreach (var entryId in entriesPathId[path]) { - compressTo.Dispose(); - stream.Dispose(); - CancellationToken.ThrowIfCancellationRequested(); - } - - var newtitle = path; - - File file = null; - var convertToExt = string.Empty; - - if (!Equals(entryId, default(T))) - { - FileDao.InvalidateCache(entryId); - file = FileDao.GetFile(entryId); - - if (file == null) + if (CancellationToken.IsCancellationRequested) { - Error = FilesCommonResource.ErrorMassage_FileNotFound; - continue; + compressTo.Dispose(); + stream.Dispose(); + CancellationToken.ThrowIfCancellationRequested(); } - if (files.ContainsKey(file.ID)) - { - convertToExt = files[file.ID]; - if (!string.IsNullOrEmpty(convertToExt)) - { - newtitle = FileUtility.ReplaceFileExtension(path, convertToExt); - } - } - } + var newtitle = path; - if (0 < counter) - { - var suffix = " (" + counter + ")"; + File file = null; + var convertToExt = string.Empty; if (!Equals(entryId, default(T))) { - newtitle = 0 < newtitle.IndexOf('.') ? newtitle.Insert(newtitle.LastIndexOf('.'), suffix) : newtitle + suffix; - } - else - { - break; - } - } + FileDao.InvalidateCache(entryId); + file = FileDao.GetFile(entryId); - compressTo.CreateEntry(newtitle); - - if (!Equals(entryId, default(T)) && file != null) - { - try - { - if (fileConverter.EnableConvert(file, convertToExt)) + if (file == null) { - //Take from converter - using (var readStream = fileConverter.Exec(file, convertToExt)) - { - compressTo.PutStream(readStream); + Error = FilesCommonResource.ErrorMassage_FileNotFound; + continue; + } - if (!string.IsNullOrEmpty(convertToExt)) + if (files.ContainsKey(file.ID)) + { + convertToExt = files[file.ID]; + if (!string.IsNullOrEmpty(convertToExt)) + { + newtitle = FileUtility.ReplaceFileExtension(path, convertToExt); + } + } + } + + if (0 < counter) + { + var suffix = " (" + counter + ")"; + + if (!Equals(entryId, default(T))) + { + newtitle = 0 < newtitle.IndexOf('.') ? newtitle.Insert(newtitle.LastIndexOf('.'), suffix) : newtitle + suffix; + } + else + { + break; + } + } + + compressTo.CreateEntry(newtitle); + + if (!Equals(entryId, default(T)) && file != null) + { + try + { + if (fileConverter.EnableConvert(file, convertToExt)) + { + //Take from converter + using (var readStream = fileConverter.Exec(file, convertToExt)) { - filesMessageService.Send(file, headers, MessageAction.FileDownloadedAs, file.Title, convertToExt); + compressTo.PutStream(readStream); + + if (!string.IsNullOrEmpty(convertToExt)) + { + filesMessageService.Send(file, headers, MessageAction.FileDownloadedAs, file.Title, convertToExt); + } + else + { + filesMessageService.Send(file, headers, MessageAction.FileDownloaded, file.Title); + } } - else + } + else + { + using (var readStream = FileDao.GetFileStream(file)) { + compressTo.PutStream(readStream); + filesMessageService.Send(file, headers, MessageAction.FileDownloaded, file.Title); } } } - else + catch (Exception ex) { - using (var readStream = FileDao.GetFileStream(file)) - { - compressTo.PutStream(readStream); - - filesMessageService.Send(file, headers, MessageAction.FileDownloaded, file.Title); - } + Error = ex.Message; + Logger.Error(Error, ex); } } - catch (Exception ex) + else { - Error = ex.Message; - Logger.Error(Error, ex); + compressTo.PutNextEntry(); } + compressTo.CloseEntry(); + counter++; } - else - { - compressTo.PutNextEntry(); - } - compressTo.CloseEntry(); - counter++; - } + + ProgressStep(); + } + } + - ProgressStep(); - } } private void ReplaceLongPath(ItemNameValueCollection entriesPathId) @@ -429,27 +434,23 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations private SetupInfo SetupInfo { get; } private FileConverter FileConverter { get; } private FilesMessageService FilesMessageService { get; } - private CompressToArchive CompressToArchive { get; } public FileDownloadOperationScope( GlobalStore globalStore, FilesLinkUtility filesLinkUtility, SetupInfo setupInfo, FileConverter fileConverter, - FilesMessageService filesMessageService, - CompressToArchive compressToArchive) + FilesMessageService filesMessageService) { GlobalStore = globalStore; FilesLinkUtility = filesLinkUtility; SetupInfo = setupInfo; FileConverter = fileConverter; FilesMessageService = filesMessageService; - CompressToArchive = compressToArchive; } - public void Deconstruct(out CompressToArchive compressToArchive, out GlobalStore globalStore, out FilesLinkUtility filesLinkUtility, out SetupInfo setupInfo, out FileConverter fileConverter, out FilesMessageService filesMessageService) - { - compressToArchive = CompressToArchive; + public void Deconstruct(out GlobalStore globalStore, out FilesLinkUtility filesLinkUtility, out SetupInfo setupInfo, out FileConverter fileConverter, out FilesMessageService filesMessageService) + { globalStore = GlobalStore; filesLinkUtility = FilesLinkUtility; setupInfo = SetupInfo; diff --git a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileOperationsManager.cs b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileOperationsManager.cs index e0a46e8dd8..28967fced5 100644 --- a/products/ASC.Files/Core/Services/WCFService/FileOperations/FileOperationsManager.cs +++ b/products/ASC.Files/Core/Services/WCFService/FileOperations/FileOperationsManager.cs @@ -34,7 +34,8 @@ using ASC.Common; using ASC.Common.Threading; using ASC.Core.Tenants; using ASC.Files.Core.Resources; - +using ASC.Web.Files.Core.Compress; + using Microsoft.Extensions.Primitives; namespace ASC.Web.Files.Services.WCFService.FileOperations @@ -181,6 +182,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations services.TryAdd(); services.TryAdd(); services.TryAdd(); + services.TryAdd(); services.AddDistributedTaskQueueService(10); } } From 72ad5c6e917f5fa65cdcc479846b83d23e5276da Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 3 Aug 2021 23:07:03 +0300 Subject: [PATCH 5/8] fix Bug 51451 --- products/ASC.Files/Core/Core/Compress/CompressToZip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.Files/Core/Core/Compress/CompressToZip.cs b/products/ASC.Files/Core/Core/Compress/CompressToZip.cs index 828535ce48..881e7e4cd0 100644 --- a/products/ASC.Files/Core/Core/Compress/CompressToZip.cs +++ b/products/ASC.Files/Core/Core/Compress/CompressToZip.cs @@ -52,7 +52,7 @@ namespace ASC.Web.Files.Core.Compress /// File name with extension, this name will have the file in the archive public void CreateEntry(string title) { - zipEntry = new ZipEntry(title); + zipEntry = new ZipEntry(title) { IsUnicodeText = true }; } /// From 36b464a29b0beefc383c013b3198257f32a74a85 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 4 Aug 2021 11:57:12 +0300 Subject: [PATCH 6/8] Web: Components: delete console.log --- packages/asc-web-components/snackbar/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/asc-web-components/snackbar/index.js b/packages/asc-web-components/snackbar/index.js index 64257e4ecc..2c6ae69eba 100644 --- a/packages/asc-web-components/snackbar/index.js +++ b/packages/asc-web-components/snackbar/index.js @@ -32,8 +32,6 @@ class SnackBar extends React.Component { const bar = document.querySelector(`#${window.snackbar.parentElementId}`); bar.remove(); //ReactDOM.unmountComponentAtNode(window.snackbar.parentElementId); - } else { - console.error("Not found snackbar"); } } From a9734f78e1857a66e985973e23f40a8cee209487 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 4 Aug 2021 12:06:16 +0300 Subject: [PATCH 7/8] Web: Client: added about content --- .../components/pages/About/AboutContent.js | 115 ++++++++++++++++++ .../src/components/pages/About/index.js | 104 +--------------- 2 files changed, 117 insertions(+), 102 deletions(-) create mode 100644 web/ASC.Web.Client/src/components/pages/About/AboutContent.js diff --git a/web/ASC.Web.Client/src/components/pages/About/AboutContent.js b/web/ASC.Web.Client/src/components/pages/About/AboutContent.js new file mode 100644 index 0000000000..d5a48d00b6 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/About/AboutContent.js @@ -0,0 +1,115 @@ +import React from "react"; +import Text from "@appserver/components/text"; +import Link from "@appserver/components/link"; +import { useTranslation } from "react-i18next"; +import styled from "styled-components"; +import { ReactSVG } from "react-svg"; + +const AboutBody = styled.div` + width: 100%; + + .avatar { + margin-top: 32px; + margin-bottom: 16px; + } + + .row { + display: flex; + flex-direction: row; + } + + .copyright { + margin-top: 16px; + } +`; + +const AboutContent = ({ personal, versionAppServer }) => { + const { t } = useTranslation("About"); + const versionEditor = "6.3.1"; + const license = "AGPL-3.0"; + const link = "https://github.com/ONLYOFFICE"; + const phone = "+371 660-16425"; + const email = "support@onlyoffice.com"; + const address = + "20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050"; + + return ( + +
+ {personal ? ( + + ) : ( + Logo + )} +
+ +
+ {t("DocumentManagement")}: + + ONLYOFFICE App Server + + + v.{versionAppServer} + +
+ +
+ {t("OnlineEditors")}: + + ONLYOFFICE Docs + + + v.{versionEditor} + +
+ +
+ {t("SoftwareLicense")}: + + {license} + +
+ + + © Ascensio System SIA + + +
+ + {t("AboutCompanyAddressTitle")}: {address} + +
+ +
+ + {t("AboutCompanyTelTitle")}: {phone} + +
+
+ {t("AboutCompanyEmailTitle")}: + + {email} + +
+
+ ); +}; + +export default AboutContent; diff --git a/web/ASC.Web.Client/src/components/pages/About/index.js b/web/ASC.Web.Client/src/components/pages/About/index.js index 4aeb309aed..8b917fede8 100644 --- a/web/ASC.Web.Client/src/components/pages/About/index.js +++ b/web/ASC.Web.Client/src/components/pages/About/index.js @@ -1,6 +1,5 @@ import React, { useEffect } from "react"; import Text from "@appserver/components/text"; -import Link from "@appserver/components/link"; import PageLayout from "@appserver/common/components/PageLayout"; import { I18nextProvider, Trans, withTranslation } from "react-i18next"; import styled from "styled-components"; @@ -9,25 +8,10 @@ import { setDocumentTitle } from "../../../helpers/utils"; import i18n from "./i18n"; import withLoader from "../Confirm/withLoader"; import { inject, observer } from "mobx-react"; -import { ReactSVG } from "react-svg"; +import AboutContent from "./AboutContent"; const BodyStyle = styled.div` - width: 100%; padding: ${isMobileOnly ? "48px 0 0" : "80px 147px 0"}; - - .avatar { - margin-top: 32px; - margin-bottom: 16px; - } - - .row { - display: flex; - flex-direction: row; - } - - .copyright { - margin-top: 16px; - } `; const Body = ({ t, personal, versionAppServer }) => { @@ -35,97 +19,13 @@ const Body = ({ t, personal, versionAppServer }) => { setDocumentTitle(t("Common:About")); }, [t]); - const versionEditor = "6.3.1"; - const license = "AGPL-3.0"; - const link = "https://github.com/ONLYOFFICE"; - const phone = "+371 660-16425"; - const email = "support@onlyoffice.com"; - const address = - "20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050"; - return ( {t("AboutHeader")} -
- {personal ? ( - - ) : ( - Logo - )} -
- -
- {t("DocumentManagement")}: - - ONLYOFFICE App Server - - - v.{versionAppServer} - -
- -
- {t("OnlineEditors")}: - - ONLYOFFICE Docs - - - v.{versionEditor} - -
- -
- {t("SoftwareLicense")}: - - {license} - -
- - - © Ascensio System SIA - - -
- {t("AboutCompanyAddressTitle")}: - {address} -
- -
- {t("AboutCompanyTelTitle")}: - {phone} -
-
- {t("AboutCompanyEmailTitle")}: - - {email} - -
+
); }; From fbf0ee3bf0f9cbec43d1d9a189259444f09e95c9 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Wed, 4 Aug 2021 12:06:37 +0300 Subject: [PATCH 8/8] Web: Client: added about dialog --- .../NavMenu/sub-components/header-nav.js | 31 ++++++++- .../src/components/pages/About/AboutDialog.js | 42 ++++++++++++ .../pages/About/ModalDialogContainer.js | 67 +++++++++++++++++++ 3 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 web/ASC.Web.Client/src/components/pages/About/AboutDialog.js create mode 100644 web/ASC.Web.Client/src/components/pages/About/ModalDialogContainer.js diff --git a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js index ff7da60d64..74fb7185be 100644 --- a/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js +++ b/web/ASC.Web.Client/src/components/NavMenu/sub-components/header-nav.js @@ -10,6 +10,8 @@ import { inject, observer } from "mobx-react"; import { withRouter } from "react-router"; import { AppServerConfig } from "@appserver/common/constants"; import config from "../../../../package.json"; +import { isDesktop } from "react-device-detect"; +import AboutDialog from "../../pages/About/AboutDialog"; const { proxyURL } = AppServerConfig; const homepage = config.homepage; @@ -61,8 +63,10 @@ const HeaderNav = ({ isAuthenticated, peopleAvailable, isPersonal, + versionAppServer, }) => { - const { t } = useTranslation(["NavMenu", "Common"]); + const { t } = useTranslation(["NavMenu", "Common", "About"]); + const [visibleDialog, setVisibleDialog] = useState(false); const onProfileClick = useCallback(() => { peopleAvailable @@ -70,7 +74,15 @@ const HeaderNav = ({ : window.open(PROFILE_MY_URL, "_blank"); }, []); - const onAboutClick = useCallback(() => history.push(ABOUT_URL), []); + const onAboutClick = useCallback(() => { + if (isDesktop) { + setVisibleDialog(true); + } else { + history.push(ABOUT_URL); + } + }, []); + + const onCloseDialog = () => setVisibleDialog(false); const onSwitchToDesktopClick = useCallback(() => { deleteCookie("desktop_view"); @@ -142,6 +154,14 @@ const HeaderNav = ({ ) : ( <> )} + + ); }; @@ -167,7 +187,11 @@ export default withRouter( language, logout, } = auth; - const { defaultPage, personal: isPersonal } = settingsStore; + const { + defaultPage, + personal: isPersonal, + version: versionAppServer, + } = settingsStore; const { user } = userStore; const modules = auth.availableModules; return { @@ -180,6 +204,7 @@ export default withRouter( modules, logout, peopleAvailable: modules.some((m) => m.appName === "people"), + versionAppServer, }; })(observer(HeaderNav)) ); diff --git a/web/ASC.Web.Client/src/components/pages/About/AboutDialog.js b/web/ASC.Web.Client/src/components/pages/About/AboutDialog.js new file mode 100644 index 0000000000..6abf6cc399 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/About/AboutDialog.js @@ -0,0 +1,42 @@ +import React from "react"; +import PropTypes from "prop-types"; +import ModalDialog from "@appserver/components/modal-dialog"; +import ModalDialogContainer from "./ModalDialogContainer"; +import { I18nextProvider, useTranslation } from "react-i18next"; +import AboutContent from "./AboutContent"; +import i18n from "./i18n"; + +const AboutDialog = (props) => { + const { visible, onClose, personal, versionAppServer } = props; + const { t, ready } = useTranslation(["About", "Common"]); + + return ( + + {t("AboutHeader")} + + + + + ); +}; + +AboutDialog.propTypes = { + visible: PropTypes.bool, + onClose: PropTypes.func, + personal: PropTypes.bool, + versionAppServer: PropTypes.string, +}; + +const AboutDialogWrapper = (props) => { + return ( + + + + ); +}; + +export default AboutDialogWrapper; diff --git a/web/ASC.Web.Client/src/components/pages/About/ModalDialogContainer.js b/web/ASC.Web.Client/src/components/pages/About/ModalDialogContainer.js new file mode 100644 index 0000000000..b3c61b02ab --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/About/ModalDialogContainer.js @@ -0,0 +1,67 @@ +import styled from "styled-components"; +import { tablet } from "@appserver/components/utils/device"; +import ModalDialog from "@appserver/components/modal-dialog"; + +const ModalDialogContainer = styled(ModalDialog)` + .invite-link-dialog-wrapper { + display: flex; + + @media ${tablet} { + display: grid; + grid-gap: 8px; + grid-template-columns: auto; + } + } + + .text-dialog { + margin: 16px 0; + } + + .input-dialog { + margin-top: 16px; + } + + .button-dialog { + margin-left: 8px; + } + + .warning-text { + margin: 20px 0; + } + + .textarea-dialog { + margin-top: 12px; + } + + .link-dialog { + transition: opacity 0.2s; + margin-right: 12px; + opacity: ${(props) => (props.ChangeTextAnim ? 0 : 1)}; + } + + .error-label { + position: absolute; + max-width: 100%; + } + + .field-body { + position: relative; + } + + .toggle-content-dialog { + .heading-toggle-content { + font-size: 16px; + } + + .modal-dialog-content { + padding: 8px 16px; + border: 1px solid lightgray; + + .modal-dialog-checkbox:not(:last-child) { + padding-bottom: 4px; + } + } + } +`; + +export default ModalDialogContainer;