Skip to content

Commit

Permalink
Fix icon path in tutorial introduction (elastic#49684)
Browse files Browse the repository at this point in the history
Some icons are included as SVG files with relative paths to their
location. Add the base path so these files are correctly displayed when
Kibana is not running from the root path.
  • Loading branch information
jsoriano authored and jkelastic committed Jan 17, 2020
1 parent 64b3f50 commit 0898ebc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ class TutorialUi extends React.Component {
);
}

let icon = this.state.tutorial.euiIconType;
if (icon && icon.includes('/')) {
icon = this.props.addBasePath(icon);
}

const instructions = this.getInstructions();
content = (
<div>
Expand All @@ -371,7 +376,7 @@ class TutorialUi extends React.Component {
description={this.props.replaceTemplateStrings(this.state.tutorial.longDescription)}
previewUrl={previewUrl}
exportedFieldsUrl={exportedFieldsUrl}
iconType={this.state.tutorial.euiIconType}
iconType={icon}
isBeta={this.state.tutorial.isBeta}
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TutorialDirectoryUi extends React.Component {
let tutorialCards = tutorialConfigs.map(tutorialConfig => {
// add base path to SVG based icons
let icon = tutorialConfig.euiIconType;
if (icon != null && icon.includes('/')) {
if (icon && icon.includes('/')) {
icon = this.props.addBasePath(icon);
}

Expand Down

0 comments on commit 0898ebc

Please sign in to comment.