Merge branch 'feature/workspaces' of github.com:ONLYOFFICE/AppServer into feature/workspaces

This commit is contained in:
Ilya Oleshko 2021-03-12 13:00:24 +03:00
commit e673f48751
5 changed files with 47 additions and 39 deletions

View File

@ -26,7 +26,7 @@ class MainButton extends React.PureComponent {
}
handleClick = (e) => {
if (!this.state.isOpen && this.ref.current.contains(e.target)) return;
if (this.state.isOpen && this.ref.current.contains(e.target)) return;
this.toggle(false);
};

View File

@ -1,6 +1,6 @@
import React, { Suspense, useEffect } from "react";
import { Provider as PeopleProvider, inject, observer } from "mobx-react";
import { Switch } from "react-router";
import { Router, Switch } from "react-router-dom";
import PeopleStore from "./store/PeopleStore";
import Home from "./components/pages/Home";
import Loader from "@appserver/components/loader";
@ -17,6 +17,7 @@ import config from "../package.json";
import "./custom.scss";
import i18n from "./i18n";
import { I18nextProvider } from "react-i18next";
import history from "@appserver/common/history";
const Error404 = React.lazy(() => import("studio/Error404"));
@ -40,37 +41,42 @@ const PeopleContent = (props) => {
<Suspense
fallback={<Loader className="pageLoader" type="rombs" size="40px" />}
>
<Switch>
<PrivateRoute
exact
path={`${homepage}/view/:userId`}
component={Profile}
/>
<PrivateRoute
path={`${homepage}/edit/:userId`}
restricted
allowForMe
component={ProfileAction}
/>
<PrivateRoute
path={`${homepage}/create/:type`}
restricted
component={ProfileAction}
/>
<PrivateRoute
path={[`${homepage}/group/edit/:groupId`, `${homepage}/group/create`]}
restricted
component={GroupAction}
/>
<PrivateRoute
path={`${homepage}/reassign/:userId`}
restricted
component={Reassign}
/>
<PrivateRoute exact path={homepage} component={Home} />
<PrivateRoute path={`${homepage}/filter`} component={Home} />
<PrivateRoute component={Error404} />
</Switch>
<Router history={history}>
<Switch>
<PrivateRoute
exact
path={`${homepage}/view/:userId`}
component={Profile}
/>
<PrivateRoute
path={`${homepage}/edit/:userId`}
restricted
allowForMe
component={ProfileAction}
/>
<PrivateRoute
path={`${homepage}/create/:type`}
restricted
component={ProfileAction}
/>
<PrivateRoute
path={[
`${homepage}/group/edit/:groupId`,
`${homepage}/group/create`,
]}
restricted
component={GroupAction}
/>
<PrivateRoute
path={`${homepage}/reassign/:userId`}
restricted
component={Reassign}
/>
<PrivateRoute exact path={homepage} component={Home} />
<PrivateRoute path={`${homepage}/filter`} component={Home} />
<PrivateRoute component={Error404} />
</Switch>
</Router>
</Suspense>
);
};
@ -90,7 +96,7 @@ const peopleStore = new PeopleStore();
export default (props) => (
<PeopleProvider peopleStore={peopleStore}>
<I18nextProvider i18n={i18n}>
<People {...props}/>
<People {...props} />
</I18nextProvider>
</PeopleProvider>
);

View File

@ -109,8 +109,6 @@ class InviteDialogComponent extends React.Component {
getPortalInviteLinks().then(() => {
this.setState({
visible: true,
userInvitationLink: this.props.userInvitationLink,
guestInvitationLink: this.props.guestInvitationLink,
});
});
} else {

View File

@ -22,7 +22,8 @@ import { Base } from "@appserver/components/themes";
import store from "studio/store";
import config from "../package.json";
import "./custom.scss";
import "./i18n";
import { I18nextProvider } from "react-i18next";
import i18n from "./i18n";
const Payments = React.lazy(() => import("./components/pages/Payments"));
const Error404 = React.lazy(() => import("studio/Error404"));
@ -259,7 +260,9 @@ const ShellWrapper = inject(({ auth }) => {
export default () => (
<ThemeProvider theme={Base}>
<MobxProvider {...store}>
<ShellWrapper />
<I18nextProvider i18n={i18n}>
<ShellWrapper />
</I18nextProvider>
</MobxProvider>
</ThemeProvider>
);

View File

@ -91,8 +91,9 @@ class PureOwnerSettings extends Component {
toastr.error(error);
})
.finally(() => this.setState({ showLoader: false }));
} else {
this.setState({ showLoader: false });
}
this.setState({ showLoader: false });
hideLoader();
}