DocSpace-buildtools/web/ASC.Web.Client/src/App.js

173 lines
4.9 KiB
JavaScript
Raw Normal View History

import React from "react";
import { Provider } from "react-redux";
import Shell from "./Shell";
import store from "./store/store";
import "./custom.scss";
const App = () => (
<Provider store={store}>
<Shell />
</Provider>
);
export default App;
// import React, { Suspense, lazy } from "react";
// import { Router, Route, Switch } from "react-router-dom";
// import { connect } from "react-redux";
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// import {
// store as CommonStore,
// history,
// PrivateRoute,
// PublicRoute,
// Login,
// Error404,
// Offline,
// ComingSoon,
// NavMenu,
// Main,
// utils,
// toastr,
// Layout,
// ScrollToTop,
// } from "asc-web-common";
// import Home from "./components/pages/Home";
// const About = lazy(() => import("./components/pages/About"));
// const Confirm = lazy(() => import("./components/pages/Confirm"));
// const Settings = lazy(() => import("./components/pages/Settings"));
// const Wizard = lazy(() => import("./components/pages/Wizard"));
// const Payments = lazy(() => import("./components/pages/Payments"));
// const ThirdPartyResponse = lazy(() => import("./components/pages/ThirdParty"));
// const {
// setIsLoaded,
// getUser,
// getPortalSettings,
// getModules,
// getIsAuthenticated,
// } = CommonStore.auth.actions;
// class App extends React.Component {
// constructor(props) {
// super(props);
// const pathname = window.location.pathname.toLowerCase();
// this.isThirdPartyResponse = pathname.indexOf("thirdparty") !== -1;
// }
// componentDidMount() {
// const {
// getPortalSettings,
// getUser,
// getModules,
// setIsLoaded,
// getIsAuthenticated,
// } = this.props;
// getIsAuthenticated()
// .then((isAuthenticated) => {
// if (isAuthenticated) utils.updateTempContent(isAuthenticated);
// if (this.isThirdPartyResponse) {
// setIsLoaded();
// return;
// }
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// const requests = [];
// if (!isAuthenticated) {
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// requests.push(getPortalSettings());
// } else if (
// !window.location.pathname.includes("confirm/EmailActivation")
// ) {
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// requests.push(getUser());
// requests.push(getPortalSettings());
// requests.push(getModules());
// }
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// Promise.all(requests)
// .catch((e) => {
// toastr.error(e);
// })
// .finally(() => {
// utils.updateTempContent();
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// setIsLoaded();
// });
// })
// .catch((err) => toastr.error(err));
// }
// render() {
// return navigator.onLine ? (
Merge branch 'develop' into feature/workspaces # Conflicts: # packages/asc-web-common/src/components/Layout/MobileLayout.js # packages/asc-web-common/src/components/Layout/ScrollToTop.js # packages/asc-web-common/src/components/Layout/context.js # packages/asc-web-common/src/components/Layout/index.js # packages/asc-web-common/src/components/NavMenu/index.js # packages/asc-web-common/src/components/NavMenu/sub-components/header-nav.js # packages/asc-web-common/src/components/PageLayout/index.js # packages/asc-web-common/src/components/PageLayout/sub-components/article.js # packages/asc-web-common/src/components/PageLayout/sub-components/section-header.js # packages/asc-web-common/src/components/PageLayout/sub-components/section.js # packages/asc-web-components/src/components/icons/svg/button.cancel.react.svg # packages/asc-web-components/src/components/icons/svg/clear.active.react.svg # packages/asc-web-components/src/components/icons/svg/load.error.react.svg # products/ASC.Files/Client/package.json # products/ASC.Files/Client/src/App.js # products/ASC.Files/Client/src/store/files/actions.js # products/ASC.People/Client/package.json # products/ASC.People/Client/src/App.js # products/ASC.People/Client/src/components/pages/Profile/index.js # products/ASC.People/Client/src/components/pages/ProfileAction/index.js # products/ASC.People/Client/yarn.lock # web/ASC.Web.Client/package.json # web/ASC.Web.Client/src/App.js # web/ASC.Web.Client/yarn.lock # web/ASC.Web.Common/package.json # web/ASC.Web.Common/yarn.lock # web/ASC.Web.Components/package.json # web/ASC.Web.Components/yarn.lock # yarn.lock
2021-01-29 13:39:00 +00:00
// <Layout>
// <Router history={history}>
// <ScrollToTop />
// {!this.isThirdPartyResponse && <NavMenu />}
// <Main>
// <Suspense fallback={null}>
// <Switch>
// <Route exact path="/wizard" component={Wizard} />
// <PublicRoute
// exact
// path={[
// "/login",
// "/login/error=:error",
// "/login/confirmed-email=:confirmedEmail",
// ]}
// component={Login}
// />
// <Route path="/confirm" component={Confirm} />
// <PrivateRoute
// path={`/thirdparty/:provider`}
// component={ThirdPartyResponse}
// />
// <PrivateRoute
// exact
// path={["/", "/error=:error"]}
// component={Home}
// />
// <PrivateRoute exact path="/about" component={About} />
// <PrivateRoute
// restricted
// path="/settings"
// component={Settings}
// />
// <PrivateRoute
// exact
// path={["/coming-soon"]}
// component={ComingSoon}
// />
// <PrivateRoute path="/payments" component={Payments} />
// <PrivateRoute component={Error404} />
// </Switch>
// </Suspense>
// </Main>
// </Router>
// </Layout>
// ) : (
// <Offline />
// );
// }
// }
// const mapStateToProps = (state) => {
// const { modules, isLoaded, settings } = state.auth;
// const { organizationName } = settings;
// return {
// modules,
// isLoaded,
// organizationName,
// };
// };
// const mapDispatchToProps = (dispatch) => {
// return {
// getIsAuthenticated: () => getIsAuthenticated(dispatch),
// getPortalSettings: () => getPortalSettings(dispatch),
// getUser: () => getUser(dispatch),
// getModules: () => getModules(dispatch),
// setIsLoaded: () => dispatch(setIsLoaded(true)),
// };
// };
// export default connect(mapStateToProps, mapDispatchToProps)(App);