From d83706dfc84508524cf9dd879745eaaae507d85a Mon Sep 17 00:00:00 2001 From: Sarath Nair <91882341+sarath-nair-sonarsource@users.noreply.github.com> Date: Wed, 25 Sep 2024 12:00:35 +0200 Subject: [PATCH] SONAR-22764 Do not show project bind hint for non projects (#11850) --- .../project/components/PageHeader.tsx | 2 +- .../__tests__/PermissionsProject-it.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) 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 80aa2ec2b75..419e7b6a536 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 @@ -109,7 +109,7 @@ export default function PageHeader(props: Readonly) { )} - {githubProvisioningStatus && !isGitHubProject && ( + {githubProvisioningStatus && !isGitHubProject && isProject(component.qualifier) && ( {translate('project_permission.local_project_with_github_provisioning')} 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 e7e2585b60d..c1d2be79d89 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 @@ -449,6 +449,22 @@ describe('GitHub provisioning', () => { .every((item) => item.getAttributeNames().includes('disabled')), ).toBe(false); }); + + it.each([ComponentQualifier.Portfolio, ComponentQualifier.Application])( + 'shoudlnt show sync warning for portfolio and applications', + async (qualifier) => { + const user = userEvent.setup(); + const ui = getPageObject(user); + dopTranslationHandler.gitHubConfigurations.push( + mockGitHubConfiguration({ provisioningType: ProvisioningType.auto }), + ); + renderPermissionsProjectApp({ qualifier }, { featureList: [Feature.GithubProvisioning] }); + await ui.appLoaded(); + + expect(ui.pageTitle.get()).toBeInTheDocument(); + expect(ui.nonGHProjectWarning.query()).not.toBeInTheDocument(); + }, + ); }); describe('GitLab provisioning', () => { -- 2.39.5