Skip to content

Commit

Permalink
[Synthetics] Fix monitor summary page layout (#140492)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Sep 12, 2022
1 parent 2335e1e commit fd424e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useParams } from 'react-router-dom';
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { MonitorSummaryLastRunInfo } from './last_run_info';
import { getMonitorStatusAction, selectMonitorStatus } from '../../state';
import { RunTestManually } from './run_test_manually';

export const MonitorSummaryTitle = () => {
const dispatch = useDispatch();
Expand All @@ -23,9 +24,18 @@ export const MonitorSummaryTitle = () => {
}, [dispatch, monitorId]);

return (
<EuiFlexGroup direction="column" gutterSize="xs">
<EuiFlexItem>{data?.monitor.name}</EuiFlexItem>
<EuiFlexItem grow={false}>{data && <MonitorSummaryLastRunInfo ping={data} />}</EuiFlexItem>
<EuiFlexGroup>
<EuiFlexItem>
<EuiFlexGroup direction="column" gutterSize="xs">
<EuiFlexItem>{data?.monitor.name}</EuiFlexItem>
<EuiFlexItem grow={false}>
{data && <MonitorSummaryLastRunInfo ping={data} />}
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<RunTestManually />
</EuiFlexItem>
</EuiFlexGroup>
);
};
12 changes: 3 additions & 9 deletions x-pack/plugins/synthetics/public/apps/synthetics/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { useInspectorContext } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import { MonitorAddPage } from './components/monitor_add_edit/monitor_add_page';
import { MonitorEditPage } from './components/monitor_add_edit/monitor_edit_page';
import { RunTestManually } from './components/monitor_summary/run_test_manually';
import { MonitorSummaryHeaderContent } from './components/monitor_summary/monitor_summary_header_content';
import { MonitorSummaryTitle } from './components/monitor_summary/monitor_summary_title';
import { MonitorSummaryPage } from './components/monitor_summary/monitor_summary';
Expand Down Expand Up @@ -79,22 +78,17 @@ const getRoutes = (
},
},
{
title: i18n.translate('xpack.synthetics.gettingStartedRoute.title', {
defaultMessage: 'Synthetics Getting Started | {baseTitle}',
title: i18n.translate('xpack.synthetics.monitorSummaryRoute.title', {
defaultMessage: 'Monitor summary | {baseTitle}',
values: { baseTitle },
}),
path: MONITOR_ROUTE,
component: () => <MonitorSummaryPage />,
dataTestSubj: 'syntheticsGettingStartedPage',
pageSectionProps: {
alignment: 'center',
paddingSize: 'none',
},
pageHeader: {
paddingSize: 'none',
children: <MonitorSummaryHeaderContent />,
pageTitle: <MonitorSummaryTitle />,
rightSideItems: [<RunTestManually />],
// rightSideItems: [<RunTestManually />],
},
},
{
Expand Down

0 comments on commit fd424e6

Please sign in to comment.