import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import { getReportUrl } from '../../api/component-report';
import { Branch } from '../../types/branch-like';
-import { isPortfolioLike } from '../../types/component';
export interface ComponentReportActionsRendererProps {
component: T.Component;
download={[component.name, branch?.name, 'PDF Report.pdf'].filter(s => !!s).join(' - ')}
href={getReportUrl(component.key, branch?.name)}
target="_blank"
+ data-test="overview__download-pdf-report-button"
rel="noopener noreferrer">
{simple
? translate('download_verb')
const frequencyTranslation = translate('report.frequency', frequency).toLowerCase();
return (
- <a href="#" onClick={onClickHandler}>
+ <a href="#" onClick={onClickHandler} data-test="overview__subscribe-to-report-button">
{translateWithParameters(translationKey, frequencyTranslation)}
</a>
);
};
- return canSubscribe && isPortfolioLike(component.qualifier) ? (
+ return canSubscribe ? (
<Dropdown
overlay={
<ul className="menu">
>
<li>
<a
+ data-test="overview__download-pdf-report-button"
download="MyProject - PDF Report.pdf"
href="/api/governance_reports/download?componentKey=my-project"
rel="noopener noreferrer"
</li>
<li>
<a
+ data-test="overview__subscribe-to-report-button"
href="#"
onClick={[MockFunction]}
>
>
<li>
<a
+ data-test="overview__download-pdf-report-button"
download="MyProject - PDF Report.pdf"
href="/api/governance_reports/download?componentKey=my-project"
rel="noopener noreferrer"
</li>
<li>
<a
+ data-test="overview__subscribe-to-report-button"
href="#"
onClick={[MockFunction]}
>
exports[`should render correctly: cannot subscribe 1`] = `
<a
+ data-test="overview__download-pdf-report-button"
download="MyProject - PDF Report.pdf"
href="/api/governance_reports/download?componentKey=my-project"
rel="noopener noreferrer"
>
<li>
<a
+ data-test="overview__download-pdf-report-button"
download="MyProject - PDF Report.pdf"
href="/api/governance_reports/download?componentKey=my-project"
rel="noopener noreferrer"
`;
exports[`should render correctly: not a portfolio 1`] = `
-<a
- download="MyProject - PDF Report.pdf"
- href="/api/governance_reports/download?componentKey=my-project"
- rel="noopener noreferrer"
- target="_blank"
+<Dropdown
+ overlay={
+ <ul
+ className="menu"
+ >
+ <li>
+ <a
+ data-test="overview__download-pdf-report-button"
+ download="MyProject - PDF Report.pdf"
+ href="/api/governance_reports/download?componentKey=my-project"
+ rel="noopener noreferrer"
+ target="_blank"
+ >
+ download_verb
+ </a>
+ </li>
+ <li>
+ <a
+ data-test="overview__subscribe-to-report-button"
+ href="#"
+ onClick={[MockFunction]}
+ >
+ component_report.subscribe_x.report.frequency.weekly
+ </a>
+ </li>
+ </ul>
+ }
>
- component_report.download.qualifier.trk
-</a>
+ <Button
+ className="dropdown-toggle"
+ >
+ component_report.report.qualifier.TRK
+ <DropdownIcon
+ className="spacer-left icon-half-transparent"
+ />
+ </Button>
+</Dropdown>
`;
background_task.type.PROJECT_EXPORT=Project Export
background_task.type.PROJECT_IMPORT=Project Import
background_task.type.AUDIT_PURGE=Audit Log Purge
+background_task.type.REPORT_SUBMIT=Report Email Submit
background_tasks.page=Background Tasks
background_tasks.page.description=This page allows monitoring of the queue of tasks running asynchronously on the server. It also gives access to the history of finished tasks and their status. Analysis report processing is the most common kind of background task.