From dafc7f30715e9d061e8b2c5b6d178ed2f6775ffd Mon Sep 17 00:00:00 2001 From: Belen Pruvost Date: Wed, 11 Aug 2021 13:07:48 +0200 Subject: [PATCH] SONAR-15139 - Add scheduled email reports subscription --- .../ComponentReportActionsRenderer.tsx | 6 +-- ...mponentReportActionsRenderer-test.tsx.snap | 49 ++++++++++++++++--- .../resources/org/sonar/l10n/core.properties | 1 + 3 files changed, 46 insertions(+), 10 deletions(-) diff --git a/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx b/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx index b08035d5325..a693b8315f7 100644 --- a/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx +++ b/server/sonar-web/src/main/js/components/controls/ComponentReportActionsRenderer.tsx @@ -25,7 +25,6 @@ import DropdownIcon from 'sonar-ui-common/components/icons/DropdownIcon'; 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; @@ -47,6 +46,7 @@ export default function ComponentReportActionsRenderer(props: ComponentReportAct 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') @@ -72,13 +72,13 @@ export default function ComponentReportActionsRenderer(props: ComponentReportAct const frequencyTranslation = translate('report.frequency', frequency).toLowerCase(); return ( - + {translateWithParameters(translationKey, frequencyTranslation)} ); }; - return canSubscribe && isPortfolioLike(component.qualifier) ? ( + return canSubscribe ? ( diff --git a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ComponentReportActionsRenderer-test.tsx.snap b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ComponentReportActionsRenderer-test.tsx.snap index df37dbbcc68..e80e9bbf4e0 100644 --- a/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ComponentReportActionsRenderer-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/controls/__tests__/__snapshots__/ComponentReportActionsRenderer-test.tsx.snap @@ -8,6 +8,7 @@ exports[`should render correctly: can subscribe, not subscribed 1`] = ` >
  • @@ -46,6 +48,7 @@ exports[`should render correctly: can subscribe, subscribed 1`] = ` >
  • @@ -78,6 +82,7 @@ exports[`should render correctly: can subscribe, subscribed 1`] = ` exports[`should render correctly: cannot subscribe 1`] = `
  • +
  • + + download_verb + +
  • +
  • + + component_report.subscribe_x.report.frequency.weekly + +
  • + + } > - component_report.download.qualifier.trk - + +
    `; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index a34df0bccc2..8e79a50764e 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -2867,6 +2867,7 @@ background_task.type.APP_REFRESH=Recomputation 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. -- 2.39.5