-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uptime] Add callout for synthetics UI #79563
Merged
justinkambic
merged 10 commits into
elastic:master
from
justinkambic:uptime_callout-synthetics
Oct 7, 2020
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
bc78f67
Add callout for synthetics UI.
justinkambic 26b1c47
Merge branch 'master' into uptime_callout-synthetics
kibanamachine 0d4f0c3
Refresh outdated test snapshots.
justinkambic 9b3bd6d
Test synthetics callout component.
justinkambic 3d0a2ca
Merge branch 'uptime_callout-synthetics' of github.com:justinkambic/k…
justinkambic b0d5919
Merge branch 'master' into uptime_callout-synthetics
justinkambic 5bb5372
Update callout copy.
justinkambic 6e93592
Update URL for announcement link.
justinkambic 4417839
Update test snapshots.
justinkambic eabe044
Merge branch 'master' into uptime_callout-synthetics
kibanamachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
x-pack/plugins/uptime/public/components/overview/synthetics_callout.tsx
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,60 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { EuiButton, EuiCallOut, EuiSpacer } from '@elastic/eui'; | ||
import React, { useState } from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
|
||
const SYNTHETICS_CALLOUT_LS_KEY = 'xpack.uptime.syntheticsCallout.display'; | ||
const shouldShowSyntheticsCallout = () => { | ||
let value = localStorage.getItem(SYNTHETICS_CALLOUT_LS_KEY); | ||
if (value === null) { | ||
localStorage.setItem(SYNTHETICS_CALLOUT_LS_KEY, 'true'); | ||
value = 'true'; | ||
} | ||
return value === 'true'; | ||
}; | ||
const hideSyntheticsCallout = () => localStorage.setItem(SYNTHETICS_CALLOUT_LS_KEY, 'false'); | ||
|
||
export const SyntheticsCallout = () => { | ||
const [shouldShow, setShouldShow] = useState<boolean>(shouldShowSyntheticsCallout()); | ||
if (!shouldShow) { | ||
return null; | ||
} | ||
return ( | ||
<> | ||
<EuiCallOut | ||
title={i18n.translate('xpack.uptime.overview.pageHeader.syntheticsCallout.title', { | ||
defaultMessage: 'Elastic Synthetics', | ||
})} | ||
iconType="beaker" | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="xpack.uptime.overview.pageHeader.syntheticsCallout.content" | ||
defaultMessage="Elastic Uptime now supports synthetic browser monitors! Learn how to use them {here}." | ||
values={{ here: <a href="https://elastic.co/synthetics">here</a> }} | ||
/> | ||
</p> | ||
<EuiButton | ||
onClick={() => { | ||
if (shouldShow) { | ||
hideSyntheticsCallout(); | ||
setShouldShow(false); | ||
} | ||
}} | ||
> | ||
<FormattedMessage | ||
id="xpack.uptime.overview.pageHeader.syntheticsCallout.dismissButtonText" | ||
defaultMessage="Dismiss" | ||
/> | ||
</EuiButton> | ||
</EuiCallOut> | ||
<EuiSpacer size="s" /> | ||
</> | ||
); | ||
}; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewpost thoughts on this copy? and the URL below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I make a small design suggestion for the callout layout? I would like to suggest that we make the link to the synthetics elastic.co page the primary link and allow for users to dismiss the callout as a secondary option. I don't think the small inline link is going to be clicked, thereby making the dismiss option the most common action. Perhaps something like this? I'm sure that we can beef up the copy as well of this announcement 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewvc "Uptime is now previewing support for scripted multi-step availability checks. This means you can interact with elements of a webpage and check the availability of an entire journey (such as making a purchase or signing into a system) instead of just a simple single page up/down check. Please click below to read more and, if you'd like to be one of the first to use these capabilities, you can download our preview synthetics agent and view your synthetic checks in Uptime"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewvc https://www.elastic.co/what-is/synthetic-monitoring That's the link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drewpost URL updated in 6e93592.