diff --git a/app/client/docker/templates/nginx-linux.conf.template b/app/client/docker/templates/nginx-linux.conf.template index 73636fb5fb..210138a28f 100644 --- a/app/client/docker/templates/nginx-linux.conf.template +++ b/app/client/docker/templates/nginx-linux.conf.template @@ -36,6 +36,7 @@ server { sub_filter __APPSMITH_VERSION_ID__ '${APPSMITH_VERSION_ID}'; sub_filter __APPSMITH_VERSION_RELEASE_DATE__ '${APPSMITH_VERSION_RELEASE_DATE}'; sub_filter __APPSMITH_INTERCOM_APP_ID__ '${APPSMITH_INTERCOM_APP_ID}'; + sub_filter __APPSMITH_MAIL_ENABLED__ '${APPSMITH_MAIL_ENABLED}'; } location /f { @@ -103,6 +104,7 @@ server { sub_filter __APPSMITH_VERSION_ID__ '${APPSMITH_VERSION_ID}'; sub_filter __APPSMITH_VERSION_RELEASE_DATE__ '${APPSMITH_VERSION_RELEASE_DATE}'; sub_filter __APPSMITH_INTERCOM_APP_ID__ '${APPSMITH_INTERCOM_APP_ID}'; + sub_filter __APPSMITH_MAIL_ENABLED__ '${APPSMITH_MAIL_ENABLED}'; } location /f { diff --git a/app/client/docker/templates/nginx-mac.conf.template b/app/client/docker/templates/nginx-mac.conf.template index 5bf1e8081b..888d15c25a 100644 --- a/app/client/docker/templates/nginx-mac.conf.template +++ b/app/client/docker/templates/nginx-mac.conf.template @@ -36,6 +36,7 @@ server { sub_filter __APPSMITH_VERSION_ID__ '${APPSMITH_VERSION_ID}'; sub_filter __APPSMITH_VERSION_RELEASE_DATE__ '${APPSMITH_VERSION_RELEASE_DATE}'; sub_filter __APPSMITH_INTERCOM_APP_ID__ '${APPSMITH_INTERCOM_APP_ID}'; + sub_filter __APPSMITH_MAIL_ENABLED__ '${APPSMITH_MAIL_ENABLED}'; } location /f { @@ -104,6 +105,7 @@ server { sub_filter __APPSMITH_VERSION_ID__ '${APPSMITH_VERSION_ID}'; sub_filter __APPSMITH_VERSION_RELEASE_DATE__ '${APPSMITH_VERSION_RELEASE_DATE}'; sub_filter __APPSMITH_INTERCOM_APP_ID__ '${APPSMITH_INTERCOM_APP_ID}'; + sub_filter __APPSMITH_MAIL_ENABLED__ '${APPSMITH_MAIL_ENABLED}'; } diff --git a/app/client/public/index.html b/app/client/public/index.html index 8086d8ef28..451b7420eb 100755 --- a/app/client/public/index.html +++ b/app/client/public/index.html @@ -97,11 +97,12 @@ id: parseConfig("__APPSMITH_VERSION_ID__"), releaseDate: parseConfig("__APPSMITH_VERSION_RELEASE_DATE__") }, - intercomAppID: parseConfig("__APPSMITH_INTERCOM_APP_ID__"), + intercomAppID: parseConfig("__APPSMITH_INTERCOM_APP_ID__"), + mailEnabled: parseConfig("__APPSMITH_MAIL_ENABLED__").length > 0, }; - \ No newline at end of file + diff --git a/app/client/src/assets/images/email-not-configured.svg b/app/client/src/assets/images/email-not-configured.svg new file mode 100644 index 0000000000..2ddfaaec3d --- /dev/null +++ b/app/client/src/assets/images/email-not-configured.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/client/src/configs/index.ts b/app/client/src/configs/index.ts index 5c9eecd009..eab451cd81 100644 --- a/app/client/src/configs/index.ts +++ b/app/client/src/configs/index.ts @@ -29,6 +29,7 @@ type INJECTED_CONFIGS = { releaseDate: string; }; intercomAppID: string; + mailEnabled: boolean; }; declare global { interface Window { @@ -90,6 +91,9 @@ const getConfigsFromEnvVars = (): INJECTED_CONFIGS => { releaseDate: process.env.REACT_APP_VERSION_RELEASE_DATE || "", }, intercomAppID: process.env.REACT_APP_INTERCOM_APP_ID || "", + mailEnabled: process.env.REACT_APP_MAIL_ENABLED + ? process.env.REACT_APP_MAIL_ENABLED.length > 0 + : false, }; }; @@ -206,5 +210,6 @@ export const getAppsmithConfigs = (): AppsmithUIConfigs => { appVersion: ENV_CONFIG.appVersion || APPSMITH_FEATURE_CONFIGS.appVersion, intercomAppID: ENV_CONFIG.intercomAppID || APPSMITH_FEATURE_CONFIGS.intercomAppID, + mailEnabled: ENV_CONFIG.mailEnabled || APPSMITH_FEATURE_CONFIGS.mailEnabled, }; }; diff --git a/app/client/src/configs/types.ts b/app/client/src/configs/types.ts index a638126994..fa6566bbed 100644 --- a/app/client/src/configs/types.ts +++ b/app/client/src/configs/types.ts @@ -66,4 +66,5 @@ export type AppsmithUIConfigs = { releaseDate: string; }; intercomAppID: string; + mailEnabled: boolean; }; diff --git a/app/client/src/pages/UserAuth/ForgotPassword.tsx b/app/client/src/pages/UserAuth/ForgotPassword.tsx index 214fe95f42..6bc6d9ca80 100644 --- a/app/client/src/pages/UserAuth/ForgotPassword.tsx +++ b/app/client/src/pages/UserAuth/ForgotPassword.tsx @@ -23,7 +23,6 @@ import { } from "constants/messages"; import { AUTH_LOGIN_URL } from "constants/routes"; import FormMessage from "components/editorComponents/form/FormMessage"; - import { FORGOT_PASSWORD_FORM_NAME } from "constants/forms"; import FormGroup from "components/editorComponents/form/FormGroup"; import Button from "components/editorComponents/Button"; @@ -33,6 +32,9 @@ import { ForgotPasswordFormValues, forgotPasswordSubmitHandler, } from "./helpers"; +import { getAppsmithConfigs } from "configs"; + +const { mailEnabled } = getAppsmithConfigs(); const validate = (values: ForgotPasswordFormValues) => { const errors: ForgotPasswordFormValues = {}; @@ -69,6 +71,21 @@ export const ForgotPassword = (props: ForgotPasswordProps) => { message={`${FORGOT_PASSWORD_SUCCESS_TEXT} ${props.emailValue}`} /> )} + {!mailEnabled && ( + + )} {submitFailed && error && }

{FORGOT_PASSWORD_PAGE_TITLE}

diff --git a/app/client/src/pages/organization/OrgInviteUsersForm.tsx b/app/client/src/pages/organization/OrgInviteUsersForm.tsx index aeaa176554..3abda4d23d 100644 --- a/app/client/src/pages/organization/OrgInviteUsersForm.tsx +++ b/app/client/src/pages/organization/OrgInviteUsersForm.tsx @@ -32,6 +32,8 @@ import { isPermitted, PERMISSION_TYPE, } from "../Applications/permissionHelpers"; +import { getAppsmithConfigs } from "configs"; +import { ReactComponent as NoEmailConfigImage } from "assets/images/email-not-configured.svg"; const OrgInviteTitle = styled.div` font-weight: bold; @@ -117,6 +119,23 @@ const Loading = styled(Spinner)` width: 100%; `; +const MailConfigContainer = styled.div` + display: flex; + flex-direction: column; + padding: 5px; + align-items: center; + && > span { + color: #2e3d49; + font-weight: 500; + font-size: 14px; + } + && > a { + color: rgba(46, 61, 73, 0.5); + font-size: 12px; + text-decoration: underline; + } +`; + const validateFormValues = (values: { users: string; role: string }) => { if (values.users && values.users.length > 0) { const _users = values.users.split(",").filter(Boolean); @@ -150,6 +169,8 @@ const validate = (values: any) => { return errors; }; +const { mailEnabled } = getAppsmithConfigs(); + const OrgInviteUsersForm = (props: any) => { const { handleSubmit, @@ -248,16 +269,31 @@ const OrgInviteUsersForm = (props: any) => { {isLoading ? ( ) : ( - - {allUsers.map((user: { username: string; roleName: string }) => { - return ( -
-
{user.username}
-
{user.roleName}
-
- ); - })} -
+ + {!mailEnabled && ( + + {allUsers.length === 0 && } + You haven’t setup any email service yet + + Please configure your email service to invite people + + + )} + + {allUsers.map((user: { username: string; roleName: string }) => { + return ( +
+
{user.username}
+
{user.roleName}
+
+ ); + })} +
+
)} {!pathRegex.test(currentPath) && canManage && (