-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [TSVB] Document the new index pattern mode * Add a callout to TSVB to advertise the new index pattern mode * Conditionally render the callout, give capability to dismiss it * Fix i18n * Update the notification texts * Update notification text * Change callout storage key * add UseIndexPatternModeCallout component * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Update docs/user/dashboard/tsvb.asciidoc Co-authored-by: Kaarina Tungseth <[email protected]> * Final docs changes * Remove TSVB from title Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Kaarina Tungseth <[email protected]> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Alexey Antonov <[email protected]> Co-authored-by: Kaarina Tungseth <[email protected]>
- Loading branch information
1 parent
133ba92
commit 9fbf449
Showing
5 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
69 changes: 69 additions & 0 deletions
69
...ugins/vis_type_timeseries/public/application/components/use_index_patter_mode_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,69 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React, { useMemo, useCallback } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import useLocalStorage from 'react-use/lib/useLocalStorage'; | ||
import { EuiButton, EuiCallOut, EuiFlexGroup, EuiLink } from '@elastic/eui'; | ||
import { getCoreStart } from '../../services'; | ||
|
||
const LOCAL_STORAGE_KEY = 'TSVB_INDEX_PATTERN_CALLOUT_HIDDEN'; | ||
|
||
export const UseIndexPatternModeCallout = () => { | ||
const [dismissed, setDismissed] = useLocalStorage(LOCAL_STORAGE_KEY, false); | ||
const indexPatternModeLink = useMemo( | ||
() => getCoreStart().docLinks.links.visualize.tsvbIndexPatternMode, | ||
[] | ||
); | ||
|
||
const dismissNotice = useCallback(() => { | ||
setDismissed(true); | ||
}, [setDismissed]); | ||
|
||
if (dismissed) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<EuiCallOut | ||
title={ | ||
<FormattedMessage | ||
id="visTypeTimeseries.visEditorVisualization.indexPatternMode.notificationTitle" | ||
defaultMessage="TSVB now supports index patterns" | ||
/> | ||
} | ||
iconType="cheer" | ||
size="s" | ||
> | ||
<p> | ||
<FormattedMessage | ||
id="visTypeTimeseries.visEditorVisualization.indexPatternMode.notificationMessage" | ||
defaultMessage="Great news! You can now visualize the data from Elasticsearch indices or Kibana index patterns. {indexPatternModeLink}." | ||
values={{ | ||
indexPatternModeLink: ( | ||
<EuiLink href={indexPatternModeLink} target="_blank" external> | ||
<FormattedMessage | ||
id="visTypeTimeseries.visEditorVisualization.indexPatternMode.link" | ||
defaultMessage="Check it out." | ||
/> | ||
</EuiLink> | ||
), | ||
}} | ||
/> | ||
</p> | ||
<EuiFlexGroup gutterSize="none"> | ||
<EuiButton size="s" onClick={dismissNotice}> | ||
<FormattedMessage | ||
id="visTypeTimeseries.visEditorVisualization.indexPatternMode.dismissNoticeButtonText" | ||
defaultMessage="Dismiss" | ||
/> | ||
</EuiButton> | ||
</EuiFlexGroup> | ||
</EuiCallOut> | ||
); | ||
}; |
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