dont show add user button when idp already set up for host (#28089)

This commit is contained in:
Gabriel Hernandez 2025-04-10 17:50:31 +01:00 committed by GitHub
parent 5ef16be93c
commit 453ddecf93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,6 +110,7 @@ import AddEndUserModal from "../cards/User/components/AddEndUserModal";
import {
generateChromeProfilesValues,
generateOtherEmailsValues,
generateUsernameValues,
} from "../cards/User/helpers";
const baseClass = "host-details";
@ -949,7 +950,10 @@ const HostDetailsPage = ({
className={defaultCardClass}
platform={host.platform}
endUsers={host.end_users ?? []}
enableAddEndUser={isDarwinHost}
enableAddEndUser={
isDarwinHost &&
generateUsernameValues(host.end_users ?? []).length !== 0
}
onAddEndUser={() => setShowAddEndUserModal(true)}
/>
)}