2020-08-03 14:18:48 +00:00
|
|
|
import React from "react";
|
Feature/entity browse (#220)
# New Feature: Entity Explorer
- Entities are actions (apis and queries), datasources, pages, and widgets
- With this new feature, all entities in the application will be available
to view in the new entity explorer sidebar
- All existing application features from the api sidebar, query sidebar, datasource sidebar and pages sidebar
now are avialable on the entity explorer sidebar
- Users are now able to quickly switch to any entity in the application from the entity explorer sidebar.
- Users can also search all entities in the application from the new sidebar. Use cmd + f or ctrl + f to focus on the search input
- Users can rename entities from the new sidebar
- Users can also perform contextual actions on these entities like set a page as home page, copy/move actions, delete entity, etc from the context menu available alongside the entities in the sidebar
- Users can view the properties of the entities in the sidebar, as well as copy bindings to use in the application.
2020-08-10 08:52:45 +00:00
|
|
|
import "./wdyr";
|
2019-03-16 11:33:15 +00:00
|
|
|
import ReactDOM from "react-dom";
|
|
|
|
|
import { Provider } from "react-redux";
|
|
|
|
|
import "./index.css";
|
2020-09-16 11:50:47 +00:00
|
|
|
import { ThemeProvider } from "constants/DefaultTheme";
|
2019-12-30 07:35:16 +00:00
|
|
|
import { appInitializer } from "utils/AppsmithUtils";
|
2020-11-24 07:01:37 +00:00
|
|
|
import { Slide } from "react-toastify";
|
2019-12-23 12:16:33 +00:00
|
|
|
import store from "./store";
|
2020-05-28 18:10:26 +00:00
|
|
|
import { LayersContext, Layers } from "constants/Layers";
|
2020-08-03 14:18:48 +00:00
|
|
|
import AppRouter from "./AppRouter";
|
2020-09-03 08:08:04 +00:00
|
|
|
import * as Sentry from "@sentry/react";
|
2021-02-11 12:54:00 +00:00
|
|
|
import { getCurrentThemeDetails, ThemeMode } from "selectors/themeSelectors";
|
2020-09-16 11:50:47 +00:00
|
|
|
import { connect } from "react-redux";
|
|
|
|
|
import { AppState } from "reducers";
|
|
|
|
|
import { setThemeMode } from "actions/themeActions";
|
2020-11-24 07:01:37 +00:00
|
|
|
import { StyledToastContainer } from "components/ads/Toast";
|
2021-02-16 06:17:23 +00:00
|
|
|
import localStorage from "utils/localStorage";
|
2021-03-29 15:47:22 +00:00
|
|
|
import "./polyfills/corejs-add-on";
|
2021-01-22 05:20:55 +00:00
|
|
|
// enable autofreeze only in development
|
|
|
|
|
import { setAutoFreeze } from "immer";
|
|
|
|
|
const shouldAutoFreeze = process.env.NODE_ENV === "development";
|
|
|
|
|
setAutoFreeze(shouldAutoFreeze);
|
|
|
|
|
|
2020-11-09 09:23:20 +00:00
|
|
|
import AppErrorBoundary from "./AppErrorBoundry";
|
2021-03-15 12:17:56 +00:00
|
|
|
import GlobalStyles from "globalStyles";
|
2019-09-02 15:36:24 +00:00
|
|
|
appInitializer();
|
2019-11-21 10:52:49 +00:00
|
|
|
|
2021-04-28 10:28:39 +00:00
|
|
|
function App() {
|
2020-08-03 14:18:48 +00:00
|
|
|
return (
|
2020-09-03 08:08:04 +00:00
|
|
|
<Sentry.ErrorBoundary fallback={"An error has occured"}>
|
|
|
|
|
<Provider store={store}>
|
|
|
|
|
<LayersContext.Provider value={Layers}>
|
2020-09-16 11:50:47 +00:00
|
|
|
<ThemedAppWithProps />
|
2020-09-03 08:08:04 +00:00
|
|
|
</LayersContext.Provider>
|
|
|
|
|
</Provider>
|
|
|
|
|
</Sentry.ErrorBoundary>
|
2020-08-03 14:18:48 +00:00
|
|
|
);
|
2021-04-28 10:28:39 +00:00
|
|
|
}
|
2020-08-03 14:18:48 +00:00
|
|
|
|
2020-09-16 11:50:47 +00:00
|
|
|
class ThemedApp extends React.Component<{
|
|
|
|
|
currentTheme: any;
|
2020-11-03 13:05:40 +00:00
|
|
|
setTheme: (themeMode: ThemeMode) => void;
|
2020-09-16 11:50:47 +00:00
|
|
|
}> {
|
|
|
|
|
componentDidMount() {
|
|
|
|
|
if (localStorage.getItem("THEME") === "LIGHT") {
|
|
|
|
|
this.props.setTheme(ThemeMode.LIGHT);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<ThemeProvider theme={this.props.currentTheme}>
|
2020-11-24 07:01:37 +00:00
|
|
|
<StyledToastContainer
|
2020-09-16 11:50:47 +00:00
|
|
|
autoClose={5000}
|
|
|
|
|
closeButton={false}
|
2021-04-28 10:28:39 +00:00
|
|
|
draggable={false}
|
|
|
|
|
hideProgressBar
|
2020-11-24 07:01:37 +00:00
|
|
|
pauseOnHover={false}
|
2021-04-28 10:28:39 +00:00
|
|
|
transition={Slide}
|
2020-09-16 11:50:47 +00:00
|
|
|
/>
|
2021-03-15 12:17:56 +00:00
|
|
|
<GlobalStyles />
|
2020-11-09 09:23:20 +00:00
|
|
|
<AppErrorBoundary>
|
|
|
|
|
<AppRouter />
|
|
|
|
|
</AppErrorBoundary>
|
2020-09-16 11:50:47 +00:00
|
|
|
</ThemeProvider>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const mapStateToProps = (state: AppState) => ({
|
2021-02-11 12:54:00 +00:00
|
|
|
currentTheme: getCurrentThemeDetails(state),
|
2020-09-16 11:50:47 +00:00
|
|
|
});
|
|
|
|
|
const mapDispatchToProps = (dispatch: any) => ({
|
|
|
|
|
setTheme: (mode: ThemeMode) => {
|
|
|
|
|
dispatch(setThemeMode(mode));
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const ThemedAppWithProps = connect(
|
|
|
|
|
mapStateToProps,
|
|
|
|
|
mapDispatchToProps,
|
|
|
|
|
)(ThemedApp);
|
|
|
|
|
|
2020-08-03 14:18:48 +00:00
|
|
|
ReactDOM.render(<App />, document.getElementById("root"));
|
2021-01-23 08:16:50 +00:00
|
|
|
|
|
|
|
|
// expose store when run in Cypress
|
|
|
|
|
if ((window as any).Cypress) {
|
|
|
|
|
(window as any).store = store;
|
|
|
|
|
}
|