-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the help text elements displayed when users access the des…
…tinations list page after destinations deprecation. (#413) * Refactored the help text elements displayed when users access the destinations list page after destinations deprecation. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Refactored the help text elements displayed when users access the destinations list page after destinations deprecation. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Updated snapshot. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Updated button text. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Updated snapshot files. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> * Refactored landing page logic. Signed-off-by: AWSHurneyt <hurneyt@amazon.com> Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
- Loading branch information
1 parent
c1520c3
commit 58dee83
Showing
10 changed files
with
802 additions
and
4,009 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...tinations/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = ( | ||
<EuiText> | ||
Destinations will be deprecated going forward. Install the Notifications plugin for a new | ||
centralized place to manage your notification channels. | ||
</EuiText> | ||
); | ||
const noNotificationsButton = ( | ||
<EuiButton | ||
external | ||
fill | ||
href={NOTIFICATIONS_LEARN_MORE_HREF} | ||
target={'_blank'} | ||
iconSide={'right'} | ||
iconType={'popout'} | ||
> | ||
View install instructions | ||
</EuiButton> | ||
); | ||
|
||
const hasNotificationsTitle = 'Destinations have become channels in Notifications'; | ||
const hasNotificationsText = ( | ||
<EuiText> | ||
<p> | ||
Your destinations have been migrated as channels in Notifications, a new centralized place to | ||
manage your notification channels. Destinations will be deprecated going forward. | ||
<EuiLink external href={NOTIFICATIONS_LEARN_MORE_HREF} target={'_blank'}> | ||
Learn more | ||
</EuiLink> | ||
</p> | ||
</EuiText> | ||
); | ||
const hasNotificationsButton = ( | ||
<EuiButton fill href={MANAGE_CHANNELS_PATH}> | ||
View in Notifications | ||
</EuiButton> | ||
); | ||
|
||
const FullPageNotificationsInfoCallOut = ({ hasNotificationPlugin }) => ( | ||
<EuiPanel> | ||
<EuiEmptyPrompt | ||
title={<h2>{hasNotificationPlugin ? hasNotificationsTitle : noNotificationsTitle}</h2>} | ||
body={hasNotificationPlugin ? hasNotificationsText : noNotificationsText} | ||
actions={hasNotificationPlugin ? hasNotificationsButton : noNotificationsButton} | ||
/> | ||
</EuiPanel> | ||
); | ||
|
||
export default FullPageNotificationsInfoCallOut; |
20 changes: 20 additions & 0 deletions
20
...ions/components/FullPageNotificationsInfoCallOut/FullPageNotificationsInfoCallOut.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = <FullPageNotificationsInfoCallOut hasNotificationPlugin={true} />; | ||
expect(render(component)).toMatchSnapshot(); | ||
}); | ||
test('renders when Notifications plugin is not installed', () => { | ||
const component = <FullPageNotificationsInfoCallOut hasNotificationPlugin={false} />; | ||
expect(render(component)).toMatchSnapshot(); | ||
}); | ||
}); |
138 changes: 138 additions & 0 deletions
138
...lPageNotificationsInfoCallOut/__snapshots__/FullPageNotificationsInfoCallOut.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`FullPageNotificationsInfoCallOut renders when Notifications plugin is installed 1`] = ` | ||
<div | ||
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow" | ||
> | ||
<div | ||
class="euiEmptyPrompt" | ||
> | ||
<h2 | ||
class="euiTitle euiTitle--medium" | ||
> | ||
Destinations have become channels in Notifications | ||
</h2> | ||
<span | ||
class="euiTextColor euiTextColor--subdued" | ||
> | ||
<div | ||
class="euiSpacer euiSpacer--m" | ||
/> | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
<p> | ||
Your destinations have been migrated as channels in Notifications, a new centralized place to manage your notification channels. Destinations will be deprecated going forward. | ||
<a | ||
class="euiLink euiLink--primary" | ||
href="https://opensearch.org/docs/monitoring-plugins/alerting/monitors/#questions-about-destinations" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
Learn more | ||
</a> | ||
</p> | ||
<div> | ||
<a | ||
class="euiLink euiLink--primary" | ||
href="https://opensearch.org/docs/monitoring-plugins/alerting/monitors/#questions-about-destinations" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
EuiIconMock | ||
</a> | ||
</div> | ||
<a | ||
class="euiLink euiLink--primary" | ||
href="https://opensearch.org/docs/monitoring-plugins/alerting/monitors/#questions-about-destinations" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
<span | ||
class="euiScreenReaderOnly" | ||
> | ||
(opens in a new tab or window) | ||
</span> | ||
</a> | ||
<p /> | ||
</div> | ||
</div> | ||
</span> | ||
<div | ||
class="euiSpacer euiSpacer--l" | ||
/> | ||
<a | ||
class="euiButton euiButton--primary euiButton--fill" | ||
href="/app/notifications-dashboards#/channels" | ||
rel="noreferrer" | ||
> | ||
<span | ||
class="euiButtonContent euiButton__content" | ||
> | ||
<span | ||
class="euiButton__text" | ||
> | ||
View in Notifications | ||
</span> | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
`; | ||
|
||
exports[`FullPageNotificationsInfoCallOut renders when Notifications plugin is not installed 1`] = ` | ||
<div | ||
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow" | ||
> | ||
<div | ||
class="euiEmptyPrompt" | ||
> | ||
<h2 | ||
class="euiTitle euiTitle--medium" | ||
> | ||
Destinations will become channels in Notifications | ||
</h2> | ||
<span | ||
class="euiTextColor euiTextColor--subdued" | ||
> | ||
<div | ||
class="euiSpacer euiSpacer--m" | ||
/> | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
<div | ||
class="euiText euiText--medium" | ||
> | ||
Destinations will be deprecated going forward. Install the Notifications plugin for a new centralized place to manage your notification channels. | ||
</div> | ||
</div> | ||
</span> | ||
<div | ||
class="euiSpacer euiSpacer--l" | ||
/> | ||
<a | ||
class="euiButton euiButton--primary euiButton--fill" | ||
href="https://opensearch.org/docs/monitoring-plugins/alerting/monitors/#questions-about-destinations" | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
> | ||
<span | ||
class="euiButtonContent euiButtonContent--iconRight euiButton__content" | ||
> | ||
<div> | ||
EuiIconMock | ||
</div> | ||
<span | ||
class="euiButton__text" | ||
> | ||
View install instructions | ||
</span> | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
`; |
8 changes: 8 additions & 0 deletions
8
public/pages/Destinations/components/FullPageNotificationsInfoCallOut/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import FullPageNotificationsInfoCallOut from './FullPageNotificationsInfoCallOut'; | ||
|
||
export default FullPageNotificationsInfoCallOut; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.