From abd3d0d6975412d0fc4807afbac6d3cf330a6162 Mon Sep 17 00:00:00 2001 From: Kohinoor Chatterjee Date: Tue, 21 Nov 2023 16:45:09 -0800 Subject: [PATCH] remove last updated backported to 2.1 (#805) * remove last updated backported to 2.1 Signed-off-by: kohinoor98 * updated test snapshot Signed-off-by: kohinoor98 * Removed "last updated by" sections from the UI. (#767) * Removed "last updated by" section from the UI as the SearchMonitor API can no longer return that info. Signed-off-by: AWSHurneyt * Updated cypress workflow. Signed-off-by: AWSHurneyt --------- Signed-off-by: AWSHurneyt (cherry picked from commit 1bea77f5af67faf294ce24f9239914c6a0c5c7a8) Signed-off-by: kohinoor98 --------- Signed-off-by: kohinoor98 Signed-off-by: AWSHurneyt Co-authored-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 6 +- .../DestinationsList.test.js.snap | 243 +----------------- .../DestinationsList/utils/constants.js | 9 - .../MonitorOverview.test.js.snap | 14 - .../MonitorOverview/utils/getOverviewStats.js | 10 - .../utils/getOverviewStats.test.js | 4 - .../__snapshots__/Monitors.test.js.snap | 9 - .../containers/Monitors/utils/tableUtils.js | 16 -- 8 files changed, 12 insertions(+), 299 deletions(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index b890e0996..209a8ef2c 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -2,10 +2,10 @@ name: E2E Cypress tests on: pull_request: branches: - - "*" + - '*' push: branches: - - "*" + - '*' env: OPENSEARCH_DASHBOARDS_VERSION: '2.1.0' OPENSEARCH_VERSION: '2.1.0-SNAPSHOT' @@ -68,7 +68,7 @@ jobs: - name: Run OpenSearch Dashboards server run: | cd OpenSearch-Dashboards - yarn start --no-base-path --no-watch & + yarn start --no-base-path --no-watch --server.host="0.0.0.0" & sleep 300 # timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:5601/api/status)" != "200" ]]; do sleep 5; done' - name: Run Cypress tests 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..875b6058d 100644 --- a/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap +++ b/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap @@ -912,15 +912,6 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` "truncateText": true, "width": "100px", }, - Object { - "field": "user", - "name": "Last updated by", - "render": [Function], - "sortable": true, - "textOnly": true, - "truncateText": true, - "width": "100px", - }, Object { "actions": Array [ Object { @@ -1014,13 +1005,6 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` "name": "Destination type", "onSort": [Function], }, - Object { - "isSortAscending": undefined, - "isSorted": false, - "key": "_data_s_user_2", - "name": "Last updated by", - "onSort": [Function], - }, ] } > @@ -1269,68 +1253,9 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` - - - - - @@ -2601,68 +2510,9 @@ exports[`DestinationsList renders when Notification plugin is not installed 1`] - - - - - @@ -3969,68 +3803,9 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` - - - - - (value && value.name ? value.name : '-'), - }, ]; 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 56795047d..69cc25cf8 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap +++ b/public/pages/MonitorDetails/components/MonitorOverview/__snapshots__/MonitorOverview.test.js.snap @@ -143,20 +143,6 @@ exports[`MonitorOverview renders 1`] = ` -
-
- - Last updated by - -
- - -
-
-
diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js index 3b6d574fc..b664ec715 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.js @@ -115,15 +115,5 @@ export default function getOverviewStats( header: 'Monitor version number', value: monitorVersion, }, - { - /* 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. - 2. Monitors are created when security plugin is disabled, these will have empty User object. - (`monitor.user.name`, `monitor.user.roles` are empty ) - 3. Monitors are created when security plugin is enabled, these will have an User object. */ - header: 'Last updated by', - value: monitor.user && monitor.user.name ? monitor.user.name : '-', - }, ]; } diff --git a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js index 2bf486470..d9c567dfe 100644 --- a/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js +++ b/public/pages/MonitorDetails/components/MonitorOverview/utils/getOverviewStats.test.js @@ -46,10 +46,6 @@ describe('getOverviewStats', () => { header: 'Monitor version number', value: monitorVersion, }, - { - header: 'Last updated by', - value: monitor.user.name, - }, ]); }); }); 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..90b3fe8f5 100644 --- a/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap +++ b/public/pages/Monitors/containers/Monitors/__snapshots__/Monitors.test.js.snap @@ -43,15 +43,6 @@ exports[`Monitors renders 1`] = ` "truncateText": true, "width": "150px", }, - Object { - "field": "user", - "name": "Last updated by", - "render": [Function], - "sortable": true, - "textOnly": true, - "truncateText": true, - "width": "100px", - }, Object { "field": "latestAlert", "name": "Latest alert", diff --git a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js index c8b92249f..0523e0200 100644 --- a/public/pages/Monitors/containers/Monitors/utils/tableUtils.js +++ b/public/pages/Monitors/containers/Monitors/utils/tableUtils.js @@ -25,22 +25,6 @@ export const columns = [ width: '150px', render: (name, item) => {name}, }, - { - field: 'user', - name: 'Last updated by', - 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. - 2. Monitors are created when security plugin is disabled, these will have empty User object. - (`monitor.user.name`, `monitor.user.roles` are empty ) - 3. Monitors are created when security plugin is enabled, these will have an User object. */ - render: (_, item) => - item.monitor.user && item.monitor.user.name ? item.monitor.user.name : '-', - }, { field: 'latestAlert', name: 'Latest alert',