[ReponseOps][Reporting] Allow users to schedule reports and view schedules list#224849
[ReponseOps][Reporting] Allow users to schedule reports and view schedules list#224849umbopepato merged 18 commits intomainfrom
Conversation
## 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>
|
Pinging @elastic/response-ops (Team:ResponseOps) |
| expect(await reporting.isGenerateReportButtonDisabled()).to.be(null); | ||
| await exports.closeExportFlyout(); | ||
| expect(await exports.isPopoverItemEnabled('CSV')).to.be(true); | ||
| await reporting.openExportPopover(); |
There was a problem hiding this comment.
Shouldn't it be await exports.closeExportFlyout();?
Same in other modified tests.
There was a problem hiding this comment.
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 🙂
There was a problem hiding this comment.
Okay, thanks for explaining! Probably could be renamed into toggleExportPopover if there is no "close" action.
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM
| }); | ||
|
|
||
| useEffect(() => { | ||
| if (!hasManageReportingPrivilege && userProfile?.user.email) { |
There was a problem hiding this comment.
I had to do this imperatively since the form defaultValue doesn't seem to be reactive
There was a problem hiding this comment.
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}/>
}
There was a problem hiding this comment.
I am a bit confused by !hasManageReportingPrivilege. Why is that? What happens when I have reporting privileges?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
should space_id be optional?
| export const getKey = queryKeys.getHealth; | ||
|
|
||
| export const useGetReportingHealthQuery = ({ http }: { http: HttpSetup }) => { | ||
| return useQuery({ |
There was a problem hiding this comment.
It should be possible to useKibana to acquire the http setup service
| }: { | ||
| userProfileService?: UserProfileService; | ||
| }) => { | ||
| return useQuery({ |
There was a problem hiding this comment.
const { userProfile } = useKibana().services;
| export const getKey = mutationKeys.scheduleReport; | ||
|
|
||
| export const useScheduleReport = ({ http }: { http: HttpSetup }) => { | ||
| return useMutation({ |
There was a problem hiding this comment.
const { http } = useKibana().services
| apiClient, | ||
| services, | ||
| }: CreateScheduledReportProviderOptions): ExportShareDerivatives => { | ||
| return { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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}> |
There was a problem hiding this comment.
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
);
tsullivan
left a comment
There was a problem hiding this comment.
Left some comments from reading the code. I'm very excited to see this coming through!
cnasikas
left a comment
There was a problem hiding this comment.
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.
- 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
@timestampset in the 1970 year.
- The tooltip over the app icon does not show a human friendly text
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
startDatebeingundefined. 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
useMemowhen calculating primitive values.
| `${INTERNAL_ROUTES.SCHEDULED.LIST}` | ||
| ); | ||
|
|
||
| const report = reportList.find((item) => item.id === id); |
There was a problem hiding this comment.
Don't we have a get by ID API?
|
|
||
| describe('getScheduledReportInfo', () => { | ||
| beforeEach(() => { | ||
| httpClient.get.mockResolvedValueOnce({ data: [{ id: '123', title: 'Scheduled Report 1' }] }); |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
Shouldn't this be part of x-pack/platform/plugins/private/reporting/public/management/mutation_keys.ts?
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
| 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> = { |
There was a problem hiding this comment.
Could we use Weekday enum exported from src/platform/packages/shared/kbn-rrule/types.ts?
|
|
||
| const onSubmit = async () => { | ||
| try { | ||
| if (await form.validate()) { |
There was a problem hiding this comment.
I think submit also validates, and it passed the isValid on the onSubmit method.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Should we put a limit on the number of characters a title should have?
| }) | ||
| ); | ||
| queryClient.invalidateQueries({ | ||
| queryKey: queryKeys.getScheduledList({}), |
There was a problem hiding this comment.
I think it would be better if we invalidated all queries like ['reporting', 'scheduledList'].
| ); | ||
| } | ||
|
|
||
| import('./management/integrations/scheduled_report_share_integration').then( |
There was a problem hiding this comment.
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 }]); |
There was a problem hiding this comment.
Based on the description of the above test, we should add another valid email.
joana-cps
left a comment
There was a problem hiding this comment.
@js-jankisalvi default number of rows in both tables should be 50
|
Starting backport for target branches: 8.19 https://github.com/elastic/kibana/actions/runs/15854866850 |
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
|
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
…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>
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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
…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>
) ## 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
…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)
Summary
Verification steps
🐞 Happy Path
basicSchedule export⚡️ Edge Cases
Missing default notifications email connector
Unmet prerequisites
-E xpack.security.enabled=falseor-E xpack.security.authc.api_key.enabled=falseSchedule exportbutton should not appear in the Export menuUnsupported license
Schedule exportbutton should not appear in the Export menuUsers without
Manage Scheduled ReportsprivilegeManage Scheduled Reportsprivilege (underStack Management)Send by emailfield is disabled, showing a hint about the user profile missing an email addressSend by emailtoggle is now enabledTofield is disabled and precompiled with the user's email addressFlyout form validation
File nameshould be requiredToshould not allow to insert invalid email addressesToshould not allow to insert unallowed email addresses (not in allowlist)❌ Failure Cases
Known issues
compressedattribute wrongly forwarded by form-hook-lib to DOM element (this is likely a form lib issue):https://github.com/user-attachments/assets/f2dc7a46-a3a9-465d-b8a1-3187b200f9b9
Screenshots
Health API error:

Health API loading state:

Health API success with some missing prerequisites:

Form validation:

Success toast:

Failure toast:

Print format toggle:

Missing notifications email connector callout:

User without

Manage Scheduled Reportsprivilege and without email address in profileUser without

Manage Scheduled Reportsprivilege with email address in profileRelease Notes
Added the ability to schedule reports with a recurring schedule and view previously scheduled reports
References
Closes #216321
Closes #216322
Checklist
release_note:*label is applied per the guidelines