Skip to content

Commit

Permalink
Hide ineffectual MFA checkbox on user form for team admins
Browse files Browse the repository at this point in the history
Also fixes some capitalization/pluralization issues for user management for team admins

For #24623.
  • Loading branch information
iansltx committed Dec 11, 2024
1 parent bf7876a commit 5e7bf69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ const UsersPage = ({ location, router }: ITeamSubnavProps): JSX.Element => {
defaultSortDirection="asc"
actionButton={{
name: isGlobalAdmin ? "add user" : "create user",
buttonText: isGlobalAdmin ? "Add users" : "Create users",
buttonText: isGlobalAdmin ? "Add users" : "Create user",
variant: "brand",
onActionButtonClick: isGlobalAdmin
? toggleAddUserModal
Expand Down Expand Up @@ -476,7 +476,7 @@ const UsersPage = ({ location, router }: ITeamSubnavProps): JSX.Element => {
onCancel={toggleCreateUserModal}
onSubmit={onCreateUserSubmit}
defaultGlobalRole={null}
defaultTeamRole="observer"
defaultTeamRole="Observer"
defaultTeams={[
{ id: currentTeamDetails.id, name: "", role: "observer" },
]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ const UserForm = ({
<SelectRoleForm
currentTeam={currentTeam || formData.teams[0]}
teams={formData.teams}
defaultTeamRole={defaultTeamRole || "observer"}
defaultTeamRole={defaultTeamRole || "Observer"}
onFormChange={onTeamRoleChange}
isApiOnly={isApiOnly}
/>
Expand Down Expand Up @@ -630,6 +630,7 @@ const UserForm = ({
renderPasswordSection()}
{(isPremiumTier || isMfaEnabled) &&
!formData.sso_enabled &&
isModifiedByGlobalAdmin &&
renderTwoFactorAuthenticationOption()}
{isPremiumTier ? renderPremiumRoleOptions() : renderGlobalRoleForm()}
</form>
Expand Down

0 comments on commit 5e7bf69

Please sign in to comment.