aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Vorona <viktor.vorona@sonarsource.com>2023-07-17 17:20:36 +0200
committersonartech <sonartech@sonarsource.com>2023-07-18 20:03:22 +0000
commitee95bb3b3db83bbadf265c850138134bd740ecf3 (patch)
tree71a3191d7d4022eb0d0e53c3684111913d9efa4f
parent7d6499b37ca0dc87daab2ddf7fb25ff7034c3028 (diff)
downloadsonarqube-ee95bb3b3db83bbadf265c850138134bd740ecf3.tar.gz
sonarqube-ee95bb3b3db83bbadf265c850138134bd740ecf3.zip
SONAR-19787 Make disabled state explanation explicit
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx26
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx5
-rw-r--r--server/sonar-web/src/main/js/apps/permissions/test-utils.ts1
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
4 files changed, 17 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx
index f9b0bcf125c..200c721f57c 100644
--- a/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx
+++ b/server/sonar-web/src/main/js/apps/permissions/project/components/PageHeader.tsx
@@ -19,7 +19,6 @@
*/
import * as React from 'react';
import GitHubSynchronisationWarning from '../../../../app/components/GitHubSynchronisationWarning';
-import Tooltip from '../../../../components/controls/Tooltip';
import { Button } from '../../../../components/controls/buttons';
import { Alert } from '../../../../components/ui/Alert';
import DeferredSpinner from '../../../../components/ui/DeferredSpinner';
@@ -72,15 +71,13 @@ export default function PageHeader(props: Props) {
<h1 className="page-title">
{translate('permissions.page')}
{provisionedByGitHub && (
- <Tooltip overlay={translate('roles.page.description.github')}>
- <img
- alt="github"
- className="spacer-left spacer-right"
- aria-label={translate('project_permission.github_managed')}
- height={16}
- src={`${getBaseUrl()}/images/alm/github.svg`}
- />
- </Tooltip>
+ <img
+ alt="github"
+ className="spacer-left spacer-right"
+ aria-label={translate('project_permission.github_managed')}
+ height={16}
+ src={`${getBaseUrl()}/images/alm/github.svg`}
+ />
)}
</h1>
@@ -106,9 +103,12 @@ export default function PageHeader(props: Props) {
<p>{description}</p>
{visibilityDescription && <p>{visibilityDescription}</p>}
{provisionedByGitHub && (
- <div className="sw-mt-2">
- <GitHubSynchronisationWarning short />
- </div>
+ <>
+ <p>{translate('roles.page.description.github')}</p>
+ <div className="sw-mt-2">
+ <GitHubSynchronisationWarning short />
+ </div>
+ </>
)}
{githubProvisioningStatus && !isGitHubProject && (
<Alert variant="warning" className="sw-mt-2">
diff --git a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx
index 01b17d95ee4..73b39423a4c 100644
--- a/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx
+++ b/server/sonar-web/src/main/js/apps/permissions/project/components/__tests__/PermissionsProject-it.tsx
@@ -309,9 +309,8 @@ it('should have disabled permissions for GH Project', async () => {
expect(ui.pageTitle.get()).toBeInTheDocument();
expect(ui.pageTitle.get()).toHaveAccessibleName(/project_permission.github_managed/);
- await expect(ui.pageTitle.byRole('img').get()).toHaveATooltipWithContent(
- 'roles.page.description.github'
- );
+ expect(ui.pageTitle.byRole('img').get()).toBeInTheDocument();
+ expect(ui.githubExplanations.get()).toBeInTheDocument();
expect(ui.projectPermissionCheckbox('John', Permissions.Admin).get()).toBeChecked();
expect(ui.projectPermissionCheckbox('John', Permissions.Admin).get()).toHaveAttribute(
diff --git a/server/sonar-web/src/main/js/apps/permissions/test-utils.ts b/server/sonar-web/src/main/js/apps/permissions/test-utils.ts
index 15f971e558b..3acb1f2169d 100644
--- a/server/sonar-web/src/main/js/apps/permissions/test-utils.ts
+++ b/server/sonar-web/src/main/js/apps/permissions/test-utils.ts
@@ -41,6 +41,7 @@ export function getPageObject(user: UserEvent) {
visibilityRadio: (visibility: Visibility) =>
byRole('radio', { name: `visibility.${visibility}` }),
githubLogo: byRole('img', { name: 'project_permission.github_managed' }),
+ githubExplanations: byText('roles.page.description.github'),
confirmRemovePermissionDialog: byRole('dialog', {
name: 'project_permission.remove_only_confirmation_title',
}),
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index 4801252f199..b4eb9e98c49 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -593,7 +593,7 @@ roles.page=Project Permissions
roles.page.description2=Grant and revoke project-level permissions. Permissions can be granted to groups or individual users.
roles.page.description_portfolio=Grant and revoke portfolio-level permissions. Permissions can be granted to groups or individual users.
roles.page.description_application=Grant and revoke application-level permissions. Permissions can be granted to groups or individual users.
-roles.page.description.github=GitHub-provisioned project permissions are read-only for users provisioned from GitHub. For non-GitHub users, the permissions can only be removed.
+roles.page.description.github=Project permissions are read-only for users provisioned from GitHub. For non-GitHub users, the permissions can only be removed.
project_permission.github_managed=Provisioned from GitHub
project_permission.local_project_with_github_provisioning=Please note that this project is not linked to GitHub. Bind it to GitHub to take advantage of the provisioning of permissions.
project_permission.remove_only_confirmation=Are you sure you want to remove the permission {permission} from {holder}? The permission can not be added back.