avoid passing functions from ngReact (#24460) (#24465)

This commit is contained in:
Nathan Reese 2018-10-24 09:23:13 -06:00 committed by GitHub
parent d7527b2746
commit b33f858c1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 8 deletions

View file

@ -35,7 +35,6 @@ import { recentlyAccessedShape } from './recently_accessed';
import { I18nProvider } from '@kbn/i18n/react';
export function HomeApp({
addBasePath,
directories,
recentlyAccessed,
}) {
@ -47,7 +46,7 @@ export function HomeApp({
const renderTutorialDirectory = (props) => {
return (
<TutorialDirectory
addBasePath={addBasePath}
addBasePath={chrome.addBasePath}
openTab={props.match.params.tab}
isCloudEnabled={isCloudEnabled}
/>
@ -57,7 +56,7 @@ export function HomeApp({
const renderTutorial = (props) => {
return (
<Tutorial
addBasePath={addBasePath}
addBasePath={chrome.addBasePath}
isCloudEnabled={isCloudEnabled}
getTutorial={getTutorial}
replaceTemplateStrings={replaceTemplateStrings}
@ -83,7 +82,7 @@ export function HomeApp({
path="/home/feature_directory"
>
<FeatureDirectory
addBasePath={addBasePath}
addBasePath={chrome.addBasePath}
directories={directories}
/>
</Route>
@ -91,7 +90,7 @@ export function HomeApp({
path="/home"
>
<Home
addBasePath={addBasePath}
addBasePath={chrome.addBasePath}
directories={directories}
apmUiEnabled={apmUiEnabled}
recentlyAccessed={recentlyAccessed}
@ -107,7 +106,6 @@ export function HomeApp({
}
HomeApp.propTypes = {
addBasePath: PropTypes.func.isRequired,
directories: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string.isRequired,
title: PropTypes.string.isRequired,

View file

@ -1,5 +1,4 @@
<home-app
add-base-path="addBasePath"
directories="directories"
recently-accessed="recentlyAccessed"
/>

View file

@ -37,7 +37,6 @@ function getRoute() {
return {
template,
controller($scope, config, indexPatterns, Private) {
$scope.addBasePath = chrome.addBasePath;
$scope.directories = Private(FeatureCatalogueRegistryProvider).inTitleOrder;
$scope.recentlyAccessed = recentlyAccessed.get().map(item => {
item.link = chrome.addBasePath(item.link);