-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* replacing Angular watch list UI with React one * fixing TS issues * addressing PR feedback * fixing TS issues * more TS fixes * TS fix * addressing more PR feedback * TS fixes * removing unused/incompatible translations * fixing functional test * prettier fix * fixing typp * fixing missing comma * fixing data-test-subject typo * fixing functional test * fixing functional tests * fixing delete functional tests * addressing PR feedback * progress on watch edit * port advanced watcher to react (#34188) * port advanced watcher to react * fix i18n * update execute trigger override text fields to number input and select fields * fix page title for edit mode * remove todo comments * add license validity check; pass kbnUrl service as prop * address review comments
- Loading branch information
1 parent
a170f7a
commit a7ecccc
Showing
31 changed files
with
2,393 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const WATCH_TAB_ID_EDIT = 'watchEditTab'; | ||
export const WATCH_TAB_ID_SIMULATE = 'watchSimulateTab'; | ||
|
||
interface WatchTab { | ||
id: string; | ||
name: string; | ||
} | ||
|
||
export const WATCH_TABS: WatchTab[] = [ | ||
{ | ||
id: WATCH_TAB_ID_EDIT, | ||
name: i18n.translate('xpack.watcher.sections.watchEdit.json.editTabLabel', { | ||
defaultMessage: 'Edit', | ||
}), | ||
}, | ||
{ | ||
id: WATCH_TAB_ID_SIMULATE, | ||
name: i18n.translate('xpack.watcher.sections.watchEdit.json.simulateTabLabel', { | ||
defaultMessage: 'Simulate', | ||
}), | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export interface ExecutedWatchResults { | ||
id: string; | ||
watchId: string; | ||
details: any; | ||
startTime: Date; | ||
watchStatus: { | ||
state: string; | ||
actionStatuses: Array<{ state: string; lastExecutionReason: string }>; | ||
}; | ||
} | ||
|
||
export interface ExecutedWatchDetails { | ||
triggerData: { | ||
triggeredTime: Date; | ||
scheduledTime: Date; | ||
}; | ||
ignoreCondition: boolean; | ||
alternativeInput: any; | ||
actionModes: { | ||
[key: string]: string; | ||
}; | ||
recordExecution: boolean; | ||
upstreamJson: any; | ||
} | ||
|
||
export interface BaseWatch { | ||
id: string; | ||
type: string; | ||
isNew: boolean; | ||
name: string; | ||
isSystemWatch: boolean; | ||
watchStatus: any; | ||
watchErrors: any; | ||
typeName: string; | ||
displayName: string; | ||
upstreamJson: any; | ||
resetActions: () => void; | ||
createAction: (type: string, actionProps: {}) => void; | ||
validate: () => { warning: { message: string } }; | ||
actions: [ | ||
{ | ||
id: string; | ||
type: string; | ||
} | ||
]; | ||
watch: { | ||
actions: { | ||
[key: string]: { [key: string]: any }; | ||
}; | ||
}; | ||
} |
44 changes: 44 additions & 0 deletions
44
x-pack/plugins/watcher/public/components/confirm_watches_modal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
import { EuiConfirmModal, EuiOverlayMask } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import React from 'react'; | ||
|
||
export const ConfirmWatchesModal = ({ | ||
modalOptions, | ||
callback, | ||
}: { | ||
modalOptions: { message: string } | null; | ||
callback: (isConfirmed?: boolean) => void; | ||
}) => { | ||
if (!modalOptions) { | ||
return null; | ||
} | ||
return ( | ||
<EuiOverlayMask> | ||
<EuiConfirmModal | ||
buttonColor="danger" | ||
title={i18n.translate('xpack.watcher.sections.watchEdit.json.saveConfirmModal.title', { | ||
defaultMessage: 'Confirm save', | ||
})} | ||
onCancel={() => callback()} | ||
onConfirm={() => { | ||
callback(true); | ||
}} | ||
cancelButtonText={i18n.translate( | ||
'xpack.watcher.sections.watchEdit.json.saveConfirmModal.cancelButtonLabel', | ||
{ defaultMessage: 'Cancel' } | ||
)} | ||
confirmButtonText={i18n.translate( | ||
'xpack.watcher.sections.watchEdit.json.saveConfirmModal.saveButtonLabel', | ||
{ defaultMessage: 'Save' } | ||
)} | ||
> | ||
{modalOptions.message} | ||
</EuiConfirmModal> | ||
</EuiOverlayMask> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiFormRow } from '@elastic/eui'; | ||
import React, { Children, cloneElement, Fragment, ReactElement } from 'react'; | ||
|
||
export const ErrableFormRow = ({ | ||
errorKey, | ||
isShowingErrors, | ||
errors, | ||
children, | ||
...rest | ||
}: { | ||
errorKey: string; | ||
isShowingErrors: boolean; | ||
errors: { [key: string]: string[] }; | ||
children: ReactElement; | ||
[key: string]: any; | ||
}) => { | ||
return ( | ||
<EuiFormRow | ||
isInvalid={isShowingErrors && errors[errorKey].length > 0} | ||
error={errors[errorKey]} | ||
{...rest} | ||
> | ||
<Fragment> | ||
{Children.map(children, child => | ||
cloneElement(child, { | ||
isInvalid: isShowingErrors && errors[errorKey].length > 0, | ||
}) | ||
)} | ||
</Fragment> | ||
</EuiFormRow> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.