Skip to content

Commit eb1fab1

Browse files
committed
[ML] Add Custom URLs and Calendars to the Job wizards (elastic#51281)
* [ML] editor to ts * [ML] custom_urls component to ts * [ML] custom urls in job creator, define CustomSettings interface * [ML] custom urls selection * [ML] custom urls description text * [ML] description for calendars * [ML] update layout to full width * [ML] fix i18n * [ML] adjust editor test * [ML] fix type for FormattedMessage * [ML] fix types * [ML] add modal edit mode to the custom urls editor * [ML] fix calendars saving * [ML] update snapshot * [ML] add test support * [ML] update form description text * [ML] adjust layout * [ML] set modal width * [ML] fix total value condition in getTestUrl * [ML] fix token replacement for string values * [ML] align calendar selection * [ML] manage calendars link * [ML] fix form description ids * [ML] styles for custom urls description * [ML] manage calendars as a link * [ML] refresh calendars button * [ML] remove redundant css rule * Revert "[ML] remove redundant css rule" This reverts commit 6b9a50e * [ML] update calendar service, move calendars out of the job config * [ML] fix translation key * [ML] fix i18n * [ML] alight calendars selection * [ML] calendar types * [ML] update calendars description * [ML] calendars cloning * [ML] align additional settings with advanced * [ML] fix typo, clean up calendars * [ML] persist created_by for custom urls * [ML] fix fetchCalendarsByIds * [ML] extend stashCombinedJob with calendars * [ML] remove redundant check and fallback for calendars
1 parent 61f5787 commit eb1fab1

File tree

39 files changed

+1248
-912
lines changed

39 files changed

+1248
-912
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License;
4+
* you may not use this file except in compliance with the Elastic License.
5+
*/
6+
7+
export type CalendarId = string;
8+
9+
export interface Calendar {
10+
calendar_id: CalendarId;
11+
description: string;
12+
events: any[];
13+
job_ids: string[];
14+
}
15+
16+
export interface UpdateCalendar extends Calendar {
17+
calendarId: CalendarId;
18+
}

x-pack/legacy/plugins/ml/common/types/custom_urls.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66

77
import { AnomalyRecordDoc } from './anomalies';
88

9-
export interface UrlConfig {
9+
/**
10+
* Base Interface for basic custom URL.
11+
*/
12+
export interface BaseUrlConfig {
1013
url_name: string;
1114
url_value: string;
1215
}
1316

14-
export interface KibanaUrlConfig extends UrlConfig {
17+
export interface KibanaUrlConfig extends BaseUrlConfig {
1518
time_range: string;
1619
}
1720

21+
export type UrlConfig = BaseUrlConfig | KibanaUrlConfig;
22+
1823
export interface CustomUrlAnomalyRecordDoc extends AnomalyRecordDoc {
1924
earliest: string;
2025
latest: string;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
@import 'components/custom_url_editor/index';
22
@import 'jobs_list/index'; // SASSTODO: Various EUI overwrites throughout this folder
3+
@import 'new_job/pages/components/job_details_step/components/additional_section/components/custom_urls/index';
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/legacy/plugins/ml/public/application/jobs/components/custom_url_editor/constants.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ export const URL_TYPE = {
1313
export const TIME_RANGE_TYPE = {
1414
AUTO: 'auto',
1515
INTERVAL: 'interval',
16-
};
16+
} as const;
17+
18+
export type TimeRangeType = typeof TIME_RANGE_TYPE[keyof typeof TIME_RANGE_TYPE];

0 commit comments

Comments
 (0)