Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Uptime] One click simple monitor down alert #73835

Merged
merged 113 commits into from
Aug 27, 2020
Merged
Show file tree
Hide file tree
Changes from 110 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
88e72eb
WIP
shahzad31 Jul 7, 2020
63c2d02
Merge branch 'master' into anomlay-alert
shahzad31 Jul 7, 2020
043744c
added anomaly alert
shahzad31 Jul 8, 2020
8c239ab
update types
shahzad31 Jul 9, 2020
ff43601
update types
shahzad31 Jul 9, 2020
295438b
update
shahzad31 Jul 9, 2020
2a15b18
types
shahzad31 Jul 9, 2020
58e916c
types
shahzad31 Jul 9, 2020
3f27868
update ML part
shahzad31 Jul 9, 2020
4d8da9e
update ML part
shahzad31 Jul 9, 2020
094af77
update ML part
shahzad31 Jul 9, 2020
090c103
unnecessary change
shahzad31 Jul 9, 2020
74f4d2c
icon for disable
shahzad31 Jul 9, 2020
01015e8
Merge branch 'master' into anomlay-alert
shahzad31 Jul 9, 2020
d986c82
update test
shahzad31 Jul 9, 2020
ec61845
update api
shahzad31 Jul 9, 2020
ee32e41
update labels
shahzad31 Jul 9, 2020
ffadc42
Merge branch 'master' into anomlay-alert
shahzad31 Jul 9, 2020
fb7c631
Merge branch 'master' into anomlay-alert
shahzad31 Jul 9, 2020
2f80f3e
Merge branch 'master' into anomlay-alert
shahzad31 Jul 9, 2020
634c352
Merge branch 'master' into anomlay-alert
shahzad31 Jul 9, 2020
c1a5b51
resolve conflicts
shahzad31 Jul 9, 2020
e554348
fix types
shahzad31 Jul 9, 2020
241084c
fix editing alert
shahzad31 Jul 11, 2020
92d2b33
fix types
shahzad31 Jul 12, 2020
7ab1152
added actions column
shahzad31 Jul 13, 2020
7b1884a
Merge branch 'master' into anomlay-alert
shahzad31 Jul 13, 2020
4b17ac5
Merge branch 'master' into one-click-alert
shahzad31 Jul 13, 2020
c1f6777
added code to add alert
shahzad31 Jul 13, 2020
04e516e
Merge branch 'master' into anomlay-alert
shahzad31 Jul 13, 2020
7325189
update anomaly message
shahzad31 Jul 13, 2020
3f7d10c
added anomaly alert test
shahzad31 Jul 13, 2020
074dec8
update
shahzad31 Jul 13, 2020
3825d1b
update type
shahzad31 Jul 14, 2020
d1325ca
Merge branch 'master' into anomlay-alert
shahzad31 Jul 14, 2020
6eabaf9
fix ml legacy scoped client
shahzad31 Jul 14, 2020
eb194ea
Merge branch 'master' into one-click-alert
shahzad31 Jul 14, 2020
531e422
update
shahzad31 Jul 14, 2020
927054e
Merge branch 'anomlay-alert' into one-click-alert
shahzad31 Jul 14, 2020
f31d69c
WIP
shahzad31 Jul 15, 2020
05d41d8
Merge branch 'master' into one-click-alert
shahzad31 Jul 23, 2020
085c071
Merge branch 'master' into one-click-alert
shahzad31 Jul 29, 2020
a0d040e
fix conflict
shahzad31 Jul 30, 2020
3a85723
Merge branch 'master' into one-click-alert
shahzad31 Jul 30, 2020
f07feba
Merge branch 'master' into one-click-alert
shahzad31 Jul 30, 2020
61fe855
added aria label
shahzad31 Jul 30, 2020
4c37e7e
Added deleteion loading
shahzad31 Jul 30, 2020
b87d017
Merge branch 'master' into one-click-alert
shahzad31 Jul 30, 2020
1ff7108
fix type
shahzad31 Jul 30, 2020
0a6229a
Merge branch 'master' into one-click-alert
shahzad31 Jul 31, 2020
628c27e
update
shahzad31 Jul 31, 2020
b6a19c8
update tests
shahzad31 Jul 31, 2020
2a209cf
update
shahzad31 Jul 31, 2020
b5789e2
update type
shahzad31 Jul 31, 2020
a439862
fix types
shahzad31 Jul 31, 2020
d3bb689
WIP
shahzad31 Aug 3, 2020
0d0261d
Merge branch 'master' into one-click-alert
shahzad31 Aug 3, 2020
d72b76e
added enabled alerts section
shahzad31 Aug 4, 2020
a2c42d0
add data
shahzad31 Aug 6, 2020
90884f3
Merge branch 'master' into singular-alert
shahzad31 Aug 6, 2020
6a52f80
update
shahzad31 Aug 6, 2020
f51be23
Merge branch 'master' into singular-alert
shahzad31 Aug 6, 2020
45f93b1
update tests
shahzad31 Aug 10, 2020
3184c35
fix test
shahzad31 Aug 10, 2020
f68d5e4
update i18n
shahzad31 Aug 10, 2020
7aed8f0
update i18n
shahzad31 Aug 10, 2020
1089722
update i18n
shahzad31 Aug 10, 2020
145cf31
fix
shahzad31 Aug 10, 2020
a569174
Merge branch 'master' into singular-alert
shahzad31 Aug 10, 2020
35bc0fb
update message
shahzad31 Aug 10, 2020
ff3b5ee
Merge branch 'master' into one-click-alert
shahzad31 Aug 11, 2020
1ce78d4
Merge branch 'singular-alert' into one-click-alert
shahzad31 Aug 11, 2020
bc5090b
update
shahzad31 Aug 12, 2020
c1ba86b
Merge branch 'master' into one-click-alert
shahzad31 Aug 15, 2020
f9e7988
update
shahzad31 Aug 16, 2020
74b9db9
update
shahzad31 Aug 16, 2020
f18ce04
Merge branch 'master' into one-click-alert
shahzad31 Aug 17, 2020
4243639
revert
shahzad31 Aug 17, 2020
0736dc9
update types
shahzad31 Aug 17, 2020
f9063fe
added component
shahzad31 Aug 17, 2020
8514cdf
update test
shahzad31 Aug 17, 2020
6eefc88
Merge branch 'master' into one-click-alert
shahzad31 Aug 18, 2020
0a2989d
incorporate PR feedback
shahzad31 Aug 19, 2020
b1acead
fix focus
shahzad31 Aug 19, 2020
776b3bb
Merge branch 'master' into one-click-alert
shahzad31 Aug 19, 2020
8a8b8e8
Merge branch 'master' into one-click-alert
shahzad31 Aug 20, 2020
4295a46
update drawer
shahzad31 Aug 20, 2020
b0139ff
Merge branch 'master' into one-click-alert
elasticmachine Aug 20, 2020
2e699b4
Merge branch 'one-click-alert' of https://github.com/shahzad31/kibana…
shahzad31 Aug 20, 2020
f659775
Merge branch 'master' into one-click-alert
shahzad31 Aug 21, 2020
f8d0a73
handle edge case
shahzad31 Aug 21, 2020
9695fe8
Merge branch 'master' into one-click-alert
shahzad31 Aug 24, 2020
06d5f5c
improve btn text
shahzad31 Aug 24, 2020
0a71e3c
improve btn text
shahzad31 Aug 24, 2020
cb8d15b
use switch instead of icons
shahzad31 Aug 24, 2020
b148973
update snapshot
shahzad31 Aug 24, 2020
891745a
use compressed form
shahzad31 Aug 24, 2020
0aa01a2
fix type
shahzad31 Aug 24, 2020
02f9864
update snapshot
shahzad31 Aug 24, 2020
570527b
update snapshot
shahzad31 Aug 24, 2020
21dfc2b
Merge branch 'master' into one-click-alert
shahzad31 Aug 24, 2020
8cb214c
update test
shahzad31 Aug 24, 2020
b513e16
update test
shahzad31 Aug 24, 2020
8eea816
Merge branch 'master' into one-click-alert
shahzad31 Aug 25, 2020
e7095a0
PR feedback
shahzad31 Aug 25, 2020
f1550f5
fix test and type
shahzad31 Aug 25, 2020
e186833
Merge branch 'master' into one-click-alert
shahzad31 Aug 25, 2020
4a4ca48
remove delete action
shahzad31 Aug 25, 2020
3632d96
Merge branch 'master' into one-click-alert
shahzad31 Aug 26, 2020
dd3915b
remove unnecessary function
shahzad31 Aug 26, 2020
a0000d0
Merge branch 'master' into one-click-alert
elasticmachine Aug 26, 2020
3ffc899
Merge branch 'master' into one-click-alert
elasticmachine Aug 26, 2020
507a12e
Merge branch 'master' into one-click-alert
elasticmachine Aug 26, 2020
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
1 change: 1 addition & 0 deletions x-pack/plugins/triggers_actions_ui/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export {
AlertTypeParamsExpressionProps,
ValidationResult,
ActionVariable,
ActionConnector,
} from './types';
export {
ConnectorAddFlyout,
Expand Down
3 changes: 3 additions & 0 deletions x-pack/plugins/uptime/common/constants/rest_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export enum API_URLS {
ML_DELETE_JOB = `/api/ml/jobs/delete_jobs`,
ML_CAPABILITIES = '/api/ml/ml_capabilities',
ML_ANOMALIES_RESULT = `/api/ml/results/anomalies_table_data`,

ALERT_ACTIONS = '/api/actions',
CREATE_ALERT = '/api/alerts/alert',
ALERT = '/api/alerts/alert/',
ALERTS_FIND = '/api/alerts/_find',
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ export const DYNAMIC_SETTINGS_DEFAULTS: DynamicSettings = {
heartbeatIndices: 'heartbeat-8*',
certAgeThreshold: 730,
certExpirationThreshold: 30,
defaultConnectors: [],
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const AtomicStatusCheckParamsType = t.intersection([
search: t.string,
filters: StatusCheckFiltersType,
shouldCheckStatus: t.boolean,
isAutoGenerated: t.boolean,
}),
]);

Expand All @@ -34,6 +35,7 @@ export const StatusCheckParamsType = t.intersection([
t.partial({
filters: t.string,
shouldCheckStatus: t.boolean,
isAutoGenerated: t.boolean,
}),
t.type({
locations: t.array(t.string),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const DynamicSettingsType = t.type({
heartbeatIndices: t.string,
certAgeThreshold: t.number,
certExpirationThreshold: t.number,
defaultConnectors: t.array(t.string),
});

export const DynamicSettingsSaveType = t.intersection([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export type MonitorError = t.TypeOf<typeof MonitorErrorType>;

export const MonitorDetailsType = t.intersection([
t.type({ monitorId: t.string }),
t.partial({ error: MonitorErrorType }),
t.partial({ timestamp: t.string }),
t.partial({ error: MonitorErrorType, timestamp: t.string, alerts: t.unknown }),
]);
export type MonitorDetails = t.TypeOf<typeof MonitorDetailsType>;
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import React from 'react';
import { shallow, mount } from 'enzyme';
import { EuiLink, EuiButton } from '@elastic/eui';

import '../../../../lib/__mocks__/react_router_history.mock';
import '../../../../lib/__mocks__/ut_router_history.mock';

import { ReactRouterEuiLink, ReactRouterEuiButton } from '../link_for_eui';
import { mockHistory } from '../../../../lib/__mocks__';
import { mockHistory } from '../../../../lib/__mocks__/ut_router_history.mock';

describe('EUI & React Router Component Helpers', () => {
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useMonitorId } from '../../../hooks';
import { setAlertFlyoutType, setAlertFlyoutVisible } from '../../../state/actions';
import { useAnomalyAlert } from './use_anomaly_alert';
import { ConfirmAlertDeletion } from './confirm_alert_delete';
import { deleteAlertAction } from '../../../state/actions/alerts';
import { deleteAnomalyAlertAction } from '../../../state/alerts/alerts';

interface Props {
hasMLJob: boolean;
Expand Down Expand Up @@ -52,7 +52,7 @@ export const ManageMLJobComponent = ({ hasMLJob, onEnableJob, onJobDelete }: Pro
const [isConfirmAlertDeleteOpen, setIsConfirmAlertDeleteOpen] = useState(false);

const deleteAnomalyAlert = () =>
dispatch(deleteAlertAction.get({ alertId: anomalyAlert?.id as string }));
dispatch(deleteAnomalyAlertAction.get({ alertId: anomalyAlert?.id as string }));

const showLoading = isMLJobCreating || isMLJobLoading;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import { useContext, useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { getExistingAlertAction } from '../../../state/actions/alerts';
import { alertSelector, selectAlertFlyoutVisibility } from '../../../state/selectors';
import { selectAlertFlyoutVisibility } from '../../../state/selectors';
import { UptimeRefreshContext } from '../../../contexts';
import { useMonitorId } from '../../../hooks';
import { anomalyAlertSelector, getAnomalyAlertAction } from '../../../state/alerts/alerts';

export const useAnomalyAlert = () => {
const { lastRefresh } = useContext(UptimeRefreshContext);
Expand All @@ -18,12 +18,12 @@ export const useAnomalyAlert = () => {

const monitorId = useMonitorId();

const { data: anomalyAlert } = useSelector(alertSelector);
const { data: anomalyAlert } = useSelector(anomalyAlertSelector);

const alertFlyoutVisible = useSelector(selectAlertFlyoutVisibility);

useEffect(() => {
dispatch(getExistingAlertAction.get({ monitorId }));
dispatch(getAnomalyAlertAction.get({ monitorId }));
}, [monitorId, lastRefresh, dispatch, alertFlyoutVisible]);

return anomalyAlert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { getLayerList } from '../map_config';
import { mockLayerList } from './__mocks__/mock';
import { mockLayerList } from './__mocks__/poly_layer_mock';
import { LocationPoint } from '../embedded_map';
import { UptimeAppColors } from '../../../../../../apps/uptime_app';

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading