diff --git a/cypress/integration/query_level_monitor_spec.js b/cypress/integration/query_level_monitor_spec.js index 3ca9a3b91..1e3cb3bb1 100644 --- a/cypress/integration/query_level_monitor_spec.js +++ b/cypress/integration/query_level_monitor_spec.js @@ -166,7 +166,7 @@ describe('Query-Level Monitors', () => { cy.contains(SAMPLE_MONITOR, { timeout: 20000 }); // Select the existing monitor - cy.get('a').contains(SAMPLE_MONITOR, { timeout: 20000 }).click(); + cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click(); // Click Edit button cy.contains('Edit', { timeout: 20000 }).click({ force: true }); @@ -195,7 +195,7 @@ describe('Query-Level Monitors', () => { cy.contains(SAMPLE_MONITOR, { timeout: 20000 }); // Select the existing monitor - cy.get('a').contains(SAMPLE_MONITOR, { timeout: 20000 }).click({ force: true }); + cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click({ force: true }); // Click Edit button cy.contains('Edit', { timeout: 20000 }).click({ force: true }); @@ -304,7 +304,7 @@ describe('Query-Level Monitors', () => { cy.contains(SAMPLE_MONITOR); // Select the existing monitor - cy.get('a').contains(SAMPLE_MONITOR).click(); + cy.get(`[data-test-subj="${SAMPLE_MONITOR}"]`).click(); // Click Edit button cy.contains('Edit').click({ force: true }); @@ -373,7 +373,7 @@ describe('Query-Level Monitors', () => { cy.contains(SAMPLE_DAYS_INTERVAL_MONITOR, { timeout: 20000 }); // Select the existing monitor - cy.get('a').contains(SAMPLE_DAYS_INTERVAL_MONITOR).click({ force: true }); + cy.get(`[data-test-subj="${SAMPLE_DAYS_INTERVAL_MONITOR}"]`).click({ force: true }); // Click Edit button cy.contains('Edit').click({ force: true }); @@ -398,7 +398,7 @@ describe('Query-Level Monitors', () => { cy.contains(SAMPLE_CRON_EXPRESSION_MONITOR, { timeout: 20000 }); // Select the existing monitor - cy.get('a').contains(SAMPLE_CRON_EXPRESSION_MONITOR).click({ force: true }); + cy.get(`[data-test-subj="${SAMPLE_CRON_EXPRESSION_MONITOR}"]`).click({ force: true }); // Click Edit button cy.contains('Edit').click({ force: true }); diff --git a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js index 78091dc7d..0a186fd61 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js @@ -8,18 +8,17 @@ import { EuiCallOut, EuiButton, EuiSpacer } from '@elastic/eui'; import { MANAGE_CHANNELS_PATH } from '../../../CreateTrigger/utils/constants'; const NotificationsInfoCallOut = ({ hasNotificationPlugin }) => { - console.log(`NotificationsInfoCallOut: ${hasNotificationPlugin}`); return (

Your destinations have been migrated to Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward. - - {hasNotificationPlugin && ( - View Notifications - )}

+ + {hasNotificationPlugin && ( + View Notifications + )}
diff --git a/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap b/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap index 0e03bbd9b..750bb13c6 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap @@ -41,7 +41,6 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is installed -

@@ -77,7 +76,6 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is not insta

-

diff --git a/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap b/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap index 3cbd3af90..60098e69b 100644 --- a/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap +++ b/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap @@ -82,14 +82,14 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` >

Your destinations have been migrated to Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward. - -

-

+ +
+
@@ -1556,14 +1556,14 @@ exports[`DestinationsList renders when Notification plugin is not installed 1`] >

Your destinations have been migrated to Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward. - -

-

+ +
+
@@ -2888,14 +2888,14 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` >

Your destinations have been migrated to Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward. - -

-

+ +
+
diff --git a/public/pages/Monitors/containers/Monitors/Monitors.js b/public/pages/Monitors/containers/Monitors/Monitors.js index 21f9de5a5..9367aafa0 100644 --- a/public/pages/Monitors/containers/Monitors/Monitors.js +++ b/public/pages/Monitors/containers/Monitors/Monitors.js @@ -75,7 +75,7 @@ export default class Monitors extends Component { ...staticColumns, { name: 'Actions', - width: '75px', + width: '60px', actions: [ { name: 'Acknowledge', @@ -86,11 +86,13 @@ export default class Monitors extends Component { name: 'Enable', description: 'Enable this Monitor', onClick: this.onClickEnable, + available: (item) => !item.enabled, }, { name: 'Disable', description: 'Disable this Monitor', onClick: this.onClickDisable, + available: (item) => item.enabled, }, { name: 'Delete', 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 d664a137d..5dcbfd468 100644 --- a/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap +++ b/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap @@ -40,8 +40,6 @@ exports[`Monitors renders 1`] = ` "render": [Function], "sortable": true, "textOnly": true, - "truncateText": true, - "width": "150px", }, Object { "field": "user", @@ -50,7 +48,6 @@ exports[`Monitors renders 1`] = ` "sortable": true, "textOnly": true, "truncateText": true, - "width": "100px", }, Object { "field": "latestAlert", @@ -58,7 +55,6 @@ exports[`Monitors renders 1`] = ` "sortable": false, "textOnly": true, "truncateText": true, - "width": "150px", }, Object { "field": "enabled", @@ -66,7 +62,6 @@ exports[`Monitors renders 1`] = ` "render": [Function], "sortable": false, "truncateText": false, - "width": "100px", }, Object { "dataType": "date", @@ -75,35 +70,30 @@ exports[`Monitors renders 1`] = ` "render": [Function], "sortable": true, "truncateText": false, - "width": "150px", }, Object { "field": "active", "name": "Active", "sortable": true, "truncateText": false, - "width": "100px", }, Object { "field": "acknowledged", "name": "Acknowledged", "sortable": true, "truncateText": false, - "width": "100px", }, Object { "field": "errors", "name": "Errors", "sortable": true, "truncateText": false, - "width": "100px", }, Object { "field": "ignored", "name": "Ignored", "sortable": true, "truncateText": false, - "width": "100px", }, Object { "actions": Array [ @@ -113,11 +103,13 @@ exports[`Monitors renders 1`] = ` "onClick": [Function], }, Object { + "available": [Function], "description": "Enable this Monitor", "name": "Enable", "onClick": [Function], }, Object { + "available": [Function], "description": "Disable this Monitor", "name": "Disable", "onClick": [Function], @@ -129,7 +121,7 @@ exports[`Monitors renders 1`] = ` }, ], "name": "Actions", - "width": "75px", + "width": "60px", }, ] } diff --git a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js index c8b92249f..4aab897e9 100644 --- a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js +++ b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js @@ -20,10 +20,12 @@ export const columns = [ field: 'name', name: 'Monitor name', sortable: true, - truncateText: true, textOnly: true, - width: '150px', - render: (name, item) => {name}, + render: (name, item) => ( + + {name} + + ), }, { field: 'user', @@ -31,7 +33,6 @@ export const columns = [ sortable: true, truncateText: true, textOnly: true, - width: '100px', /* There are 3 cases: 1. Monitors created by older versions and never updated. These monitors won’t have User details in the monitor object. `monitor.user` will be null. @@ -47,14 +48,12 @@ export const columns = [ sortable: false, truncateText: true, textOnly: true, - width: '150px', }, { field: 'enabled', name: 'State', sortable: false, truncateText: false, - width: '100px', render: (enabled) => (enabled ? 'Enabled' : 'Disabled'), }, { @@ -64,34 +63,29 @@ export const columns = [ truncateText: false, render: renderTime, dataType: 'date', - width: '150px', }, { field: 'active', name: 'Active', sortable: true, truncateText: false, - width: '100px', }, { field: 'acknowledged', name: 'Acknowledged', sortable: true, truncateText: false, - width: '100px', }, { field: 'errors', name: 'Errors', sortable: true, truncateText: false, - width: '100px', }, { field: 'ignored', name: 'Ignored', sortable: true, truncateText: false, - width: '100px', }, ];