Skip to content

Commit

Permalink
Fixes management app breadcrumb error (opensearch-project#2344)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Pc <[email protected]>

Signed-off-by: Ashwin Pc <[email protected]>
Signed-off-by: Sergey V. Osipov <[email protected]>
  • Loading branch information
ashwin-pc authored and sipopo committed Dec 16, 2022
1 parent 19b4a96 commit 607ad19
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 607ad19

Please sign in to comment.