From d93439d54ed3f7c096241670030409503b1fbbca Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 15:37:25 -0800 Subject: [PATCH 1/6] Refactored the help text elements displayed when users access the destinations list page after destinations deprecation. Signed-off-by: AWSHurneyt --- .../EmptyDestinations/EmptyDestinations.js | 34 +- .../FullPageNotificationsInfoCallOut.js | 59 + .../FullPageNotificationsInfoCallOut.test.js | 20 + ...lPageNotificationsInfoCallOut.test.js.snap | 138 + .../FullPageNotificationsInfoCallOut/index.js | 8 + .../NotificationsInfoCallOut.js | 60 +- .../NotificationsInfoCallOut.test.js.snap | 66 +- .../DestinationsList/DestinationsList.js | 180 +- .../DestinationsList.test.js.snap | 6746 +++++++++-------- public/pages/Destinations/utils/constants.js | 3 + 10 files changed, 3919 insertions(+), 3395 deletions(-) create mode 100644 public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.js create mode 100644 public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.test.js create mode 100644 public/pages/Destinations/components/FullPageNotificationsInfoCallOut/__snapshots__/FullPageNotificationsInfoCallOut.test.js.snap create mode 100644 public/pages/Destinations/components/FullPageNotificationsInfoCallOut/index.js diff --git a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js index 0b6b4de9a..47d5388a4 100644 --- a/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js +++ b/public/pages/Destinations/components/DestinationsList/EmptyDestinations/EmptyDestinations.js @@ -5,11 +5,29 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { EuiButton, EuiEmptyPrompt, EuiText } from '@elastic/eui'; +import { EuiButton, EuiEmptyPrompt, EuiLink, EuiText } from '@elastic/eui'; +import { MANAGE_CHANNELS_PATH } from '../../../../CreateTrigger/utils/constants'; -const filterText = - 'There are no destinations matching your applied filters. Reset your filters to view all destinations.'; -const emptyText = 'There are no existing destinations.'; +const filterText = (hasNotificationPlugin) => + hasNotificationPlugin ? ( + <> +

+ There are no destinations matching your applied filters. Reset your filters to view all + destinations. +

+

+ Migrated destinations can be found in  + {Notifications} +

+ + ) : ( +

+ There are no destinations matching your applied filters. Reset your filters to view all + destinations. +

+ ); + +const emptyText =

There are no existing destinations.

; const resetFiltersButton = (resetFilters) => ( @@ -22,14 +40,10 @@ const propTypes = { onResetFilters: PropTypes.func.isRequired, }; -const EmptyDestinations = ({ isFilterApplied, onResetFilters }) => ( +const EmptyDestinations = ({ hasNotificationPlugin, isFilterApplied, onResetFilters }) => ( -

{isFilterApplied ? filterText : emptyText}

- - } + body={{isFilterApplied ? filterText(hasNotificationPlugin) : emptyText}} actions={isFilterApplied ? resetFiltersButton(onResetFilters) : undefined} /> ); diff --git a/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.js b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.js new file mode 100644 index 000000000..c3f41f9fc --- /dev/null +++ b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.js @@ -0,0 +1,59 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { EuiButton, EuiEmptyPrompt, EuiLink, EuiPanel, EuiText } from '@elastic/eui'; +import { MANAGE_CHANNELS_PATH } from '../../../CreateTrigger/utils/constants'; +import { NOTIFICATIONS_LEARN_MORE_HREF } from '../../utils/constants'; + +const noNotificationsTitle = 'Destinations will become channels in Notifications'; +const noNotificationsText = ( + + Destinations will be deprecated going forward. Install the Notifications plugin for a new + centralized place to manage your notification channels. + +); +const noNotificationsButton = ( + + View install instructions + +); + +const hasNotificationsTitle = 'Destinations have become channels in Notifications'; +const hasNotificationsText = ( + +

+ Your destinations have been migrated as channels in Notifications, a new centralized place to + manage your notification channels. Destinations will be deprecated going forward.  + + Learn more + +

+
+); +const hasNotificationsButton = ( + + View in Notifications + +); + +const FullPageNotificationsInfoCallOut = ({ hasNotificationPlugin }) => ( + + {hasNotificationPlugin ? hasNotificationsTitle : noNotificationsTitle}} + body={hasNotificationPlugin ? hasNotificationsText : noNotificationsText} + actions={hasNotificationPlugin ? hasNotificationsButton : noNotificationsButton} + /> + +); + +export default FullPageNotificationsInfoCallOut; diff --git a/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.test.js b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.test.js new file mode 100644 index 000000000..9b4562d50 --- /dev/null +++ b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.test.js @@ -0,0 +1,20 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import React from 'react'; +import { render } from 'enzyme'; + +import FullPageNotificationsInfoCallOut from './FullPageNotificationsInfoCallOut'; + +describe('FullPageNotificationsInfoCallOut', () => { + test('renders when Notifications plugin is installed', () => { + const component = ; + expect(render(component)).toMatchSnapshot(); + }); + test('renders when Notifications plugin is not installed', () => { + const component = ; + expect(render(component)).toMatchSnapshot(); + }); +}); diff --git a/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/__snapshots__/FullPageNotificationsInfoCallOut.test.js.snap b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/__snapshots__/FullPageNotificationsInfoCallOut.test.js.snap new file mode 100644 index 000000000..188b52294 --- /dev/null +++ b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/__snapshots__/FullPageNotificationsInfoCallOut.test.js.snap @@ -0,0 +1,138 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`FullPageNotificationsInfoCallOut renders when Notifications plugin is installed 1`] = ` +
+
+

+ Destinations have become channels in Notifications +

+ +
+
+
+

+ Your destinations have been migrated as channels in Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward.  + + Learn more + +

+ + + + (opens in a new tab or window) + + +

+

+
+ + +
+`; + +exports[`FullPageNotificationsInfoCallOut renders when Notifications plugin is not installed 1`] = ` +
+
+

+ Destinations will become channels in Notifications +

+ +
+
+
+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. +
+
+ + +
+`; diff --git a/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/index.js b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/index.js new file mode 100644 index 000000000..fb7c78790 --- /dev/null +++ b/public/pages/Destinations/components/FullPageNotificationsInfoCallOut/index.js @@ -0,0 +1,8 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import FullPageNotificationsInfoCallOut from './FullPageNotificationsInfoCallOut'; + +export default FullPageNotificationsInfoCallOut; diff --git a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js index 78091dc7d..86a5134fe 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js @@ -4,24 +4,62 @@ */ import React from 'react'; -import { EuiCallOut, EuiButton, EuiSpacer } from '@elastic/eui'; +import { EuiCallOut, EuiButton, EuiLink, EuiSpacer } from '@elastic/eui'; import { MANAGE_CHANNELS_PATH } from '../../../CreateTrigger/utils/constants'; +import { NOTIFICATIONS_LEARN_MORE_HREF } from '../../utils/constants'; + +const noNotificationsTitle = 'Unable to send notifications. Notifications plugin is required.'; +const noNotificationsBodyText = ( + <> +

+ Destinations will be deprecated going forward. Install the Notifications plugin for a new + centralized place to manage your notification channels. +

+

+ Existing destinations will be automatically migrated once Notifications plugin is installed. +

+ +); +const noNotificationsButton = ( + + View install instructions + +); + +const hasNotificationsTitle = 'Destinations have become channels in Notifications.'; +const hasNotificationsBodyText = ( +

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

+); +const hasNotificationsButton = ( + View Notifications +); 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 ? hasNotificationsBodyText : noNotificationsBodyText} + + {hasNotificationPlugin ? hasNotificationsButton : noNotificationsButton} - +
); }; 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..469fb7915 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap @@ -21,8 +21,39 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is installed class="euiTextColor euiTextColor--default" >

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

+ + + + (opens in a new tab or window) + + +

@@ -41,7 +72,6 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is installed -

@@ -54,15 +84,18 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is installed exports[`NotificationsInfoCallOut renders when Notifications plugin is not installed 1`] = `
+
+ EuiIconMock +
- Destinations have become channels in Notifications. + Unable to send notifications. Notifications plugin is required.

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

+

+ Existing destinations will be automatically migrated once Notifications plugin is installed.

diff --git a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js index f27b76179..9defd102f 100644 --- a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js +++ b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js @@ -5,7 +5,14 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { EuiBasicTable, EuiHorizontalRule, EuiCallOut } from '@elastic/eui'; +import { + EuiBasicTable, + EuiCallOut, + EuiHorizontalRule, + EuiSpacer, + EuiText, + EuiTitle, +} from '@elastic/eui'; import queryString from 'query-string'; import _ from 'lodash'; import ContentPanel from '../../../../components/ContentPanel'; @@ -26,7 +33,7 @@ import { getAllowList } from '../../utils/helpers'; import { DESTINATION_TYPE } from '../../utils/constants'; import { backendErrorNotification } from '../../../../utils/helpers'; import NotificationsInfoCallOut from '../../components/NotificationsInfoCallOut'; -import NotificationsCallOut from '../../../CreateTrigger/components/NotificationsCallOut'; +import FullPageNotificationsInfoCallOut from '../../components/FullPageNotificationsInfoCallOut'; class DestinationsList extends React.Component { constructor(props) { @@ -279,6 +286,7 @@ class DestinationsList extends React.Component { render() { const { httpClient, notifications } = this.props; const { + destinations, destinationToDelete, page, queryParams: { size, search, type, sortDirection, sortField }, @@ -310,80 +318,106 @@ class DestinationsList extends React.Component { color="danger" /> ) : null} - - {!hasNotificationPlugin && } - { - this.setState({ showManageSenders: true }); - }} - onClickManageEmailGroups={() => { - this.setState({ showManageEmailGroups: true }); - }} - /> - } - > - { - this.setState({ showDeleteConfirmation: false }); - }} - onConfirm={this.handleDeleteDestination} - /> - + {destinations.length > 0 ? ( + + ) : ( +
+ +

Destinations (deprecated)

+
+ + + + +

Destinations pending for migration

+
+ {hasNotificationPlugin ? ( + + Destinations that are pending migration will continue to work. + + ) : null} +
+ } + actions={ + { + this.setState({ showManageSenders: true }); + }} + onClickManageEmailGroups={() => { + this.setState({ showManageEmailGroups: true }); + }} + /> + } + > + { + this.setState({ showDeleteConfirmation: false }); + }} + onConfirm={this.handleDeleteDestination} + /> - + - - - - ) - } - onChange={this.handlePageChange} - sorting={sorting} - /> -
+ + + + + + ) + } + onChange={this.handlePageChange} + sorting={sorting} + /> + +
+ )} ); } 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..6f00b4478 100644 --- a/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap +++ b/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap @@ -47,41 +47,75 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` } } > - -
- + +

-
+ + +
+ + +
+
- - Destinations have become channels in Notifications. - -
-
-
+ +
+ -

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

+

+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. +

+

+ Existing destinations will be automatically migrated once Notifications plugin is installed. +

@@ -89,133 +123,117 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` className="euiSpacer euiSpacer--l" /> -

-
-
-
-
-
- - -
- -
-
- -
- -
-
- - - Notifications plugin is not installed - -
- -
- -
-

- Install the notifications plugin in order to create and select channels to send out notifications. - - - - Learn more - -

- - - - . -

-
-
-
-
-
-
- -
+ + +
+ EuiIconMock +
+
+ + View install instructions + +
+ + + + +
+ +
+ +
+ + +
+ +
+ + -
-
- - - } - bodyStyles={ - Object { - "padding": "initial", } - } - title="Destinations (deprecated)" - > - + +

+ Destinations pending for migration +

+
+

+ } > -
- -
- -
- + +
-

- Destinations (deprecated) -

- -
-
- -
+
+ +

+ Destinations pending for migration +

+
+
+ + +
+
+ - -
- -
- + +
- -
- -
- - Actions - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="destinationActionsPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" +
+ +
-
-
+ - + } + closePopover={[Function]} + display="inlineBlock" + hasArrow={true} + id="destinationActionsPopover" + isOpen={false} + ownFocus={true} + panelPaddingSize="none" + > +
+
+ - - - + + + + +
-
- -
- -
- - -
- -
- -
- -
- - -
+
+
+
+ + +
+
+
+ +
+ +
+ + - -
- -
-
- -
-
-
- - - - - -
+
+ +
+ + +
+
+
+ + + + + - -
- + +
- -
- - - - -
- + + + +
- - - - -
-
+ + +
+
+
+
-
- -
-
-
- -
+ +
+
+ - - -
- - - All type - - - - - - - - + All type + + + + + + + + -
- - - - - -
-
+ + + +
+ +
-
- - -
- - -
+ +
+
+ - - - -
- -
- - - -
-
- + + + + + + + +
+
+ + } + onChange={[Function]} + pagination={ Object { - "actions": Array [ - Object { - "description": "View this destination.", - "name": "View", - "onClick": [Function], - }, + "pageIndex": 0, + "pageSize": 20, + "pageSizeOptions": Array [ + 5, + 10, + 20, + 50, ], - "name": "Actions", - "width": "35px", - }, - ] - } - hasActions={true} - isSelectable={true} - items={Array []} - noItemsMessage={ - - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, + "totalItemCount": 0, + } } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, + responsive={true} + sorting={ + Object { + "sort": Object { + "direction": "desc", + "field": "name", + }, + } } - } - tableLayout="fixed" - > -
-
- -
- +
+ +
-
- -
- - -
- + + +
-
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" +
-
-
+ - - + + + +
-
-
-
- -
-
-
- -
- - - + + + + + + + + + - - - - - - - - + + + + + - - - - - + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - -
- -
+ +
+ +
+ Destination name + + + + +
+ EuiIconMock +
+
+ + + +
+ Destination type + + + + + + + + + - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } + -
+

+ There are no existing destinations. +

+ + } style={ Object { "maxWidth": "45em", } } > - - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+ +
+

+ There are no existing destinations. +

+
+
+
+
+
+ +
+ + + +
+ + + + + + + + +
-
- + +
- - - + + + `; @@ -1521,41 +1573,75 @@ exports[`DestinationsList renders when Notification plugin is not installed 1`] } } > - -
- + +

-
+ + +
+ + +
+
- - Destinations have become channels in Notifications. - -
-
-
+ +
+ -

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

+

+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. +

+

+ Existing destinations will be automatically migrated once Notifications plugin is installed. +

@@ -1563,133 +1649,117 @@ exports[`DestinationsList renders when Notification plugin is not installed 1`] className="euiSpacer euiSpacer--l" /> -

-
-
-
-
-
- - -
- -
-
- -
- -
-
- - - Notifications plugin is not installed - -
- -
- -
-

- Install the notifications plugin in order to create and select channels to send out notifications. - - - - Learn more - -

- - - - . -

-
-
-
-
-
-
- -
+ + +
+ EuiIconMock +
+
+ + View install instructions + +
+ + + + +
+ +
+ +
+ + +
+ +
+ + -
-
- - - } - bodyStyles={ - Object { - "padding": "initial", } - } - title="Destinations (deprecated)" - > - + +

+ Destinations pending for migration +

+
+

+ } > -
- -
- -
- + +
-

- Destinations (deprecated) -

- -
-
- -
+
+ +

+ Destinations pending for migration +

+
+
+ + +
+
+ - -
- -
- + +
- -
- - -
- -
- -
-
-
-
- -
+
+ + +
+ +
+ +
+
+
+
+ - -
- -
-
- -
-
-
- - - - - -
+
+ +
+ + +
+
+
+ + + + + - -
- + +
- -
- - - - -
- + + + +
- - - - -
-
+ + +
+
+
+
-
- -
-
-
- -
+ +
+
+ - - -
- - - All type - - - - + All type + + + + -
- - - - - -
-
+ + + +
+ +
-
- - -
- - -
+ +
+
+ - - - -
- - - - - -
-
- + + + + + + + +
+
+ + } + onChange={[Function]} + pagination={ Object { - "actions": Array [ - Object { - "description": "View this destination.", - "name": "View", - "onClick": [Function], - }, + "pageIndex": 0, + "pageSize": 20, + "pageSizeOptions": Array [ + 5, + 10, + 20, + 50, ], - "name": "Actions", - "width": "35px", - }, - ] - } - hasActions={true} - isSelectable={true} - items={Array []} - noItemsMessage={ - - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, + "totalItemCount": 0, + } } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, + responsive={true} + sorting={ + Object { + "sort": Object { + "direction": "desc", + "field": "name", + }, + } } - } - tableLayout="fixed" - > -
-
- -
- +
+ +
-
- -
- - -
- + + +
-
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" +
-
-
+ - - + + + +
-
-
-
- -
-
-
- -
- - - + + + + + + + + + - - - - - - - - + + + + + - - - - - + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - -
- -
+ +
+ +
+ Destination name + + + + +
+ EuiIconMock +
+
+ + + +
+ Destination type + + + + + + + + + - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } + -
+

+ There are no existing destinations. +

+ + } style={ Object { "maxWidth": "45em", } } > - - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+ +
+

+ There are no existing destinations. +

+
+
+
+
+
+ +
+ + + +
+ + + + + + + + +
-
- + +
- - - + + + `; @@ -2853,41 +2957,75 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` } } > - -
- + +

-
+ + +
+ + +
+
- - Destinations have become channels in Notifications. - -
-
-
+ +
+ -

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

+

+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. +

+

+ Existing destinations will be automatically migrated once Notifications plugin is installed. +

@@ -2895,867 +3033,857 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` className="euiSpacer euiSpacer--l" /> -

-
-
-
-
-
- - -
- -
-
- -
- -
-
- - - Notifications plugin is not installed - -
- -
- -
-

- Install the notifications plugin in order to create and select channels to send out notifications. - - - - Learn more - -

- - - - . -

-
-
-
-
-
-
- -
+ + +
+ EuiIconMock +
+
+ + View install instructions + +
+ + + + +
+ +
+ +
+ + +
+ +
+ + -
-
- - - } - bodyStyles={ - Object { - "padding": "initial", } - } - title="Destinations (deprecated)" - > - -
+ +

+ Destinations pending for migration +

+
+
+ } + > + - -
- -
- + +
-

- Destinations (deprecated) -

- -
-
- -
+
+ +

+ Destinations pending for migration +

+
+
+

+
+
+ + - -
- -
- + +
- -
- - -
- -
- -
-
-
-
- -
+
+ + +
+ +
+ + +
+ + + - -
- -
-
- -
-
-
- - - - - -
+
+ +
+ + +
+
+
+ + + + + - -
- + +
- -
- - - - -
- + + + +
- - - - -
-
+ + +
+
+
+
-
- -
-
-
- -
+ +
+
+ - - -
- - - All type - - - - - - - + All type + + + + + + + -
- - - - - -
-
+ + + +
+ +
-
- - -
- - -
+ +
+
+ - - - - - - - - - -
-
- + + + + + + + +
+
+ + } + onChange={[Function]} + pagination={ Object { - "actions": Array [ - Object { - "description": "View this destination.", - "name": "View", - "onClick": [Function], - }, + "pageIndex": 0, + "pageSize": 20, + "pageSizeOptions": Array [ + 5, + 10, + 20, + 50, ], - "name": "Actions", - "width": "35px", - }, - ] - } - hasActions={true} - isSelectable={true} - items={Array []} - noItemsMessage={ - - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, + "totalItemCount": 0, + } } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, + responsive={true} + sorting={ + Object { + "sort": Object { + "direction": "desc", + "field": "name", + }, + } } - } - tableLayout="fixed" - > -
-
- -
- +
+ +
-
- -
- - -
- + + +
-
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" +
-
-
+ - - + + + +
-
-
-
- -
-
-
- -
- - - + + + + + + + + + - - - - - - - - + + + + + - - - - - + + - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - -
- -
+ +
+ +
+ Destination name + + + + +
+ EuiIconMock +
+
+ + + +
+ Destination type + + + + + + + + + - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } + -
+

+ There are no existing destinations. +

+ + } style={ Object { "maxWidth": "45em", } } > - - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
+ + +
+ +
+

+ There are no existing destinations. +

+
+
+
+
+
+ +
+ + + +
+ + + + + + + + +
-
- + +
- - - + + + `; diff --git a/public/pages/Destinations/utils/constants.js b/public/pages/Destinations/utils/constants.js index 16d497c49..adef6a9bc 100644 --- a/public/pages/Destinations/utils/constants.js +++ b/public/pages/Destinations/utils/constants.js @@ -18,3 +18,6 @@ export const DESTINATION_OPTIONS = [ ]; export const ALLOW_LIST_SETTING_PATH = 'plugins.alerting.destination.allow_list'; + +export const NOTIFICATIONS_LEARN_MORE_HREF = + 'https://opensearch.org/docs/monitoring-plugins/alerting/monitors/#questions-about-destinations'; From 77295abcfe82fc868911adea05b0089d7f1e1478 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 16:54:25 -0800 Subject: [PATCH 2/6] Refactored the help text elements displayed when users access the destinations list page after destinations deprecation. Signed-off-by: AWSHurneyt --- .../containers/DestinationsList/DestinationsList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js index 9defd102f..8ddd7be40 100644 --- a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js +++ b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js @@ -319,7 +319,7 @@ class DestinationsList extends React.Component { /> ) : null} - {destinations.length > 0 ? ( + {destinations.length === 0 ? ( ) : (
From 1f29c0d40326737ee101c5455f4b2007ef9bf35f Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 17:12:47 -0800 Subject: [PATCH 3/6] Updated snapshot. Signed-off-by: AWSHurneyt --- .../DestinationsList.test.js.snap | 4447 ++--------------- 1 file changed, 357 insertions(+), 4090 deletions(-) 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 6f00b4478..57f722ef9 100644 --- a/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap +++ b/public/pages/Destinations/containers/DestinationsList/__snapshots__/DestinationsList.test.js.snap @@ -47,1482 +47,155 @@ exports[`DestinationsList renders when Notification plugin is installed 1`] = ` } } > -
- -

- Destinations (deprecated) -

-
- + +
- - -
- + + View install instructions + + } + body={ + + Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. + + } + title={ +

+ Destinations will become channels in Notifications +

+ } >
-
- - - Unable to send notifications. Notifications plugin is required. - -
- + + -
-
+ + +
-

- Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. -

-

- Existing destinations will be automatically migrated once Notifications plugin is installed. -

- + - -
-
-
- - -
- -
- - - } - bodyStyles={ - Object { - "padding": "initial", - } - } - title={ -
- -

- Destinations pending for migration -

-
-
- } - > - -
- -
- -
- -

-
- -

- Destinations pending for migration -

-
+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels.
-

-
-
-
- -
- -
- -
- - -
- -
- - Actions - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - id="destinationActionsPopover" - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
+
+
+ + + - -
- -
- - -
-
-
- - - - + + - -
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - - -
-
-
-
-
- -
-
- - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, - } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, - } - } - tableLayout="fixed" - > -
-
- -
- -
- -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - -
-
-
-
-
-
-
+
+ EuiIconMock
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } - > -
- - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- + + + View install instructions + + + + + +
-
- - -
+ +
+
+ `; @@ -1573,1340 +246,155 @@ exports[`DestinationsList renders when Notification plugin is not installed 1`] } } > -
- -

- Destinations (deprecated) -

-
- + +
- - -
- + + View install instructions + + } + body={ + + Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. + + } + title={ +

+ Destinations will become channels in Notifications +

+ } >
-
- - - Unable to send notifications. Notifications plugin is required. - -
- + + -
-
+ + +
-

- Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. -

-

- Existing destinations will be automatically migrated once Notifications plugin is installed. -

- + - -
-
-
- - -
- -
- - - } - bodyStyles={ - Object { - "padding": "initial", - } - } - title={ -
- -

- Destinations pending for migration -

-
-
- } - > - -
- -
- -
- -

-
- -

- Destinations pending for migration -

-
+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels.
-

-
-
-
- -
- -
- -
- - -
- - -
- -
- -
- -
- - -
+
+
+ + + - -
- -
- - -
-
-
- - - - + + - -
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - - -
-
-
-
-
- -
-
- - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, - } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, - } - } - tableLayout="fixed" - > -
-
- -
- -
- -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - -
-
-
-
-
-
-
+
+ EuiIconMock
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } - > -
- - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- + + + View install instructions + + + + + +
-
- - -
+ +
+ + `; @@ -2957,1375 +445,154 @@ exports[`DestinationsList renders when email is disallowed 1`] = ` } } > -
- -

- Destinations (deprecated) -

-
- + +
- - -
- + + View install instructions + + } + body={ + + Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. + + } + title={ +

+ Destinations will become channels in Notifications +

+ } >
-
- - - Unable to send notifications. Notifications plugin is required. - -
- + + -
-
+ + +
-

- Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. -

-

- Existing destinations will be automatically migrated once Notifications plugin is installed. -

- + - -
-
-
- - -
- -
- - - } - bodyStyles={ - Object { - "padding": "initial", - } - } - title={ -
- -

- Destinations pending for migration -

-
-
- } - > - -
- -
- -
- -

-
- -

- Destinations pending for migration -

-
+ Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels.
-

-
-
-
- -
- -
- -
- - -
- - -
- -
- -
- -
- - -
+
+
+ + + - -
- -
- - -
-
-
- - - - + + - -
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - -
-
- - - - -
- - - - - -
-
-
-
-
-
-
-
- -
- - - -
-
-
-
-
- -
-
- - } - onChange={[Function]} - pagination={ - Object { - "pageIndex": 0, - "pageSize": 20, - "pageSizeOptions": Array [ - 5, - 10, - 20, - 50, - ], - "totalItemCount": 0, - } - } - responsive={true} - sorting={ - Object { - "sort": Object { - "direction": "desc", - "field": "name", - }, - } - } - tableLayout="fixed" - > -
-
- -
- -
- -
- - -
- -
- - - - } - closePopover={[Function]} - display="inlineBlock" - hasArrow={true} - isOpen={false} - ownFocus={true} - panelPaddingSize="none" - > -
-
- - - -
-
-
-
-
-
-
+
+ EuiIconMock
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - - - - - - Actions - - - - - -
-
- - - -

- There are no existing destinations. -

- - } - style={ - Object { - "maxWidth": "45em", - } - } - > -
- - - -
- -
-

- There are no existing destinations. -

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- + + + View install instructions + + + + + +
-
- - -
+ +
+ + `; From b208bd3a6848b63fb5e55557b3d9bddd64e6ae49 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 17:47:33 -0800 Subject: [PATCH 4/6] Updated button text. Signed-off-by: AWSHurneyt --- .../NotificationsInfoCallOut/NotificationsInfoCallOut.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js index 86a5134fe..09f606eb6 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/NotificationsInfoCallOut.js @@ -43,7 +43,7 @@ const hasNotificationsBodyText = (

); const hasNotificationsButton = ( - View Notifications + View in Notifications ); const NotificationsInfoCallOut = ({ hasNotificationPlugin }) => { From 4d988e7cc9ae3314f3cf8d6c3222f04e3ddfba0d Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 17:59:47 -0800 Subject: [PATCH 5/6] Updated snapshot files. Signed-off-by: AWSHurneyt --- .../__snapshots__/NotificationsInfoCallOut.test.js.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 469fb7915..c4f250a0f 100644 --- a/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap +++ b/public/pages/Destinations/components/NotificationsInfoCallOut/__snapshots__/NotificationsInfoCallOut.test.js.snap @@ -68,7 +68,7 @@ exports[`NotificationsInfoCallOut renders when Notifications plugin is installed - View Notifications + View in Notifications From 5c57f84ccb4f3c5ebbbc2c8dcfe78375d1e99938 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 8 Dec 2022 19:27:06 -0800 Subject: [PATCH 6/6] Refactored landing page logic. Signed-off-by: AWSHurneyt --- .../containers/DestinationsList/DestinationsList.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js index 8ddd7be40..6669f8d5e 100644 --- a/public/pages/Destinations/containers/DestinationsList/DestinationsList.js +++ b/public/pages/Destinations/containers/DestinationsList/DestinationsList.js @@ -319,9 +319,7 @@ class DestinationsList extends React.Component { /> ) : null} - {destinations.length === 0 ? ( - - ) : ( + {isDestinationLoading || totalDestinations > 0 || isFilterApplied ? (

Destinations (deprecated)

@@ -417,6 +415,8 @@ class DestinationsList extends React.Component { />
+ ) : ( + )} );