]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-18734 Display details about available branches in regulatory report modal
authorAmbroise C <ambroise.christea@sonarsource.com>
Tue, 28 Mar 2023 15:48:24 +0000 (17:48 +0200)
committersonartech <sonartech@sonarsource.com>
Wed, 29 Mar 2023 20:03:02 +0000 (20:03 +0000)
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 3da859b87b96548f39357e92fa081d71a806d99b..a316e386a37cb187dd78d45c04e18b70d74586b9 100644 (file)
 import classNames from 'classnames';
 import { orderBy } from 'lodash';
 import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
 import { getBranches } from '../../../../../../api/branches';
 import { getRegulatoryReportUrl } from '../../../../../../api/regulatory-report';
+import DocLink from '../../../../../../components/common/DocLink';
 import { ButtonLink } from '../../../../../../components/controls/buttons';
 import Select, { LabelValueSelectOption } from '../../../../../../components/controls/Select';
+import { Alert } from '../../../../../../components/ui/Alert';
 import {
   getBranchLikeDisplayName,
   isBranch,
@@ -123,6 +126,24 @@ export default class RegulatoryReport extends React.PureComponent<Props, State>
               value={branchLikesOptions.find((o) => o.value === selectedBranch)}
             />
           </div>
+          <Alert variant="info">
+            <div>
+              {translate('regulatory_page.available_branches_info.only_keep_when_inactive')}
+            </div>
+            <div>
+              <FormattedMessage
+                id="regulatory_page.available_branches_info.more_info"
+                defaultMessage={translate('regulatory_page.available_branches_info.more_info')}
+                values={{
+                  doc_link: (
+                    <DocLink to="/analyzing-source-code/branches/branch-analysis/#inactive-branches">
+                      {translate('regulatory_page.available_branches_info.more_info.doc_link')}
+                    </DocLink>
+                  ),
+                }}
+              />
+            </div>
+          </Alert>
           <div className="modal-field big-spacer-top">
             {downloadStarted && (
               <div>
index 7607277012039b6e17ebe9cf984e24ad877dfaf9..95eff79d2a15889fe953623e869a80bdb0b984aa 100644 (file)
@@ -40,6 +40,10 @@ it('should open the regulatory report page', async () => {
   expect(await screen.findByText('regulatory_report.page')).toBeInTheDocument();
   expect(screen.getByText('regulatory_report.description1')).toBeInTheDocument();
   expect(screen.getByText('regulatory_report.description2')).toBeInTheDocument();
+  expect(
+    screen.getByText('regulatory_page.available_branches_info.only_keep_when_inactive')
+  ).toBeInTheDocument();
+  expect(screen.getByText('regulatory_page.available_branches_info.more_info')).toBeInTheDocument();
 
   const branchSelect = screen.getByRole('combobox', { name: 'regulatory_page.select_branch' });
   expect(branchSelect).toBeInTheDocument();
index 3c89856a286ed6f702424271aa73b8af2f4abe0f..3b8586ad21bde89f9cbe43175060ef38ca857db4 100644 (file)
@@ -675,6 +675,9 @@ regulatory_report.bullet_point3=Lists of findings for both new and overall code
 regulatory_report.description2=The generation and download of the report may take a few minutes.
 regulatory_page.download_start.sentence=Your download should start shortly. This may take some time.
 regulatory_page.select_branch=Select Branch
+regulatory_page.available_branches_info.only_keep_when_inactive=Only branches marked as "Keep when inactive" are available.
+regulatory_page.available_branches_info.more_info=For further details, please check the {doc_link}.
+regulatory_page.available_branches_info.more_info.doc_link=related documentation
 
 #------------------------------------------------------------------------------
 #