From d41e3d94e3c5f7aa6dd168ba1040ba8c210b1a0f Mon Sep 17 00:00:00 2001 From: Ankita Kinger Date: Mon, 3 Apr 2023 20:09:13 +0530 Subject: [PATCH] chore: Updating empty state for members in the invite modal (#22026) ## Description Updating empty state for members in the invite modal. Earlier, we used to show a message that email setup needs to be completed to invite users, but this doesn't hold true today. So we are removing this and adding the message "You haven't invited any users yet" in case there are no members to show in the invite modal. Fixes [#22017](https://github.com/appsmithorg/appsmith/issues/22017) ## Type of change - Chore (housekeeping or task changes that don't impact user perception) ## How Has This Been Tested? > This has been tested manually and works as expected. - Manual ## Checklist: ### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --- app/client/src/ce/constants/messages.ts | 1 + .../workspace/WorkspaceInviteUsersForm.tsx | 22 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index 3cfe9ce717..6a4f2ab346 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -165,6 +165,7 @@ export const USERS_HAVE_ACCESS_TO_ALL_APPS = () => "Users will have access to all applications in this workspace"; export const USERS_HAVE_ACCESS_TO_ONLY_THIS_APP = () => "Users will only have access to this application"; +export const NO_USERS_INVITED = () => "You haven't invited any users yet"; export const CREATE_PASSWORD_RESET_SUCCESS = () => `Your password has been set`; export const CREATE_PASSWORD_RESET_SUCCESS_LOGIN_LINK = () => `Login`; diff --git a/app/client/src/ce/pages/workspace/WorkspaceInviteUsersForm.tsx b/app/client/src/ce/pages/workspace/WorkspaceInviteUsersForm.tsx index 0a61e2c223..199ce6250c 100644 --- a/app/client/src/ce/pages/workspace/WorkspaceInviteUsersForm.tsx +++ b/app/client/src/ce/pages/workspace/WorkspaceInviteUsersForm.tsx @@ -33,6 +33,7 @@ import { INVITE_USERS_VALIDATION_EMAIL_LIST, INVITE_USERS_VALIDATION_ROLE_EMPTY, USERS_HAVE_ACCESS_TO_ALL_APPS, + NO_USERS_INVITED, } from "@appsmith/constants/messages"; import { isEmail } from "utils/formhelpers"; import { @@ -69,7 +70,7 @@ import { isEllipsisActive } from "utils/helpers"; import { USER_PHOTO_ASSET_URL } from "constants/userConstants"; import type { WorkspaceUserRoles } from "@appsmith/constants/workspaceConstants"; -const { cloudHosting, mailEnabled } = getAppsmithConfigs(); +const { cloudHosting } = getAppsmithConfigs(); export const CommonTitleTextStyle = css` color: ${Colors.CHARCOAL}; @@ -207,11 +208,6 @@ export const MailConfigContainer = styled.div` font-weight: 500; font-size: 14px; } - && > a { - color: ${(props) => props.theme.colors.modal.email.desc}; - font-size: 12px; - text-decoration: underline; - } `; export const LabelText = styled(Text)` @@ -334,7 +330,6 @@ function WorkspaceInviteUsersForm(props: any) { const { allUsers, anyTouched, - disableEmailSetup = false, disableManageUsers = false, disableUserList = false, error, @@ -520,17 +515,10 @@ function WorkspaceInviteUsersForm(props: any) { ) : ( <> - {!mailEnabled && !disableEmailSetup && ( + {allUsers.length === 0 && ( - {allUsers.length === 0 && } - You haven’t setup any email service yet - - Please configure your email service to invite people - + + {createMessage(NO_USERS_INVITED)} )} {!disableUserList && (