Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions src/legacy/core_plugins/kibana/public/home/components/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Home extends Component {
const showTelemetryDisclaimer = getServices().getInjected(
'telemetryNotifyUserAboutOptInDefault'
);

const currentOptInStatus = this.props.getOptInStatus();
this.state = {
// If welcome is enabled, we wait for loading to complete
// before rendering. This prevents an annoying flickering
Expand All @@ -64,6 +64,7 @@ export class Home extends Component {
isNewKibanaInstance: false,
isWelcomeEnabled,
showTelemetryDisclaimer,
currentOptInStatus,
};
}

Expand Down Expand Up @@ -222,14 +223,13 @@ export class Home extends Component {
renderLoading() {
return '';
}

renderWelcome() {
return (
<Welcome
onSkip={this.skipWelcome}
urlBasePath={this.props.urlBasePath}
showTelemetryDisclaimer={this.state.showTelemetryDisclaimer}
onOptInSeen={this.props.onOptInSeen}
currentOptInStatus={this.state.currentOptInStatus}
/>
);
}
Expand Down Expand Up @@ -269,4 +269,5 @@ Home.propTypes = {
urlBasePath: PropTypes.string.isRequired,
mlEnabled: PropTypes.bool.isRequired,
onOptInSeen: PropTypes.func.isRequired,
getOptInStatus: PropTypes.func.isRequired,
};
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ describe('home', () => {
setItem: sinon.mock(),
},
urlBasePath: 'goober',
onOptInSeen() {
return false;
},
getOptInStatus: jest.fn(),
};
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ import { getTutorial } from '../load_tutorials';
import { replaceTemplateStrings } from './tutorial/replace_template_strings';
import { getServices } from '../kibana_services';
import { npSetup } from 'ui/new_platform';

export function HomeApp({ directories }) {
const {
getInjected,
savedObjectsClient,
getBasePath,
addBasePath,
telemetryOptInProvider: { setOptInNoticeSeen },
telemetryOptInProvider: { setOptInNoticeSeen, getOptIn },
} = getServices();
const { cloud } = npSetup.plugins;
const isCloudEnabled = !!(cloud && cloud.isCloudEnabled);
Expand Down Expand Up @@ -87,6 +86,7 @@ export function HomeApp({ directories }) {
localStorage={localStorage}
urlBasePath={getBasePath()}
onOptInSeen={setOptInNoticeSeen}
getOptInStatus={getOptIn}
/>
</Route>
<Route path="/home">
Expand Down
Loading