Browse Source

SONAR-18734 Display details about available branches in regulatory report modal

tags/10.0.0.68432
Ambroise C 1 year ago
parent
commit
9dd80122e0

+ 21
- 0
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/RegulatoryReport.tsx View File

@@ -20,10 +20,13 @@
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>

+ 4
- 0
server/sonar-web/src/main/js/app/components/nav/component/projectInformation/projectRegulatoryReport/__tests__/RegulatoryReport-it.tsx View 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();

+ 3
- 0
sonar-core/src/main/resources/org/sonar/l10n/core.properties View 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

#------------------------------------------------------------------------------
#

Loading…
Cancel
Save