Skip to content

Commit

Permalink
Fixes management app breadcrumb error
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Pc <[email protected]>
  • Loading branch information
ashwin-pc committed Sep 13, 2022
1 parent a19a741 commit 62aef0b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { EuiPageContent, EuiSpacer, EuiText, EuiFlexItem, EuiFlexGroup } from '@
import { EuiDescriptionListTitle } from '@elastic/eui';
import { EuiDescriptionListDescription, EuiDescriptionList } from '@elastic/eui';
import { EuiLink } from '@elastic/eui';
import { useMount } from 'react-use';
import { getListBreadcrumbs } from '../../breadcrumbs';
import { IndexPatternCreationOption } from '../../types';
import { CreateButton } from '../../create_button';
Expand All @@ -56,7 +57,9 @@ export const EmptyIndexPatternPrompt = ({
docLinksIndexPatternIntro,
setBreadcrumbs,
}: Props) => {
setBreadcrumbs(getListBreadcrumbs());
useMount(() => {
setBreadcrumbs(getListBreadcrumbs());
});

return (
<EuiPageContent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { FormattedMessage } from '@osd/i18n/react';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import React, { useState, useEffect } from 'react';
import { i18n } from '@osd/i18n';
import { useMount } from 'react-use';
import {
reactRouterNavigate,
useOpenSearchDashboards,
Expand Down Expand Up @@ -111,7 +112,10 @@ export const IndexPatternTable = ({ canSave, history }: Props) => {
const [isLoadingSources, setIsLoadingSources] = useState<boolean>(true);
const [isLoadingIndexPatterns, setIsLoadingIndexPatterns] = useState<boolean>(true);

setBreadcrumbs(getListBreadcrumbs());
useMount(() => {
setBreadcrumbs(getListBreadcrumbs());
});

useEffect(() => {
(async function () {
const options = await indexPatternManagementStart.creation.getIndexPatternCreationOptions(
Expand Down
5 changes: 4 additions & 1 deletion src/plugins/management/public/components/landing/landing.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import { useMount } from 'react-use';

interface ManagementLandingPageProps {
version: string;
setBreadcrumbs: () => void;
}

export const ManagementLandingPage = ({ version, setBreadcrumbs }: ManagementLandingPageProps) => {
setBreadcrumbs();
useMount(() => {
setBreadcrumbs();
});

return (
<EuiPageContent horizontalPosition="center" data-test-subj="managementHome">
Expand Down

0 comments on commit 62aef0b

Please sign in to comment.