]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-19600 Change wording for DevOps platform settings description depending on...
authorDavid Cho-Lerat <david.cho-lerat@sonarsource.com>
Wed, 30 Aug 2023 15:19:23 +0000 (17:19 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 31 Aug 2023 20:02:56 +0000 (20:02 +0000)
server/sonar-web/src/main/js/apps/settings/components/almIntegration/AlmTabRenderer.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 5096a11a8fc6760cb32e1a794da12f7a8841da06..3e7934d26203494b7727e218ddea928fe29d99b5 100644 (file)
@@ -19,6 +19,9 @@
  */
 import * as React from 'react';
 import { FormattedMessage } from 'react-intl';
+import withAppStateContext, {
+  WithAppStateContextProps,
+} from '../../../../app/components/app-state/withAppStateContext';
 import Link from '../../../../components/common/Link';
 import { getTabId, getTabPanelId } from '../../../../components/controls/BoxedTabs';
 import { Button } from '../../../../components/controls/buttons';
@@ -32,6 +35,7 @@ import {
   AlmSettingsBindingStatus,
   isBitbucketCloudBindingDefinition,
 } from '../../../../types/alm-settings';
+import { EditionKey } from '../../../../types/editions';
 import { Dict } from '../../../../types/types';
 import AlmBindingDefinitionBox from './AlmBindingDefinitionBox';
 import AlmBindingDefinitionForm from './AlmBindingDefinitionForm';
@@ -62,9 +66,10 @@ const AUTHENTICATION_AVAILABLE_PLATFORMS = [
   AlmKeys.BitbucketServer,
 ];
 
-export default function AlmTabRenderer(props: AlmTabRendererProps) {
+function AlmTabRenderer(props: AlmTabRendererProps & WithAppStateContextProps) {
   const {
     almTab,
+    appState: { edition },
     branchesEnabled,
     definitions,
     definitionStatus,
@@ -77,6 +82,8 @@ export default function AlmTabRenderer(props: AlmTabRendererProps) {
 
   const preventCreation = loadingProjectCount || (!multipleAlmEnabled && definitions.length > 0);
 
+  const isCommunityEdition = edition === EditionKey.community;
+
   return (
     <div
       className="bordered"
@@ -128,7 +135,11 @@ export default function AlmTabRenderer(props: AlmTabRendererProps) {
         <Alert variant="info" className="spacer">
           <FormattedMessage
             id="settings.almintegration.tabs.authentication-moved"
-            defaultMessage={translate('settings.almintegration.tabs.authentication_moved')}
+            defaultMessage={
+              isCommunityEdition
+                ? translate('settings.almintegration.tabs.community_edition_cannot_delegate_auth')
+                : translate('settings.almintegration.tabs.authentication_moved')
+            }
             values={{
               link: (
                 <Link
@@ -147,3 +158,5 @@ export default function AlmTabRenderer(props: AlmTabRendererProps) {
     </div>
   );
 }
+
+export default withAppStateContext(AlmTabRenderer);
index 3538296fccf4b33c09dcf19a417df04579cfe03d..c923765068afd27b29b2e345f62174cabd862ab9 100644 (file)
@@ -1469,6 +1469,7 @@ settings.almintegration.feature.alm_repo_import.description=Select repositories
 settings.almintegration.feature.alm_repo_import.disabled=Disabled
 settings.almintegration.feature.alm_repo_import.disabled.no_url=This feature is disabled because your configured instance has no URL.
 settings.almintegration.tabs.authentication_moved=You can delegate authentication to this DevOps Platform. The relevant settings are under the {link} section.
+settings.almintegration.tabs.community_edition_cannot_delegate_auth=You cannot delegate authentication to this DevOps Platform with the Community Edition of SonarQube.
 
 # Authentication Common
 settings.authentication.title=Authentication