aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/components/permissions/UserHolder.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/components/permissions/UserHolder.tsx')
-rw-r--r--server/sonar-web/src/main/js/components/permissions/UserHolder.tsx29
1 files changed, 11 insertions, 18 deletions
diff --git a/server/sonar-web/src/main/js/components/permissions/UserHolder.tsx b/server/sonar-web/src/main/js/components/permissions/UserHolder.tsx
index 1f3bc7f1bce..e07c01b6f87 100644
--- a/server/sonar-web/src/main/js/components/permissions/UserHolder.tsx
+++ b/server/sonar-web/src/main/js/components/permissions/UserHolder.tsx
@@ -22,8 +22,7 @@ import * as React from 'react';
import { translate } from '../../helpers/l10n';
import { isPermissionDefinitionGroup } from '../../helpers/permissions';
import { getBaseUrl } from '../../helpers/system';
-import { useIdentityProviderQuery } from '../../queries/identity-provider/common';
-import { PermissionDefinitions, PermissionUser, Provider } from '../../types/types';
+import { PermissionDefinitions, PermissionUser } from '../../types/types';
import PermissionCell from './PermissionCell';
import usePermissionChange from './usePermissionChange';
@@ -32,22 +31,18 @@ interface Props {
permissions: PermissionDefinitions;
selectedPermission?: string;
user: PermissionUser;
- isGitHubProject?: boolean;
disabled?: boolean;
removeOnly?: boolean;
}
export default function UserHolder(props: Props) {
- const { user, disabled, removeOnly, permissions, isGitHubProject, selectedPermission } = props;
+ const { user, disabled, removeOnly, permissions, selectedPermission } = props;
const { loading, handleCheck, modal } = usePermissionChange({
holder: user,
onToggle: props.onToggle,
permissions,
removeOnly,
});
- const { data: identityProvider } = useIdentityProviderQuery({
- enabled: isGitHubProject ?? false,
- });
const permissionCells = permissions.map((permission) => (
<PermissionCell
@@ -94,17 +89,15 @@ export default function UserHolder(props: Props) {
<strong>{user.name}</strong>
<Note className="sw-ml-2">{user.login}</Note>
</div>
- {isGitHubProject &&
- identityProvider?.provider === Provider.Github &&
- user.managed && (
- <img
- alt="github"
- className="sw-ml-2"
- height={16}
- aria-label={translate('project_permission.github_managed')}
- src={`${getBaseUrl()}/images/alm/github.svg`}
- />
- )}
+ {disabled && (
+ <img
+ alt="github"
+ className="sw-ml-2"
+ height={16}
+ aria-label={translate('project_permission.github_managed')}
+ src={`${getBaseUrl()}/images/alm/github.svg`}
+ />
+ )}
</div>
{user.email && (
<div className="sw-mt-2 sw-max-w-100 sw-text-ellipsis sw-whitespace-nowrap sw-overflow-hidden">