Fix merge conflicts with master - 3-sept
This commit is contained in:
commit
a3ccf9f3c3
|
|
@ -30,6 +30,7 @@
|
|||
"lint-staged": "^8.1.0",
|
||||
"lodash": "^4.17.11",
|
||||
"nanoid": "^2.0.4",
|
||||
"netlify-identity-widget": "^1.5.5",
|
||||
"node-sass": "^4.11.0",
|
||||
"normalizr": "^3.3.0",
|
||||
"prettier": "^1.16.0",
|
||||
|
|
|
|||
1
app/client/public/_redirects
Normal file
1
app/client/public/_redirects
Normal file
|
|
@ -0,0 +1 @@
|
|||
/* /index.html 200
|
||||
|
|
@ -4,7 +4,8 @@ import { Provider } from "react-redux";
|
|||
import "./index.css";
|
||||
import App from "./App";
|
||||
import Editor from "./pages/Editor";
|
||||
import PageNotFound from "./pages/PageNotFound";
|
||||
import PageNotFound from "./pages/common/PageNotFound";
|
||||
import LoginPage from "./pages/common/LoginPage";
|
||||
import * as serviceWorker from "./serviceWorker";
|
||||
import { BrowserRouter, Route, Switch } from "react-router-dom";
|
||||
import { createStore, applyMiddleware } from "redux";
|
||||
|
|
@ -18,8 +19,8 @@ import { rootSaga } from "./sagas"
|
|||
import { DndProvider } from "react-dnd"
|
||||
import HTML5Backend from "react-dnd-html5-backend"
|
||||
import { appInitializer } from "./utils/AppsmithUtils";
|
||||
|
||||
appInitializer()
|
||||
import ProtectedRoute from "./pages/common/ProtectedRoute";
|
||||
appInitializer();
|
||||
WidgetBuilderRegistry.registerWidgetBuilders();
|
||||
const sagaMiddleware = createSagaMiddleware()
|
||||
const store = createStore(appReducer, applyMiddleware(sagaMiddleware));
|
||||
|
|
@ -33,6 +34,7 @@ ReactDOM.render(
|
|||
<Switch>
|
||||
<Route exact path="/" component={App} />
|
||||
<Route exact path="/builder" component={Editor} />
|
||||
<Route exact path="/login" component={LoginPage} />
|
||||
<Route component={PageNotFound} />
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
|
|
|
|||
21
app/client/src/pages/common/LoginPage.tsx
Normal file
21
app/client/src/pages/common/LoginPage.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import * as React from "react"
|
||||
import { RouterProps } from "react-router";
|
||||
import netlifyIdentity from 'netlify-identity-widget';
|
||||
|
||||
class LoginPage extends React.PureComponent<RouterProps> {
|
||||
|
||||
componentDidMount() {
|
||||
netlifyIdentity.open()
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div style={{ textAlign: "center" }}>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default LoginPage
|
||||
|
||||
|
||||
16
app/client/src/pages/common/ProtectedRoute.tsx
Normal file
16
app/client/src/pages/common/ProtectedRoute.tsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import * as React from "react"
|
||||
import _ from "lodash"
|
||||
import { Route, Redirect } from "react-router-dom";
|
||||
|
||||
import netlifyIdentity from 'netlify-identity-widget';
|
||||
|
||||
const ProtectedRoute = ({ path: path, component: Component, ...rest }: { path: string, component: React.ReactType }) => {
|
||||
let windowDoc: any = window
|
||||
return (<Route {...rest} render={(props) => (
|
||||
!_.isNil(netlifyIdentity.currentUser())
|
||||
? <Component {...props} />
|
||||
: <Redirect to={"/login"} />
|
||||
)} />)
|
||||
}
|
||||
|
||||
export default ProtectedRoute
|
||||
|
|
@ -2,6 +2,7 @@ import { ReduxAction } from "../constants/ActionConstants"
|
|||
import { SENTRY_PROD_CONFIG, SENTRY_STAGE_CONFIG, HOTJAR_PROD_HJID, HOTJAR_PROD_HJSV } from "../constants/ThirdPartyConstants";
|
||||
import * as Sentry from '@sentry/browser';
|
||||
import AnalyticsUtil from "./AnalyticsUtil"
|
||||
import netlifyIdentity from 'netlify-identity-widget';
|
||||
|
||||
export const createReducer = (
|
||||
initialState: any,
|
||||
|
|
@ -17,6 +18,7 @@ export const createReducer = (
|
|||
}
|
||||
|
||||
export const appInitializer = () => {
|
||||
netlifyIdentity.init();
|
||||
switch (process.env.REACT_APP_ENVIRONMENT) {
|
||||
case "PRODUCTION":
|
||||
Sentry.init(SENTRY_PROD_CONFIG);
|
||||
|
|
|
|||
|
|
@ -7391,6 +7391,11 @@ neo-async@^2.5.0, neo-async@^2.6.0, neo-async@^2.6.1:
|
|||
resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c"
|
||||
integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==
|
||||
|
||||
netlify-identity-widget@^1.5.5:
|
||||
version "1.5.5"
|
||||
resolved "https://registry.yarnpkg.com/netlify-identity-widget/-/netlify-identity-widget-1.5.5.tgz#e9ba8d7676263507106060236cf55c2992f425e4"
|
||||
integrity sha512-gCILbXMVn83TiRaiPCWk93ynyyYgxn8N/KoO+WOfyGZaNgq7gMMPtn7vo6VDe/ZczgyCn9DRlm3artNoj78/MQ==
|
||||
|
||||
next-tick@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user