diff --git a/products/ASC.Files/Client/yarn.lock b/products/ASC.Files/Client/yarn.lock index 22b2a4bc2b..8cad14d64a 100644 --- a/products/ASC.Files/Client/yarn.lock +++ b/products/ASC.Files/Client/yarn.lock @@ -9458,6 +9458,11 @@ react-content-loader@^5.1.1, react-content-loader@^5.1.2: resolved "https://registry.yarnpkg.com/react-content-loader/-/react-content-loader-5.1.4.tgz#854bafe4415dd9de07174621375bc308edd0ebb5" integrity sha512-hTq7pZi2GKCK6a9d3u6XStozm0QGCEjw8cSqQReiWnh2up6IwCha5R5TF0o6SY5qUDpByloEZEZtnFxpJyENFw== +react-content-loader@^5.1.2: + version "5.1.4" + resolved "https://registry.yarnpkg.com/react-content-loader/-/react-content-loader-5.1.4.tgz#854bafe4415dd9de07174621375bc308edd0ebb5" + integrity sha512-hTq7pZi2GKCK6a9d3u6XStozm0QGCEjw8cSqQReiWnh2up6IwCha5R5TF0o6SY5qUDpByloEZEZtnFxpJyENFw== + react-custom-scrollbars@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/react-custom-scrollbars/-/react-custom-scrollbars-4.2.1.tgz#830fd9502927e97e8a78c2086813899b2a8b66db" diff --git a/web/ASC.Web.Client/package.json b/web/ASC.Web.Client/package.json index f506a2e901..f11149ecd4 100644 --- a/web/ASC.Web.Client/package.json +++ b/web/ASC.Web.Client/package.json @@ -23,6 +23,7 @@ "react-redux": "7.1.3", "react-router": "5.1.2", "react-router-dom": "5.1.2", + "react-string-format": "^0.1.0", "redux": "4.0.5", "redux-thunk": "2.3.0", "reselect": "^4.0.0", diff --git a/web/ASC.Web.Client/public/images/thirdparties/bitly.svg b/web/ASC.Web.Client/public/images/thirdparties/bitly.svg new file mode 100644 index 0000000000..6ba56303a3 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/bitly.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/box.svg b/web/ASC.Web.Client/public/images/thirdparties/box.svg new file mode 100644 index 0000000000..d5cda33a1e --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/box.svg @@ -0,0 +1,3 @@ + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/clickatell.svg b/web/ASC.Web.Client/public/images/thirdparties/clickatell.svg new file mode 100644 index 0000000000..d4eccc5889 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/clickatell.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/docusign.svg b/web/ASC.Web.Client/public/images/thirdparties/docusign.svg new file mode 100644 index 0000000000..37f1376ee5 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/docusign.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/dropbox.svg b/web/ASC.Web.Client/public/images/thirdparties/dropbox.svg new file mode 100644 index 0000000000..6e627f3372 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/dropbox.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/easybib.svg b/web/ASC.Web.Client/public/images/thirdparties/easybib.svg new file mode 100644 index 0000000000..625f4f8506 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/easybib.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/facebook.svg b/web/ASC.Web.Client/public/images/thirdparties/facebook.svg new file mode 100644 index 0000000000..873bbf1011 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/facebook.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/firebase.svg b/web/ASC.Web.Client/public/images/thirdparties/firebase.svg new file mode 100644 index 0000000000..f9c7047b79 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/firebase.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/google.svg b/web/ASC.Web.Client/public/images/thirdparties/google.svg new file mode 100644 index 0000000000..82cfec0e7e --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/google.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/googlecloud.svg b/web/ASC.Web.Client/public/images/thirdparties/googlecloud.svg new file mode 100644 index 0000000000..123aa4f854 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/googlecloud.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/linkedin.svg b/web/ASC.Web.Client/public/images/thirdparties/linkedin.svg new file mode 100644 index 0000000000..93c1bc4862 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/linkedin.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/mailru.svg b/web/ASC.Web.Client/public/images/thirdparties/mailru.svg new file mode 100644 index 0000000000..fbe55b1f17 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/mailru.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/rackspace.svg b/web/ASC.Web.Client/public/images/thirdparties/rackspace.svg new file mode 100644 index 0000000000..a02515db5e --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/rackspace.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/s3.svg b/web/ASC.Web.Client/public/images/thirdparties/s3.svg new file mode 100644 index 0000000000..ec6ff2666b --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/s3.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/selectel.svg b/web/ASC.Web.Client/public/images/thirdparties/selectel.svg new file mode 100644 index 0000000000..de7f47c180 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/selectel.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/skydrive.svg b/web/ASC.Web.Client/public/images/thirdparties/skydrive.svg new file mode 100644 index 0000000000..26bb99cf79 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/skydrive.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/smsc.svg b/web/ASC.Web.Client/public/images/thirdparties/smsc.svg new file mode 100644 index 0000000000..06699de0a8 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/smsc.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/telegram.svg b/web/ASC.Web.Client/public/images/thirdparties/telegram.svg new file mode 100644 index 0000000000..26821adc53 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/telegram.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/twilio.svg b/web/ASC.Web.Client/public/images/thirdparties/twilio.svg new file mode 100644 index 0000000000..44f5f002e4 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/twilio.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/twitter.svg b/web/ASC.Web.Client/public/images/thirdparties/twitter.svg new file mode 100644 index 0000000000..e50f5c48d6 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/twitter.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/vk.svg b/web/ASC.Web.Client/public/images/thirdparties/vk.svg new file mode 100644 index 0000000000..20a9f118df --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/vk.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/wordpress.svg b/web/ASC.Web.Client/public/images/thirdparties/wordpress.svg new file mode 100644 index 0000000000..2936cc1408 --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/wordpress.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/yahoo.svg b/web/ASC.Web.Client/public/images/thirdparties/yahoo.svg new file mode 100644 index 0000000000..7453541e0a --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/yahoo.svg @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/ASC.Web.Client/public/images/thirdparties/yandex.svg b/web/ASC.Web.Client/public/images/thirdparties/yandex.svg new file mode 100644 index 0000000000..f79e82686e --- /dev/null +++ b/web/ASC.Web.Client/public/images/thirdparties/yandex.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/headerContainer.js b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/headerContainer.js index c9389a37fa..6f982ceae3 100644 --- a/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/headerContainer.js +++ b/web/ASC.Web.Client/src/components/pages/PaymentsEnterprise/sub-components/headerContainer.js @@ -21,7 +21,6 @@ const StyledHeader = styled.div` grid-template-columns: 1fr; grid-template-rows: min-content min-content; grid-row-gap: 8px; - .payments-header { font-style: normal; line-height: 32px; @@ -30,7 +29,6 @@ const StyledHeader = styled.div` margin-bottom: 40px; line-height: 20px; } - @media (max-width: 632px) { .payments-header-additional_support { margin-bottom: 16px; 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..8fa7531c6b --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/index.js @@ -0,0 +1,30 @@ +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("./thirdPartyServicesSettings")); + +const Integration = ({ match }) => { + const basePath = "/settings/integration"; + + return ( + } + > + + + + + ); +}; + +export default withRouter(Integration); 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..64cbe445f6 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerItem.js @@ -0,0 +1,63 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { Box, Text } from "asc-web-components"; +import ConsumerToggle from "./consumerToggle"; + +class ConsumerItem extends React.Component { + render() { + const { + consumer, + onModalOpen, + setConsumer, + updateConsumerProps, + t, + } = this.props; + + const logo = `/images/thirdparties/${consumer.name.toLowerCase()}.svg`; + + return ( + <> + + + + {consumer.name} + + + + + + + {consumer.description} + + + + ); + } +} + +export default ConsumerItem; + +ConsumerItem.propTypes = { + consumer: PropTypes.shape({ + name: PropTypes.string, + title: PropTypes.string, + description: PropTypes.string, + instruction: PropTypes.string, + canSet: PropTypes.bool, + props: PropTypes.arrayOf(PropTypes.object), + }).isRequired, + onModalOpen: PropTypes.func.isRequired, + setConsumer: PropTypes.func.isRequired, + updateConsumerProps: PropTypes.func.isRequired, +}; diff --git a/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerModalDialog.js b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerModalDialog.js new file mode 100644 index 0000000000..bd7bb9a8f2 --- /dev/null +++ b/web/ASC.Web.Client/src/components/pages/Settings/categories/integration/sub-components/consumerModalDialog.js @@ -0,0 +1,227 @@ +import React from "react"; +import PropTypes from "prop-types"; +import { + ModalDialog, + Text, + Button, + TextInput, + Box, + Link, + toastr, +} from "asc-web-components"; +import ModalDialogContainer from "./modalDialogContainer"; +import { Trans } from "react-i18next"; +import { connect } from "react-redux"; +import { + getSelectedConsumer, + getConsumerInstruction, +} from "../../../../../../store/settings/selectors"; +import { store as commonStore } from "asc-web-common"; + +const { getUrlSupport, getUrlAuthKeys } = commonStore.auth.selectors; + +class ConsumerModalDialog extends React.Component { + constructor(props) { + super(props); + this.state = {}; + } + + mapTokenNameToState = () => { + const { selectedConsumer } = this.props; + selectedConsumer.props.map((prop) => + this.setState({ + [`${prop.name}`]: prop.value, + }) + ); + }; + + onChangeHandler = (e) => { + this.setState({ + [e.target.name]: e.target.value, + }); + }; + + updateConsumerValues = () => { + const { + onChangeLoading, + selectedConsumer, + updateConsumerProps, + onModalClose, + t, + } = this.props; + const { state } = this; + + onChangeLoading(true); + + const prop = []; + + let i = 0; + let stateLength = Object.keys(state).length; + for (i = 0; i < stateLength; i++) { + prop.push({ + name: Object.keys(state)[i], + value: Object.values(state)[i], + }); + } + const data = { + name: selectedConsumer.name, + props: prop, + }; + updateConsumerProps(data) + .then(() => { + onChangeLoading(false); + toastr.success(t("ThirdPartyPropsActivated")); + }) + .catch((error) => { + onChangeLoading(false); + toastr.error(error); + }) + .finally(onModalClose()); + }; + + // shouldComponentUpdate(nextProps, nextState) { + // console.log("this.state: ", this.state, "nextState: ", nextState); + // return nextState !== this.state; + // } + + componentDidMount() { + this.mapTokenNameToState(); + } + + bodyDescription = ( + + + + {this.props.t("ThirdPartyHowItWorks")} + + + + + For more detailed instructions about connecting this service, please + refer to our{" "} + + Help Center + {" "} + that provides all the necessary information. + + + + ); + + bottomDescription = ( + + If you still have some questions on how to connect this service or need + technical assistance, please feel free to contact our{" "} + + Support Team + + + ); + + render() { + const { + selectedConsumer, + consumerInstruction, + onModalClose, + dialogVisible, + isLoading, + t, + } = this.props; + const { + state, + onChangeHandler, + updateConsumerValues, + bodyDescription, + bottomDescription, + } = this; + + return ( + + + {selectedConsumer.title} + + {consumerInstruction} + {bodyDescription} + + {selectedConsumer.props.map((prop, i) => ( + + + + {prop.title}: + + + + + + + ))} + + {bottomDescription} + + +