diff --git a/products/ASC.People/Client/src/App.js b/products/ASC.People/Client/src/App.js index 2cb35cc64b..732534454f 100644 --- a/products/ASC.People/Client/src/App.js +++ b/products/ASC.People/Client/src/App.js @@ -2,14 +2,13 @@ import React, { Suspense } from "react"; import { connect } from "react-redux"; import { Router, Switch, Redirect } from "react-router-dom"; import { Loader } from "asc-web-components"; -import PeopleLayout from "./components/Layout/index"; import Home from "./components/pages/Home"; import Profile from './components/pages/Profile'; import ProfileAction from './components/pages/ProfileAction'; import GroupAction from './components/pages/GroupAction'; import Reassign from './components/pages/Reassign'; import Import from './components/pages/Import'; -import { history, PrivateRoute, PublicRoute, Login, Error404 } from "asc-web-common"; +import { history, PrivateRoute, PublicRoute, Login, Error404, StudioLayout } from "asc-web-common"; /*const Profile = lazy(() => import("./components/pages/Profile")); const ProfileAction = lazy(() => import("./components/pages/ProfileAction")); @@ -19,7 +18,7 @@ const App = ({ settings }) => { const { homepage } = settings; return ( - + } > @@ -65,7 +64,7 @@ const App = ({ settings }) => { - + ); }; diff --git a/products/ASC.People/Client/src/components/Layout/i18n.js b/products/ASC.People/Client/src/components/Layout/i18n.js deleted file mode 100644 index abb38c631d..0000000000 --- a/products/ASC.People/Client/src/components/Layout/i18n.js +++ /dev/null @@ -1,61 +0,0 @@ -import i18n from "i18next"; -import Backend from "i18next-xhr-backend"; -import config from "../../../package.json"; - -const newInstance = i18n.createInstance(); - -if (process.env.NODE_ENV === "production") { - newInstance - .use(Backend) - .init({ - lng: 'en', - fallbackLng: "en", - debug: true, - - interpolation: { - escapeValue: false, // not needed for react as it escapes by default - format: function (value, format) { - if (format === 'lowercase') return value.toLowerCase(); - return value; - } - }, - - react: { - useSuspense: false - }, - backend: { - loadPath: `${config.homepage}/locales/Layout/{{lng}}/{{ns}}.json` - } - }); -} else if (process.env.NODE_ENV === "development") { - - const resources = { - en: { - translation: require("./locales/en/translation.json") - }, - ru: { - translation: require("./locales/ru/translation.json") - } - }; - - newInstance.init({ - resources: resources, - lng: 'en', - fallbackLng: "en", - debug: true, - - interpolation: { - escapeValue: false, // not needed for react as it escapes by default - format: function (value, format) { - if (format === 'lowercase') return value.toLowerCase(); - return value; - } - }, - - react: { - useSuspense: false - } - }); -} - -export default newInstance; diff --git a/products/ASC.People/Client/src/components/Layout/index.js b/products/ASC.People/Client/src/components/Layout/index.js deleted file mode 100644 index 780c29b824..0000000000 --- a/products/ASC.People/Client/src/components/Layout/index.js +++ /dev/null @@ -1,126 +0,0 @@ -import React from 'react'; -import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; -import { withRouter } from "react-router"; -import { Layout, Toast } from 'asc-web-components'; -import { withTranslation, I18nextProvider } from 'react-i18next'; -import i18n from "./i18n"; -import { store } from 'asc-web-common'; -const { logout } = store.auth.actions; - -class PurePeopleLayout extends React.Component { - shouldComponentUpdate(nextProps) { - if (this.props.hasChanges !== nextProps.hasChanges) { - return true; - } - - return false; - } - - onProfileClick = () => { - console.log('ProfileBtn'); - const { history, settings } = this.props; - history.push(`${settings.homepage}/view/@self`); - } - - onAboutClick = () => { - window.location.href = "/about"; - } - - onLogoutClick = () => { - this.props.logout(); - } - - onLogoClick = () => window.open("/", '_self'); - - render() { - const { hasChanges, children, t } = this.props; - - const currentUserActions = [ - { - key: 'ProfileBtn', label: t('Profile'), onClick: this.onProfileClick - }, - { - key: 'AboutBtn', label: t('AboutCompanyTitle'), onClick: this.onAboutClick - }, - { - key: 'LogoutBtn', label: t('LogoutButton'), onClick: this.onLogoutClick - }, - ]; - - const newProps = hasChanges - ? { - currentUserActions: currentUserActions, - onLogoClick: this.onLogoClick, - ...this.props - } - : {}; - - console.log("PeopleLayout render", newProps); - return ( - <> - - {children} - - ); - } -}; - - -const getAvailableModules = (modules, currentUser) => { - const isUserAdmin = currentUser.isAdmin; - const customModules = isUserAdmin ? [ - { - separator: true, - id: "nav-separator-2" - }, - { - id: 'settings', - title: 'Settings', - iconName: "SettingsIcon", - notifications: 0, - url: '/settings', - onClick: () => window.open('/settings', "_self"), - onBadgeClick: e => console.log("SettingsIconBadge Clicked", e) - }] : []; - - const separator = { separator: true, id: 'nav-separator-1' }; - const products = modules.map(product => { - return { - id: product.id, - title: product.title, - iconName: 'PeopleIcon', - notifications: 0, - url: product.link, - onClick: () => window.open(product.link, '_self'), - onBadgeClick: e => console.log('PeopleIconBadge Clicked', e) - }; - }) || []; - - return products.length ? [separator, ...products, ...customModules] : products; -}; - -function mapStateToProps(state) { - return { - hasChanges: state.auth.isAuthenticated && state.auth.isLoaded, - availableModules: getAvailableModules(state.auth.modules, state.auth.user), - currentUser: state.auth.user, - currentModuleId: state.auth.settings.currentProductId, - settings: state.auth.settings, - language: state.auth.user.cultureName || state.auth.settings.culture, - }; -} - -const PeopleLayoutContainer = withTranslation()(PurePeopleLayout); - -const PeopleLayout = (props) => { - const { language } = props; - i18n.changeLanguage(language); - return (); -}; - -PeopleLayout.propTypes = { - logout: PropTypes.func.isRequired -}; - -export default connect(mapStateToProps, { logout })(withRouter((PeopleLayout))); diff --git a/web/ASC.Web.Client/src/App.js b/web/ASC.Web.Client/src/App.js index 288f7eb7dc..421837429c 100644 --- a/web/ASC.Web.Client/src/App.js +++ b/web/ASC.Web.Client/src/App.js @@ -1,8 +1,7 @@ import React, { Suspense, lazy } from "react"; import { Router, Route, Switch } from "react-router-dom"; import { Loader } from "asc-web-components"; -import StudioLayout from "./components/Layout/index"; -import { history, PrivateRoute, PublicRoute, Login, Error404 } from "asc-web-common"; +import { history, PrivateRoute, PublicRoute, Login, Error404, StudioLayout} from "asc-web-common"; const Home = lazy(() => import("./components/pages/Home")); const About = lazy(() => import("./components/pages/About")); diff --git a/web/ASC.Web.Client/src/components/Layout/i18n.js b/web/ASC.Web.Client/src/components/Layout/i18n.js deleted file mode 100644 index 7eeb017e67..0000000000 --- a/web/ASC.Web.Client/src/components/Layout/i18n.js +++ /dev/null @@ -1,60 +0,0 @@ -import i18n from "i18next"; -import Backend from "i18next-xhr-backend"; - -const newInstance = i18n.createInstance(); - -if (process.env.NODE_ENV === "production") { - newInstance - .use(Backend) - .init({ - lng: 'en', - fallbackLng: "en", - debug: false, - - interpolation: { - escapeValue: false, // not needed for react as it escapes by default - format: function (value, format) { - if (format === 'lowercase') return value.toLowerCase(); - return value; - } - }, - - react: { - useSuspense: false - }, - backend: { - loadPath: `/locales/Layout/{{lng}}/{{ns}}.json` - } - }); -} else if (process.env.NODE_ENV === "development") { - - const resources = { - en: { - translation: require("./locales/en/translation.json") - }, - ru: { - translation: require("./locales/ru/translation.json") - } - }; - - newInstance.init({ - resources: resources, - lng: 'en', - fallbackLng: "en", - debug: true, - - interpolation: { - escapeValue: false, // not needed for react as it escapes by default - format: function (value, format) { - if (format === 'lowercase') return value.toLowerCase(); - return value; - } - }, - - react: { - useSuspense: false - } - }); -} - -export default newInstance; \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/Layout/index.js b/web/ASC.Web.Client/src/components/Layout/index.js deleted file mode 100644 index e7b38e23b7..0000000000 --- a/web/ASC.Web.Client/src/components/Layout/index.js +++ /dev/null @@ -1,124 +0,0 @@ -import React from "react"; -import { connect } from "react-redux"; -import PropTypes from "prop-types"; -import { withRouter } from "react-router"; -import { Layout, Toast } from "asc-web-components"; -import { withTranslation, I18nextProvider } from 'react-i18next'; -import i18n from "./i18n"; -import isEqual from "lodash/isEqual"; -import { store } from 'asc-web-common'; -const { logout } = store.auth.actions; - -class PureStudioLayout extends React.Component { - shouldComponentUpdate(nextProps, nextState) { - return !isEqual(this.props, nextProps) || !isEqual(this.state, nextState); - } - - onProfileClick = () => { - window.location.href = "/products/people/view/@self"; - } - - onAboutClick = () => { - this.props.history.push("/about"); - } - - onLogoutClick = () => { - this.props.logout(); - this.props.history.push("/"); - } - - onLogoClick = () => this.props.history.push("/"); - - render() { - const { hasChanges, children, t } = this.props; - - const currentUserActions = [ - { - key: 'ProfileBtn', label: t("Profile"), onClick: this.onProfileClick - }, - { - key: 'AboutBtn', label: t("AboutCompanyTitle"), onClick: this.onAboutClick - }, - { - key: 'LogoutBtn', label: t("LogoutButton"), onClick: this.onLogoutClick - }, - ]; - - const newProps = hasChanges - ? { - currentUserActions: currentUserActions, - onLogoClick: this.onLogoClick, - ...this.props - } - : {}; - - console.log("StudioLayout render", newProps); - return ( - <> - - {children} - - ); - } -}; - - -const getAvailableModules = (modules, currentUser) => { - const isUserAdmin = currentUser.isAdmin; - const separator = { separator: true, id: "nav-separator-1" }; - const customModules = isUserAdmin ? [ - { - separator: true, - id: "nav-separator-2" - }, - { - id: 'settings', - title: 'Settings', - iconName: "SettingsIcon", - notifications: 0, - url: '/settings', - onClick: () => window.open('/settings', "_self"), - onBadgeClick: e => console.log("SettingsIconBadge Clicked", e) - }] : []; - const products = - modules.map(product => { - return { - id: product.id, - title: product.title, - iconName: "PeopleIcon", - notifications: 0, - url: product.link, - onClick: () => window.open(product.link, "_self"), - onBadgeClick: e => console.log("PeopleIconBadge Clicked", e) - }; - }) || []; - - return products.length ? [separator, ...products, ...customModules] : products; -}; - -function mapStateToProps(state) { - let availableModules = getAvailableModules(state.auth.modules, state.auth.user); - return { - hasChanges: state.auth.isAuthenticated && state.auth.isLoaded, - availableModules: availableModules, - currentUser: state.auth.user, - currentModuleId: state.auth.settings.currentProductId, - language: state.auth.user.cultureName || state.auth.settings.culture, - }; -}; -const StudioLayoutContainer = withTranslation()(PureStudioLayout); - -const StudioLayout = (props) => { - const { language } = props; - i18n.changeLanguage(language); - return (); -}; - -StudioLayout.propTypes = { - logout: PropTypes.func.isRequired -}; - -export default connect( - mapStateToProps, - { logout } -)(withRouter(StudioLayout)); diff --git a/web/ASC.Web.Client/src/components/Layout/locales/en/translation.json b/web/ASC.Web.Client/src/components/Layout/locales/en/translation.json deleted file mode 100644 index 63d5bb0dbe..0000000000 --- a/web/ASC.Web.Client/src/components/Layout/locales/en/translation.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Profile": "Profile", - "AboutCompanyTitle": "About this program", - "LogoutButton": "Sign Out" -} \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/Layout/locales/ru/translation.json b/web/ASC.Web.Client/src/components/Layout/locales/ru/translation.json deleted file mode 100644 index 0883767d3c..0000000000 --- a/web/ASC.Web.Client/src/components/Layout/locales/ru/translation.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "Profile": "Профиль", - "AboutCompanyTitle": "О программе", - "LogoutButton": "Выйти" -} \ No newline at end of file diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js index 4d9cf76e9b..7ecff10599 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/activateUser.js @@ -3,7 +3,6 @@ import { withRouter } from "react-router"; import { withTranslation } from 'react-i18next'; import { Button, TextInput, PageLayout, Text, PasswordInput, toastr, Loader } from 'asc-web-components'; import styled from 'styled-components'; -import { Collapse } from 'reactstrap'; import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import { store, constants } from 'asc-web-common'; @@ -298,10 +297,9 @@ class Confirm extends React.PureComponent { */} - -
{this.state.errorText}
-
+ + {this.state.errorText} + ) diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeOwner.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeOwner.js index 754cd68caa..a9c26f2db4 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeOwner.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changeOwner.js @@ -4,44 +4,44 @@ import { withTranslation } from "react-i18next"; import { connect } from "react-redux"; import PropTypes from "prop-types"; import styled from "styled-components"; -import { Container, Row, Col, Card, CardTitle, CardImg } from "reactstrap"; import { Button, PageLayout, Text, toastr } from "asc-web-components"; //import { } from "../../../../../src/store/auth/actions"; -const BodyStyle = styled(Container)` +const BodyStyle = styled.div` margin-top: 70px; - .buttons-style { - margin-top: 20px; - min-width: 110px; - } - .button-style { - margin-right: 8px; - } - .confirm_text { - margin: 12px 0; - } + .owner-container { + display: grid; - .password-card { - border: none; - .card-img { - max-width: 216px; - max-height: 35px; - } - .card-title { - word-wrap: break-word; - margin: 8px 0; - text-align: left; - font-size: 24px; - color: #116d9d; - } - } + .owner-wrapper { + align-self: center; + justify-self: center; + .owner-img { + max-width: 216px; + max-height: 35px; + } + .owner-title { + word-wrap: break-word; + margin: 8px 0; + text-align: left; + font-size: 24px; + color: #116d9d; + } + .owner-confirm_text { + margin: 20px 0 12px 0; + } + .owner-buttons { + margin-top: 20px; + min-width: 110px; + } + .owner-button { + margin-right: 8px; + } - .row_display { - display: flex; - } - .confirm-text { - margin-top: 32px; + .owner-confirm-message { + margin-top: 32px; + } + } } `; @@ -68,61 +68,47 @@ class Form extends React.PureComponent { render() { const { t, greetingTitle } = this.props; - const mdOptions = { size: 6, offset: 2 }; return ( - - - - - {greetingTitle} - - - - - - +
+
+ Logo + {greetingTitle} + {t("ConfirmOwnerPortalTitle", { newOwner: "NEW OWNER" })} - - - {this.state.showButtons ? ( - - -
+
); } diff --git a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js index 325fdda331..730c2e6c99 100644 --- a/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js +++ b/web/ASC.Web.Client/src/components/pages/Confirm/sub-components/changePassword.js @@ -4,7 +4,6 @@ import { withTranslation } from "react-i18next"; import { connect } from "react-redux"; import PropTypes from "prop-types"; import styled from "styled-components"; -import { Container, Row, Col, Card, CardTitle, CardImg } from "reactstrap"; import { Button, PageLayout, @@ -13,34 +12,32 @@ import { Loader, toastr } from "asc-web-components"; -import { store } from 'asc-web-common'; -const { changePassword, getConfirmationInfo, logout } = store.auth.actions; +import { store } from "asc-web-common"; +const { changePassword, getConfirmationInfo, logout } = store.auth.actions; -const BodyStyle = styled(Container)` - margin-top: 70px; - p { +const BodyStyle = styled.form` + margin: 70px auto 0 auto; + max-width: 500px; + + .password-header { + margin-bottom: 24px; + + .password-logo { + max-width: 216px; + max-height: 35px; + } + + .password-title { + margin: 8px 0; + } + } + + .password-text { margin-bottom: 5px; } - .button-style { - margin-top: 20px; - } - .password-row { - margin: 23px 0 0; - .password-card { - border: none; - .card-img { - max-width: 216px; - max-height: 35px; - } - .card-title { - word-wrap: break-word; - margin: 8px 0; - text-align: left; - font-size: 24px; - color: #116d9d; - } - } + .password-button { + margin-top: 20px; } `; @@ -106,8 +103,7 @@ class Form extends React.PureComponent { componentDidMount() { const { getConfirmationInfo, history } = this.props; - getConfirmationInfo(this.state.key) - .catch(error => { + getConfirmationInfo(this.state.key).catch(error => { toastr.error(this.props.t(`${error}`)); history.push("/"); }); @@ -126,69 +122,65 @@ class Form extends React.PureComponent { render() { const { settings, isConfirmLoaded, t, greetingTitle } = this.props; const { isLoading, password, passwordEmpty } = this.state; - const mdOptions = { size: 6, offset: 3 }; return !isConfirmLoaded ? ( ) : ( - - - - - - {greetingTitle} - - - {t("PassworResetTitle")} - - -