diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index b33247202..b8632faa4 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -3804,6 +3804,37 @@ + + csi + + + labels + + + title + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + + + documents diff --git a/client/src/App/App.container.jsx b/client/src/App/App.container.jsx index b6b837271..def27878c 100644 --- a/client/src/App/App.container.jsx +++ b/client/src/App/App.container.jsx @@ -29,7 +29,8 @@ const wsLink = new WebSocketLink({ reconnect: true, connectionParams: async () => { //const token = localStorage.getItem("token"); - const token = await auth.currentUser.getIdToken(true); + const token = + auth.currentUser && (await auth.currentUser.getIdToken(true)); if (token) { return { headers: { @@ -42,7 +43,8 @@ const wsLink = new WebSocketLink({ }); const subscriptionMiddleware = { applyMiddleware: async (options, next) => { - options.authToken = await auth.currentUser.getIdToken(true); + options.authToken = + auth.currentUser && (await auth.currentUser.getIdToken(true)); next(); }, }; @@ -70,18 +72,21 @@ const link = split( ); const authLink = setContext((_, { headers }) => { - return auth.currentUser.getIdToken().then((token) => { - if (token) { - return { - headers: { - ...headers, - authorization: token ? `Bearer ${token}` : "", - }, - }; - } else { - return { headers }; - } - }); + return ( + auth.currentUser && + auth.currentUser.getIdToken().then((token) => { + if (token) { + return { + headers: { + ...headers, + authorization: token ? `Bearer ${token}` : "", + }, + }; + } else { + return { headers }; + } + }) + ); }); const retryLink = new RetryLink({ diff --git a/client/src/App/App.js b/client/src/App/App.js index b5f7a5d56..e071f0a85 100644 --- a/client/src/App/App.js +++ b/client/src/App/App.js @@ -18,12 +18,13 @@ const SignInPage = lazy(() => import("../pages/sign-in/sign-in.page")); const Unauthorized = lazy(() => import("../pages/unauthorized/unauthorized.component") ); +const CsiPage = lazy(() => import("../pages/csi/csi.container.page")); const mapStateToProps = createStructuredSelector({ - currentUser: selectCurrentUser + currentUser: selectCurrentUser, }); -const mapDispatchToProps = dispatch => ({ - checkUserSession: () => dispatch(checkUserSession()) +const mapDispatchToProps = (dispatch) => ({ + checkUserSession: () => dispatch(checkUserSession()), }); export default connect( @@ -48,9 +49,8 @@ export default connect( }> - - + + {componentList.map((f, idx) => { + switch (f.type) { + case "checkbox": + return ; + case "slider": + return ; + case "text": + return ; + case "textarea": + return