Skip to content

Commit

Permalink
Hide ineffectual MFA checkbox on user form for team admins (#24656)
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.

# Checklist for submitter
- [x] Manual QA for all new/changed functionality
  • Loading branch information
iansltx authored Dec 11, 2024
1 parent 2118616 commit fda6bca
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 fda6bca

Please sign in to comment.