Skip to content

[ReponseOps][Reporting] Allow users to schedule reports and view schedules list#224849

Merged
umbopepato merged 18 commits intomainfrom
scheduled-reports-ui
Jun 24, 2025
Merged

[ReponseOps][Reporting] Allow users to schedule reports and view schedules list#224849
umbopepato merged 18 commits intomainfrom
scheduled-reports-ui

Conversation

@umbopepato
Copy link
Member

@umbopepato umbopepato commented Jun 23, 2025

Summary

  • Implements the flyout to schedule reports
  • Adds a Schedules table to the Stack Management > Reporting page to view schedules
  • Updates the Reports table to show information about scheduled reports

Verification steps

🐞 Happy Path

  • Add the following configuration to your Kibana config file
    notifications.connectors.default.email: gmail
    xpack.actions.preconfigured:
      gmail:
        name: 'email: my gmail'
        actionTypeId: '.email'
    
  • Log in as an admin user or user with Reporting privileges and a license != basic
  • If you don't have data in Kibana, navigate to Home > Try sample data and activate a sample data set
  • Create a Dashboard or Discover session
  • Open the ⬇️ (Export) menu in the toolbar
  • Click Schedule export
  • Schedule reports with different combinations of file name, export type, recurrence schedule and email notification settings
  • Navigate to Stack Management > Reporting
  • Check that the scheduled reports match the displayed items in the Reports and Schedules tabs (⚠️ some jobs might not have started because of the recurrence rule so you might not find the reports immediately)

⚡️ Edge Cases

Missing default notifications email connector

  • Start Kibana without the default email connector from point n.1 of the happy path
  • When trying to schedule a report, the flyout should show a callout informing the user about the missing email connector

Unmet prerequisites

  • Start ES with any of the following flags: -E xpack.security.enabled=false or -E xpack.security.authc.api_key.enabled=false
  • The Schedule export button should not appear in the Export menu

Unsupported license

  • Log in as a user with a basic license or without capabilities to generate reports
  • The Schedule export button should not appear in the Export menu

Users without Manage Scheduled Reports privilege

  • Create a role with sufficient privileges to access and export any object type (Dashboards, Discover, ...), do not grant the Manage Scheduled Reports privilege (under Stack Management)
  • Create a user with this role, without an email address
  • Open the Schedule export flyout
  • Check that the Send by email field is disabled, showing a hint about the user profile missing an email address
  • Add an email address to the user (for the changes to take effect you might have to renew the session, logging back in)
  • Check that the Send by email toggle is now enabled
  • Check that when toggling email notifications on, the To field is disabled and precompiled with the user's email address

Flyout form validation

  • File name should be required
  • To should not allow to insert invalid email addresses
  • To should not allow to insert unallowed email addresses (not in allowlist)
  • Recurrence subform should show presets based on the current datetime

❌ Failure Cases

Known issues

Screenshots

Health API error:
Screenshot 2025-05-31 at 10 48 40

Health API loading state:
Screenshot 2025-05-31 at 10 49 04

Health API success with some missing prerequisites:
Screenshot 2025-06-17 at 16 59 57

Form validation:
image

Success toast:
image

Failure toast:
image

Print format toggle:
image

Missing notifications email connector callout:
image

User without Manage Scheduled Reports privilege and without email address in profile
Screenshot 2025-06-23 at 14 51 07

User without Manage Scheduled Reports privilege with email address in profile
image

Release Notes

Added the ability to schedule reports with a recurring schedule and view previously scheduled reports

References

Closes #216321
Closes #216322

Checklist

umbopepato and others added 2 commits June 23, 2025 10:23
## Summary

> [!IMPORTANT]
> This PR is targeting the `scheduled-reports-ui` feature branch, where
the backend changes from the `scheduled-reports` branch are temporarily
integrated while waiting for
#221028 to be merged (see the
squashed `[TMP] ...` commit message).

Implements the flyout UI for the creation and read-only viewing of
scheduled reports (exports).

<img height="500" alt="image"
src="https://github.com/user-attachments/assets/6bbd274b-1bbb-481f-ac40-4d7131be6d85"
/>

<details>

<summary>

## Known issues

</summary>

- Console error due to `compressed` attribute wrongly forwarded by
form-hook-lib to DOM element (this is likely a form lib issue):
<img width="916" alt="image"
src="https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90"
/>

- Email validation errors accumulate instead of replacing the previous
one (again looks like a fom lib issue):

https://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9

</details>

<details>

<summary>

## Screenshots

</summary>

Health API error:
<img height="500" alt="Screenshot 2025-05-31 at 10 48 40"
src="https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede"
/>

Health API loading state:
<img height="500" alt="Screenshot 2025-05-31 at 10 49 04"
src="https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837"
/>

Health API success with some missing prerequisites:
<img width="449" alt="Screenshot 2025-06-17 at 16 59 57"
src="https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459"
/>

Form validation:
<img height="500" alt="image"
src="https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8"
/>

Success toast:
<img width="480" alt="image"
src="https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2"
/>

Failure toast:
<img width="518" alt="image"
src="https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18"
/>

Print format toggle:
<img width="502" alt="image"
src="https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd"
/>

Missing notifications email connector callout:
<img width="499" alt="image"
src="https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085"
/>

</details>

## References

Closes #216321
Stacked on #220535

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Eyo O. Eyo <7893459+eokoneyo@users.noreply.github.com>
…224354)

## Summary
Resolves #216322


> [!IMPORTANT]
> This PR is targeting the `scheduled-reports-ui` feature branch, where
the backend changes from the `scheduled-reports` branch are temporarily
integrated while waiting for
#221028 to be merged (see the
squashed `[TMP] ...` commit message).
> This PR has few commits from
#222135 to support view schedule
config table action. Please ignore code changes in folders if you are
already reviewing other PR.

`src/platform/packages/private/kbn-reporting/public/share/share_context_menu`,
`src/platform/packages/shared/response-ops/recurring-schedule-form`,
 `x-pack/platform/plugins/private/reporting/public/management/schemas`, 

`x-pack/platform/plugins/private/reporting/public/management/validators`
and

`xpack/platform/plugins/shared/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx`.


This PR adds new tabs `Exports` and `Schedules` in Reporting section.
`Exports` tab shows the list of all reports. Allows to open dashboard,
download report and view report information.
`Schedules` tab shows list of scheduled reports. Allows to disable
schedule.
 

### Checklist

Check the PR satisfies following conditions. 

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios


### What to test 

- Verify tabs
- Verify exports table shows list of all reports
- Verify schedules table shows list of scheduled report
- Verify you can disable scheduled report
- Verify pagination in both tables

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@umbopepato umbopepato requested review from a team as code owners June 23, 2025 11:12
@umbopepato umbopepato added Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// release_note:feature Makes this part of the condensed release notes backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Jun 23, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@js-jankisalvi js-jankisalvi changed the title [ReponseOps][Reporting] Scheduled reports UI [ReponseOps][Reporting] Allow users to schedule reports and view schedules list Jun 23, 2025
expect(await reporting.isGenerateReportButtonDisabled()).to.be(null);
await exports.closeExportFlyout();
expect(await exports.isPopoverItemEnabled('CSV')).to.be(true);
await reporting.openExportPopover();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be await exports.closeExportFlyout();?
Same in other modified tests.

Copy link
Member Author

@umbopepato umbopepato Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jughosta! I know, it's a bit unintuitive. The reporting.openExportPopover() doesn't open the export flyout, but the export popover. Some tests were failing because that popover might remain open/reopen after generating an export from the flyout, resulting in some elements below it being unclickable. Since we don't have a close button, I used the same strategy as in other fn tests in Kibana which is clicking again on the button that opens the popover to close it 🙂

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, thanks for explaining! Probably could be renamed into toggleExportPopover if there is no "close" action.

Copy link
Contributor

@jughosta jughosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Data Discovery changes LGTM

Copy link
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shared UX changes LGTM

});

useEffect(() => {
if (!hasManageReportingPrivilege && userProfile?.user.email) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to do this imperatively since the form defaultValue doesn't seem to be reactive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a different pattern to avoid this useEffect. Not suggesting to do it now but it could be like this:

const FormWrapper = ({ initialState, hasManageReportingPrivilege, email }) => {
  const form = useForm({ defaultValue: initialState });
  <Form form={form}> .... </Form>
}

const ScheduledReportFlyoutContent = () => {

if (isUserProfileLoading || isLoadingSomethingElse) {
 return null;
}

// all data are available. we can construct the initial state
const initialState = {....}

return <FormWrapper {...someProps} initialState={initialState}/>
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused by !hasManageReportingPrivilege. Why is that? What happens when I have reporting privileges?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you're a reporting manager, then the choice of email recipients is totally free. Non-managers can only email to themselves

};
payload?: ReportApiJSON['payload'];
schedule: RruleSchedule;
space_id: string;
Copy link
Member

@tsullivan tsullivan Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should space_id be optional?

export const getKey = queryKeys.getHealth;

export const useGetReportingHealthQuery = ({ http }: { http: HttpSetup }) => {
return useQuery({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be possible to useKibana to acquire the http setup service

}: {
userProfileService?: UserProfileService;
}) => {
return useQuery({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { userProfile } = useKibana().services;

export const getKey = mutationKeys.scheduleReport;

export const useScheduleReport = ({ http }: { http: HttpSetup }) => {
return useMutation({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { http } = useKibana().services

apiClient,
services,
}: CreateScheduledReportProviderOptions): ExportShareDerivatives => {
return {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you can use the "concise body arrow function" to return an object literal, and leave out the return:

export const createScheduledReportShareIntegration = ({
  apiClient,
  services,
}: CreateScheduledReportProviderOptions): ExportShareDerivatives => ({
  id: 'scheduledReports',
  ...
});

data: dataService,
share: shareService,
actions: actionsService,
notifications: notificationsService,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on some of my comments about leveraging the useKibana hook, you might want to add toasts and userProfile to this set of services.


render(
ReactDOM.render(
<KibanaRenderContextProvider {...coreStart}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not important for this PR, but we have a new stateful service that provides context to internal components, which replaces KibanaRenderContextProvider.

  ReactDOM.render(
    coreStart.rendering.addContext(
      <KibanaContextProvider services={services}>
      ...
      </KibanaContextProvider>
    ),
    element
  );

Copy link
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments from reading the code. I'm very excited to see this coming through!

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! So nice to see this feature live. I really appreciate the hard work you both put on this feature and I know a lot of my comments would be done if you had more time. I tested with different roles and licenses and used the domain_allowlist configuration. Everything works as expected. I found the following small issues that can be addressed on a different PR:

  • If I configured the Visualization feature privilege to not have the reporting privilege I can see the schedule button. Then when I open the flyout the file type selection is empty.
  • For some reason, I get an error (403) from the ILM API. I am logged in as a super user. The error I get is related to index access, but I went to discover, and I can see the docs in the index. There was a bug where when I opened the flyout to view the config, I was getting a loading spinner. It was fixed with the latest commit.
Screenshot 2025-06-23 at 11 19 01 PM
  • I get some errors in the console with the report generation. It is not related to this PR but I wanted to mention it.
2025-06-23T15:34:05.944+03:00][WARN ][plugins.security.routes] API keys are intended for programmatic access. Do not use API keys to authenticate access via a web browser.
[2025-06-23T15:34:05.950+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:05.950+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:05.996+03:00][INFO ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] handled 237 page requests
[2025-06-23T15:34:05.998+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:05.998+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.059+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.060+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.102+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.102+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Using kebab-case for css properties in objects is not supported. Did you mean pageBreakInside?", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:06.102+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.124+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.125+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.224+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.225+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Using kebab-case for css properties in objects is not supported. Did you mean backgroundImage?", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:06.283+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.283+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Using kebab-case for css properties in objects is not supported. Did you mean borderRadius?", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:06.284+03:00][WARN ][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting] Chromium received a non-OK response (404) for request https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings
[2025-06-23T15:34:06.289+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Favorites service is not available for current user", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:06.289+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.289+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.289+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Failed to load resource: the server responded with a status of 404 ()", url: "https://localhost:5602/internal/security/user_profile?dataPath=avatar%2CuserSettings" }
[2025-06-23T15:34:06.430+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Warning: render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:07.406+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Warning: render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
[2025-06-23T15:34:07.454+03:00][ERROR][plugins.reporting.pdf-export-v2.execute-job:e199009d-d156-45c1-9764-9dc0d2b401fe.screenshotting.browser-driver.headless-browser-console] Error in browser console: { message: "Warning: render(...): Replacing React-rendered children with a new root component. If you intended to update the children of this node, you should instead have the existing children update their state and render the new components instead of calling ReactDOM.render.", url: "https://localhost:5602/XXXXXXXXXXXX/bundles/core/core.entry.js" }
  • The "Go to Kibana" link in the email footer links to Kibana and not to the scheduling page
  • The reporting document has the @timestamp set in the 1970 year.
Screenshot 2025-06-24 at 1 54 18 PM
  • The tooltip over the app icon does not show a human friendly text
Screenshot 2025-06-23 at 3 16 33 PM

Regarding my comments in the code we can address most of them in a different PR. Some thoughts which can also be addressed in a different PR:

  • We changed the recurring form handles the startDate being undefined. This lead to a lot checks for undefined values. Could we just pass the startDate as now and then remove it before sending it to the backend?
  • A lot of code missing unit tests
  • No basic e2e tests
  • In a lot of places in the code we could export the logic in smaller functions to make it more readable and avoid using useMemo when calculating primitive values.

`${INTERNAL_ROUTES.SCHEDULED.LIST}`
);

const report = reportList.find((item) => item.id === id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have a get by ID API?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No we don't, right @ymao1 ?


describe('getScheduledReportInfo', () => {
beforeEach(() => {
httpClient.get.mockResolvedValueOnce({ data: [{ id: '123', title: 'Scheduled Report 1' }] });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Because we filter out the reports that do not match the ID, let's add another item here.

};

export const mutationKeys = {
bulkDisableScheduledReports: () => [root, 'bulkDisableScheduledReports'] as const,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be part of x-pack/platform/plugins/private/reporting/public/management/mutation_keys.ts?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should! I was going to move this yesterday but waited to have a full CI cycle. I'll keep this in mind for the improvements after merge 🙂

});

describe('Schedules', () => {
it('does allow user with reporting privileges o navigate to the Schedules tab', async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it('does allow user with reporting privileges o navigate to the Schedules tab', async () => {
it('does allow user with reporting privileges to navigate to the Schedules tab', async () => {

7: 'SU',
};

export const RRULE_TO_ISO_WEEKDAYS: Record<string, number> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use Weekday enum exported from src/platform/packages/shared/kbn-rrule/types.ts?


const onSubmit = async () => {
try {
if (await form.validate()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think submit also validates, and it passed the isValid on the onSubmit method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know about this one, it looked like the lib just didn't validate it (see point n.6 of Ying's review)

title={<h3>{i18n.SCHEDULED_REPORT_FORM_DETAILS_SECTION_TITLE}</h3>}
>
<FormField
path="title"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we put a limit on the number of characters a title should have?

})
);
queryClient.invalidateQueries({
queryKey: queryKeys.getScheduledList({}),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better if we invalidated all queries like ['reporting', 'scheduledList'].

);
}

import('./management/integrations/scheduled_report_share_integration').then(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am skeptical about this pattern. Could we async load inside one of the createScheduledReportShareIntegration methods? Also, does the sharing export support registering on the start method?

it('returns invalid message if one email is invalid', () => {
const validateEmailAddresses = jest
.fn()
.mockReturnValue([{ valid: false, reason: InvalidEmailReason.invalid }]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the description of the above test, we should add another valid email.

Copy link

@joana-cps joana-cps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@js-jankisalvi default number of rows in both tables should be 50

@umbopepato umbopepato enabled auto-merge (squash) June 24, 2025 13:21
@umbopepato umbopepato merged commit 0c377fa into main Jun 24, 2025
11 checks passed
@umbopepato umbopepato deleted the scheduled-reports-ui branch June 24, 2025 15:32
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15854866850

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #134 / Reporting Functional Tests with Security enabled Access to Management > Reporting Schedules does not allow user to access schedules that does not have reporting privileges
  • [job] [logs] FTR Configs #61 / Unified Tabs Examples Managing Unified Tabs can edit tab label with keyboard events

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
reporting 163 214 +51

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/reporting-common 97 99 +2
@kbn/reporting-public 103 109 +6
share 87 90 +3
total +11

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
alerting 92.0KB 93.7KB +1.6KB
fleet 2.1MB 2.1MB +452.0B
reporting 110.7KB 158.3KB +47.6KB
total +49.7KB

Public APIs missing exports

Total count of every type that is part of your API that should be exported but is not. This will cause broken links in the API documentation system. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats exports for more detailed information.

id before after diff
@kbn/reporting-common 13 14 +1
share 15 21 +6
total +7

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
reporting 50.8KB 53.9KB +3.1KB
share 52.1KB 52.1KB +26.0B
total +3.1KB
Unknown metric groups

API count

id before after diff
@kbn/reporting-common 107 109 +2
@kbn/reporting-public 110 116 +6
share 153 156 +3
total +11

async chunk count

id before after diff
reporting 4 7 +3

ESLint disabled in files

id before after diff
reporting 0 1 +1

ESLint disabled line counts

id before after diff
reporting 5 9 +4

Total ESLint disabled count

id before after diff
reporting 5 10 +5

History

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 224849

Questions ?

Please refer to the Backport tool documentation

akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request Jun 25, 2025
…dules list (elastic#224849)

## Summary

- Implements the flyout to schedule reports
- Adds a Schedules table to the Stack Management > Reporting page to
view schedules
- Updates the Reports table to show information about scheduled reports

<details>
<summary>

## Verification steps

</summary>

### 🐞 Happy Path
- Add the following configuration to your Kibana config file
    ```
    notifications.connectors.default.email: gmail
    xpack.actions.preconfigured:
      gmail:
        name: 'email: my gmail'
        actionTypeId: '.email'
    ````
- Log in as an admin user or user with Reporting privileges and a
license != `basic`
- If you don't have data in Kibana, navigate to Home > Try sample data
and activate a sample data set
- Create a Dashboard or Discover session
- Open the ⬇️ (Export) menu in the toolbar
- Click `Schedule export`
- Schedule reports with different combinations of file name, export
type, recurrence schedule and email notification settings
- Navigate to Stack Management > Reporting
- Check that the scheduled reports match the displayed items in the
Reports and Schedules tabs (⚠️ some jobs might not have started because
of the recurrence rule so you might not find the reports immediately)

### ⚡️ Edge Cases
Missing default notifications email connector
- Start Kibana without the default email connector from point n.1 of the
happy path
- When trying to schedule a report, the flyout should show a callout
informing the user about the missing email connector

Unmet prerequisites
- Start ES with any of the following flags: `-E
xpack.security.enabled=false` or `-E
xpack.security.authc.api_key.enabled=false`
- The `Schedule export` button should not appear in the Export menu

Unsupported license
- Log in as a user with a basic license or without capabilities to
generate reports
- The `Schedule export` button should not appear in the Export menu

Users without `Manage Scheduled Reports` privilege
- Create a role with sufficient privileges to access and export any
object type (Dashboards, Discover, ...), do not grant the `Manage
Scheduled Reports` privilege (under `Stack Management`)
- Create a user with this role, _without an email address_
- Open the Schedule export flyout
- Check that the `Send by email` field is disabled, showing a hint about
the user profile missing an email address
- Add an email address to the user (for the changes to take effect you
might have to renew the session, logging back in)
- Check that the `Send by email` toggle is now enabled
- Check that when toggling email notifications on, the `To` field is
disabled and precompiled with the user's email address

Flyout form validation
- `File name` should be required
- `To` should not allow to insert invalid email addresses
- `To` should not allow to insert unallowed email addresses (not in
allowlist)
- Recurrence subform should show presets based on the current datetime

### ❌ Failure Cases


</details>

<details>

<summary>

## Known issues

</summary>

- PDF print option is not displayed in readOnly mode
- Console error due to `compressed` attribute wrongly forwarded by
form-hook-lib to DOM element (this is likely a form lib issue):
<img width="916" alt="image"
src="https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90"
/>
- Email validation errors accumulate instead of replacing the previous
one (again looks like a fom lib issue):

https://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9

</details>



<details>

<summary>

## Screenshots

</summary>

Health API error:
<img height="500" alt="Screenshot 2025-05-31 at 10 48 40"
src="https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede"
/>

Health API loading state:
<img height="500" alt="Screenshot 2025-05-31 at 10 49 04"
src="https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837"
/>

Health API success with some missing prerequisites:
<img width="449" alt="Screenshot 2025-06-17 at 16 59 57"
src="https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459"
/>

Form validation:
<img height="500" alt="image"
src="https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8"
/>

Success toast:
<img width="480" alt="image"
src="https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2"
/>

Failure toast:
<img width="518" alt="image"
src="https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18"
/>

Print format toggle:
<img width="502" alt="image"
src="https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd"
/>

Missing notifications email connector callout:
<img width="499" alt="image"
src="https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085"
/>

User without `Manage Scheduled Reports` privilege and without email
address in profile
<img width="492" alt="Screenshot 2025-06-23 at 14 51 07"
src="https://github.com/user-attachments/assets/e0867b7b-3358-4cf0-8adf-c141a1ded76f"
/>

User without `Manage Scheduled Reports` privilege with email address in
profile
<img width="498" alt="image"
src="https://github.com/user-attachments/assets/c45a0c31-cac7-4acb-b068-b3cfc02aac68"
/>


</details>

## Release Notes

Added the ability to schedule reports with a recurring schedule and view
previously scheduled reports

## References

Closes elastic#216321
Closes elastic#216322

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Eyo O. Eyo <7893459+eokoneyo@users.noreply.github.com>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
Co-authored-by: Janki Salvi <jankigaurav.salvi@elastic.co>
@umbopepato
Copy link
Member Author

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

umbopepato added a commit to umbopepato/kibana that referenced this pull request Jun 25, 2025
…dules list (elastic#224849)

## Summary

- Implements the flyout to schedule reports
- Adds a Schedules table to the Stack Management > Reporting page to
view schedules
- Updates the Reports table to show information about scheduled reports

<details>
<summary>

## Verification steps

</summary>

### 🐞 Happy Path
- Add the following configuration to your Kibana config file
    ```
    notifications.connectors.default.email: gmail
    xpack.actions.preconfigured:
      gmail:
        name: 'email: my gmail'
        actionTypeId: '.email'
    ````
- Log in as an admin user or user with Reporting privileges and a
license != `basic`
- If you don't have data in Kibana, navigate to Home > Try sample data
and activate a sample data set
- Create a Dashboard or Discover session
- Open the ⬇️ (Export) menu in the toolbar
- Click `Schedule export`
- Schedule reports with different combinations of file name, export
type, recurrence schedule and email notification settings
- Navigate to Stack Management > Reporting
- Check that the scheduled reports match the displayed items in the
Reports and Schedules tabs (⚠️ some jobs might not have started because
of the recurrence rule so you might not find the reports immediately)

### ⚡️ Edge Cases
Missing default notifications email connector
- Start Kibana without the default email connector from point n.1 of the
happy path
- When trying to schedule a report, the flyout should show a callout
informing the user about the missing email connector

Unmet prerequisites
- Start ES with any of the following flags: `-E
xpack.security.enabled=false` or `-E
xpack.security.authc.api_key.enabled=false`
- The `Schedule export` button should not appear in the Export menu

Unsupported license
- Log in as a user with a basic license or without capabilities to
generate reports
- The `Schedule export` button should not appear in the Export menu

Users without `Manage Scheduled Reports` privilege
- Create a role with sufficient privileges to access and export any
object type (Dashboards, Discover, ...), do not grant the `Manage
Scheduled Reports` privilege (under `Stack Management`)
- Create a user with this role, _without an email address_
- Open the Schedule export flyout
- Check that the `Send by email` field is disabled, showing a hint about
the user profile missing an email address
- Add an email address to the user (for the changes to take effect you
might have to renew the session, logging back in)
- Check that the `Send by email` toggle is now enabled
- Check that when toggling email notifications on, the `To` field is
disabled and precompiled with the user's email address

Flyout form validation
- `File name` should be required
- `To` should not allow to insert invalid email addresses
- `To` should not allow to insert unallowed email addresses (not in
allowlist)
- Recurrence subform should show presets based on the current datetime

### ❌ Failure Cases

</details>

<details>

<summary>

## Known issues

</summary>

- PDF print option is not displayed in readOnly mode
- Console error due to `compressed` attribute wrongly forwarded by
form-hook-lib to DOM element (this is likely a form lib issue):
<img width="916" alt="image"
src="https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90"
/>
- Email validation errors accumulate instead of replacing the previous
one (again looks like a fom lib issue):

https://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9

</details>

<details>

<summary>

## Screenshots

</summary>

Health API error:
<img height="500" alt="Screenshot 2025-05-31 at 10 48 40"
src="https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede"
/>

Health API loading state:
<img height="500" alt="Screenshot 2025-05-31 at 10 49 04"
src="https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837"
/>

Health API success with some missing prerequisites:
<img width="449" alt="Screenshot 2025-06-17 at 16 59 57"
src="https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459"
/>

Form validation:
<img height="500" alt="image"
src="https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8"
/>

Success toast:
<img width="480" alt="image"
src="https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2"
/>

Failure toast:
<img width="518" alt="image"
src="https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18"
/>

Print format toggle:
<img width="502" alt="image"
src="https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd"
/>

Missing notifications email connector callout:
<img width="499" alt="image"
src="https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085"
/>

User without `Manage Scheduled Reports` privilege and without email
address in profile
<img width="492" alt="Screenshot 2025-06-23 at 14 51 07"
src="https://github.com/user-attachments/assets/e0867b7b-3358-4cf0-8adf-c141a1ded76f"
/>

User without `Manage Scheduled Reports` privilege with email address in
profile
<img width="498" alt="image"
src="https://github.com/user-attachments/assets/c45a0c31-cac7-4acb-b068-b3cfc02aac68"
/>

</details>

## Release Notes

Added the ability to schedule reports with a recurring schedule and view
previously scheduled reports

## References

Closes elastic#216321
Closes elastic#216322

### Checklist

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Eyo O. Eyo <7893459+eokoneyo@users.noreply.github.com>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
Co-authored-by: Janki Salvi <jankigaurav.salvi@elastic.co>
(cherry picked from commit 0c377fa)

# Conflicts:
#	src/platform/packages/shared/response-ops/recurring-schedule-form/utils/convert_to_rrule.ts
#	src/platform/packages/shared/response-ops/recurring-schedule-form/utils/recurring_summary.ts
#	x-pack/platform/plugins/private/reporting/public/management/report_listing.tsx
#	x-pack/platform/plugins/private/reporting/public/redirect/redirect_app.tsx
#	x-pack/platform/plugins/private/translations/translations/fr-FR.json
#	x-pack/platform/plugins/private/translations/translations/ja-JP.json
#	x-pack/platform/plugins/private/translations/translations/zh-CN.json
#	x-pack/test/reporting_functional/reporting_and_security/management.ts
umbopepato added a commit that referenced this pull request Jun 26, 2025
…ew schedules list (#224849) (#225324)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[ReponseOps][Reporting] Allow users to schedule reports and view
schedules list (#224849)](#224849)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Umberto
Pepato","email":"umbopepato@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-06-24T15:32:14Z","message":"[ReponseOps][Reporting]
Allow users to schedule reports and view schedules list (#224849)\n\n##
Summary\n\n- Implements the flyout to schedule reports\n- Adds a
Schedules table to the Stack Management > Reporting page to\nview
schedules\n- Updates the Reports table to show information about
scheduled reports\n\n<details>\n<summary>\n\n## Verification
steps\n\n</summary>\n\n### 🐞 Happy Path\n- Add the following
configuration to your Kibana config file\n ```\n
notifications.connectors.default.email: gmail\n
xpack.actions.preconfigured:\n gmail:\n name: 'email: my gmail'\n
actionTypeId: '.email'\n ````\n- Log in as an admin user or user with
Reporting privileges and a\nlicense != `basic`\n- If you don't have data
in Kibana, navigate to Home > Try sample data\nand activate a sample
data set\n- Create a Dashboard or Discover session\n- Open the ⬇️
(Export) menu in the toolbar\n- Click `Schedule export`\n- Schedule
reports with different combinations of file name, export\ntype,
recurrence schedule and email notification settings\n- Navigate to Stack
Management > Reporting\n- Check that the scheduled reports match the
displayed items in the\nReports and Schedules tabs (⚠️ some jobs might
not have started because\nof the recurrence rule so you might not find
the reports immediately)\n\n### ⚡️ Edge Cases\nMissing default
notifications email connector\n- Start Kibana without the default email
connector from point n.1 of the\nhappy path\n- When trying to schedule a
report, the flyout should show a callout\ninforming the user about the
missing email connector\n\nUnmet prerequisites\n- Start ES with any of
the following flags: `-E\nxpack.security.enabled=false` or
`-E\nxpack.security.authc.api_key.enabled=false`\n- The `Schedule
export` button should not appear in the Export menu\n\nUnsupported
license\n- Log in as a user with a basic license or without capabilities
to\ngenerate reports\n- The `Schedule export` button should not appear
in the Export menu\n\nUsers without `Manage Scheduled Reports`
privilege\n- Create a role with sufficient privileges to access and
export any\nobject type (Dashboards, Discover, ...), do not grant the
`Manage\nScheduled Reports` privilege (under `Stack Management`)\n-
Create a user with this role, _without an email address_\n- Open the
Schedule export flyout\n- Check that the `Send by email` field is
disabled, showing a hint about\nthe user profile missing an email
address\n- Add an email address to the user (for the changes to take
effect you\nmight have to renew the session, logging back in)\n- Check
that the `Send by email` toggle is now enabled\n- Check that when
toggling email notifications on, the `To` field is\ndisabled and
precompiled with the user's email address\n\nFlyout form validation\n-
`File name` should be required\n- `To` should not allow to insert
invalid email addresses\n- `To` should not allow to insert unallowed
email addresses (not in\nallowlist)\n- Recurrence subform should show
presets based on the current datetime\n\n### ❌ Failure
Cases\n\n\n</details>\n\n<details>\n\n<summary>\n\n## Known
issues\n\n</summary>\n\n- PDF print option is not displayed in readOnly
mode\n- Console error due to `compressed` attribute wrongly forwarded
by\nform-hook-lib to DOM element (this is likely a form lib
issue):\n<img width=\"916\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90\"\n/>\n-
Email validation errors accumulate instead of replacing the
previous\none (again looks like a fom lib
issue):\n\nhttps://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9\n\n</details>\n\n\n\n<details>\n\n<summary>\n\n##
Screenshots\n\n</summary>\n\nHealth API error:\n<img height=\"500\"
alt=\"Screenshot 2025-05-31 at 10 48
40\"\nsrc=\"https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede\"\n/>\n\nHealth
API loading state:\n<img height=\"500\" alt=\"Screenshot 2025-05-31 at
10 49
04\"\nsrc=\"https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837\"\n/>\n\nHealth
API success with some missing prerequisites:\n<img width=\"449\"
alt=\"Screenshot 2025-06-17 at 16 59
57\"\nsrc=\"https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459\"\n/>\n\nForm
validation:\n<img height=\"500\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8\"\n/>\n\nSuccess
toast:\n<img width=\"480\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2\"\n/>\n\nFailure
toast:\n<img width=\"518\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18\"\n/>\n\nPrint
format toggle:\n<img width=\"502\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd\"\n/>\n\nMissing
notifications email connector callout:\n<img width=\"499\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege and without email\naddress
in profile\n<img width=\"492\" alt=\"Screenshot 2025-06-23 at 14 51
07\"\nsrc=\"https://github.com/user-attachments/assets/e0867b7b-3358-4cf0-8adf-c141a1ded76f\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege with email address
in\nprofile\n<img width=\"498\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c45a0c31-cac7-4acb-b068-b3cfc02aac68\"\n/>\n\n\n</details>\n\n##
Release Notes\n\nAdded the ability to schedule reports with a recurring
schedule and view\npreviously scheduled reports\n\n##
References\n\nCloses #216321\nCloses #216322\n\n### Checklist\n\n- [x]
Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Eyo
O. Eyo <7893459+eokoneyo@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<117571355+js-jankisalvi@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<jankigaurav.salvi@elastic.co>","sha":"0c377fafa8f3ab0eb6438e04849e2ae3257e5bbb","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:ResponseOps","release_note:feature","backport:version","v9.1.0","v8.19.0"],"title":"[ReponseOps][Reporting]
Allow users to schedule reports and view schedules
list","number":224849,"url":"https://github.com/elastic/kibana/pull/224849","mergeCommit":{"message":"[ReponseOps][Reporting]
Allow users to schedule reports and view schedules list (#224849)\n\n##
Summary\n\n- Implements the flyout to schedule reports\n- Adds a
Schedules table to the Stack Management > Reporting page to\nview
schedules\n- Updates the Reports table to show information about
scheduled reports\n\n<details>\n<summary>\n\n## Verification
steps\n\n</summary>\n\n### 🐞 Happy Path\n- Add the following
configuration to your Kibana config file\n ```\n
notifications.connectors.default.email: gmail\n
xpack.actions.preconfigured:\n gmail:\n name: 'email: my gmail'\n
actionTypeId: '.email'\n ````\n- Log in as an admin user or user with
Reporting privileges and a\nlicense != `basic`\n- If you don't have data
in Kibana, navigate to Home > Try sample data\nand activate a sample
data set\n- Create a Dashboard or Discover session\n- Open the ⬇️
(Export) menu in the toolbar\n- Click `Schedule export`\n- Schedule
reports with different combinations of file name, export\ntype,
recurrence schedule and email notification settings\n- Navigate to Stack
Management > Reporting\n- Check that the scheduled reports match the
displayed items in the\nReports and Schedules tabs (⚠️ some jobs might
not have started because\nof the recurrence rule so you might not find
the reports immediately)\n\n### ⚡️ Edge Cases\nMissing default
notifications email connector\n- Start Kibana without the default email
connector from point n.1 of the\nhappy path\n- When trying to schedule a
report, the flyout should show a callout\ninforming the user about the
missing email connector\n\nUnmet prerequisites\n- Start ES with any of
the following flags: `-E\nxpack.security.enabled=false` or
`-E\nxpack.security.authc.api_key.enabled=false`\n- The `Schedule
export` button should not appear in the Export menu\n\nUnsupported
license\n- Log in as a user with a basic license or without capabilities
to\ngenerate reports\n- The `Schedule export` button should not appear
in the Export menu\n\nUsers without `Manage Scheduled Reports`
privilege\n- Create a role with sufficient privileges to access and
export any\nobject type (Dashboards, Discover, ...), do not grant the
`Manage\nScheduled Reports` privilege (under `Stack Management`)\n-
Create a user with this role, _without an email address_\n- Open the
Schedule export flyout\n- Check that the `Send by email` field is
disabled, showing a hint about\nthe user profile missing an email
address\n- Add an email address to the user (for the changes to take
effect you\nmight have to renew the session, logging back in)\n- Check
that the `Send by email` toggle is now enabled\n- Check that when
toggling email notifications on, the `To` field is\ndisabled and
precompiled with the user's email address\n\nFlyout form validation\n-
`File name` should be required\n- `To` should not allow to insert
invalid email addresses\n- `To` should not allow to insert unallowed
email addresses (not in\nallowlist)\n- Recurrence subform should show
presets based on the current datetime\n\n### ❌ Failure
Cases\n\n\n</details>\n\n<details>\n\n<summary>\n\n## Known
issues\n\n</summary>\n\n- PDF print option is not displayed in readOnly
mode\n- Console error due to `compressed` attribute wrongly forwarded
by\nform-hook-lib to DOM element (this is likely a form lib
issue):\n<img width=\"916\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90\"\n/>\n-
Email validation errors accumulate instead of replacing the
previous\none (again looks like a fom lib
issue):\n\nhttps://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9\n\n</details>\n\n\n\n<details>\n\n<summary>\n\n##
Screenshots\n\n</summary>\n\nHealth API error:\n<img height=\"500\"
alt=\"Screenshot 2025-05-31 at 10 48
40\"\nsrc=\"https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede\"\n/>\n\nHealth
API loading state:\n<img height=\"500\" alt=\"Screenshot 2025-05-31 at
10 49
04\"\nsrc=\"https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837\"\n/>\n\nHealth
API success with some missing prerequisites:\n<img width=\"449\"
alt=\"Screenshot 2025-06-17 at 16 59
57\"\nsrc=\"https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459\"\n/>\n\nForm
validation:\n<img height=\"500\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8\"\n/>\n\nSuccess
toast:\n<img width=\"480\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2\"\n/>\n\nFailure
toast:\n<img width=\"518\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18\"\n/>\n\nPrint
format toggle:\n<img width=\"502\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd\"\n/>\n\nMissing
notifications email connector callout:\n<img width=\"499\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege and without email\naddress
in profile\n<img width=\"492\" alt=\"Screenshot 2025-06-23 at 14 51
07\"\nsrc=\"https://github.com/user-attachments/assets/e0867b7b-3358-4cf0-8adf-c141a1ded76f\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege with email address
in\nprofile\n<img width=\"498\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c45a0c31-cac7-4acb-b068-b3cfc02aac68\"\n/>\n\n\n</details>\n\n##
Release Notes\n\nAdded the ability to schedule reports with a recurring
schedule and view\npreviously scheduled reports\n\n##
References\n\nCloses #216321\nCloses #216322\n\n### Checklist\n\n- [x]
Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Eyo
O. Eyo <7893459+eokoneyo@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<117571355+js-jankisalvi@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<jankigaurav.salvi@elastic.co>","sha":"0c377fafa8f3ab0eb6438e04849e2ae3257e5bbb"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224849","number":224849,"mergeCommit":{"message":"[ReponseOps][Reporting]
Allow users to schedule reports and view schedules list (#224849)\n\n##
Summary\n\n- Implements the flyout to schedule reports\n- Adds a
Schedules table to the Stack Management > Reporting page to\nview
schedules\n- Updates the Reports table to show information about
scheduled reports\n\n<details>\n<summary>\n\n## Verification
steps\n\n</summary>\n\n### 🐞 Happy Path\n- Add the following
configuration to your Kibana config file\n ```\n
notifications.connectors.default.email: gmail\n
xpack.actions.preconfigured:\n gmail:\n name: 'email: my gmail'\n
actionTypeId: '.email'\n ````\n- Log in as an admin user or user with
Reporting privileges and a\nlicense != `basic`\n- If you don't have data
in Kibana, navigate to Home > Try sample data\nand activate a sample
data set\n- Create a Dashboard or Discover session\n- Open the ⬇️
(Export) menu in the toolbar\n- Click `Schedule export`\n- Schedule
reports with different combinations of file name, export\ntype,
recurrence schedule and email notification settings\n- Navigate to Stack
Management > Reporting\n- Check that the scheduled reports match the
displayed items in the\nReports and Schedules tabs (⚠️ some jobs might
not have started because\nof the recurrence rule so you might not find
the reports immediately)\n\n### ⚡️ Edge Cases\nMissing default
notifications email connector\n- Start Kibana without the default email
connector from point n.1 of the\nhappy path\n- When trying to schedule a
report, the flyout should show a callout\ninforming the user about the
missing email connector\n\nUnmet prerequisites\n- Start ES with any of
the following flags: `-E\nxpack.security.enabled=false` or
`-E\nxpack.security.authc.api_key.enabled=false`\n- The `Schedule
export` button should not appear in the Export menu\n\nUnsupported
license\n- Log in as a user with a basic license or without capabilities
to\ngenerate reports\n- The `Schedule export` button should not appear
in the Export menu\n\nUsers without `Manage Scheduled Reports`
privilege\n- Create a role with sufficient privileges to access and
export any\nobject type (Dashboards, Discover, ...), do not grant the
`Manage\nScheduled Reports` privilege (under `Stack Management`)\n-
Create a user with this role, _without an email address_\n- Open the
Schedule export flyout\n- Check that the `Send by email` field is
disabled, showing a hint about\nthe user profile missing an email
address\n- Add an email address to the user (for the changes to take
effect you\nmight have to renew the session, logging back in)\n- Check
that the `Send by email` toggle is now enabled\n- Check that when
toggling email notifications on, the `To` field is\ndisabled and
precompiled with the user's email address\n\nFlyout form validation\n-
`File name` should be required\n- `To` should not allow to insert
invalid email addresses\n- `To` should not allow to insert unallowed
email addresses (not in\nallowlist)\n- Recurrence subform should show
presets based on the current datetime\n\n### ❌ Failure
Cases\n\n\n</details>\n\n<details>\n\n<summary>\n\n## Known
issues\n\n</summary>\n\n- PDF print option is not displayed in readOnly
mode\n- Console error due to `compressed` attribute wrongly forwarded
by\nform-hook-lib to DOM element (this is likely a form lib
issue):\n<img width=\"916\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/09d20ba9-8781-46d6-bcfa-862d8a4cbf90\"\n/>\n-
Email validation errors accumulate instead of replacing the
previous\none (again looks like a fom lib
issue):\n\nhttps://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9\n\n</details>\n\n\n\n<details>\n\n<summary>\n\n##
Screenshots\n\n</summary>\n\nHealth API error:\n<img height=\"500\"
alt=\"Screenshot 2025-05-31 at 10 48
40\"\nsrc=\"https://github.com/user-attachments/assets/dd069597-971c-489f-9c07-eb5edfd7bede\"\n/>\n\nHealth
API loading state:\n<img height=\"500\" alt=\"Screenshot 2025-05-31 at
10 49
04\"\nsrc=\"https://github.com/user-attachments/assets/27d95bf3-bf7d-42c7-9a40-2826f38aa837\"\n/>\n\nHealth
API success with some missing prerequisites:\n<img width=\"449\"
alt=\"Screenshot 2025-06-17 at 16 59
57\"\nsrc=\"https://github.com/user-attachments/assets/c44afa97-70ff-4618-8b73-41b816514459\"\n/>\n\nForm
validation:\n<img height=\"500\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a8d4cae1-2819-4f71-a911-9300a6cf81f8\"\n/>\n\nSuccess
toast:\n<img width=\"480\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/a87c3af5-dbb0-40e8-915a-fc9d7e1d97f2\"\n/>\n\nFailure
toast:\n<img width=\"518\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/908f9dea-b5cb-4da9-b4a5-76e313837f18\"\n/>\n\nPrint
format toggle:\n<img width=\"502\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/602f3ab9-07ef-4689-a305-dc1b2b5495cd\"\n/>\n\nMissing
notifications email connector callout:\n<img width=\"499\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/fe4997a5-75e6-4450-85e5-7d853049e085\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege and without email\naddress
in profile\n<img width=\"492\" alt=\"Screenshot 2025-06-23 at 14 51
07\"\nsrc=\"https://github.com/user-attachments/assets/e0867b7b-3358-4cf0-8adf-c141a1ded76f\"\n/>\n\nUser
without `Manage Scheduled Reports` privilege with email address
in\nprofile\n<img width=\"498\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/c45a0c31-cac7-4acb-b068-b3cfc02aac68\"\n/>\n\n\n</details>\n\n##
Release Notes\n\nAdded the ability to schedule reports with a recurring
schedule and view\npreviously scheduled reports\n\n##
References\n\nCloses #216321\nCloses #216322\n\n### Checklist\n\n- [x]
Any text added follows [EUI's
writing\nguidelines](https://elastic.github.io/eui/#/guidelines/writing),
uses\nsentence case text and includes
[i18n\nsupport](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)\n-
[
]\n[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)\nwas
added for features that require explanation or tutorials\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Eyo
O. Eyo <7893459+eokoneyo@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<117571355+js-jankisalvi@users.noreply.github.com>\nCo-authored-by:
Janki Salvi
<jankigaurav.salvi@elastic.co>","sha":"0c377fafa8f3ab0eb6438e04849e2ae3257e5bbb"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
js-jankisalvi added a commit that referenced this pull request Jul 1, 2025
)

## Summary

This PR adds functional tests, more unit tests and addresses review
comments from PR #224849

Fixes #225172 flaky test

**Flaky test runner:**
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8485

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 1, 2025
…tic#225449)

## Summary

This PR adds functional tests, more unit tests and addresses review
comments from PR elastic#224849

Fixes elastic#225172 flaky test

**Flaky test runner:**
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/8485

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

(cherry picked from commit 3d7bcb0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:feature Makes this part of the condensed release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Response Ops][Reporting] Update Reporting UI to show scheduled reports [Response Ops][Reporting] Allow scheduling recurring reports from UI