Skip to content

Commit

Permalink
breadcrumbfix for datasource management - refactoring code
Browse files Browse the repository at this point in the history
Signed-off-by: mpabba3003 <[email protected]>
  • Loading branch information
mpabba3003 committed Aug 3, 2022
1 parent b0a745f commit 3093d83
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface DataSourceTableProps {
setBreadcrumbs: (crumbs: ChromeBreadcrumb[]) => void;
}

export const DataSourceTable = ({setBreadcrumbs}: DataSourceTableProps) => {
export const DataSourceTable = ({ setBreadcrumbs }: DataSourceTableProps) => {
useEffect(() => {
setBreadcrumbs([
{
Expand All @@ -29,5 +29,3 @@ export const DataSourceTable = ({setBreadcrumbs}: DataSourceTableProps) => {
</EuiTitle>
);
};

export {DataSourceTable as default}
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import { ManagementAppMountParams } from '../../../management/public';
import { OpenSearchDashboardsContextProvider } from '../../../opensearch_dashboards_react/public';
import { CreateDataSourceWizardWithRouter } from '../components/create_data_source_wizard';
import { DataSourceManagmentContext } from '../types';
import DataSourceTable from '../components/data_source_table/data_source_table';

import { DataSourceTable } from '../components/data_source_table/data_source_table';

export async function mountManagementSection(
getStartServices: StartServicesAccessor,
params: ManagementAppMountParams
) {
const [
{chrome, application, savedObjects, uiSettings, notifications, overlays, http, docLinks }
{ chrome, application, savedObjects, uiSettings, notifications, overlays, http, docLinks },
] = await getStartServices();

const deps: DataSourceManagmentContext = {
Expand All @@ -42,9 +41,8 @@ export async function mountManagementSection(
const title = i18n.translate('dataSourcesManagement.objects.dataSourcesTitle', {
defaultMessage: 'Data Sources',
});

chrome.docTitle.change(title);

chrome.docTitle.change(title);

ReactDOM.render(
<OpenSearchDashboardsContextProvider services={deps}>
Expand All @@ -55,8 +53,7 @@ export async function mountManagementSection(
<CreateDataSourceWizardWithRouter />
</Route>
<Route path={['/']}>
<DataSourceTable
setBreadcrumbs={deps.setBreadcrumbs} />
<DataSourceTable setBreadcrumbs={deps.setBreadcrumbs} />
</Route>
</Switch>
</Router>
Expand Down

0 comments on commit 3093d83

Please sign in to comment.