This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new e9ae212c1cc fix(alerts): show screenshot width field for PDF reports
(#37037)
e9ae212c1cc is described below
commit e9ae212c1ccf522183adda5d499bf77001226326
Author: Abhishek Mishra <[email protected]>
AuthorDate: Sat Feb 7 00:49:18 2026 +0530
fix(alerts): show screenshot width field for PDF reports (#37037)
---
.../src/features/alerts/AlertReportModal.test.tsx | 24 ++++++++++++++++++++++
.../src/features/alerts/AlertReportModal.tsx | 2 +-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx
b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx
index 45d896851ad..4fb6fd8412a 100644
--- a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx
+++ b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx
@@ -528,6 +528,30 @@ test('does not show screenshot width when csv is
selected', async () => {
expect(screen.queryByRole('spinbutton')).not.toBeInTheDocument();
});
+test('shows screenshot width when PDF is selected', async () => {
+ render(<AlertReportModal {...generateMockedProps(false, true, false)} />, {
+ useRedux: true,
+ });
+ userEvent.click(screen.getByTestId('contents-panel'));
+ await screen.findByText(/test chart/i);
+ const contentTypeSelector = screen.getByRole('combobox', {
+ name: /select content type/i,
+ });
+ await comboboxSelect(contentTypeSelector, 'Chart', () =>
+ screen.getByText(/select chart/i),
+ );
+ const reportFormatSelector = screen.getByRole('combobox', {
+ name: /select format/i,
+ });
+ await comboboxSelect(
+ reportFormatSelector,
+ 'PDF',
+ () => screen.getAllByText(/Send as PDF/i)[0],
+ );
+ expect(screen.getByText(/screenshot width/i)).toBeInTheDocument();
+ expect(screen.getByRole('spinbutton')).toBeInTheDocument();
+});
+
// Schedule Section
test('opens Schedule Section on click', async () => {
render(<AlertReportModal {...generateMockedProps(false, true, false)} />, {
diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx
b/superset-frontend/src/features/alerts/AlertReportModal.tsx
index fddbff73a9d..47cb494a984 100644
--- a/superset-frontend/src/features/alerts/AlertReportModal.tsx
+++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx
@@ -513,7 +513,7 @@ const AlertReportModal:
FunctionComponent<AlertReportModalProps> = ({
const [isScreenshot, setIsScreenshot] = useState<boolean>(false);
useEffect(() => {
- setIsScreenshot(reportFormat === 'PNG');
+ setIsScreenshot(reportFormat === 'PNG' || reportFormat === 'PDF');
}, [reportFormat]);
// Dropdown options