From 5bf33a1e4d947617dea0ab553a7fb4c9994b5d38 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Thu, 12 Sep 2024 17:47:41 -0700 Subject: [PATCH 01/26] remove horizontal line below search bar Signed-off-by: Joanne Wang --- public/pages/Dashboard/containers/Dashboard.js | 2 -- public/pages/Monitors/containers/Monitors/Monitors.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index 0838fe007..f0b727f35 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -562,8 +562,6 @@ export default class Dashboard extends Component { alertActions={useUpdatedUx ? actions() : undefined} /> - - - - {showAcknowledgeModal && ( Date: Thu, 12 Sep 2024 17:57:56 -0700 Subject: [PATCH 02/26] space between header and panel 16px and space around table 16px Signed-off-by: Joanne Wang --- public/pages/Home/Home.js | 2 +- public/pages/Main/Main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/pages/Home/Home.js b/public/pages/Home/Home.js index 33713c500..dd76fbf6b 100644 --- a/public/pages/Home/Home.js +++ b/public/pages/Home/Home.js @@ -86,7 +86,7 @@ export default class Home extends Component { {this.tabs.map(this.renderTab)} )} -
+
-
+
{ From 1e5c8c1228ec4758c44e4cdbe0fcd6910ea70e72 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 10:29:10 -0700 Subject: [PATCH 03/26] fix 16px around table and search bar Signed-off-by: Joanne Wang --- .../Dashboard/components/DashboardControls/DashboardControls.js | 2 +- public/pages/Dashboard/containers/Dashboard.js | 1 + .../Monitors/components/MonitorControls/MonitorControls.js | 2 +- public/pages/Monitors/containers/Monitors/Monitors.js | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index c1d38190a..65271bbb0 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -56,7 +56,7 @@ const DashboardControls = ({ break; } return ( - + } data-test-subj={'alertsDashboard_table'} + style={{ padding: '0px 16px 0px' }} /> {this.state.showAlertsModal && this.renderModal()} diff --git a/public/pages/Monitors/components/MonitorControls/MonitorControls.js b/public/pages/Monitors/components/MonitorControls/MonitorControls.js index 56c329855..3a4356347 100644 --- a/public/pages/Monitors/components/MonitorControls/MonitorControls.js +++ b/public/pages/Monitors/components/MonitorControls/MonitorControls.js @@ -34,7 +34,7 @@ const MonitorControls = ({ onPageClick, monitorActions = null, }) => ( - + {monitorItemsToDelete && ( From bfd05ab2c6985965b6ce1bb00b3bde37d8848479 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 10:32:58 -0700 Subject: [PATCH 04/26] remove pagination from top of table Signed-off-by: Joanne Wang --- .../components/DashboardControls/DashboardControls.js | 3 --- .../Monitors/components/MonitorControls/MonitorControls.js | 3 --- 2 files changed, 6 deletions(-) diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index 65271bbb0..4df332773 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -87,9 +87,6 @@ const DashboardControls = ({ {alertActions.map((action, idx) => ( {action} ))} - - - ); }; diff --git a/public/pages/Monitors/components/MonitorControls/MonitorControls.js b/public/pages/Monitors/components/MonitorControls/MonitorControls.js index 3a4356347..0be08d644 100644 --- a/public/pages/Monitors/components/MonitorControls/MonitorControls.js +++ b/public/pages/Monitors/components/MonitorControls/MonitorControls.js @@ -47,9 +47,6 @@ const MonitorControls = ({ {monitorActions && {monitorActions}} - - - ); From 120050baea858ce90ab0870f40cb800512e634b3 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 11:01:03 -0700 Subject: [PATCH 05/26] add button to create monitor Signed-off-by: Joanne Wang --- .../components/MonitorActions/MonitorActions.js | 12 +++++++++--- .../pages/Monitors/containers/Monitors/Monitors.js | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.js index 11d41090f..651bc8574 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.js @@ -10,8 +10,8 @@ import { EuiContextMenuPanel, EuiFlexGroup, EuiFlexItem, - EuiPopover, -} from '@elastic/eui'; + EuiPopover, EuiButton +} from "@elastic/eui"; import { APP_PATH } from '../../../../utils/constants'; import { PageHeader } from '../../../../components/PageHeader/PageHeader'; @@ -84,7 +84,13 @@ export default class MonitorActions extends Component { const { isActionsOpen } = this.state; const { isEditDisabled, onClickEdit } = this.props; const createMonitorControl = ( - + Create monitor ); diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index fa300072b..74b5ba2dc 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -6,7 +6,7 @@ import React, { Component } from 'react'; import _ from 'lodash'; import queryString from 'query-string'; -import { EuiBasicTable, EuiHorizontalRule } from '@elastic/eui'; +import { EuiBasicTable } from '@elastic/eui'; import AcknowledgeModal from '../../components/AcknowledgeModal'; import ContentPanel from '../../../../components/ContentPanel'; import MonitorActions from '../../components/MonitorActions'; @@ -512,7 +512,7 @@ export default class Monitors extends Component { pagination={pagination} selection={selection} sorting={sorting} - style={{ padding: '0px 16px 0px' }} + style={{ padding: useUpdatedUx ? '0px 16px' : '0px' }} /> {monitorItemsToDelete && ( From 599056c8b122ecef3537d1d8e6e4562408402585 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 11:18:10 -0700 Subject: [PATCH 06/26] add tooltip to delete Signed-off-by: Joanne Wang --- .../containers/MonitorDetails.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index 57e51a5fe..9bb09eccf 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -27,8 +27,8 @@ import { EuiTabs, EuiText, EuiButtonIcon, - EuiButton, -} from '@elastic/eui'; + EuiButton, EuiToolTip +} from "@elastic/eui"; import CreateMonitor from '../../CreateMonitor'; import MonitorOverview from '../components/MonitorOverview'; import MonitorHistory from './MonitorHistory'; @@ -492,12 +492,14 @@ export default class MonitorDetails extends Component { if (useUpdatedUx) { monitorActions.unshift( - + + + ); monitorActions.push( From 23fc71a7402a56811b77a88073a05411789a9e37 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 12:12:58 -0700 Subject: [PATCH 07/26] remove space on trash icon Signed-off-by: Joanne Wang --- public/pages/MonitorDetails/containers/MonitorDetails.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index 9bb09eccf..fb8cff1cf 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -27,7 +27,7 @@ import { EuiTabs, EuiText, EuiButtonIcon, - EuiButton, EuiToolTip + EuiButton, EuiToolTip, EuiIcon } from "@elastic/eui"; import CreateMonitor from '../../CreateMonitor'; import MonitorOverview from '../components/MonitorOverview'; @@ -494,11 +494,12 @@ export default class MonitorDetails extends Component { monitorActions.unshift( + > + + ); monitorActions.push( From 1e6b6b39229b8468be63807c64b3b2c0ab9a6142 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 12:25:55 -0700 Subject: [PATCH 08/26] fix gutter size Signed-off-by: Joanne Wang --- .../Monitors/components/MonitorControls/MonitorControls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/Monitors/components/MonitorControls/MonitorControls.js b/public/pages/Monitors/components/MonitorControls/MonitorControls.js index 0be08d644..9962ff450 100644 --- a/public/pages/Monitors/components/MonitorControls/MonitorControls.js +++ b/public/pages/Monitors/components/MonitorControls/MonitorControls.js @@ -34,7 +34,7 @@ const MonitorControls = ({ onPageClick, monitorActions = null, }) => ( - + Date: Fri, 13 Sep 2024 13:14:16 -0700 Subject: [PATCH 09/26] move edit under actions Signed-off-by: Joanne Wang --- .../MonitorActions/MonitorActions.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.js index 651bc8574..48001a316 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.js @@ -36,6 +36,17 @@ export default class MonitorActions extends Component { > Acknowledge , + { + this.onCloseActions(); + this.props.onClickEdit(); + }} + disabled={isEditDisabled} + > + Edit + , - - - Edit - - Date: Fri, 13 Sep 2024 15:56:47 -0700 Subject: [PATCH 10/26] fix notifications breadcrumb redirect Signed-off-by: Joanne Wang --- public/utils/helpers.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/utils/helpers.js b/public/utils/helpers.js index f95f3b6fc..e8df666fa 100644 --- a/public/utils/helpers.js +++ b/public/utils/helpers.js @@ -160,7 +160,9 @@ export function initManageChannelsUrl(httpClient) { const relativePath = `/app/${ getUseUpdatedUx() ? 'channels' : 'notifications-dashboards' }#/channels`; - MANAGE_CHANNELS_URL = httpClient.basePath.prepend(relativePath); + MANAGE_CHANNELS_URL = httpClient.basePath.prepend(relativePath, { + withoutClientBasePath: true, + }); } } From 2f20f8979ca9ae8d9b2b36216bea3b8ff6b54e73 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 16:41:26 -0700 Subject: [PATCH 11/26] spacing from title to panel 16 for view monitor Signed-off-by: Joanne Wang --- public/pages/MonitorDetails/containers/MonitorDetails.js | 3 +-- public/pages/Monitors/containers/Monitors/Monitors.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index fb8cff1cf..63a88b1f0 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -521,7 +521,7 @@ export default class MonitorDetails extends Component { } return ( -
+
{this.renderNoTriggersCallOut()} - {monitorItemsToDelete && ( From 3dc5cd0cdfcf7ef12737dbe4210c3cb75d27c2de Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 17:38:00 -0700 Subject: [PATCH 12/26] fix some padding and remove horiz rule for findings section Signed-off-by: Joanne Wang --- public/components/ContentPanel/ContentPanel.js | 2 +- .../Dashboard/components/DashboardControls/DashboardControls.js | 2 +- public/pages/Dashboard/containers/Dashboard.js | 1 - public/pages/Dashboard/containers/FindingsDashboard.js | 2 -- .../Monitors/components/MonitorControls/MonitorControls.js | 2 +- public/pages/Monitors/containers/Monitors/Monitors.js | 1 - 6 files changed, 3 insertions(+), 7 deletions(-) diff --git a/public/components/ContentPanel/ContentPanel.js b/public/components/ContentPanel/ContentPanel.js index 445b05183..4baa8c1c8 100644 --- a/public/components/ContentPanel/ContentPanel.js +++ b/public/components/ContentPanel/ContentPanel.js @@ -19,7 +19,7 @@ const ContentPanel = ({ children, panelOptions = {}, }) => ( - + diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index 4df332773..ea86420d6 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -56,7 +56,7 @@ const DashboardControls = ({ break; } return ( - + } data-test-subj={'alertsDashboard_table'} - style={{ padding: '0px 16px 0px' }} /> {this.state.showAlertsModal && this.renderModal()} diff --git a/public/pages/Dashboard/containers/FindingsDashboard.js b/public/pages/Dashboard/containers/FindingsDashboard.js index 61414901b..bb8552c90 100644 --- a/public/pages/Dashboard/containers/FindingsDashboard.js +++ b/public/pages/Dashboard/containers/FindingsDashboard.js @@ -229,8 +229,6 @@ export default class FindingsDashboard extends Component { )} - - ( - + {monitorItemsToDelete && ( From d90715114e0d7279b36257395824c5c2842aedb2 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 17:41:32 -0700 Subject: [PATCH 13/26] change update monitor to edit monitor Signed-off-by: Joanne Wang --- public/components/Breadcrumbs/Breadcrumbs.js | 4 ++-- public/components/Breadcrumbs/Breadcrumbs.test.js | 2 +- .../AcknowledgeAlertsModal/AcknowledgeAlertsModal.js | 2 +- public/pages/MonitorDetails/containers/MonitorDetails.js | 4 ++-- public/pages/Monitors/containers/Monitors/Monitors.js | 2 +- public/utils/constants.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/components/Breadcrumbs/Breadcrumbs.js b/public/components/Breadcrumbs/Breadcrumbs.js index 45640e466..1fc731295 100644 --- a/public/components/Breadcrumbs/Breadcrumbs.js +++ b/public/components/Breadcrumbs/Breadcrumbs.js @@ -82,8 +82,8 @@ export async function getBreadcrumb(route, routeState, httpClient) { console.error(err); } const breadcrumbs = [{ text: monitorName, href: `/monitors/${base}` }]; - if (action === MONITOR_ACTIONS.UPDATE_MONITOR) - breadcrumbs.push({ text: 'Update monitor', href: '/' }); + if (action === MONITOR_ACTIONS.EDIT_MONITOR) + breadcrumbs.push({ text: 'Edit monitor', href: '/' }); if (action === TRIGGER_ACTIONS.CREATE_TRIGGER) breadcrumbs.push({ text: 'Create trigger', href: '/' }); if (action === TRIGGER_ACTIONS.UPDATE_TRIGGER) diff --git a/public/components/Breadcrumbs/Breadcrumbs.test.js b/public/components/Breadcrumbs/Breadcrumbs.test.js index 045fc4faa..a2921166b 100644 --- a/public/components/Breadcrumbs/Breadcrumbs.test.js +++ b/public/components/Breadcrumbs/Breadcrumbs.test.js @@ -102,7 +102,7 @@ describe('getBreadcrumb', () => { httpClientMock.get.mockResolvedValue({ ok: true, resp: { name: 'random_name' } }); expect( await getBreadcrumb( - `${monitorId}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`, + `${monitorId}?action=${MONITOR_ACTIONS.EDIT_MONITOR}`, {}, httpClientMock ) diff --git a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js index a839d9c13..e9dae71f0 100644 --- a/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js +++ b/public/pages/Dashboard/components/AcknowledgeAlertsModal/AcknowledgeAlertsModal.js @@ -227,7 +227,7 @@ export default class AcknowledgeAlertsModal extends Component { onCreateTrigger = () => { const { history, monitorId, onClose } = this.props; onClose(); - history.push(`/monitors/${monitorId}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`); + history.push(`/monitors/${monitorId}?action=${MONITOR_ACTIONS.EDIT_MONITOR}`); }; render() { diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index 63a88b1f0..a5e0091b9 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -76,7 +76,7 @@ export default class MonitorDetails extends Component { const monitorType = this.state.monitor.monitor_type; this.props.history.push({ ...this.props.location, - search: `?action=${MONITOR_ACTIONS.UPDATE_MONITOR}&monitorType=${monitorType}${ + search: `?action=${MONITOR_ACTIONS.EDIT_MONITOR}&monitorType=${monitorType}${ dataSourceId !== undefined ? `&dataSourceId=${dataSourceId}` : '' }`, }); @@ -444,7 +444,7 @@ export default class MonitorDetails extends Component { setFlyout, } = this.props; const { action } = queryString.parse(location.search); - const updatingMonitor = action === MONITOR_ACTIONS.UPDATE_MONITOR; + const updatingMonitor = action === MONITOR_ACTIONS.EDIT_MONITOR; const detectorId = _.get(monitor, MONITOR_INPUT_DETECTOR_ID, undefined); if (loading) { diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index 31156c8dc..55693ad98 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -285,7 +285,7 @@ export default class Monitors extends Component { const { selectedItems: [{ id }], } = this.state; - if (id) this.props.history.push(`/monitors/${id}?action=${MONITOR_ACTIONS.UPDATE_MONITOR}`); + if (id) this.props.history.push(`/monitors/${id}?action=${MONITOR_ACTIONS.EDIT_MONITOR}`); } onClickEnable(item) { diff --git a/public/utils/constants.js b/public/utils/constants.js index 3b916785d..708b8593a 100644 --- a/public/utils/constants.js +++ b/public/utils/constants.js @@ -40,7 +40,7 @@ export const DESTINATION_ACTIONS = { }; export const MONITOR_ACTIONS = { - UPDATE_MONITOR: 'update-monitor', + EDIT_MONITOR: 'edit-monitor', }; export const TRIGGER_ACTIONS = { From 0ebea4fc09ccc69da7ac6151c8851d2c0e4b6b0c Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Fri, 13 Sep 2024 17:41:58 -0700 Subject: [PATCH 14/26] change update to save and fix padding for create monitor Signed-off-by: Joanne Wang --- .../CreateMonitor/containers/CreateMonitor/CreateMonitor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js index 46cf80ed3..eedef7099 100644 --- a/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js +++ b/public/pages/CreateMonitor/containers/CreateMonitor/CreateMonitor.js @@ -177,7 +177,7 @@ export default class CreateMonitor extends Component { } = this.props; const { createModalOpen, initialValues, plugins } = this.state; return ( -
+
- {edit ? 'Update' : 'Create'} + {edit ? 'Save' : 'Create'} From b0a36d4207aac85e7ac2463243f80ac91c11f8e3 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Sun, 15 Sep 2024 22:31:33 -0700 Subject: [PATCH 15/26] change monitor details padding and fix link to new page in alerts card Signed-off-by: Joanne Wang --- .../DataSourceAlertsCard/DataSourceAlertsCard.tsx | 10 +++++----- .../containers/MonitorDetails/MonitorDetails.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx index 35b707ae8..1f43bed54 100644 --- a/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx +++ b/public/components/DataSourceAlertsCard/DataSourceAlertsCard.tsx @@ -27,13 +27,13 @@ export const DataSourceAlertsCard: React.FC = ({ get useEffect(() => { setLoading(true); - getClient().get('../api/alerting/alerts', { + getClient().get('../api/alerting/alerts', { query: { size: 25, sortField: 'start_time', dataSourceId: dataSource?.id || '', sortDirection: 'desc' - } + } }).then(res => { if (res.ok) { setAlerts(res.alerts); @@ -53,7 +53,7 @@ export const DataSourceAlertsCard: React.FC = ({ get const createAlertDetailsHeader = useCallback((alert) => { const severityColor = getSeverityColor(alert.severity); const triggerName = alert.trigger_name ?? DEFAULT_EMPTY_DATA; - + return ( @@ -147,9 +147,9 @@ export const DataSourceAlertsCard: React.FC = ({ get - View all + View all ) -}; \ No newline at end of file +}; diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js index 04d1b10fd..a9ded014e 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js @@ -64,10 +64,10 @@ const MonitorDetails = ({ title="Monitor details" titleSize="s" panelStyles={{ - paddingBottom: '20px', + paddingBottom: '16px', paddingLeft: '10px', paddingRight: '10px', - paddingTop: '20px', + paddingTop: '16px', }} actions={anomalyDetectorContent.actions} > From cf5d02cefe0ae7f5fc781bc7bd0b17e33b979111 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Sun, 15 Sep 2024 23:13:44 -0700 Subject: [PATCH 16/26] remove boarder when empty state Signed-off-by: Joanne Wang --- public/pages/Dashboard/containers/Dashboard.js | 1 + public/pages/Monitors/containers/Monitors/Monitors.js | 1 + 2 files changed, 2 insertions(+) diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index f0b727f35..0ccec6f91 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -546,6 +546,7 @@ export default class Dashboard extends Component { bodyStyles={{ padding: 'initial' }} actions={useUpdatedUx ? undefined : actions()} panelOptions={{ hideTitleBorder: useUpdatedUx }} + panelStyles={{ padding: useUpdatedUx && totalAlerts < 1 ? '16px 16px 0px' : '16px' }} > Date: Mon, 16 Sep 2024 08:58:57 -0700 Subject: [PATCH 17/26] fix search bar spacing above Signed-off-by: Joanne Wang --- .../components/DashboardControls/DashboardControls.js | 3 ++- public/pages/Dashboard/containers/Dashboard.js | 1 + public/pages/Dashboard/containers/FindingsDashboard.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index ea86420d6..34c1d84af 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -45,6 +45,7 @@ const DashboardControls = ({ isAlertsFlyout = false, monitorType, alertActions = [], + controlsStyle = {}, }) => { let supportedStateOptions = stateOptions; switch (monitorType) { @@ -56,7 +57,7 @@ const DashboardControls = ({ break; } return ( - + {!isPreview && ( - + Date: Mon, 16 Sep 2024 09:41:56 -0700 Subject: [PATCH 18/26] make create and edit monitor panels 16px padding Signed-off-by: Joanne Wang --- .../CreateMonitor/containers/DataSource/DataSource.js | 1 - .../containers/DefineMonitor/DefineMonitor.js | 4 ---- .../containers/MonitorDetails/MonitorDetails.js | 7 +------ .../containers/ConfigureTriggers/ConfigureTriggers.js | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/public/pages/CreateMonitor/containers/DataSource/DataSource.js b/public/pages/CreateMonitor/containers/DataSource/DataSource.js index c7daff3e8..fdf159e7a 100644 --- a/public/pages/CreateMonitor/containers/DataSource/DataSource.js +++ b/public/pages/CreateMonitor/containers/DataSource/DataSource.js @@ -65,7 +65,6 @@ class DataSource extends Component { {monitorIndexDisplay} diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js index b0284aae5..96dd6cc4e 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js +++ b/public/pages/CreateMonitor/containers/DefineMonitor/DefineMonitor.js @@ -702,10 +702,6 @@ class DefineMonitor extends Component { diff --git a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js index a9ded014e..95e397863 100644 --- a/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js +++ b/public/pages/CreateMonitor/containers/MonitorDetails/MonitorDetails.js @@ -63,12 +63,7 @@ const MonitorDetails = ({ {!flyoutMode && } diff --git a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js index 199063e76..601b87630 100644 --- a/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js +++ b/public/pages/CreateTrigger/containers/ConfigureTriggers/ConfigureTriggers.js @@ -453,7 +453,7 @@ class ConfigureTriggers extends React.Component { ? 'Triggers define the conditions that determine when a composite monitor should generate its own alert.' : undefined } - panelStyles={{ paddingBottom: '0px', paddingLeft: '20px', paddingRight: '20px' }} + panelStyles={{ padding: '16px' }} bodyStyles={{ paddingLeft: '0px', padding: '10px' }} horizontalRuleClassName={'accordion-horizontal-rule'} > From 80a159d74954b857cb46a83cee62841c77f26423 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Mon, 16 Sep 2024 09:46:45 -0700 Subject: [PATCH 19/26] rename Signed-off-by: Joanne Wang --- .../components/DashboardControls/DashboardControls.js | 4 ++-- public/pages/Dashboard/containers/Dashboard.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js index 34c1d84af..fc9118b08 100644 --- a/public/pages/Dashboard/components/DashboardControls/DashboardControls.js +++ b/public/pages/Dashboard/components/DashboardControls/DashboardControls.js @@ -45,7 +45,7 @@ const DashboardControls = ({ isAlertsFlyout = false, monitorType, alertActions = [], - controlsStyle = {}, + panelStyles = {}, }) => { let supportedStateOptions = stateOptions; switch (monitorType) { @@ -57,7 +57,7 @@ const DashboardControls = ({ break; } return ( - + Date: Mon, 16 Sep 2024 10:55:07 -0700 Subject: [PATCH 20/26] fix original tabs Signed-off-by: Joanne Wang --- public/pages/Home/Home.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/Home/Home.js b/public/pages/Home/Home.js index dd76fbf6b..9174e1556 100644 --- a/public/pages/Home/Home.js +++ b/public/pages/Home/Home.js @@ -82,7 +82,7 @@ export default class Home extends Component { return (
{!defaultRoute && ( - + {this.tabs.map(this.renderTab)} )} From 6795ddfe602314b3cd94a50d9d5acc6932c70d7c Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Mon, 16 Sep 2024 11:03:01 -0700 Subject: [PATCH 21/26] fix spacing on original monitor page Signed-off-by: Joanne Wang --- public/pages/MonitorDetails/containers/MonitorDetails.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index a5e0091b9..db8e70241 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -545,6 +545,7 @@ export default class MonitorDetails extends Component { ))} + {!useUpdatedUx && } Date: Mon, 16 Sep 2024 11:06:15 -0700 Subject: [PATCH 22/26] add pagination back to the alerts page Signed-off-by: Joanne Wang --- public/pages/Dashboard/containers/Dashboard.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index 0fb1900a2..4d0d5269e 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -12,8 +12,8 @@ import { EuiHorizontalRule, EuiIcon, EuiToolTip, - EuiSmallButtonIcon, -} from '@elastic/eui'; + EuiSmallButtonIcon, EuiFlexItem, EuiPagination, EuiFlexGroup +} from "@elastic/eui"; import ContentPanel from '../../../components/ContentPanel'; import DashboardEmptyPrompt from '../components/DashboardEmptyPrompt'; import DashboardControls from '../components/DashboardControls'; @@ -530,6 +530,7 @@ export default class Dashboard extends Component { }; const useUpdatedUx = !perAlertView && getUseUpdatedUx(); + const shouldShowPagination = !perAlertView && totalAlerts > 0; return ( <> @@ -582,6 +583,18 @@ export default class Dashboard extends Component { data-test-subj={'alertsDashboard_table'} /> + {shouldShowPagination && ( + + + + + + )} + {this.state.showAlertsModal && this.renderModal()} From 10664d9e9a7842de43223ea10b52fcaf59f72190 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Mon, 16 Sep 2024 11:39:29 -0700 Subject: [PATCH 23/26] fix spacing for alerts dashboard flyout Signed-off-by: Joanne Wang --- .../Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js | 2 +- public/pages/Dashboard/containers/Dashboard.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js index 0a97b8c31..de91f1793 100644 --- a/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js +++ b/public/components/Flyout/flyouts/components/AlertsDashboardFlyoutComponent.js @@ -455,8 +455,8 @@ export default class AlertsDashboardFlyoutComponent extends Component { onPageChange={this.onPageClick} isAlertsFlyout={true} monitorType={monitorType} + panelStyles={{ padding: '8px 0px 16px' }} /> - Date: Mon, 16 Sep 2024 11:46:42 -0700 Subject: [PATCH 24/26] cleanup Signed-off-by: Joanne Wang --- public/pages/Dashboard/containers/Dashboard.js | 7 +++++-- public/pages/MonitorDetails/containers/MonitorDetails.js | 6 +++--- .../Monitors/components/MonitorActions/MonitorActions.js | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/public/pages/Dashboard/containers/Dashboard.js b/public/pages/Dashboard/containers/Dashboard.js index c7f9bcd8b..2005bee81 100644 --- a/public/pages/Dashboard/containers/Dashboard.js +++ b/public/pages/Dashboard/containers/Dashboard.js @@ -11,8 +11,11 @@ import { EuiSmallButton, EuiIcon, EuiToolTip, - EuiSmallButtonIcon, EuiFlexItem, EuiPagination, EuiFlexGroup -} from "@elastic/eui"; + EuiSmallButtonIcon, + EuiFlexItem, + EuiPagination, + EuiFlexGroup, +} from '@elastic/eui'; import ContentPanel from '../../../components/ContentPanel'; import DashboardEmptyPrompt from '../components/DashboardEmptyPrompt'; import DashboardControls from '../components/DashboardControls'; diff --git a/public/pages/MonitorDetails/containers/MonitorDetails.js b/public/pages/MonitorDetails/containers/MonitorDetails.js index db8e70241..d4aa13c10 100644 --- a/public/pages/MonitorDetails/containers/MonitorDetails.js +++ b/public/pages/MonitorDetails/containers/MonitorDetails.js @@ -26,9 +26,9 @@ import { EuiTab, EuiTabs, EuiText, - EuiButtonIcon, - EuiButton, EuiToolTip, EuiIcon -} from "@elastic/eui"; + EuiToolTip, + EuiIcon, +} from '@elastic/eui'; import CreateMonitor from '../../CreateMonitor'; import MonitorOverview from '../components/MonitorOverview'; import MonitorHistory from './MonitorHistory'; diff --git a/public/pages/Monitors/components/MonitorActions/MonitorActions.js b/public/pages/Monitors/components/MonitorActions/MonitorActions.js index 48001a316..6c10d669d 100644 --- a/public/pages/Monitors/components/MonitorActions/MonitorActions.js +++ b/public/pages/Monitors/components/MonitorActions/MonitorActions.js @@ -10,8 +10,8 @@ import { EuiContextMenuPanel, EuiFlexGroup, EuiFlexItem, - EuiPopover, EuiButton -} from "@elastic/eui"; + EuiPopover, +} from '@elastic/eui'; import { APP_PATH } from '../../../../utils/constants'; import { PageHeader } from '../../../../components/PageHeader/PageHeader'; From b8fb21099157389b65b20468df485bc5056a1b29 Mon Sep 17 00:00:00 2001 From: Joanne Wang Date: Mon, 16 Sep 2024 12:29:49 -0700 Subject: [PATCH 25/26] fix unit tests and run yarn test:jest -u Signed-off-by: Joanne Wang --- .../__snapshots__/Breadcrumbs.test.js.snap | 2 +- .../__snapshots__/ContentPanel.test.js.snap | 2 +- ...lertsDashboardFlyoutComponent.test.js.snap | 8 +- .../QueryPerformance.test.js.snap | 2 +- .../__snapshots__/VisualGraph.test.js.snap | 4 +- .../__snapshots__/CreateMonitor.test.js.snap | 2 +- .../__snapshots__/DataSource.test.js.snap | 6 - .../__snapshots__/DefineMonitor.test.js.snap | 12 - .../WorkflowDetails.test.js.snap | 2 +- .../DashboardControls.test.js.snap | 78 +- .../__snapshots__/Dashboard.test.js.snap | 681 ++---------------- .../Home/__snapshots__/Home.test.js.snap | 3 +- .../MonitorOverview.test.js.snap | 2 +- .../MonitorActions/MonitorActions.test.js | 6 +- .../__snapshots__/MonitorActions.test.js.snap | 25 +- .../containers/Monitors/Monitors.test.js | 2 +- .../__snapshots__/Monitors.test.js.snap | 8 +- 17 files changed, 72 insertions(+), 773 deletions(-) diff --git a/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap b/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap index c649707d3..7082b7064 100644 --- a/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap +++ b/public/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.js.snap @@ -70,7 +70,7 @@ Array [ }, Object { "href": "/", - "text": "Update monitor", + "text": "Edit monitor", }, ] `; diff --git a/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap b/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap index 4efb999c3..6c3fe1fe8 100644 --- a/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap +++ b/public/components/ContentPanel/__snapshots__/ContentPanel.test.js.snap @@ -3,7 +3,7 @@ exports[`ContentPanel renders 1`] = `
-
diff --git a/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap b/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap index f66def69a..2c6902d8a 100644 --- a/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap +++ b/public/pages/CreateMonitor/containers/DataSource/__snapshots__/DataSource.test.js.snap @@ -7,12 +7,6 @@ exports[`DataSource renders 1`] = ` "padding": "initial", } } - panelStyles={ - Object { - "paddingLeft": "10px", - "paddingRight": "10px", - } - } title="Select data" titleSize="s" > diff --git a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap index f4339f1e4..09fd36867 100644 --- a/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap +++ b/public/pages/CreateMonitor/containers/DefineMonitor/__snapshots__/DefineMonitor.test.js.snap @@ -91,12 +91,6 @@ exports[`DefineMonitor renders 1`] = ` "padding": "initial", } } - panelStyles={ - Object { - "paddingLeft": "10px", - "paddingRight": "10px", - } - } title="Query" titleSize="s" > @@ -144,12 +138,6 @@ exports[`DefineMonitor should show warning in case of Ad monitor and plugin is n "padding": "initial", } } - panelStyles={ - Object { - "paddingLeft": "10px", - "paddingRight": "10px", - } - } title="Query" titleSize="s" > diff --git a/public/pages/CreateMonitor/containers/WorkflowDetails/__snapshots__/WorkflowDetails.test.js.snap b/public/pages/CreateMonitor/containers/WorkflowDetails/__snapshots__/WorkflowDetails.test.js.snap index 65b8caa32..16ab04200 100644 --- a/public/pages/CreateMonitor/containers/WorkflowDetails/__snapshots__/WorkflowDetails.test.js.snap +++ b/public/pages/CreateMonitor/containers/WorkflowDetails/__snapshots__/WorkflowDetails.test.js.snap @@ -3,7 +3,7 @@ exports[`WorkflowDetails renders 1`] = `
-
- -
`; diff --git a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap index 575374ee4..a80332448 100644 --- a/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap +++ b/public/pages/Dashboard/containers/__snapshots__/Dashboard.test.js.snap @@ -113,14 +113,18 @@ exports[`Dashboard renders in flyout 1`] = ` "hideTitleBorder": false, } } + panelStyles={ + Object { + "padding": "16px", + } + } title="Alerts" titleSize="s" > @@ -128,8 +132,7 @@ exports[`Dashboard renders in flyout 1`] = ` className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow" style={ Object { - "paddingLeft": "0px", - "paddingRight": "0px", + "padding": "16px", } } > @@ -301,6 +304,11 @@ exports[`Dashboard renders in flyout 1`] = ` onSeverityChange={[Function]} onStateChange={[Function]} pageCount={1} + panelStyles={ + Object { + "padding": "8px 0px 16px", + } + } search="" severity="ALL" state="ALL" @@ -309,7 +317,7 @@ exports[`Dashboard renders in flyout 1`] = ` gutterSize="s" style={ Object { - "padding": "0px 5px", + "padding": "8px 0px 16px", } } > @@ -317,7 +325,7 @@ exports[`Dashboard renders in flyout 1`] = ` className="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--directionRow euiFlexGroup--responsive" style={ Object { - "padding": "0px 5px", + "padding": "8px 0px 16px", } } > @@ -569,216 +577,9 @@ exports[`Dashboard renders in flyout 1`] = `
- -
- - - -
-
- -
-
@@ -1736,8 +1541,7 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow" style={ Object { - "paddingLeft": "0px", - "paddingRight": "0px", + "padding": "16px", } } > @@ -1970,6 +1774,11 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` onSeverityChange={[Function]} onStateChange={[Function]} pageCount={1} + panelStyles={ + Object { + "padding": "0px 0px 16px", + } + } search="" severity="ALL" state="ALL" @@ -1978,7 +1787,7 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` gutterSize="s" style={ Object { - "padding": "0px 5px", + "padding": "0px 0px 16px", } } > @@ -1986,7 +1795,7 @@ exports[`Dashboard renders with alert by triggers view 1`] = ` className="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--directionRow euiFlexGroup--responsive" style={ Object { - "padding": "0px 5px", + "padding": "0px 0px 16px", } } > @@ -2412,216 +2221,9 @@ exports[`Dashboard renders with alert by triggers view 1`] = `
- -
- - - -
-
- -
-
@@ -3792,8 +3398,7 @@ exports[`Dashboard renders with per alert view 1`] = ` className="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow" style={ Object { - "paddingLeft": "0px", - "paddingRight": "0px", + "padding": "16px", } } > @@ -3965,6 +3570,11 @@ exports[`Dashboard renders with per alert view 1`] = ` onSeverityChange={[Function]} onStateChange={[Function]} pageCount={1} + panelStyles={ + Object { + "padding": "8px 0px 16px", + } + } search="" severity="ALL" state="ALL" @@ -3973,7 +3583,7 @@ exports[`Dashboard renders with per alert view 1`] = ` gutterSize="s" style={ Object { - "padding": "0px 5px", + "padding": "8px 0px 16px", } } > @@ -3981,7 +3591,7 @@ exports[`Dashboard renders with per alert view 1`] = ` className="euiFlexGroup euiFlexGroup--gutterSmall euiFlexGroup--directionRow euiFlexGroup--responsive" style={ Object { - "padding": "0px 5px", + "padding": "8px 0px 16px", } } > @@ -4407,216 +4017,9 @@ exports[`Dashboard renders with per alert view 1`] = `
- -
- - - -
-
- -
-
`; diff --git a/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap b/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap index 94bcb3dc6..5eb075a99 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap +++ b/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap @@ -3,7 +3,7 @@ exports[`MonitorOverview renders 1`] = `
{ }); test('does not call onClickEdit when Edit is clicked and edit is disabled', () => { - wrapper.find('[data-test-subj="editButton"]').hostNodes().simulate('click'); + wrapper.find('[data-test-subj="actionsButton"]').hostNodes().simulate('click'); + wrapper.find('[data-test-subj="editItem"]').hostNodes().simulate('click'); expect(props.onClickEdit).toHaveBeenCalledTimes(0); }); test('calls onClickEdit when Edit is clicked and isEditDisabled=false', () => { const props = getProps(); wrapper.setProps({ ...props, isEditDisabled: false }); - wrapper.find('[data-test-subj="editButton"]').hostNodes().simulate('click'); + wrapper.find('[data-test-subj="actionsButton"]').hostNodes().simulate('click'); + wrapper.find('[data-test-subj="editItem"]').hostNodes().simulate('click'); expect(props.onClickEdit).toHaveBeenCalledTimes(1); }); }); diff --git a/public/pages/Monitors/components/MonitorActions/__snapshots__/MonitorActions.test.js.snap b/public/pages/Monitors/components/MonitorActions/__snapshots__/MonitorActions.test.js.snap index 28675fe19..27f98b44e 100644 --- a/public/pages/Monitors/components/MonitorActions/__snapshots__/MonitorActions.test.js.snap +++ b/public/pages/Monitors/components/MonitorActions/__snapshots__/MonitorActions.test.js.snap @@ -35,26 +35,6 @@ exports[`MonitorActions renders 1`] = `
-
- -
@@ -65,8 +45,11 @@ exports[`MonitorActions renders 1`] = ` rel="noreferrer" > +
+ EuiIconMock +
diff --git a/public/pages/Monitors/containers/Monitors/Monitors.test.js b/public/pages/Monitors/containers/Monitors/Monitors.test.js index 8e195f85b..f68b5e111 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.test.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.test.js @@ -218,7 +218,7 @@ describe('Monitors', () => { expect(onClickEdit).toHaveBeenCalled(); expect(historyMock.push).toHaveBeenCalled(); - expect(historyMock.push).toHaveBeenCalledWith(`/monitors/random_id?action=update-monitor`); + expect(historyMock.push).toHaveBeenCalledWith(`/monitors/random_id?action=edit-monitor`); }); test('onClickEnable calls updateMonitors with monitor and enable:true update', () => { diff --git a/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap b/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap index 28233c7c4..8c0f71f42 100644 --- a/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap +++ b/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap @@ -24,6 +24,11 @@ exports[`Monitors renders 1`] = ` "hideTitleBorder": undefined, } } + panelStyles={ + Object { + "padding": "16px", + } + } title="Monitors" > - Date: Mon, 16 Sep 2024 14:56:50 -0700 Subject: [PATCH 26/26] fix cypress tests Signed-off-by: Joanne Wang --- cypress/integration/bucket_level_monitor_spec.js | 8 ++++---- cypress/integration/cluster_metrics_monitor_spec.js | 4 ++-- cypress/integration/composite_level_monitor_spec.js | 3 ++- cypress/integration/document_level_monitor_spec.js | 12 ++++++------ cypress/integration/query_level_monitor_spec.js | 12 ++++++------ 5 files changed, 20 insertions(+), 19 deletions(-) diff --git a/cypress/integration/bucket_level_monitor_spec.js b/cypress/integration/bucket_level_monitor_spec.js index 1d8077af0..766bdba6b 100644 --- a/cypress/integration/bucket_level_monitor_spec.js +++ b/cypress/integration/bucket_level_monitor_spec.js @@ -338,8 +338,8 @@ describe('Bucket-Level Monitors', () => { // Add a trigger addTriggerToVisualEditorMonitor(SAMPLE_TRIGGER, 0, SAMPLE_ACTION, true); - // Click update button to save monitor changes - cy.get('button').contains('Update').last().click({ force: true }); + // Click save to save monitor changes + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); @@ -375,8 +375,8 @@ describe('Bucket-Level Monitors', () => { timeout: 25000, }); - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: 20000 }); diff --git a/cypress/integration/cluster_metrics_monitor_spec.js b/cypress/integration/cluster_metrics_monitor_spec.js index e66145e7c..2ba38e5bf 100644 --- a/cypress/integration/cluster_metrics_monitor_spec.js +++ b/cypress/integration/cluster_metrics_monitor_spec.js @@ -369,8 +369,8 @@ describe('ClusterMetricsMonitor', () => { 'ctx.results[0].number_of_pending_tasks >= 0' ); - // Click update button to save monitor changes - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button to save monitor changes + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); diff --git a/cypress/integration/composite_level_monitor_spec.js b/cypress/integration/composite_level_monitor_spec.js index 4ef877d73..9bf785dea 100644 --- a/cypress/integration/composite_level_monitor_spec.js +++ b/cypress/integration/composite_level_monitor_spec.js @@ -130,6 +130,7 @@ describe('CompositeLevelMonitor', () => { it('by visual editor', () => { // Verify edit page + cy.contains('Edit').click({ force: true }); cy.contains('Edit monitor', { timeout: 20000 }); cy.get('input[name="name"]').type('_edited'); @@ -150,7 +151,7 @@ describe('CompositeLevelMonitor', () => { .type('{enter}'); cy.intercept('api/alerting/workflows/*').as('updateMonitorRequest'); - cy.get('button').contains('Update').click({ force: true }); + cy.get('button').contains('Save').click({ force: true }); // Wait for monitor to be created cy.wait('@updateMonitorRequest').then(() => { diff --git a/cypress/integration/document_level_monitor_spec.js b/cypress/integration/document_level_monitor_spec.js index 9e82db039..f43c3930f 100644 --- a/cypress/integration/document_level_monitor_spec.js +++ b/cypress/integration/document_level_monitor_spec.js @@ -380,8 +380,8 @@ describe('DocumentLevelMonitor', () => { // TODO: Test with Notifications plugin - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 2 rows'); @@ -446,8 +446,8 @@ describe('DocumentLevelMonitor', () => { // TODO: Test with Notifications plugin - // Click the create button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see only one row in the trigger list by checking element cy.contains('This table contains 1 row'); @@ -489,8 +489,8 @@ describe('DocumentLevelMonitor', () => { cy.get('[data-test-subj="indicesComboBox"]').should('not.have.text', TESTING_INDEX_A); cy.get('[data-test-subj="indicesComboBox"]').contains(TESTING_INDEX_B, { timeout: 20000 }); - // Click the update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click the save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: 20000 }); diff --git a/cypress/integration/query_level_monitor_spec.js b/cypress/integration/query_level_monitor_spec.js index 6743d7d1a..57f1af4c4 100644 --- a/cypress/integration/query_level_monitor_spec.js +++ b/cypress/integration/query_level_monitor_spec.js @@ -178,8 +178,8 @@ describe('Query-Level Monitors', () => { .clear() .type(UPDATED_MONITOR, { force: true }); - // Click Update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm the update process is done and the page loaded cy.contains('Edit monitor'); @@ -222,8 +222,8 @@ describe('Query-Level Monitors', () => { timeout: 25000, }); - // Click the update button - cy.get('button').contains('Update').last().click(); + // Click the save button + cy.get('button').contains('Save').last().click(); // Confirm we're on the Monitor Details page by searching for the History element cy.contains('History', { timeout: 25000 }); @@ -339,8 +339,8 @@ describe('Query-Level Monitors', () => { addVisualQueryLevelTrigger(trigger.name, i, true, `IS ${trigger.enum}`, `${i}`); } - // Click Update button - cy.get('button').contains('Update').last().click({ force: true }); + // Click save button + cy.get('button').contains('Save').last().click({ force: true }); // Confirm we can see the correct number of rows in the trigger list by checking element cy.contains(`This table contains ${triggers.length} rows`, { timeout: 25000 });