Skip to content
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

Added troubleshooting link to toast #3946

Merged
merged 3 commits into from
Apr 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Added 3 new panels to `Vulnerabilities/Inventory` [#3893](https://github.com/wazuh/wazuh-kibana-app/pull/3893)
- Added new fields of `Vulnerabilities` to the details flyout [#3893](https://github.com/wazuh/wazuh-kibana-app/pull/3893) [#3908](https://github.com/wazuh/wazuh-kibana-app/pull/3908)
- Added missing fields used in visualizations to the known fiels related to alerts [#3924](https://github.com/wazuh/wazuh-kibana-app/pull/3924)
- Added troubleshooting link to "index pattern was refreshed" toast [#3946](https://github.com/wazuh/wazuh-kibana-app/pull/3946)

### Changed

Expand Down
18 changes: 18 additions & 0 deletions public/components/visualize/wz-visualize.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ export const WzVisualize = compose(
};
reloadToast = () => {
const toastLifeTimeMs = 300000;
const [mayor, minor] = localStorage.getItem('appInfo') ?
JSON.parse(localStorage.getItem('appInfo'))['app-version'].split('.')
: ['current'];
const wazuhVersion = minor ? `${mayor}.${minor}` : mayor;
const urlTroubleShootingDocs = `https://documentation.wazuh.com/${wazuhVersion}/user-manual/kibana-app/troubleshooting.html#no-template-found-for-the-selected-index-pattern`;
asteriscos marked this conversation as resolved.
Show resolved Hide resolved
if(satisfyPluginPlatformVersion('<7.11')){
getToasts().add({
color: 'success',
Expand All @@ -167,6 +172,13 @@ export const WzVisualize = compose(
<EuiFlexItem grow={false}>
There were some unknown fields for the current index pattern.
You need to refresh the page to apply the changes.
<a
title="More information in Wazuh documentation"
href={urlTroubleShootingDocs}
target="documentation"
>
Troubleshooting
</a>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={() => window.location.reload()} size="s">Reload page</EuiButton>
Expand All @@ -182,6 +194,12 @@ export const WzVisualize = compose(
<EuiFlexItem grow={false}>
There are some unknown fields for the current index pattern.
You need to refresh the page to update the fields.
<a
title="More information in Wazuh documentation"
href={urlTroubleShootingDocs}
target="documentation">
Troubleshooting
</a>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton onClick={() => window.location.reload()} size="s">Reload page</EuiButton>
Expand Down