2023-06-22 05:28:10 +00:00
|
|
|
// This file must be executed as early as possible to ensure the preloads are triggered ASAP
|
|
|
|
|
import "./preload-route-chunks";
|
|
|
|
|
|
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";
|
2024-08-08 12:55:00 +00:00
|
|
|
import "@appsmith/ads-old/src/themes/default/index.css";
|
2024-07-30 09:56:17 +00:00
|
|
|
import "design-system/src/__theme__/default/index.css";
|
2023-01-13 11:05:59 +00:00
|
|
|
import { ThemeProvider } from "styled-components";
|
2022-08-04 05:40:44 +00:00
|
|
|
import { appInitializer } from "utils/AppUtils";
|
2022-11-30 10:38:15 +00:00
|
|
|
import store, { runSagaMiddleware } from "./store";
|
2020-05-28 18:10:26 +00:00
|
|
|
import { LayersContext, Layers } from "constants/Layers";
|
2024-08-06 14:52:22 +00:00
|
|
|
import AppRouter from "ee/AppRouter";
|
2020-09-03 08:08:04 +00:00
|
|
|
import * as Sentry from "@sentry/react";
|
2022-12-15 04:06:13 +00:00
|
|
|
import { getCurrentThemeDetails } from "selectors/themeSelectors";
|
2020-09-16 11:50:47 +00:00
|
|
|
import { connect } from "react-redux";
|
2024-08-06 14:52:22 +00:00
|
|
|
import type { AppState } from "ee/reducers";
|
2023-05-19 18:37:06 +00:00
|
|
|
import { Toast } from "design-system";
|
2021-11-23 08:01:46 +00:00
|
|
|
import "./assets/styles/index.css";
|
2023-02-08 11:23:39 +00:00
|
|
|
import "./polyfills";
|
2022-09-30 06:27:29 +00:00
|
|
|
import GlobalStyles from "globalStyles";
|
2021-01-22 05:20:55 +00:00
|
|
|
// enable autofreeze only in development
|
|
|
|
|
import { setAutoFreeze } from "immer";
|
2023-03-03 06:47:35 +00:00
|
|
|
import AppErrorBoundary from "./AppErrorBoundry";
|
2023-11-06 09:35:17 +00:00
|
|
|
import log from "loglevel";
|
2024-08-06 14:52:22 +00:00
|
|
|
import { getAppsmithConfigs } from "ee/configs";
|
2024-07-30 03:17:21 +00:00
|
|
|
import { PageViewTiming } from "@newrelic/browser-agent/features/page_view_timing";
|
|
|
|
|
import { PageViewEvent } from "@newrelic/browser-agent/features/page_view_event";
|
|
|
|
|
import { Agent } from "@newrelic/browser-agent/loaders/agent";
|
2023-06-02 06:08:45 +00:00
|
|
|
|
2023-11-06 09:35:17 +00:00
|
|
|
const { newRelic } = getAppsmithConfigs();
|
2024-04-09 08:55:46 +00:00
|
|
|
const { enableNewRelic } = newRelic;
|
|
|
|
|
|
|
|
|
|
const newRelicBrowserAgentConfig = {
|
|
|
|
|
init: {
|
|
|
|
|
distributed_tracing: { enabled: true },
|
|
|
|
|
privacy: { cookies_enabled: true },
|
|
|
|
|
},
|
|
|
|
|
info: {
|
|
|
|
|
beacon: newRelic.browserAgentEndpoint,
|
|
|
|
|
errorBeacon: newRelic.browserAgentEndpoint,
|
|
|
|
|
licenseKey: newRelic.browserAgentlicenseKey,
|
|
|
|
|
applicationID: newRelic.applicationId,
|
|
|
|
|
sa: 1,
|
|
|
|
|
},
|
|
|
|
|
loader_config: {
|
|
|
|
|
accountID: newRelic.accountId,
|
|
|
|
|
trustKey: newRelic.accountId,
|
|
|
|
|
agentID: newRelic.applicationId,
|
|
|
|
|
licenseKey: newRelic.browserAgentlicenseKey,
|
|
|
|
|
applicationID: newRelic.applicationId,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// The agent loader code executes immediately on instantiation.
|
|
|
|
|
if (enableNewRelic) {
|
2024-07-30 03:17:21 +00:00
|
|
|
new Agent(
|
|
|
|
|
{
|
|
|
|
|
...newRelicBrowserAgentConfig,
|
|
|
|
|
features: [PageViewTiming, PageViewEvent],
|
|
|
|
|
},
|
|
|
|
|
// The second argument agentIdentifier is not marked as optional in its type definition.
|
|
|
|
|
// Passing a null value throws an error as well. So we pass undefined.
|
|
|
|
|
undefined,
|
|
|
|
|
);
|
2024-04-09 08:55:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const shouldAutoFreeze = process.env.NODE_ENV === "development";
|
2021-01-22 05:20:55 +00:00
|
|
|
|
2023-06-02 06:08:45 +00:00
|
|
|
setAutoFreeze(shouldAutoFreeze);
|
2022-11-30 10:38:15 +00:00
|
|
|
runSagaMiddleware();
|
|
|
|
|
|
2019-09-02 15:36:24 +00:00
|
|
|
appInitializer();
|
2024-04-09 08:55:46 +00:00
|
|
|
|
2023-11-06 09:35:17 +00:00
|
|
|
enableNewRelic &&
|
|
|
|
|
(async () => {
|
|
|
|
|
try {
|
|
|
|
|
await import(
|
2024-07-25 04:44:36 +00:00
|
|
|
/* webpackChunkName: "otlpTelemetry" */ "./UITelemetry/auto-otel-web"
|
2023-11-06 09:35:17 +00:00
|
|
|
);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
log.error("Error loading telemetry script", e);
|
|
|
|
|
}
|
|
|
|
|
})();
|
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<{
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2020-09-16 11:50:47 +00:00
|
|
|
currentTheme: any;
|
|
|
|
|
}> {
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<ThemeProvider theme={this.props.currentTheme}>
|
2023-05-19 18:37:06 +00:00
|
|
|
<Toast />
|
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
|
|
|
});
|
|
|
|
|
|
2022-12-15 04:06:13 +00:00
|
|
|
const ThemedAppWithProps = connect(mapStateToProps)(ThemedApp);
|
2020-09-16 11:50:47 +00:00
|
|
|
|
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
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2021-01-23 08:16:50 +00:00
|
|
|
if ((window as any).Cypress) {
|
2024-07-31 15:41:28 +00:00
|
|
|
// TODO: Fix this the next time the file is edited
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
2021-01-23 08:16:50 +00:00
|
|
|
(window as any).store = store;
|
|
|
|
|
}
|