Skip to content

Commit b8bd39f

Browse files
kunknownsonartech
authored andcommitted
SONAR-26025 Remove regulatory report download option for Application (#3634)
GitOrigin-RevId: 4c8c5b03493e31023ed5d5a503478aeeff264b5b
1 parent 4376da7 commit b8bd39f

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

libs/sq-server-commons/src/components/controls/ComponentReportActionsRenderer.tsx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
ToggleTip,
3030
} from '@sonarsource/echoes-react';
3131
import { useIntl } from 'react-intl';
32+
import { isApplication } from '~shared/helpers/component';
3233
import { getReportUrl } from '../../api/component-report';
3334
import { getRegulatoryReportUrl } from '../../api/regulatory-report';
3435
import { DocLink } from '../../helpers/doc-links';
@@ -131,24 +132,27 @@ export default function ComponentReportActionsRenderer(
131132
})}
132133
</DropdownMenu.ItemButton>
133134

134-
<DropdownMenu.Separator />
135-
136-
<DropdownMenu.GroupLabel>
137-
{intl.formatMessage({ id: 'component_regulatory_report.report' })}
138-
</DropdownMenu.GroupLabel>
139-
<DropdownMenu.ItemLinkDownload
140-
download={[component.name, branch?.name, 'regulatory report.zip']
141-
.filter((s) => !!s)
142-
.join(' - ')}
143-
helpText={intl.formatMessage({
144-
id: 'component_regulatory_report.download.help_text',
145-
})}
146-
isDisabled={!branch?.excludedFromPurge}
147-
onClick={handleDownloadStarted}
148-
to={regulatoryReportDownloadURL}
149-
>
150-
{intl.formatMessage({ id: 'component_regulatory_report.download' })}
151-
</DropdownMenu.ItemLinkDownload>
135+
{!isApplication(component.qualifier) && (
136+
<>
137+
<DropdownMenu.Separator />
138+
<DropdownMenu.GroupLabel>
139+
{intl.formatMessage({ id: 'component_regulatory_report.report' })}
140+
</DropdownMenu.GroupLabel>
141+
<DropdownMenu.ItemLinkDownload
142+
download={[component.name, branch?.name, 'regulatory report.zip']
143+
.filter((s) => !!s)
144+
.join(' - ')}
145+
helpText={intl.formatMessage({
146+
id: 'component_regulatory_report.download.help_text',
147+
})}
148+
isDisabled={!branch?.excludedFromPurge}
149+
onClick={handleDownloadStarted}
150+
to={regulatoryReportDownloadURL}
151+
>
152+
{intl.formatMessage({ id: 'component_regulatory_report.download' })}
153+
</DropdownMenu.ItemLinkDownload>
154+
</>
155+
)}
152156
</>
153157
}
154158
>

0 commit comments

Comments
 (0)