From 82cbf718d0f4dc2237963581cc2e6b505be4ce50 Mon Sep 17 00:00:00 2001 From: Pranav Kanade Date: Fri, 7 Jan 2022 11:38:17 +0530 Subject: [PATCH] refactor: code splitting to support third party sso/oidc in EE (#10201) * added config to support code split * splitting config * moved the window declaration in EE file as its dependency will be updated in EE * CE: Splitting ApiConstants and SocialLogin constants * CE: split login page * CE: moved getSocialLoginButtonProps func to EE file as it's dependencies will be updated in EE * added key icon * CE: created a factory class to share social auths list * Minor style fix for social btns * Updated the third party auth styles * updated jest config * updated third party login registry class --- app/client/.babelrc | 3 ++- app/client/jest.config.js | 1 + app/client/src/api/ActionAPI.tsx | 2 +- app/client/src/api/Api.ts | 2 +- app/client/src/api/ApiUtils.test.ts | 2 +- app/client/src/api/ApiUtils.ts | 2 +- app/client/src/api/CloudServicesApi.ts | 2 +- app/client/src/api/DatasourcesApi.ts | 2 +- app/client/src/{ => ce}/configs/index.ts | 13 ++------- app/client/src/{ => ce}/configs/types.ts | 4 +-- .../src/{ => ce}/constants/ApiConstants.tsx | 0 .../src/{ => ce}/constants/SocialLogin.tsx | 15 ++--------- .../src/{ => ce}/pages/UserAuth/Login.tsx | 27 +++++++------------ .../src/{ => ce}/pages/UserAuth/SignUp.tsx | 22 +++++++-------- .../pages/UserAuth/ThirdPartyAuth.tsx | 18 ++++++------- .../inlineComments/AddCommentInput.tsx | 2 +- app/client/src/components/ads/Icon.tsx | 5 ++++ .../appsmith/help/DocumentationSearch.tsx | 2 +- .../designSystems/appsmith/help/HelpModal.tsx | 2 +- .../Debugger/ContextualMenu.tsx | 2 +- .../GlobalSearch/AlgoliaSearchWrapper.tsx | 2 +- .../editorComponents/GlobalSearch/index.tsx | 2 +- .../LocationSearchControl.tsx | 2 +- .../src/constants/ApiEditorConstants.ts | 2 +- .../src/constants/ReduxActionConstants.tsx | 2 +- app/client/src/ee/configs/index.ts | 12 +++++++++ app/client/src/ee/configs/types.ts | 1 + app/client/src/ee/constants/ApiConstants.tsx | 1 + app/client/src/ee/constants/SocialLogin.tsx | 18 +++++++++++++ app/client/src/ee/pages/UserAuth/Login.tsx | 3 +++ app/client/src/ee/pages/UserAuth/SignUp.tsx | 3 +++ .../src/ee/pages/UserAuth/ThirdPartyAuth.tsx | 16 +++++++++++ .../pages/Applications/ApplicationCard.tsx | 2 +- app/client/src/pages/Applications/index.tsx | 2 +- .../pages/Editor/DataSourceEditor/DBForm.tsx | 2 +- .../EditorAppName/NavigationMenuData.ts | 2 +- .../src/pages/UserAuth/ForgotPassword.tsx | 4 +-- .../pages/UserAuth/ThirdPartyLoginRegistry.ts | 11 ++++++++ app/client/src/pages/UserAuth/index.tsx | 4 +-- app/client/src/pages/common/ErrorPage.tsx | 2 +- .../pages/organization/OrgInviteUsersForm.tsx | 2 +- app/client/src/pages/setup/SetupForm.tsx | 2 +- app/client/src/pages/setup/SignupSuccess.tsx | 2 +- .../src/reducers/uiReducers/errorReducer.tsx | 2 +- .../sagas/ActionExecution/PluginActionSaga.ts | 2 +- app/client/src/sagas/ErrorSagas.tsx | 5 +++- app/client/src/sagas/InitSagas.ts | 2 +- app/client/src/sagas/PageSagas.tsx | 2 +- app/client/src/sagas/SuperUserSagas.tsx | 2 +- .../handleAppLevelSocketEvents.tsx | 2 +- app/client/src/sagas/userSagas.tsx | 2 +- app/client/src/utils/AnalyticsUtil.tsx | 2 +- app/client/src/utils/AppsmithUtils.tsx | 4 +-- app/client/src/utils/PerformanceTracker.ts | 2 +- app/client/src/utils/helpers.tsx | 2 +- .../widgets/ChartWidget/component/index.tsx | 2 +- .../src/widgets/MapWidget/widget/index.tsx | 2 +- app/client/tsconfig.path.json | 2 +- 58 files changed, 152 insertions(+), 110 deletions(-) rename app/client/src/{ => ce}/configs/index.ts (96%) rename app/client/src/{ => ce}/configs/types.ts (97%) rename app/client/src/{ => ce}/constants/ApiConstants.tsx (100%) rename app/client/src/{ => ce}/constants/SocialLogin.tsx (62%) rename app/client/src/{ => ce}/pages/UserAuth/Login.tsx (91%) rename app/client/src/{ => ce}/pages/UserAuth/SignUp.tsx (92%) rename app/client/src/{ => ce}/pages/UserAuth/ThirdPartyAuth.tsx (91%) create mode 100644 app/client/src/ee/configs/index.ts create mode 100644 app/client/src/ee/configs/types.ts create mode 100644 app/client/src/ee/constants/ApiConstants.tsx create mode 100644 app/client/src/ee/constants/SocialLogin.tsx create mode 100644 app/client/src/ee/pages/UserAuth/Login.tsx create mode 100644 app/client/src/ee/pages/UserAuth/SignUp.tsx create mode 100644 app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx create mode 100644 app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts diff --git a/app/client/.babelrc b/app/client/.babelrc index 1902f2666f..edc33962b2 100644 --- a/app/client/.babelrc +++ b/app/client/.babelrc @@ -14,7 +14,8 @@ "api": "./src/api/", "assets": "./src/assets/", "sagas": "./src/sagas/", + "@appsmith": "./src/ee", } }] ] -} \ No newline at end of file +} diff --git a/app/client/jest.config.js b/app/client/jest.config.js index 3274979d95..8fb707d516 100644 --- a/app/client/jest.config.js +++ b/app/client/jest.config.js @@ -25,6 +25,7 @@ module.exports = { "^worker-loader!": "/test/__mocks__/workerMock.js", "^!!raw-loader!": "/test/__mocks__/derivedMock.js", "test/(.*)": "/test/$1", + "@appsmith/(.*)": "/src/ee/$1", }, globals: { "ts-jest": { diff --git a/app/client/src/api/ActionAPI.tsx b/app/client/src/api/ActionAPI.tsx index d4bda6e6be..614cc90eb1 100644 --- a/app/client/src/api/ActionAPI.tsx +++ b/app/client/src/api/ActionAPI.tsx @@ -1,6 +1,6 @@ import API, { HttpMethod } from "api/Api"; import { ApiResponse, GenericApiResponse, ResponseMeta } from "./ApiResponses"; -import { DEFAULT_EXECUTE_ACTION_TIMEOUT_MS } from "constants/ApiConstants"; +import { DEFAULT_EXECUTE_ACTION_TIMEOUT_MS } from "@appsmith/constants/ApiConstants"; import axios, { AxiosPromise, CancelTokenSource } from "axios"; import { Action, ActionViewMode } from "entities/Action"; import { APIRequest } from "constants/AppsmithActionConstants/ActionConstants"; diff --git a/app/client/src/api/Api.ts b/app/client/src/api/Api.ts index 32dfc0f65c..24a18aba82 100644 --- a/app/client/src/api/Api.ts +++ b/app/client/src/api/Api.ts @@ -1,5 +1,5 @@ import axios, { AxiosInstance, AxiosRequestConfig } from "axios"; -import { REQUEST_TIMEOUT_MS } from "constants/ApiConstants"; +import { REQUEST_TIMEOUT_MS } from "@appsmith/constants/ApiConstants"; import { convertObjectToQueryParams } from "utils/AppsmithUtils"; import { apiFailureResponseInterceptor, diff --git a/app/client/src/api/ApiUtils.test.ts b/app/client/src/api/ApiUtils.test.ts index 9c88778a30..498fcbb00d 100644 --- a/app/client/src/api/ApiUtils.test.ts +++ b/app/client/src/api/ApiUtils.test.ts @@ -11,7 +11,7 @@ import { ERROR_0, SERVER_API_TIMEOUT_ERROR, } from "constants/messages"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; describe("axios api interceptors", () => { describe("Axios api request interceptor", () => { diff --git a/app/client/src/api/ApiUtils.ts b/app/client/src/api/ApiUtils.ts index 539094f49e..f6a2cb7532 100644 --- a/app/client/src/api/ApiUtils.ts +++ b/app/client/src/api/ApiUtils.ts @@ -9,7 +9,7 @@ import { API_STATUS_CODES, ERROR_CODES, SERVER_ERROR_CODES, -} from "constants/ApiConstants"; +} from "@appsmith/constants/ApiConstants"; import log from "loglevel"; import { ActionExecutionResponse } from "api/ActionAPI"; import store from "store"; diff --git a/app/client/src/api/CloudServicesApi.ts b/app/client/src/api/CloudServicesApi.ts index c4abc26056..003f04092b 100644 --- a/app/client/src/api/CloudServicesApi.ts +++ b/app/client/src/api/CloudServicesApi.ts @@ -1,4 +1,4 @@ -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; const { cloudServicesBaseUrl: BASE_URL } = getAppsmithConfigs(); diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index 0993c5bbb8..b36aaa2cc5 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -1,4 +1,4 @@ -import { DEFAULT_TEST_DATA_SOURCE_TIMEOUT_MS } from "constants/ApiConstants"; +import { DEFAULT_TEST_DATA_SOURCE_TIMEOUT_MS } from "@appsmith/constants/ApiConstants"; import API from "api/Api"; import { GenericApiResponse } from "./ApiResponses"; import { AxiosPromise } from "axios"; diff --git a/app/client/src/configs/index.ts b/app/client/src/ce/configs/index.ts similarity index 96% rename from app/client/src/configs/index.ts rename to app/client/src/ce/configs/index.ts index a79570c17b..bb7c8a9f0a 100644 --- a/app/client/src/configs/index.ts +++ b/app/client/src/ce/configs/index.ts @@ -2,10 +2,9 @@ import { AppsmithUIConfigs, FeatureFlagConfig } from "./types"; import { Integrations } from "@sentry/tracing"; import * as Sentry from "@sentry/react"; import { createBrowserHistory } from "history"; -import { EvaluationVersion } from "api/ApplicationApi"; const history = createBrowserHistory(); -export type INJECTED_CONFIGS = { +export interface INJECTED_CONFIGS { sentry: { dsn: string; release: string; @@ -46,14 +45,6 @@ export type INJECTED_CONFIGS = { cloudServicesBaseUrl: string; googleRecaptchaSiteKey: string; supportEmail: string; -}; -declare global { - interface Window { - APPSMITH_FEATURE_CONFIGS: INJECTED_CONFIGS; - Intercom: any; - evaluationVersion: EvaluationVersion; - Sentry: any; - } } const capitalizeText = (text: string) => { @@ -62,7 +53,7 @@ const capitalizeText = (text: string) => { return `${first}${rest}`; }; -const getConfigsFromEnvVars = (): INJECTED_CONFIGS => { +export const getConfigsFromEnvVars = (): INJECTED_CONFIGS => { return { sentry: { dsn: process.env.REACT_APP_SENTRY_DSN || "", diff --git a/app/client/src/configs/types.ts b/app/client/src/ce/configs/types.ts similarity index 97% rename from app/client/src/configs/types.ts rename to app/client/src/ce/configs/types.ts index bffe548830..c1554b85f6 100644 --- a/app/client/src/configs/types.ts +++ b/app/client/src/ce/configs/types.ts @@ -16,7 +16,7 @@ export type FeatureFlagConfig = { default: FeatureFlags; }; -export type AppsmithUIConfigs = { +export interface AppsmithUIConfigs { sentry: { enabled: boolean; dsn: string; @@ -78,4 +78,4 @@ export type AppsmithUIConfigs = { apiKey: string; }; appsmithSupportEmail: string; -}; +} diff --git a/app/client/src/constants/ApiConstants.tsx b/app/client/src/ce/constants/ApiConstants.tsx similarity index 100% rename from app/client/src/constants/ApiConstants.tsx rename to app/client/src/ce/constants/ApiConstants.tsx diff --git a/app/client/src/constants/SocialLogin.tsx b/app/client/src/ce/constants/SocialLogin.tsx similarity index 62% rename from app/client/src/constants/SocialLogin.tsx rename to app/client/src/ce/constants/SocialLogin.tsx index 4de49f4916..70ede20a84 100644 --- a/app/client/src/constants/SocialLogin.tsx +++ b/app/client/src/ce/constants/SocialLogin.tsx @@ -1,4 +1,4 @@ -import { GoogleOAuthURL, GithubOAuthURL } from "constants/ApiConstants"; +import { GoogleOAuthURL, GithubOAuthURL } from "./ApiConstants"; import GithubLogo from "assets/images/Github.png"; import GoogleLogo from "assets/images/Google.png"; @@ -6,6 +6,7 @@ export type SocialLoginButtonProps = { url: string; name: string; logo: string; + label?: string; }; export const GoogleSocialLoginButtonProps: SocialLoginButtonProps = { @@ -29,15 +30,3 @@ export const SocialLoginButtonPropsList: Record< }; export type SocialLoginType = keyof typeof SocialLoginButtonPropsList; - -export const getSocialLoginButtonProps = ( - logins: SocialLoginType[], -): SocialLoginButtonProps[] => { - return logins.map((login) => { - const socialLoginButtonProps = SocialLoginButtonPropsList[login]; - if (!socialLoginButtonProps) { - throw Error("Social login not registered: " + login); - } - return socialLoginButtonProps; - }); -}; diff --git a/app/client/src/pages/UserAuth/Login.tsx b/app/client/src/ce/pages/UserAuth/Login.tsx similarity index 91% rename from app/client/src/pages/UserAuth/Login.tsx rename to app/client/src/ce/pages/UserAuth/Login.tsx index d30d629e67..881d7dedfa 100644 --- a/app/client/src/pages/UserAuth/Login.tsx +++ b/app/client/src/ce/pages/UserAuth/Login.tsx @@ -28,9 +28,10 @@ import FormMessage from "components/ads/formFields/FormMessage"; import FormGroup from "components/ads/formFields/FormGroup"; import FormTextField from "components/ads/formFields/TextField"; import Button, { Size } from "components/ads/Button"; -import ThirdPartyAuth, { SocialLoginTypes } from "./ThirdPartyAuth"; +import ThirdPartyAuth from "@appsmith/pages/UserAuth/ThirdPartyAuth"; +import { ThirdPartyLoginRegistry } from "pages/UserAuth/ThirdPartyLoginRegistry"; import { isEmail, isEmptyString } from "utils/formhelpers"; -import { LoginFormValues } from "./helpers"; +import { LoginFormValues } from "pages/UserAuth/helpers"; import { withTheme } from "styled-components"; import { Theme } from "constants/DefaultTheme"; @@ -41,20 +42,16 @@ import { AuthCardNavLink, SignUpLinkSection, ForgotPasswordLink, -} from "./StyledComponents"; +} from "pages/UserAuth/StyledComponents"; import AnalyticsUtil from "utils/AnalyticsUtil"; -import { getAppsmithConfigs } from "configs"; -import { LOGIN_SUBMIT_PATH } from "constants/ApiConstants"; +import { getAppsmithConfigs } from "@appsmith/configs"; +import { LOGIN_SUBMIT_PATH } from "@appsmith/constants/ApiConstants"; import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; import { getIsSafeRedirectURL } from "utils/helpers"; import { getCurrentUser } from "selectors/usersSelectors"; -const { - disableLoginForm, - enableGithubOAuth, - enableGoogleOAuth, -} = getAppsmithConfigs(); +const { disableLoginForm } = getAppsmithConfigs(); const validate = (values: LoginFormValues) => { const errors: LoginFormValues = {}; @@ -81,15 +78,11 @@ type LoginFormProps = { emailValue: string } & InjectedFormProps< theme: Theme; }; -const SocialLoginList: string[] = []; -if (enableGoogleOAuth) SocialLoginList.push(SocialLoginTypes.GOOGLE); -if (enableGithubOAuth) SocialLoginList.push(SocialLoginTypes.GITHUB); - export function Login(props: LoginFormProps) { const { emailValue: email, error, valid } = props; const isFormValid = valid && email && !isEmptyString(email); const location = useLocation(); - + const socialLoginList = ThirdPartyLoginRegistry.get(); const queryParams = new URLSearchParams(location.search); let showError = false; const currentUser = useSelector(getCurrentUser); @@ -154,8 +147,8 @@ export function Login(props: LoginFormProps) { } /> )} - {SocialLoginList.length > 0 && ( - + {socialLoginList.length > 0 && ( + )} {!disableLoginForm && ( <> diff --git a/app/client/src/pages/UserAuth/SignUp.tsx b/app/client/src/ce/pages/UserAuth/SignUp.tsx similarity index 92% rename from app/client/src/pages/UserAuth/SignUp.tsx rename to app/client/src/ce/pages/UserAuth/SignUp.tsx index 52b05a48c5..beb50c54b3 100644 --- a/app/client/src/pages/UserAuth/SignUp.tsx +++ b/app/client/src/ce/pages/UserAuth/SignUp.tsx @@ -14,7 +14,7 @@ import { SpacedSubmitForm, FormActions, SignUpLinkSection, -} from "./StyledComponents"; +} from "pages/UserAuth/StyledComponents"; import { SIGNUP_PAGE_TITLE, SIGNUP_PAGE_EMAIL_INPUT_LABEL, @@ -32,15 +32,16 @@ import { import FormMessage from "components/ads/formFields/FormMessage"; import FormGroup from "components/ads/formFields/FormGroup"; import FormTextField from "components/ads/formFields/TextField"; -import ThirdPartyAuth, { SocialLoginTypes } from "./ThirdPartyAuth"; +import ThirdPartyAuth from "@appsmith/pages/UserAuth/ThirdPartyAuth"; +import { ThirdPartyLoginRegistry } from "pages/UserAuth/ThirdPartyLoginRegistry"; import Button, { Size } from "components/ads/Button"; import { isEmail, isStrongPassword, isEmptyString } from "utils/formhelpers"; -import { SignupFormValues } from "./helpers"; +import { SignupFormValues } from "pages/UserAuth/helpers"; import AnalyticsUtil from "utils/AnalyticsUtil"; -import { SIGNUP_SUBMIT_PATH } from "constants/ApiConstants"; +import { SIGNUP_SUBMIT_PATH } from "@appsmith/constants/ApiConstants"; import { connect } from "react-redux"; import { AppState } from "reducers"; import PerformanceTracker, { @@ -49,14 +50,9 @@ import PerformanceTracker, { import { useIntiateOnboarding } from "components/editorComponents/Onboarding/utils"; import { SIGNUP_FORM_EMAIL_FIELD_NAME } from "constants/forms"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { useScript, ScriptStatus, AddScriptTo } from "utils/hooks/useScript"; -const { enableGithubOAuth, enableGoogleOAuth } = getAppsmithConfigs(); -const SocialLoginList: string[] = []; -if (enableGoogleOAuth) SocialLoginList.push(SocialLoginTypes.GOOGLE); -if (enableGithubOAuth) SocialLoginList.push(SocialLoginTypes.GITHUB); - import { withTheme } from "styled-components"; import { Theme } from "constants/DefaultTheme"; import { getIsSafeRedirectURL } from "utils/helpers"; @@ -98,7 +94,7 @@ export function SignUp(props: SignUpFormProps) { }, []); const { emailValue: email, error, pristine, submitting, valid } = props; const isFormValid = valid && email && !isEmptyString(email); - + const socialLoginList = ThirdPartyLoginRegistry.get(); const location = useLocation(); const initiateOnboarding = useIntiateOnboarding(); @@ -140,8 +136,8 @@ export function SignUp(props: SignUpFormProps) { {createMessage(SIGNUP_PAGE_LOGIN_LINK_TEXT)} - {SocialLoginList.length > 0 && ( - + {socialLoginList.length > 0 && ( + )} props.theme.colors.auth.socialBtnBorder}; - padding: ${(props) => props.theme.spaces[2]}px; + margin-bottom: ${(props) => props.theme.spaces[4]}px; - &:first-child { - margin-bottom: ${(props) => props.theme.spaces[4]}px; - } - - &:only-child { + &:only-child, &:last-child { margin-bottom: 0; } @@ -47,8 +43,7 @@ const StyledSocialLoginButton = styled.a` const ButtonLogo = styled.img` margin: ${(props) => props.theme.spaces[2]}px; - width: 14px; - height: 14px; + width: 24px; `; export const SocialLoginTypes = { @@ -62,6 +57,7 @@ function SocialLoginButton(props: { logo: string; name: string; url: string; + label?: string; type: SignInType; }) { const location = useLocation(); @@ -95,7 +91,9 @@ function SocialLoginButton(props: { }} > -
{`continue with ${props.name}`}
+
+ {props.label ?? `continue with ${props.name}`} +
); } diff --git a/app/client/src/comments/inlineComments/AddCommentInput.tsx b/app/client/src/comments/inlineComments/AddCommentInput.tsx index 51a862ce26..02cdac3329 100644 --- a/app/client/src/comments/inlineComments/AddCommentInput.tsx +++ b/app/client/src/comments/inlineComments/AddCommentInput.tsx @@ -46,7 +46,7 @@ import { getCurrentAppOrg } from "selectors/organizationSelectors"; import useOrg from "utils/hooks/useOrg"; import { getCanCreateApplications } from "utils/helpers"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; diff --git a/app/client/src/components/ads/Icon.tsx b/app/client/src/components/ads/Icon.tsx index 9eab4e359c..3f11615bdd 100644 --- a/app/client/src/components/ads/Icon.tsx +++ b/app/client/src/components/ads/Icon.tsx @@ -108,6 +108,7 @@ import GitPullRequst from "remixicon-react/GitPullRequestLineIcon"; import GuideIcon from "remixicon-react/GuideFillIcon"; import HelpIcon from "remixicon-react/QuestionMarkIcon"; import InfoIcon from "remixicon-react/InformationLineIcon"; +import KeyIcon from "remixicon-react/Key2LineIcon"; import LeftArrowIcon2 from "remixicon-react/ArrowLeftSLineIcon"; import Link2 from "remixicon-react/LinkIcon"; import LeftArrowIcon from "remixicon-react/ArrowLeftLineIcon"; @@ -306,6 +307,7 @@ export const IconCollection = [ "widget", "dropdown", "refresh", + "key", ] as const; export type IconName = typeof IconCollection[number]; @@ -535,6 +537,9 @@ const Icon = forwardRef( case "invite-user": returnIcon = ; break; + case "key": + returnIcon = ; + break; case "left-arrow-2": returnIcon = ; break; diff --git a/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx b/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx index 497456a6f0..25062d91a7 100644 --- a/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx +++ b/app/client/src/components/designSystems/appsmith/help/DocumentationSearch.tsx @@ -14,7 +14,7 @@ import styled from "styled-components"; import { HelpIcons } from "icons/HelpIcons"; import { HelpBaseURL } from "constants/HelpConstants"; import { getDefaultRefinement } from "selectors/helpSelectors"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { AppState } from "reducers"; import { setHelpDefaultRefinement, diff --git a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx index 8fd85a1125..a23ca5cffa 100644 --- a/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx +++ b/app/client/src/components/designSystems/appsmith/help/HelpModal.tsx @@ -8,7 +8,7 @@ import { import styled from "styled-components"; import { theme } from "constants/DefaultTheme"; import { HelpIcons } from "icons/HelpIcons"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { LayersContext } from "constants/Layers"; import { connect } from "react-redux"; import { AppState } from "reducers"; diff --git a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx index 1705de3311..afda31ffeb 100644 --- a/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx +++ b/app/client/src/components/editorComponents/Debugger/ContextualMenu.tsx @@ -14,7 +14,7 @@ import { toggleShowGlobalSearchModal, } from "actions/globalSearchActions"; import { filterCategories, SEARCH_CATEGORY_ID } from "../GlobalSearch/utils"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { createMessage, DEBUGGER_APPSMITH_SUPPORT, diff --git a/app/client/src/components/editorComponents/GlobalSearch/AlgoliaSearchWrapper.tsx b/app/client/src/components/editorComponents/GlobalSearch/AlgoliaSearchWrapper.tsx index 6c21bb4661..88444fd943 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/AlgoliaSearchWrapper.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/AlgoliaSearchWrapper.tsx @@ -1,7 +1,7 @@ import React, { useState, useCallback, useEffect } from "react"; import algoliasearch from "algoliasearch/lite"; import { InstantSearch } from "react-instantsearch-dom"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { debounce } from "lodash"; import { isSnippet, SearchCategory } from "./utils"; diff --git a/app/client/src/components/editorComponents/GlobalSearch/index.tsx b/app/client/src/components/editorComponents/GlobalSearch/index.tsx index 2a258319cd..52592b4648 100644 --- a/app/client/src/components/editorComponents/GlobalSearch/index.tsx +++ b/app/client/src/components/editorComponents/GlobalSearch/index.tsx @@ -75,7 +75,7 @@ import { getQueryParams } from "../../../utils/AppsmithUtils"; import SnippetsFilter from "./SnippetsFilter"; import SnippetRefinements from "./SnippetRefinements"; import { Configure, Index } from "react-instantsearch-dom"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { lightTheme } from "selectors/themeSelectors"; import { SnippetAction } from "reducers/uiReducers/globalSearchReducer"; import copy from "copy-to-clipboard"; diff --git a/app/client/src/components/propertyControls/LocationSearchControl.tsx b/app/client/src/components/propertyControls/LocationSearchControl.tsx index 2040bfa6d6..11af61311a 100644 --- a/app/client/src/components/propertyControls/LocationSearchControl.tsx +++ b/app/client/src/components/propertyControls/LocationSearchControl.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import BaseControl, { ControlProps } from "./BaseControl"; import SearchBox from "react-google-maps/lib/components/places/SearchBox"; import StandaloneSearchBox from "react-google-maps/lib/components/places/StandaloneSearchBox"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { useScript, ScriptStatus, AddScriptTo } from "utils/hooks/useScript"; import { StyledInputGroup } from "./StyledControls"; import log from "loglevel"; diff --git a/app/client/src/constants/ApiEditorConstants.ts b/app/client/src/constants/ApiEditorConstants.ts index c64afc4e7c..1928d421de 100644 --- a/app/client/src/constants/ApiEditorConstants.ts +++ b/app/client/src/constants/ApiEditorConstants.ts @@ -1,5 +1,5 @@ import { ApiActionConfig } from "entities/Action"; -import { DEFAULT_ACTION_TIMEOUT } from "constants/ApiConstants"; +import { DEFAULT_ACTION_TIMEOUT } from "@appsmith/constants/ApiConstants"; import { zipObject } from "lodash"; export const HTTP_METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH"]; diff --git a/app/client/src/constants/ReduxActionConstants.tsx b/app/client/src/constants/ReduxActionConstants.tsx index 2cc1352e6c..0926855396 100644 --- a/app/client/src/constants/ReduxActionConstants.tsx +++ b/app/client/src/constants/ReduxActionConstants.tsx @@ -1,7 +1,7 @@ import { WidgetCardProps, WidgetProps } from "widgets/BaseWidget"; import { PageAction } from "constants/AppsmithActionConstants/ActionConstants"; import { Org } from "./orgConstants"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import { AppLayoutConfig } from "reducers/entityReducers/pageListReducer"; import { GitApplicationMetadata } from "../api/ApplicationApi"; diff --git a/app/client/src/ee/configs/index.ts b/app/client/src/ee/configs/index.ts new file mode 100644 index 0000000000..df85655e72 --- /dev/null +++ b/app/client/src/ee/configs/index.ts @@ -0,0 +1,12 @@ +export * from "ce/configs/index"; +import { EvaluationVersion } from "api/ApplicationApi"; +import { INJECTED_CONFIGS } from "ce/configs/index"; + +declare global { + interface Window { + APPSMITH_FEATURE_CONFIGS: INJECTED_CONFIGS; + Intercom: any; + evaluationVersion: EvaluationVersion; + Sentry: any; + } +} diff --git a/app/client/src/ee/configs/types.ts b/app/client/src/ee/configs/types.ts new file mode 100644 index 0000000000..6a5d788971 --- /dev/null +++ b/app/client/src/ee/configs/types.ts @@ -0,0 +1 @@ +export * from "ce/configs/types"; diff --git a/app/client/src/ee/constants/ApiConstants.tsx b/app/client/src/ee/constants/ApiConstants.tsx new file mode 100644 index 0000000000..8e40b6a61c --- /dev/null +++ b/app/client/src/ee/constants/ApiConstants.tsx @@ -0,0 +1 @@ +export * from "ce/constants/ApiConstants"; diff --git a/app/client/src/ee/constants/SocialLogin.tsx b/app/client/src/ee/constants/SocialLogin.tsx new file mode 100644 index 0000000000..744fc06ecd --- /dev/null +++ b/app/client/src/ee/constants/SocialLogin.tsx @@ -0,0 +1,18 @@ +export * from "ce/constants/SocialLogin"; +import { + SocialLoginButtonProps, + SocialLoginButtonPropsList, + SocialLoginType, +} from "ce/constants/SocialLogin"; + +export const getSocialLoginButtonProps = ( + logins: SocialLoginType[], +): SocialLoginButtonProps[] => { + return logins.map((login) => { + const socialLoginButtonProps = SocialLoginButtonPropsList[login]; + if (!socialLoginButtonProps) { + throw Error("Social login not registered: " + login); + } + return socialLoginButtonProps; + }); +}; diff --git a/app/client/src/ee/pages/UserAuth/Login.tsx b/app/client/src/ee/pages/UserAuth/Login.tsx new file mode 100644 index 0000000000..7592dae777 --- /dev/null +++ b/app/client/src/ee/pages/UserAuth/Login.tsx @@ -0,0 +1,3 @@ +export * from "ce/pages/UserAuth/Login"; +import * as CE_Login from "ce/pages/UserAuth/Login"; +export default CE_Login.default; diff --git a/app/client/src/ee/pages/UserAuth/SignUp.tsx b/app/client/src/ee/pages/UserAuth/SignUp.tsx new file mode 100644 index 0000000000..0eefb95add --- /dev/null +++ b/app/client/src/ee/pages/UserAuth/SignUp.tsx @@ -0,0 +1,3 @@ +export * from "ce/pages/UserAuth/SignUp"; +import * as CE_SignUp from "ce/pages/UserAuth/SignUp"; +export default CE_SignUp.default; diff --git a/app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx b/app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx new file mode 100644 index 0000000000..b810c3c5a0 --- /dev/null +++ b/app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx @@ -0,0 +1,16 @@ +import { + default as ThirdPartyAuth, + SocialLoginTypes as CE_SocialLoginTypes, +} from "ce/pages/UserAuth/ThirdPartyAuth"; +import { getAppsmithConfigs } from "@appsmith/configs"; +import { ThirdPartyLoginRegistry } from "pages/UserAuth/ThirdPartyLoginRegistry"; +const { enableGithubOAuth, enableGoogleOAuth } = getAppsmithConfigs(); + +export const SocialLoginTypes = CE_SocialLoginTypes; + +if (enableGoogleOAuth) + ThirdPartyLoginRegistry.register(SocialLoginTypes.GOOGLE); +if (enableGithubOAuth) + ThirdPartyLoginRegistry.register(SocialLoginTypes.GITHUB); + +export default ThirdPartyAuth; diff --git a/app/client/src/pages/Applications/ApplicationCard.tsx b/app/client/src/pages/Applications/ApplicationCard.tsx index 5243d8a93f..4d2c5b874e 100644 --- a/app/client/src/pages/Applications/ApplicationCard.tsx +++ b/app/client/src/pages/Applications/ApplicationCard.tsx @@ -52,7 +52,7 @@ import { import ForkApplicationModal from "./ForkApplicationModal"; import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; -import { getExportAppAPIRoute } from "constants/ApiConstants"; +import { getExportAppAPIRoute } from "@appsmith/constants/ApiConstants"; import { Colors } from "constants/Colors"; import { CONNECTED_TO_GIT, createMessage } from "constants/messages"; diff --git a/app/client/src/pages/Applications/index.tsx b/app/client/src/pages/Applications/index.tsx index b5ab4b00ad..9a2067b4e8 100644 --- a/app/client/src/pages/Applications/index.tsx +++ b/app/client/src/pages/Applications/index.tsx @@ -97,7 +97,7 @@ import getFeatureFlags from "utils/featureFlags"; import { setIsImportAppViaGitModalOpen } from "actions/gitSyncActions"; import SharedUserList from "pages/common/SharedUserList"; import { getOnboardingOrganisations } from "selectors/onboardingSelectors"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; const OrgDropDown = styled.div` display: flex; diff --git a/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx b/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx index 5037d078dd..c906a673c6 100644 --- a/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx +++ b/app/client/src/pages/Editor/DataSourceEditor/DBForm.tsx @@ -14,7 +14,7 @@ import EditButton from "components/editorComponents/Button"; import { Datasource } from "entities/Datasource"; import { reduxForm, InjectedFormProps } from "redux-form"; import { APPSMITH_IP_ADDRESSES } from "constants/DatasourceEditorConstants"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { convertArrayToSentence } from "utils/helpers"; import { PluginType } from "entities/Action"; diff --git a/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts b/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts index de04e404bf..aa9cd23f8c 100644 --- a/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts +++ b/app/client/src/pages/Editor/EditorAppName/NavigationMenuData.ts @@ -15,7 +15,7 @@ import { APPLICATIONS_URL, PAGE_LIST_EDITOR_URL } from "constants/routes"; import { MenuItemData, MenuTypes } from "./NavigationMenuItem"; import { useCallback } from "react"; import { ExplorerURLParams } from "../Explorer/helpers"; -import { getExportAppAPIRoute } from "constants/ApiConstants"; +import { getExportAppAPIRoute } from "@appsmith/constants/ApiConstants"; import { isPermitted, diff --git a/app/client/src/pages/UserAuth/ForgotPassword.tsx b/app/client/src/pages/UserAuth/ForgotPassword.tsx index aa8ca00fe5..ad3758eb9e 100644 --- a/app/client/src/pages/UserAuth/ForgotPassword.tsx +++ b/app/client/src/pages/UserAuth/ForgotPassword.tsx @@ -34,7 +34,7 @@ import { ForgotPasswordFormValues, forgotPasswordSubmitHandler, } from "./helpers"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; const { mailEnabled } = getAppsmithConfigs(); @@ -82,7 +82,7 @@ export const ForgotPassword = withTheme( {submitSucceeded && ( )} diff --git a/app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts b/app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts new file mode 100644 index 0000000000..9cf87d1bf1 --- /dev/null +++ b/app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts @@ -0,0 +1,11 @@ +export class ThirdPartyLoginRegistry { + private static methods: string[] = []; + + static register(method: string): void { + ThirdPartyLoginRegistry.methods.push(method); + } + + static get(): string[] { + return ThirdPartyLoginRegistry.methods; + } +} diff --git a/app/client/src/pages/UserAuth/index.tsx b/app/client/src/pages/UserAuth/index.tsx index 14cee38e4f..8b92c61752 100644 --- a/app/client/src/pages/UserAuth/index.tsx +++ b/app/client/src/pages/UserAuth/index.tsx @@ -1,8 +1,8 @@ import React from "react"; import { Route, Switch, useLocation, useRouteMatch } from "react-router-dom"; -import Login from "./Login"; +import Login from "@appsmith/pages/UserAuth/Login"; import { AuthCard, AuthCardContainer, AuthContainer } from "./StyledComponents"; -import SignUp from "./SignUp"; +import SignUp from "@appsmith/pages/UserAuth/SignUp"; import ForgotPassword from "./ForgotPassword"; import ResetPassword from "./ResetPassword"; import PageNotFound from "pages/common/PageNotFound"; diff --git a/app/client/src/pages/common/ErrorPage.tsx b/app/client/src/pages/common/ErrorPage.tsx index 03e7178da2..40b765b9c5 100644 --- a/app/client/src/pages/common/ErrorPage.tsx +++ b/app/client/src/pages/common/ErrorPage.tsx @@ -1,6 +1,6 @@ import React from "react"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import PageNotFound from "pages/common/PageNotFound"; import ServerTimeout from "pages/common/ServerTimeout"; import ServerUnavailable from "pages/common/ServerUnavailable"; diff --git a/app/client/src/pages/organization/OrgInviteUsersForm.tsx b/app/client/src/pages/organization/OrgInviteUsersForm.tsx index 8d0a241954..9f180560b0 100644 --- a/app/client/src/pages/organization/OrgInviteUsersForm.tsx +++ b/app/client/src/pages/organization/OrgInviteUsersForm.tsx @@ -28,7 +28,7 @@ import { isPermitted, PERMISSION_TYPE, } from "../Applications/permissionHelpers"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { ReactComponent as NoEmailConfigImage } from "assets/images/email-not-configured.svg"; import AnalyticsUtil from "utils/AnalyticsUtil"; import Button, { Size } from "components/ads/Button"; diff --git a/app/client/src/pages/setup/SetupForm.tsx b/app/client/src/pages/setup/SetupForm.tsx index e1d8c79b9c..851f4c00f5 100644 --- a/app/client/src/pages/setup/SetupForm.tsx +++ b/app/client/src/pages/setup/SetupForm.tsx @@ -18,7 +18,7 @@ import { import { formValueSelector, InjectedFormProps, reduxForm } from "redux-form"; import { isEmail, isStrongPassword } from "utils/formhelpers"; import { AppState } from "reducers"; -import { SUPER_USER_SUBMIT_PATH } from "constants/ApiConstants"; +import { SUPER_USER_SUBMIT_PATH } from "@appsmith/constants/ApiConstants"; import { useState } from "react"; const PageWrapper = styled.div` diff --git a/app/client/src/pages/setup/SignupSuccess.tsx b/app/client/src/pages/setup/SignupSuccess.tsx index c8b2d63e81..3292b11f9e 100644 --- a/app/client/src/pages/setup/SignupSuccess.tsx +++ b/app/client/src/pages/setup/SignupSuccess.tsx @@ -1,5 +1,5 @@ import { firstTimeUserOnboardingInit } from "actions/onboardingActions"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { ReduxActionTypes } from "constants/ReduxActionConstants"; import { APPLICATIONS_URL, diff --git a/app/client/src/reducers/uiReducers/errorReducer.tsx b/app/client/src/reducers/uiReducers/errorReducer.tsx index 88789eb9bf..0f30386d91 100644 --- a/app/client/src/reducers/uiReducers/errorReducer.tsx +++ b/app/client/src/reducers/uiReducers/errorReducer.tsx @@ -4,7 +4,7 @@ import { ReduxActionTypes, ReduxActionErrorPayload, } from "constants/ReduxActionConstants"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import _ from "lodash"; const initialState: ErrorReduxState = { diff --git a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts index 4143309302..cd7717ed26 100644 --- a/app/client/src/sagas/ActionExecution/PluginActionSaga.ts +++ b/app/client/src/sagas/ActionExecution/PluginActionSaga.ts @@ -69,7 +69,7 @@ import PerformanceTracker, { import * as log from "loglevel"; import { EMPTY_RESPONSE } from "components/editorComponents/ApiResponseView"; import { AppState } from "reducers"; -import { DEFAULT_EXECUTE_ACTION_TIMEOUT_MS } from "constants/ApiConstants"; +import { DEFAULT_EXECUTE_ACTION_TIMEOUT_MS } from "@appsmith/constants/ApiConstants"; import { evaluateActionBindings } from "sagas/EvaluationsSaga"; import { isBlobUrl, mapToPropList, parseBlobUrl } from "utils/AppsmithUtils"; import { getType, Types } from "utils/TypeHelpers"; diff --git a/app/client/src/sagas/ErrorSagas.tsx b/app/client/src/sagas/ErrorSagas.tsx index 9282c9d0b7..616d82ed85 100644 --- a/app/client/src/sagas/ErrorSagas.tsx +++ b/app/client/src/sagas/ErrorSagas.tsx @@ -11,7 +11,10 @@ import { Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import { flushErrors } from "actions/errorActions"; import { AUTH_LOGIN_URL } from "constants/routes"; -import { ERROR_CODES, SERVER_ERROR_CODES } from "constants/ApiConstants"; +import { + ERROR_CODES, + SERVER_ERROR_CODES, +} from "@appsmith/constants/ApiConstants"; import { getSafeCrash } from "selectors/errorSelectors"; import { getCurrentUser } from "selectors/usersSelectors"; import { ANONYMOUS_USERNAME } from "constants/userConstants"; diff --git a/app/client/src/sagas/InitSagas.ts b/app/client/src/sagas/InitSagas.ts index 9bd3059587..36eb1980be 100644 --- a/app/client/src/sagas/InitSagas.ts +++ b/app/client/src/sagas/InitSagas.ts @@ -15,7 +15,7 @@ import { ReduxActionTypes, ReduxActionWithoutPayload, } from "constants/ReduxActionConstants"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import { fetchPage, diff --git a/app/client/src/sagas/PageSagas.tsx b/app/client/src/sagas/PageSagas.tsx index 0327d4a6b9..1bd441fd3f 100644 --- a/app/client/src/sagas/PageSagas.tsx +++ b/app/client/src/sagas/PageSagas.tsx @@ -88,7 +88,7 @@ import { Toaster } from "components/ads/Toast"; import { Variant } from "components/ads/common"; import { migrateIncorrectDynamicBindingPathLists } from "utils/migrations/IncorrectDynamicBindingPathLists"; import * as Sentry from "@sentry/react"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import AnalyticsUtil from "utils/AnalyticsUtil"; import DEFAULT_TEMPLATE from "templates/default"; import { GenerateTemplatePageRequest } from "../api/PageApi"; diff --git a/app/client/src/sagas/SuperUserSagas.tsx b/app/client/src/sagas/SuperUserSagas.tsx index 13b024bf6c..da46acfd01 100644 --- a/app/client/src/sagas/SuperUserSagas.tsx +++ b/app/client/src/sagas/SuperUserSagas.tsx @@ -12,7 +12,7 @@ import { User } from "constants/userConstants"; import { takeLatest, all, call, put, delay, select } from "redux-saga/effects"; import history from "utils/history"; import { validateResponse } from "./ErrorSagas"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { ApiResponse } from "api/ApiResponses"; import { diff --git a/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx b/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx index fecf1d291a..68b7ca10b6 100644 --- a/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx +++ b/app/client/src/sagas/WebsocketSagas/handleAppLevelSocketEvents.tsx @@ -19,7 +19,7 @@ import { } from "constants/messages"; import { Variant } from "components/ads/common"; import React from "react"; -import { getAppsmithConfigs } from "../../configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; export default function* handleAppLevelSocketEvents(event: any) { const currentUser = yield select(getCurrentUser); diff --git a/app/client/src/sagas/userSagas.tsx b/app/client/src/sagas/userSagas.tsx index 562e11a93e..c84970f3af 100644 --- a/app/client/src/sagas/userSagas.tsx +++ b/app/client/src/sagas/userSagas.tsx @@ -44,7 +44,7 @@ import { INVITE_USERS_TO_ORG_FORM } from "constants/forms"; import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import { ANONYMOUS_USERNAME, CommentsOnboardingState, diff --git a/app/client/src/utils/AnalyticsUtil.tsx b/app/client/src/utils/AnalyticsUtil.tsx index b1d74b1364..41837d91e5 100644 --- a/app/client/src/utils/AnalyticsUtil.tsx +++ b/app/client/src/utils/AnalyticsUtil.tsx @@ -1,7 +1,7 @@ // Events import * as log from "loglevel"; import smartlookClient from "smartlook-client"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import * as Sentry from "@sentry/react"; import { ANONYMOUS_USERNAME, User } from "../constants/userConstants"; import { sha256 } from "js-sha256"; diff --git a/app/client/src/utils/AppsmithUtils.tsx b/app/client/src/utils/AppsmithUtils.tsx index c4b4f7d49c..b97435e417 100644 --- a/app/client/src/utils/AppsmithUtils.tsx +++ b/app/client/src/utils/AppsmithUtils.tsx @@ -3,7 +3,7 @@ import { Page, ReduxAction, } from "constants/ReduxActionConstants"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import * as Sentry from "@sentry/react"; import AnalyticsUtil from "./AnalyticsUtil"; import FormControlRegistry from "./FormControlRegistry"; @@ -14,7 +14,7 @@ import * as log from "loglevel"; import { LogLevelDesc } from "loglevel"; import produce from "immer"; import { AppIconCollection, AppIconName } from "components/ads/AppIcon"; -import { ERROR_CODES } from "constants/ApiConstants"; +import { ERROR_CODES } from "@appsmith/constants/ApiConstants"; import { createMessage, ERROR_500 } from "../constants/messages"; import localStorage from "utils/localStorage"; import { APP_MODE } from "entities/App"; diff --git a/app/client/src/utils/PerformanceTracker.ts b/app/client/src/utils/PerformanceTracker.ts index 99f56fccea..1cfa3f93ea 100644 --- a/app/client/src/utils/PerformanceTracker.ts +++ b/app/client/src/utils/PerformanceTracker.ts @@ -1,6 +1,6 @@ import * as Sentry from "@sentry/react"; import { Span, SpanStatus } from "@sentry/tracing"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import _ from "lodash"; import * as log from "loglevel"; diff --git a/app/client/src/utils/helpers.tsx b/app/client/src/utils/helpers.tsx index 175f88bf51..eb665939ec 100644 --- a/app/client/src/utils/helpers.tsx +++ b/app/client/src/utils/helpers.tsx @@ -18,7 +18,7 @@ import { PERMISSION_TYPE, } from "pages/Applications/permissionHelpers"; import { User } from "constants/userConstants"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { sha256 } from "js-sha256"; import moment from "moment"; import log from "loglevel"; diff --git a/app/client/src/widgets/ChartWidget/component/index.tsx b/app/client/src/widgets/ChartWidget/component/index.tsx index c60652bcdf..5e4f36d5e7 100644 --- a/app/client/src/widgets/ChartWidget/component/index.tsx +++ b/app/client/src/widgets/ChartWidget/component/index.tsx @@ -3,7 +3,7 @@ import React from "react"; import styled from "styled-components"; import { getBorderCSSShorthand, invisible } from "constants/DefaultTheme"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import { ChartDataPoint, ChartType, diff --git a/app/client/src/widgets/MapWidget/widget/index.tsx b/app/client/src/widgets/MapWidget/widget/index.tsx index ec6031d2e0..4a9e2c0712 100644 --- a/app/client/src/widgets/MapWidget/widget/index.tsx +++ b/app/client/src/widgets/MapWidget/widget/index.tsx @@ -5,7 +5,7 @@ import MapComponent from "../component"; import { ValidationTypes } from "constants/WidgetValidation"; import { EventType } from "constants/AppsmithActionConstants/ActionConstants"; -import { getAppsmithConfigs } from "configs"; +import { getAppsmithConfigs } from "@appsmith/configs"; import styled from "styled-components"; import { DEFAULT_CENTER } from "constants/WidgetConstants"; import { getBorderCSSShorthand } from "constants/DefaultTheme"; diff --git a/app/client/tsconfig.path.json b/app/client/tsconfig.path.json index 7f94edc294..a6d3c8dd45 100644 --- a/app/client/tsconfig.path.json +++ b/app/client/tsconfig.path.json @@ -2,7 +2,7 @@ "compilerOptions": { "baseUrl": "src", "paths": { - "@appsmith/*": ["enterprise/*"], + "@appsmith/*": ["ee/*"], "test/*": ["../test/*"] } }