Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
167 commits
Select commit Hold shift + click to select a range
a74e49d
Support rrule for task scheduling
ersin-erdal Apr 9, 2025
6163f7e
remove redundant return
ersin-erdal Apr 9, 2025
20ecece
add functional tests
ersin-erdal Apr 11, 2025
c29a08e
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine Apr 11, 2025
de20db1
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Apr 11, 2025
65f0960
fix linting
ersin-erdal Apr 11, 2025
2dde5f6
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal Apr 11, 2025
717cadb
fix linter
ersin-erdal Apr 11, 2025
72b108e
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine Apr 11, 2025
38e69ef
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 11, 2025
c9e71ba
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Apr 11, 2025
5f6fad9
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 11, 2025
d05d9c8
Allowing shared concurrency task types
ymao1 Apr 14, 2025
4a04b90
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 14, 2025
249f14c
set second to [0]
ersin-erdal Apr 15, 2025
4c60d8e
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal Apr 15, 2025
4a14142
testing schedule is more resilient
ersin-erdal Apr 15, 2025
4ec1bca
remove "only"
ersin-erdal Apr 15, 2025
1275f1e
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 16, 2025
8aff2c9
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 16, 2025
04b70a2
Merge branch 'main' into shared-concurrency-tasks
elasticmachine Apr 23, 2025
c9547ae
Merge branch 'main' into shared-concurrency-tasks
elasticmachine Apr 25, 2025
850ec64
throw when interval is not provided for the next run calculation
ersin-erdal Apr 28, 2025
10c40e5
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal Apr 28, 2025
af75dfb
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal Apr 28, 2025
95cf333
[CI] Auto-commit changed files from 'node scripts/jest_integration -u…
kibanamachine Apr 28, 2025
d5227aa
update read me
ersin-erdal Apr 28, 2025
2a1482e
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal Apr 28, 2025
372d4c7
Merge branch 'main' into shared-concurrency-tasks
elasticmachine Apr 28, 2025
62fe072
update read me
ersin-erdal Apr 28, 2025
0f0685e
export Frequency and Weekday from TM
ersin-erdal Apr 28, 2025
cc65fd5
Merge branch 'pr/217728' into report-dependencies
ymao1 Apr 28, 2025
11053d1
Merge branch 'shared-concurrency-tasks' into report-dependencies
ymao1 Apr 28, 2025
23d837d
Schedule report api
ymao1 Apr 28, 2025
bbabb1f
Schedule report api
ymao1 Apr 28, 2025
f5bb665
Cleanup
ymao1 Apr 28, 2025
5375fd2
Stubbing out task
ymao1 Apr 28, 2025
f039e51
add rrule examples
ersin-erdal Apr 29, 2025
e75e796
fix rrule example
ersin-erdal Apr 29, 2025
c7e0fdc
Schedule report task
ymao1 Apr 29, 2025
424d733
PR feedback
ymao1 Apr 29, 2025
0514306
Merge branch 'main' of github.com:elastic/kibana into shared-concurre…
ymao1 Apr 29, 2025
fd55806
Adding unit tests
ymao1 Apr 30, 2025
d42d1bd
[CI] Auto-commit changed files from 'node scripts/yarn_deduplicate'
kibanamachine Apr 30, 2025
214fcd5
Fixing types
ymao1 Apr 30, 2025
5019e54
Merge branch 'scheduled-reports-task' of github.com:ymao1/kibana into…
ymao1 Apr 30, 2025
5ee4309
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Apr 30, 2025
2d6dfab
Fixing types
ymao1 Apr 30, 2025
b2d9bbd
Merge branch 'pr/217728' into report-dependencies
ymao1 Apr 30, 2025
8caeb79
Merge branch 'shared-concurrency-tasks' into report-dependencies
ymao1 Apr 30, 2025
7a0d9c5
Merge branch 'scheduled-reports' of github.com:elastic/kibana into re…
ymao1 Apr 30, 2025
64cfb78
Merge branch 'report-dependencies' into scheduled-reports-api
ymao1 Apr 30, 2025
b98f26c
Fixing types
ymao1 Apr 30, 2025
3fd59a1
Cleanup
ymao1 Apr 30, 2025
0370162
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Apr 30, 2025
ed0a7c0
Merge
ymao1 Apr 30, 2025
e47833c
Updating tests
ymao1 Apr 30, 2025
0277de9
Fixing tests
ymao1 Apr 30, 2025
b0ce938
Merge branch 'scheduled-reports-api' of github.com:ymao1/kibana into …
ymao1 Apr 30, 2025
2e48fe2
Merge branch 'scheduled-reports-api' into scheduled-reports-task
ymao1 May 1, 2025
530ac2c
Fixing tests
ymao1 May 1, 2025
cec4e50
Cleanup
ymao1 May 1, 2025
a0cff7a
Cleanup
ymao1 May 1, 2025
d3742b8
wip
ymao1 May 2, 2025
e770dce
Title includes runAt time
ymao1 May 2, 2025
18a5973
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 2, 2025
626cf01
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal May 2, 2025
fbb3f85
remove mappings
ersin-erdal May 2, 2025
f361058
remove mappings
ersin-erdal May 2, 2025
7099229
[CI] Auto-commit changed files from 'node scripts/check_mappings_upda…
kibanamachine May 2, 2025
a0e3fc9
Merge
ymao1 May 2, 2025
baa41cb
Merge branch 'report-dependencies' of github.com:ymao1/kibana into re…
ymao1 May 2, 2025
2947bcc
Merge branch 'pr/217728' into report-dependencies
ymao1 May 2, 2025
3afe5b2
Fix
ymao1 May 2, 2025
dc96d64
Merge and add createdBy mapping
ymao1 May 2, 2025
c1884f3
Merge branch 'scheduled-reports-api' into scheduled-reports-task
ymao1 May 2, 2025
5398116
remove schema from v4
ersin-erdal May 2, 2025
5a800d5
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal May 2, 2025
9cd5011
types types types
ymao1 May 2, 2025
8faaf40
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal May 3, 2025
aaf4309
Merge branch 'main' into shared-concurrency-tasks
elasticmachine May 5, 2025
5c55c02
Merge branch 'main' into 216308-support-rrule-for-task-scheduling
ersin-erdal May 5, 2025
fc2b386
Merge branch 'scheduled-reports' of github.com:elastic/kibana into re…
ymao1 May 5, 2025
4fed516
Merge branch 'shared-concurrency-tasks' into report-dependencies
ymao1 May 5, 2025
d1104e4
Merge branch 'pr/217728' into report-dependencies
ymao1 May 5, 2025
c9911fa
Merge branch 'report-dependencies' into scheduled-reports-api
ymao1 May 5, 2025
85cb015
Updating types
ymao1 May 5, 2025
e811ec2
Merge
ymao1 May 5, 2025
d18fcaf
Fixing types
ymao1 May 5, 2025
0253ced
add explicit error log when the next run at cannot be calculated
ersin-erdal May 5, 2025
590e659
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal May 5, 2025
3834eaf
[CI] Auto-commit changed files from 'node scripts/styled_components_m…
kibanamachine May 5, 2025
c7e26f0
add missing logger
ersin-erdal May 5, 2025
8455d3c
Merge branch '216308-support-rrule-for-task-scheduling' of github.com…
ersin-erdal May 5, 2025
1e3d3e9
Handling notification
ymao1 May 5, 2025
bbea405
fix unit test
ersin-erdal May 5, 2025
4df59d0
Merge
ymao1 May 6, 2025
17bdcd0
Merge branch 'report-dependencies' into scheduled-reports-api
ymao1 May 6, 2025
4a4e0c5
Merge branch 'scheduled-reports-api' into scheduled-reports-task
ymao1 May 6, 2025
e20f1bf
Cleanup
ymao1 May 6, 2025
edbc60e
wip
ymao1 May 6, 2025
402ef5c
Merge
ymao1 May 6, 2025
d5799f5
Merge
ymao1 May 6, 2025
bfef31b
Merge branch 'pr/217728' into report-dependencies
ymao1 May 6, 2025
8cc0976
Merge branch 'report-dependencies' into scheduled-reports-api
ymao1 May 6, 2025
03c8304
Merge branch 'scheduled-reports-api' into scheduled-reports-task
ymao1 May 6, 2025
d60eee5
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 6, 2025
2bd0d5d
Adding schedule reports API
ymao1 May 7, 2025
d0da6b4
Merge
ymao1 May 7, 2025
9a7bda6
Fixing bad merge
ymao1 May 7, 2025
9dc45bc
list api working
ymao1 May 7, 2025
b325370
working on bulk disable
ymao1 May 8, 2025
6a7b62e
Merge
ymao1 May 8, 2025
99f186c
Merge
ymao1 May 8, 2025
601fbc6
Fixing types
ymao1 May 8, 2025
bc09318
Adding cc,bcc fields and validation for max recipients
ymao1 May 8, 2025
ea37895
Merge
ymao1 May 8, 2025
4d05198
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 8, 2025
99a9d62
logic is in place
ymao1 May 8, 2025
d87b6f1
Merge branch 'scheduled-reports' of github.com:elastic/kibana into sc…
ymao1 May 19, 2025
def242b
Merge branch 'scheduled-reports-api' into scheduled-reports-task
ymao1 May 19, 2025
7d5c29e
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 19, 2025
6041b91
Unit tests
ymao1 May 19, 2025
fd0a43d
[Response Ops][Reporting] Scheduled Reports - Schedule API (#219771)
ymao1 May 20, 2025
a7065b2
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 20, 2025
4ca09af
Merge
ymao1 May 20, 2025
f3efd5a
Fixing attempts
ymao1 May 20, 2025
5caa214
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 20, 2025
2bac2c4
Fixing tests
ymao1 May 20, 2025
717ebba
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 21, 2025
4750222
Merge branch 'scheduled-reports' of github.com:elastic/kibana into sc…
ymao1 May 21, 2025
91900d9
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 21, 2025
5432b88
Adding functional tests
ymao1 May 21, 2025
296449b
adding logging
ymao1 May 22, 2025
c32bea7
handling last run search errors
ymao1 May 22, 2025
37e7fd2
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 23, 2025
d60bbff
Merge branch 'scheduled-reports' of github.com:elastic/kibana into sc…
ymao1 May 23, 2025
08db312
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 27, 2025
3955376
Merge branch 'scheduled-reports' of github.com:elastic/kibana into sc…
ymao1 May 27, 2025
2242eee
Merge branch 'scheduled-reports-task' into scheduled-reports-find
ymao1 May 28, 2025
577b517
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 29, 2025
9cf25dd
[Response Ops][Reporting] Scheduled Reports - Task (merging into feat…
ymao1 May 30, 2025
6010d6a
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 May 30, 2025
c3cb16e
Merge
ymao1 May 30, 2025
83ad071
Cleanup
ymao1 May 30, 2025
b76a961
initial commit
js-jankisalvi Jun 6, 2025
12d8064
Merge
ymao1 Jun 6, 2025
dac0556
Merge
ymao1 Jun 6, 2025
af3b804
[Lens] Always show number sign when comparing to Primary metric (#222…
dej611 Jun 10, 2025
4703f76
Bulk operations support `gap_range` (#221078)
nkhristinin Jun 10, 2025
7ad35a4
[Security Solution] Enforce sending the request to API even if offlin…
Jun 10, 2025
4180267
update retrieve_elastic_doc prompt to generate query in English (#222…
arturoliduena Jun 10, 2025
95f74be
[Lens] Fix the button text for going back to the aggregation based vi…
andrimal Jun 10, 2025
245fb8e
[ILM][Index Management] Replace deprecated EuiFilterSelectItem (#223001)
damian-polewski Jun 10, 2025
eb2cb21
Merge branch 'main' of github.com:elastic/kibana into scheduled-reports
ymao1 Jun 10, 2025
c1a94bd
Merge branch 'scheduled-reports' of github.com:elastic/kibana into sc…
ymao1 Jun 10, 2025
6030bf0
PR feedback
ymao1 Jun 10, 2025
1f6abbb
PR feedback
ymao1 Jun 10, 2025
fbac095
PR feedback
ymao1 Jun 10, 2025
15e4d52
Merge commit 'refs/pull/220922/head' of https://github.com/elastic/ki…
js-jankisalvi Jun 11, 2025
744da54
integrated list and disable apis
js-jankisalvi Jun 11, 2025
33f1736
added tests
js-jankisalvi Jun 13, 2025
2a597c5
add more unit tests, update ilm links
js-jankisalvi Jun 17, 2025
78ca0a3
[CI] Auto-commit changed files from 'node scripts/notice'
kibanamachine Jun 17, 2025
eabec54
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jun 17, 2025
6bd5015
lint, type, translations fix
js-jankisalvi Jun 17, 2025
06859ea
Merge branch 'scheduled-reports-list-ui' of https://github.com/js-jan…
js-jankisalvi Jun 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61483,6 +61483,12 @@ components:
enum:
- delete
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -61501,6 +61507,12 @@ components:
enum:
- disable
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down Expand Up @@ -61532,6 +61544,12 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down Expand Up @@ -61624,6 +61642,12 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -61647,6 +61671,12 @@ components:
enum:
- enable
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -61667,6 +61697,12 @@ components:
enum:
- export
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -61685,6 +61721,12 @@ components:
enum:
- run
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down
42 changes: 42 additions & 0 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70856,6 +70856,12 @@ components:
enum:
- delete
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -70874,6 +70880,12 @@ components:
enum:
- disable
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down Expand Up @@ -70905,6 +70917,12 @@ components:
required:
- include_exceptions
- include_expired_exceptions
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down Expand Up @@ -70997,6 +71015,12 @@ components:
$ref: '#/components/schemas/Security_Detections_API_BulkActionEditPayload'
minItems: 1
type: array
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -71020,6 +71044,12 @@ components:
enum:
- enable
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -71040,6 +71070,12 @@ components:
enum:
- export
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand All @@ -71058,6 +71094,12 @@ components:
enum:
- run
type: string
gaps_range_end:
description: Gaps range end, valid only when query is provided
type: string
gaps_range_start:
description: Gaps range start, valid only when query is provided
type: string
ids:
description: Array of rule IDs. Array of rule IDs to which a bulk action will be applied. Only valid when query property is undefined.
items:
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,9 @@
"installCount",
"unInstallCount"
],
"scheduled_report": [
"createdBy"
],
"search": [
"description",
"title"
Expand Down
8 changes: 8 additions & 0 deletions packages/kbn-check-mappings-update-cli/current_mappings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3119,6 +3119,14 @@
}
}
},
"scheduled_report": {
"dynamic": false,
"properties": {
"createdBy": {
"type": "keyword"
}
}
},
"search": {
"dynamic": false,
"properties": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const previouslyRegisteredTypes = [
'query',
'rules-settings',
'sample-data-telemetry',
'scheduled_report',
'search',
'search-session',
'search-telemetry',
Expand Down
7 changes: 7 additions & 0 deletions src/platform/packages/private/kbn-reporting/common/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ export class AuthenticationExpiredError extends ReportingError {
}
}

export class MissingAuthenticationError extends ReportingError {
static code = 'missing_authentication_header_error' as const;
public get code(): string {
return MissingAuthenticationError.code;
}
}

export class QueueTimeoutError extends ReportingError {
static code = 'queue_timeout_error' as const;
public get code(): string {
Expand Down
5 changes: 5 additions & 0 deletions src/platform/packages/private/kbn-reporting/common/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ export const INTERNAL_ROUTES = {
DELETE_PREFIX: prefixInternalPath + '/jobs/delete', // docId is added to the final path
DOWNLOAD_PREFIX: prefixInternalPath + '/jobs/download', // docId is added to the final path
},
SCHEDULED: {
LIST: prefixInternalPath + '/scheduled/list',
BULK_DISABLE: prefixInternalPath + '/scheduled/bulk_disable',
},
HEALTH: prefixInternalPath + '/_health',
GENERATE_PREFIX: prefixInternalPath + '/generate', // exportTypeId is added to the final path
SCHEDULE_PREFIX: prefixInternalPath + '/schedule', // exportTypeId is added to the final path
};

const prefixPublicPath = '/api/reporting';
Expand Down
26 changes: 26 additions & 0 deletions src/platform/packages/private/kbn-reporting/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import type {
LayoutParams,
PerformanceMetrics as ScreenshotMetrics,
} from '@kbn/screenshotting-plugin/common';
import type { Rrule } from '@kbn/task-manager-plugin/server/task';
import type { ConcreteTaskInstance } from '@kbn/task-manager-plugin/server';
import { Rrule } from '@kbn/task-manager-plugin/server/task';
import { JOB_STATUS } from './constants';
import type { LocatorParams } from './url';

Expand Down Expand Up @@ -66,6 +68,7 @@ export interface BaseParams {
objectType: string;
title: string;
version: string; // to handle any state migrations
forceNow?: string;
layout?: LayoutParams; // png & pdf only
pagingStrategy?: CsvPagingStrategy; // csv only
}
Expand Down Expand Up @@ -152,6 +155,7 @@ export interface ReportSource {
created_at: string; // timestamp in UTC
'@timestamp'?: string; // creation timestamp, only used for data streams compatibility
status: JOB_STATUS;
scheduled_report_id?: string;

/*
* `output` is only populated if the report job is completed or failed.
Expand Down Expand Up @@ -209,3 +213,25 @@ export interface LicenseCheckResults {
showLinks: boolean;
message: string;
}

export interface ScheduledReport {
id: string;
createdAt: string;
createdBy: string;
enabled: boolean;
jobtype: string;
lastRun: string | undefined;
nextRun: string | undefined;
objectType: string;
notification?: {
email?: {
to?: string[];
bcc?: string[];
cc?: string[];
};
};
schedule: {
rrule: Rrule;
};
title: string;
}
32 changes: 31 additions & 1 deletion src/platform/packages/private/kbn-reporting/public/job.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
import moment from 'moment';
import React from 'react';

import { EuiText, EuiTextColor } from '@elastic/eui';
import {
EuiBadge,
EuiFlexGroup,
EuiFlexItem,
EuiIconTip,
EuiText,
EuiTextColor,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { JOB_STATUS } from '@kbn/reporting-common';
import type {
Expand Down Expand Up @@ -79,6 +86,7 @@ export class Job {

public readonly queue_time_ms?: Required<ReportFields>['queue_time_ms'][number];
public readonly execution_time_ms?: Required<ReportFields>['execution_time_ms'][number];
public readonly scheduled_report_id?: ReportSource['scheduled_report_id'];

constructor(report: ReportApiJSON) {
this.id = report.id;
Expand Down Expand Up @@ -117,6 +125,7 @@ export class Job {
this.metrics = report.metrics;
this.queue_time_ms = report.queue_time_ms;
this.execution_time_ms = report.execution_time_ms;
this.scheduled_report_id = report.scheduled_report_id;
}

public isSearch() {
Expand Down Expand Up @@ -254,6 +263,27 @@ export class Job {
return this.formatDate(this.created_at);
}

getExportType(): React.ReactElement {
const exportType = this.scheduled_report_id
? i18n.translate('reporting.jobExportType.scheduled', {
defaultMessage: 'Scheduled',
})
: i18n.translate('reporting.jobExportType.single', {
defaultMessage: 'Single',
});

return (
<EuiBadge data-test-subj={`reportExportType-${exportType}`} color="hollow">
<EuiFlexGroup gutterSize="s" alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
<EuiIconTip type={this.scheduled_report_id ? 'calendar' : 'download'} size="s" />
</EuiFlexItem>
<EuiFlexItem grow={false}>{exportType}</EuiFlexItem>
</EuiFlexGroup>
</EuiBadge>
);
}

/*
* We use `output.warnings` to show the error of a failed report job,
* and to show warnings of a job that completed with warnings.
Expand Down
Loading