Skip to content

Commit ccecb29

Browse files
remove deprecated xpack:defaultAdminEmail from email action
1 parent 6c74295 commit ccecb29

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

x-pack/legacy/plugins/watcher/public/models/action/email_action.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@
77
import { get, isArray } from 'lodash';
88
import { BaseAction } from './base_action';
99
import { i18n } from '@kbn/i18n';
10-
import chrome from 'ui/chrome';
1110

1211
export class EmailAction extends BaseAction {
1312
constructor(props = {}) {
1413
super(props);
1514

16-
const uiSettings = chrome.getUiSettingsClient();
17-
const defaultToEmail = uiSettings.get('xPack:defaultAdminEmail');
18-
const toArray = get(props, 'to', defaultToEmail);
15+
const toArray = get(props, 'to');
16+
1917
this.to = isArray(toArray) ? toArray : toArray && [ toArray ];
2018

2119
const defaultSubject = i18n.translate('xpack.watcher.models.emailAction.defaultSubjectText', {
@@ -24,6 +22,7 @@ export class EmailAction extends BaseAction {
2422
context: '{{ctx.metadata.name}}',
2523
}
2624
});
25+
2726
this.subject = get(props, 'subject', props.ignoreDefaults ? null : defaultSubject);
2827

2928
this.body = get(props, 'body');

x-pack/legacy/plugins/watcher/public/sections/watch_edit/components/threshold_watch_edit/action_fields/email_action_fields.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const EmailActionFields: React.FunctionComponent<Props> = ({
3333
errorKey="to"
3434
fullWidth
3535
errors={errors}
36-
isShowingErrors={hasErrors && to !== null}
36+
isShowingErrors={hasErrors && to !== undefined}
3737
label={i18n.translate(
3838
'xpack.watcher.sections.watchEdit.threshold.emailAction.recipientTextFieldLabel',
3939
{

0 commit comments

Comments
 (0)