Merged in bugfix/productfruits (pull request #1524)
- misc updates / clear stage
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { useSplitClient } from "@splitsoftware/splitio-react";
|
import { useSplitClient } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Result } from "antd";
|
import { Button, Result } from "antd";
|
||||||
import LogRocket from "logrocket";
|
import LogRocket from "logrocket";
|
||||||
import React, { lazy, Suspense, useEffect, useState } from "react";
|
import React, { lazy, Suspense, useEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Route, Routes } from "react-router-dom";
|
import { Route, Routes } from "react-router-dom";
|
||||||
@@ -9,7 +9,7 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
|
import DocumentEditorContainer from "../components/document-editor/document-editor.container";
|
||||||
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
|
import ErrorBoundary from "../components/error-boundary/error-boundary.component";
|
||||||
|
|
||||||
//Component Imports
|
// Component Imports
|
||||||
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../components/loading-spinner/loading-spinner.component";
|
||||||
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
import DisclaimerPage from "../pages/disclaimer/disclaimer.page";
|
||||||
import LandingPage from "../pages/landing/landing.page";
|
import LandingPage from "../pages/landing/landing.page";
|
||||||
@@ -28,15 +28,16 @@ import { ProductFruits } from "react-product-fruits";
|
|||||||
const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component"));
|
const ResetPassword = lazy(() => import("../pages/reset-password/reset-password.component"));
|
||||||
const ManagePage = lazy(() => import("../pages/manage/manage.page.container"));
|
const ManagePage = lazy(() => import("../pages/manage/manage.page.container"));
|
||||||
const SignInPage = lazy(() => import("../pages/sign-in/sign-in.page"));
|
const SignInPage = lazy(() => import("../pages/sign-in/sign-in.page"));
|
||||||
|
|
||||||
const CsiPage = lazy(() => import("../pages/csi/csi.container.page"));
|
const CsiPage = lazy(() => import("../pages/csi/csi.container.page"));
|
||||||
const MobilePaymentContainer = lazy(() => import("../pages/mobile-payment/mobile-payment.container"));
|
const MobilePaymentContainer = lazy(() => import("../pages/mobile-payment/mobile-payment.container"));
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
online: selectOnline,
|
online: selectOnline,
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentEula: selectCurrentEula
|
currentEula: selectCurrentEula
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
checkUserSession: () => dispatch(checkUserSession()),
|
checkUserSession: () => dispatch(checkUserSession()),
|
||||||
setOnline: (isOnline) => dispatch(setOnline(isOnline))
|
setOnline: (isOnline) => dispatch(setOnline(isOnline))
|
||||||
@@ -47,6 +48,23 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
const [listenersAdded, setListenersAdded] = useState(false);
|
const [listenersAdded, setListenersAdded] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const workspaceCode = useMemo(
|
||||||
|
() =>
|
||||||
|
InstanceRenderMgr({
|
||||||
|
imex: null,
|
||||||
|
rome: "9BkbEseqNqxw8jUH",
|
||||||
|
promanager: "aoJoEifvezYI0Z0P"
|
||||||
|
}),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
|
const workspaceLogin = useMemo(
|
||||||
|
() => ({
|
||||||
|
email: currentUser.email,
|
||||||
|
username: currentUser.email
|
||||||
|
}),
|
||||||
|
[currentUser.email]
|
||||||
|
);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!navigator.onLine) {
|
if (!navigator.onLine) {
|
||||||
setOnline(false);
|
setOnline(false);
|
||||||
@@ -55,16 +73,12 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
checkUserSession();
|
checkUserSession();
|
||||||
}, [checkUserSession, setOnline]);
|
}, [checkUserSession, setOnline]);
|
||||||
|
|
||||||
//const b = Grid.useBreakpoint();
|
|
||||||
// console.log("Breakpoints:", b);
|
|
||||||
|
|
||||||
// Associate event listeners, memoize to prevent multiple listeners being added
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const offlineListener = (e) => {
|
const offlineListener = () => {
|
||||||
setOnline(false);
|
setOnline(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onlineListener = (e) => {
|
const onlineListener = () => {
|
||||||
setOnline(true);
|
setOnline(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -98,7 +112,7 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
InstanceRenderMgr({
|
InstanceRenderMgr({
|
||||||
imex: "gvfvfw/bodyshopapp",
|
imex: "gvfvfw/bodyshopapp",
|
||||||
rome: "rome-online/rome-online",
|
rome: "rome-online/rome-online",
|
||||||
promanager: "" //TODO:AIO Add in log rocket for promanager instances.
|
promanager: "" // TODO: AIO Add in log rocket for promanager instances.
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -111,30 +125,25 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
|
|
||||||
handleBeta();
|
handleBeta();
|
||||||
|
|
||||||
if (!online)
|
if (!online) {
|
||||||
return (
|
return (
|
||||||
<Result
|
<Result
|
||||||
status="warning"
|
status="warning"
|
||||||
title={t("general.labels.nointernet")}
|
title={t("general.labels.nointernet")}
|
||||||
subTitle={t("general.labels.nointernet_sub")}
|
subTitle={t("general.labels.nointernet_sub")}
|
||||||
extra={
|
extra={
|
||||||
<Button
|
<Button type="primary" onClick={() => window.location.reload()}>
|
||||||
type="primary"
|
|
||||||
onClick={() => {
|
|
||||||
window.location.reload();
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("general.actions.refresh")}
|
{t("general.actions.refresh")}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (currentEula && !currentUser.eulaIsAccepted) {
|
if (currentEula && !currentUser.eulaIsAccepted) {
|
||||||
return <Eula />;
|
return <Eula />;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Any route that is not assigned and matched will default to the Landing Page component
|
|
||||||
return (
|
return (
|
||||||
<Suspense
|
<Suspense
|
||||||
fallback={
|
fallback={
|
||||||
@@ -147,19 +156,9 @@ export function App({ bodyshop, checkUserSession, currentUser, online, setOnline
|
|||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ProductFruits
|
{currentUser && currentUser.email && (
|
||||||
workspaceCode={InstanceRenderMgr({
|
<ProductFruits workspaceCode={workspaceCode} debug language="en" user={workspaceLogin} />
|
||||||
imex: null,
|
)}
|
||||||
rome: "9BkbEseqNqxw8jUH",
|
|
||||||
promanager: "aoJoEifvezYI0Z0P"
|
|
||||||
})}
|
|
||||||
debug
|
|
||||||
language="en"
|
|
||||||
user={{
|
|
||||||
email: currentUser.email,
|
|
||||||
username: currentUser.email
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
|
|||||||
Reference in New Issue
Block a user