From a1f53b16c4143ba98eb4b12f8b9044e2c84e616a Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Tue, 4 Aug 2020 09:52:58 +0300 Subject: [PATCH 01/86] TPS init --- .../Settings/categories/integration/index.js | 24 +++++++++++++++++++ .../integration/third-party-services.js | 13 ++++++++++ 2 files changed, 37 insertions(+) create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/index.js create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/index.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/index.js new file mode 100644 index 0000000000..d43854af29 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/index.js @@ -0,0 +1,24 @@ +import React, { lazy, Suspense } from "react"; +import { Route, Switch } from "react-router-dom"; +import { withRouter } from "react-router"; +import { Loader } from "asc-web-components"; + +const ThirdPartyServices = lazy(() => import("./third-party-services")); + +const Integration = ({ match }) => { + const basePath = '/settings/integration'; + + return ( + }> + + + + + ); +}; + +export default withRouter(Integration); \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js new file mode 100644 index 0000000000..44fcabf052 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js @@ -0,0 +1,13 @@ +import React from "react"; + +class ThirdParty extends React.Component { + + render() { + return ( +
tfs settings
+ ) + } +} + + +export default ThirdParty; \ No newline at end of file From 153a420674b78fe6966418f9c567a40e480cd464 Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Tue, 4 Aug 2020 09:53:13 +0300 Subject: [PATCH 02/86] Add routing --- .../src/components/pages/Settings/index.js | 9 +++++++-- .../pages/Settings/utils/settingsTree.js | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/index.js b/web/ASC.Web.Client/src/components/pages/Settings/index.js index 7aae96b3a6..68e14f5a65 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/index.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/index.js @@ -1,4 +1,4 @@ -import React, { lazy,Suspense } from "react"; +import React, { lazy, Suspense } from "react"; import { Route, Switch, Redirect } from "react-router-dom"; import { withRouter } from "react-router"; import Layout from './Layout'; @@ -6,10 +6,11 @@ import { Loader } from "asc-web-components"; const CommonSettings = lazy(() => import("./categories/common")); const SecuritySettings = lazy(() => import("./categories/security")); +const IntegrationSettings = lazy(() => import("./categories/integration")); const Settings = () => { const basePath = '/settings'; - + return ( }> @@ -18,6 +19,10 @@ const Settings = () => { path={`${basePath}/security`} component={SecuritySettings} /> + Date: Tue, 4 Aug 2020 11:53:00 +0300 Subject: [PATCH 03/86] Add styles and data prototypes --- .../sub-components/consumerItem.js | 28 +++++++++++++ .../integration/sub-components/consumers.js | 20 +++++++++ .../sub-components/modal-dialog-container.js | 0 .../sub-components/modal-dialog.js | 0 .../integration/third-party-services.js | 42 +++++++++++++++++-- 5 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog-container.js create mode 100644 web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js new file mode 100644 index 0000000000..12fbc32224 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js @@ -0,0 +1,28 @@ +import React from "react"; +import { Box, Text } from "asc-web-components"; + +const ConsumerItem = (props) => { + return ( + <> + + + + + {props.name} logo + + + + toggle + + + + + {props.description} + + + + + ) +} + +export default ConsumerItem; \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js new file mode 100644 index 0000000000..547d07b015 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js @@ -0,0 +1,20 @@ +export const consumers = [ + { + name: "Amazon", + description: "Подключите Amazon AWS S3 для резервного копирования и хранения данных портала.", + innerDescription: "Добавив Amazon AWS S3, вы сможете использовать его для создания резервных копий портала, чтобы предотвратить потерю данных. Также используйте его для хранения данных и статического содержимого портала.", + tokens: ["Ключ доступа S3", "Секретный ключ доступа S3"] + }, + { + name: "Mail.ru", + description: "Подключите приложение для входа на портал по учетной записи Mail.ru.", + innerDescription: "Добавив приложение сервиса Mail.ru Вы сможете на странице своего профиля подключить вход на портал используя аккаунт Mail.ru.", + tokens: ["ID", "Секретный ключ"] + }, + { + name: "Telegram", + description: "Подключите аккаунт Telegram для получения оповещений портала через Telegram.", + innerDescription: "", + tokens: ["Токен бота", "Имя бота"] + } +] \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog-container.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog-container.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js index 44fcabf052..dcbe4dbbd6 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/third-party-services.js @@ -1,13 +1,49 @@ import React from "react"; +import { consumers } from "./sub-components/consumers"; +import { Box, Text } from "asc-web-components"; +import ConsumerItem from "./sub-components/consumerItem"; -class ThirdParty extends React.Component { +class ThirdPartyServices extends React.Component { + + constructor(props) { + super(props); + this.state = { + consumers: consumers, + dialogVisible: false + } + } + + onToggleClick = () => { + this.setState( { + dialogVisible: true + }) + } + + titleDescription = "Ключи авторизации позволяют подключить портал ONLYOFFICE к сторонним сервисам, таким как Twitter, Facebook, Dropbox и т.д. Подключите портал к Facebook, Twitter или Linkedin, если Вы не хотите каждый раз при входе вводить свои учетные данные на портале. Привяжите портал к таким сервисам, как Dropbox, OneDrive и т.д. чтобы перенести документы из всех этих хранилищ в модуль Документы ONLYOFFICE." render() { return ( -
tfs settings
+ <> + + + {this.titleDescription} + + + + {this.state.consumers + .map((c) => + + )} + + + + ) } } -export default ThirdParty; \ No newline at end of file +export default ThirdPartyServices; \ No newline at end of file From d0c8cb7486ee6c03b98eefbdf342e53ec8c255fe Mon Sep 17 00:00:00 2001 From: Vladislav Makhov Date: Wed, 5 Aug 2020 09:07:41 +0300 Subject: [PATCH 04/86] Add modal dialog --- .../sub-components/consumerItem.js | 15 +++++++-- .../integration/sub-components/consumers.js | 2 +- .../sub-components/modal-dialog.js | 22 +++++++++++++ .../integration/third-party-services.js | 33 +++++++++++++++---- 4 files changed, 61 insertions(+), 11 deletions(-) diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js index 12fbc32224..83fdaa6cc6 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js @@ -1,26 +1,35 @@ import React from "react"; import { Box, Text } from "asc-web-components"; +import ConsumerModalDialog from "./modal-dialog"; const ConsumerItem = (props) => { + + const { name, description, dialogVisible, consumers, onModalClose, onToggleClick } = props; + return ( <> - {props.name} logo + {name} logo - + toggle - {props.description} + {description} + {dialogVisible && } ) } diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js index 547d07b015..45a9a9abbb 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumers.js @@ -14,7 +14,7 @@ export const consumers = [ { name: "Telegram", description: "Подключите аккаунт Telegram для получения оповещений портала через Telegram.", - innerDescription: "", + innerDescription: "Описание", tokens: ["Токен бота", "Имя бота"] } ] \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js index e69de29bb2..55bfd76413 100644 --- a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/modal-dialog.js @@ -0,0 +1,22 @@ +import React from "react"; +import { ModalDialog, Text, Button, TextInput } from "asc-web-components"; + +const ConsumerModalDialog = (props) => { + const { consumers, name, innerDescription } = props; + const getConsumerName = (key) => { + return consumers.find((c,i) => i === key).name; + } + return ( + , {innerDescription}]} + footerContent={[