Skip to content

Commit

Permalink
Fixed due to comments
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed Nov 10, 2020
1 parent 39f8587 commit 378fa7c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 4 additions & 0 deletions x-pack/plugins/alerts/common/builtin_action_groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ export const ResolvedActionGroup: ActionGroup = {
defaultMessage: 'Resolved',
}),
};

export function getBuiltinActionGroups(): ActionGroup[] {
return [ResolvedActionGroup];
}
6 changes: 1 addition & 5 deletions x-pack/plugins/alerts/server/alert_type_registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
AlertInstanceContext,
ActionGroup,
} from './types';
import { ResolvedActionGroup } from '../common';
import { getBuiltinActionGroups } from '../common';

interface ConstructorOptions {
taskManager: TaskManagerSetupContract;
Expand Down Expand Up @@ -161,7 +161,3 @@ function validateActionGroups(alertTypeId: string, actionGroups: ActionGroup[])
);
}
}

function getBuiltinActionGroups(): ActionGroup[] {
return [ResolvedActionGroup];
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@ export async function createAlert({
'createdBy' | 'updatedBy' | 'muteAll' | 'mutedInstanceIds' | 'executionStatus'
>;
}): Promise<Alert> {
if (alert.actions.length === 2) {
alert.actions[1].group = 'resolved';
}
return await http.post(`${BASE_ALERT_API_PATH}/alert`, {
body: JSON.stringify(alert),
});
Expand Down

0 comments on commit 378fa7c

Please sign in to comment.