Skip to content

Commit

Permalink
Move Alerts Flyout to subfolder
Browse files Browse the repository at this point in the history
  • Loading branch information
CoenWarmer committed Mar 17, 2023
1 parent ae8bcda commit 9cb2050
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import React, { ComponentType } from 'react';
import { ALERT_UUID } from '@kbn/rule-data-utils';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { PluginContext, PluginContextValue } from '../context/plugin_context';
import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock';
import { PluginContext, PluginContextValue } from '../../context/plugin_context';
import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock';
import AlertsFlyout from './alerts_flyout';
import { apmAlertResponseExample } from './alerts_flyout.mock';
import { AlertsFlyout } from './alerts_flyout';

interface Args {
alerts: Array<Record<string, unknown>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import React from 'react';
import * as useUiSettingHook from '@kbn/kibana-react-plugin/public/ui_settings/use_ui_setting';
import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock';
import { render } from '../utils/test_helper';
import { AlertsFlyout } from './alerts_flyout';
import type { TopAlert } from '../typings/alerts';
import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock';
import AlertsFlyout from './alerts_flyout';
import { render } from '../../utils/test_helper';
import type { TopAlert } from '../../typings/alerts';

describe('AlertsFlyout', () => {
jest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import { ALERT_UUID } from '@kbn/rule-data-utils';
import { AlertsFlyoutHeader } from './alerts_flyout_header';
import { AlertsFlyoutBody } from './alerts_flyout_body';
import { AlertsFlyoutFooter } from './alerts_flyout_footer';
import { parseAlert } from '../pages/alerts/helpers/parse_alert';
import type { ObservabilityRuleTypeRegistry } from '../rules/create_observability_rule_type_registry';
import type { TopAlert } from '../typings/alerts';
import { parseAlert } from '../../pages/alerts/helpers/parse_alert';
import type { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry';
import type { TopAlert } from '../../typings/alerts';

type AlertsFlyoutProps = {
alert?: TopAlert;
Expand All @@ -24,7 +24,7 @@ type AlertsFlyoutProps = {
selectedAlertId?: string;
} & EuiFlyoutProps;

export function AlertsFlyout({
function AlertsFlyout({
alert,
alerts,
isInApp = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
* 2.0.
*/
import React from 'react';
import { render } from '../utils/test_helper';
import { render } from '../../utils/test_helper';
import * as useUiSettingHook from '@kbn/kibana-react-plugin/public/ui_settings/use_ui_setting';
import { createObservabilityRuleTypeRegistryMock } from '../rules/observability_rule_type_registry_mock';
import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock';
import { AlertsFlyoutBody } from './alerts_flyout_body';
import { inventoryThresholdAlert } from '../rules/fixtures/example_alerts';
import { parseAlert } from '../pages/alerts/helpers/parse_alert';
import { RULE_DETAILS_PAGE_ID } from '../pages/rule_details/rule_details';
import { inventoryThresholdAlert } from '../../rules/fixtures/example_alerts';
import { parseAlert } from '../../pages/alerts/helpers/parse_alert';
import { RULE_DETAILS_PAGE_ID } from '../../pages/rule_details/rule_details';

describe('AlertsFlyoutBody', () => {
jest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ import {
import { AlertLifecycleStatusBadge } from '@kbn/alerts-ui-shared';
import moment from 'moment-timezone';
import { useUiSetting } from '@kbn/kibana-react-plugin/public';
import { useKibana } from '../utils/kibana_react';
import { asDuration } from '../../common/utils/formatters';
import { paths } from '../config/paths';
import { translations } from '../config/translations';
import { formatAlertEvaluationValue } from '../utils/format_alert_evaluation_value';
import { RULE_DETAILS_PAGE_ID } from '../pages/rule_details/rule_details';
import type { TopAlert } from '../typings/alerts';
import { useKibana } from '../../utils/kibana_react';
import { asDuration } from '../../../common/utils/formatters';
import { paths } from '../../config/paths';
import { translations } from '../../config/translations';
import { formatAlertEvaluationValue } from '../../utils/format_alert_evaluation_value';
import { RULE_DETAILS_PAGE_ID } from '../../pages/rule_details/rule_details';
import type { TopAlert } from '../../typings/alerts';

interface FlyoutProps {
alert: TopAlert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/
import React from 'react';
import { EuiFlyoutFooter, EuiFlexGroup, EuiFlexItem, EuiButton } from '@elastic/eui';
import { useKibana } from '../utils/kibana_react';
import { usePluginContext } from '../hooks/use_plugin_context';
import { isAlertDetailsEnabledPerApp } from '../utils/is_alert_details_enabled';
import { translations } from '../config/translations';
import { paths } from '../config/paths';
import type { TopAlert } from '../typings/alerts';
import { useKibana } from '../../utils/kibana_react';
import { usePluginContext } from '../../hooks/use_plugin_context';
import { isAlertDetailsEnabledPerApp } from '../../utils/is_alert_details_enabled';
import { translations } from '../../config/translations';
import { paths } from '../../config/paths';
import type { TopAlert } from '../../typings/alerts';

interface FlyoutProps {
alert: TopAlert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import React from 'react';
import { ALERT_RULE_NAME } from '@kbn/rule-data-utils';
import { EuiSpacer, EuiTitle } from '@elastic/eui';
import type { TopAlert } from '../typings/alerts';
import type { TopAlert } from '../../typings/alerts';

interface FlyoutProps {
alert: TopAlert;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
import React, { useCallback, useMemo } from 'react';
import { AlertsTableFlyoutBaseProps } from '@kbn/triggers-actions-ui-plugin/public';

import type { ObservabilityRuleTypeRegistry } from '../rules/create_observability_rule_type_registry';
import { AlertsFlyoutHeader } from './alerts_flyout_header';
import { AlertsFlyoutBody } from './alerts_flyout_body';
import { AlertsFlyoutFooter } from './alerts_flyout_footer';
import { parseAlert } from '../pages/alerts/helpers/parse_alert';

export { AlertsFlyout } from './alerts_flyout';
import { parseAlert } from '../../pages/alerts/helpers/parse_alert';
import type { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry';

export const useGetAlertFlyoutComponents = (
observabilityRuleTypeRegistry: ObservabilityRuleTypeRegistry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
AlertActions,
Props as AlertActionsProps,
} from '../../pages/alerts/components/alert_actions';
import { useGetAlertFlyoutComponents } from '../use_get_alert_flyout_components';
import { useGetAlertFlyoutComponents } from '../alerts_flyout/use_get_alert_flyout_components';
import type { ObservabilityRuleTypeRegistry } from '../../rules/create_observability_rule_type_registry';
import type { ConfigSchema } from '../../plugin';
import type { TopAlert } from '../../typings/alerts';
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/observability/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export {
METRIC_TYPE,
} from './hooks/use_track_metric';

export const LazyAlertsFlyout = lazy(() => import('./components/alerts_flyout'));
export const LazyAlertsFlyout = lazy(() => import('./components/alerts_flyout/alerts_flyout'));
export { useFetcher, FETCH_STATUS } from './hooks/use_fetcher';
export { useEsSearch, createEsParams } from './hooks/use_es_search';

Expand Down

0 comments on commit 9cb2050

Please sign in to comment.