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
This commit is contained in:
parent
07ad5aadee
commit
82cbf718d0
|
|
@ -14,7 +14,8 @@
|
|||
"api": "./src/api/",
|
||||
"assets": "./src/assets/",
|
||||
"sagas": "./src/sagas/",
|
||||
"@appsmith": "./src/ee",
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ module.exports = {
|
|||
"^worker-loader!": "<rootDir>/test/__mocks__/workerMock.js",
|
||||
"^!!raw-loader!": "<rootDir>/test/__mocks__/derivedMock.js",
|
||||
"test/(.*)": "<rootDir>/test/$1",
|
||||
"@appsmith/(.*)": "<rootDir>/src/ee/$1",
|
||||
},
|
||||
globals: {
|
||||
"ts-jest": {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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", () => {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { getAppsmithConfigs } from "configs";
|
||||
import { getAppsmithConfigs } from "@appsmith/configs";
|
||||
|
||||
const { cloudServicesBaseUrl: BASE_URL } = getAppsmithConfigs();
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 || "",
|
||||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
});
|
||||
};
|
||||
|
|
@ -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 && (
|
||||
<ThirdPartyAuth logins={SocialLoginList} type={"SIGNIN"} />
|
||||
{socialLoginList.length > 0 && (
|
||||
<ThirdPartyAuth logins={socialLoginList} type={"SIGNIN"} />
|
||||
)}
|
||||
{!disableLoginForm && (
|
||||
<>
|
||||
|
|
@ -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)}
|
||||
</AuthCardNavLink>
|
||||
</SignUpLinkSection>
|
||||
{SocialLoginList.length > 0 && (
|
||||
<ThirdPartyAuth logins={SocialLoginList} type={"SIGNUP"} />
|
||||
{socialLoginList.length > 0 && (
|
||||
<ThirdPartyAuth logins={socialLoginList} type={"SIGNUP"} />
|
||||
)}
|
||||
<SpacedSubmitForm
|
||||
action={signupURL}
|
||||
|
|
@ -3,7 +3,7 @@ import styled from "styled-components";
|
|||
import {
|
||||
getSocialLoginButtonProps,
|
||||
SocialLoginType,
|
||||
} from "constants/SocialLogin";
|
||||
} from "@appsmith/constants/SocialLogin";
|
||||
import { getTypographyByKey } from "constants/DefaultTheme";
|
||||
import AnalyticsUtil, { EventName } from "utils/AnalyticsUtil";
|
||||
import { useLocation } from "react-router-dom";
|
||||
|
|
@ -23,13 +23,9 @@ const StyledSocialLoginButton = styled.a`
|
|||
align-items: center;
|
||||
justify-content: center;
|
||||
border: solid 1px ${(props) => 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: {
|
|||
}}
|
||||
>
|
||||
<ButtonLogo alt={` ${props.name} login`} src={props.logo} />
|
||||
<div className="login-method">{`continue with ${props.name}`}</div>
|
||||
<div className="login-method">
|
||||
{props.label ?? `continue with ${props.name}`}
|
||||
</div>
|
||||
</StyledSocialLoginButton>
|
||||
);
|
||||
}
|
||||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = <InviteUserIcon />;
|
||||
break;
|
||||
case "key":
|
||||
returnIcon = <KeyIcon />;
|
||||
break;
|
||||
case "left-arrow-2":
|
||||
returnIcon = <LeftArrowIcon2 />;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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"];
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
12
app/client/src/ee/configs/index.ts
Normal file
12
app/client/src/ee/configs/index.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
1
app/client/src/ee/configs/types.ts
Normal file
1
app/client/src/ee/configs/types.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "ce/configs/types";
|
||||
1
app/client/src/ee/constants/ApiConstants.tsx
Normal file
1
app/client/src/ee/constants/ApiConstants.tsx
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "ce/constants/ApiConstants";
|
||||
18
app/client/src/ee/constants/SocialLogin.tsx
Normal file
18
app/client/src/ee/constants/SocialLogin.tsx
Normal file
|
|
@ -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;
|
||||
});
|
||||
};
|
||||
3
app/client/src/ee/pages/UserAuth/Login.tsx
Normal file
3
app/client/src/ee/pages/UserAuth/Login.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export * from "ce/pages/UserAuth/Login";
|
||||
import * as CE_Login from "ce/pages/UserAuth/Login";
|
||||
export default CE_Login.default;
|
||||
3
app/client/src/ee/pages/UserAuth/SignUp.tsx
Normal file
3
app/client/src/ee/pages/UserAuth/SignUp.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export * from "ce/pages/UserAuth/SignUp";
|
||||
import * as CE_SignUp from "ce/pages/UserAuth/SignUp";
|
||||
export default CE_SignUp.default;
|
||||
16
app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx
Normal file
16
app/client/src/ee/pages/UserAuth/ThirdPartyAuth.tsx
Normal file
|
|
@ -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;
|
||||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 && (
|
||||
<FormMessage
|
||||
intent="lightSuccess"
|
||||
message={`${createMessage(FORGOT_PASSWORD_SUCCESS_TEXT)}
|
||||
message={`${createMessage(FORGOT_PASSWORD_SUCCESS_TEXT)}
|
||||
${props.emailValue}`}
|
||||
/>
|
||||
)}
|
||||
|
|
|
|||
11
app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts
Normal file
11
app/client/src/pages/UserAuth/ThirdPartyLoginRegistry.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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`
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": "src",
|
||||
"paths": {
|
||||
"@appsmith/*": ["enterprise/*"],
|
||||
"@appsmith/*": ["ee/*"],
|
||||
"test/*": ["../test/*"]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user