-
- {alertType !== AlertTypes.ANOMALY_BASED_ALERT && (
-
-
Check conditions using data from
-
- {popoverContent}
-
- )}
-
+
+ {popoverContent}
);
}
diff --git a/frontend/src/container/CreateAlertV2/EvaluationSettings/__tests__/EvaluationSettings.test.tsx b/frontend/src/container/CreateAlertV2/EvaluationSettings/__tests__/EvaluationSettings.test.tsx
index 6949faca149d..c3b31f6e5ba8 100644
--- a/frontend/src/container/CreateAlertV2/EvaluationSettings/__tests__/EvaluationSettings.test.tsx
+++ b/frontend/src/container/CreateAlertV2/EvaluationSettings/__tests__/EvaluationSettings.test.tsx
@@ -1,14 +1,11 @@
import { render, screen } from '@testing-library/react';
import * as alertState from 'container/CreateAlertV2/context';
-import * as utils from 'container/CreateAlertV2/utils';
-import { AlertTypes } from 'types/api/alerts/alertTypes';
import EvaluationSettings from '../EvaluationSettings';
import { createMockAlertContextState } from './testUtils';
jest.mock('container/CreateAlertV2/utils', () => ({
...jest.requireActual('container/CreateAlertV2/utils'),
- showCondensedLayout: jest.fn().mockReturnValue(false),
}));
const mockSetEvaluationWindow = jest.fn();
@@ -18,52 +15,14 @@ jest.spyOn(alertState, 'useCreateAlertState').mockReturnValue(
}),
);
-jest.mock('../AdvancedOptions', () => ({
- __esModule: true,
- default: (): JSX.Element => (
-
AdvancedOptions
- ),
-}));
-
-const EVALUATION_SETTINGS_TEXT = 'Evaluation settings';
-const CHECK_CONDITIONS_USING_DATA_FROM_TEXT =
- 'Check conditions using data from';
-
describe('EvaluationSettings', () => {
- it('should render the default evaluation settings layout', () => {
- render(
);
- expect(screen.getByText(EVALUATION_SETTINGS_TEXT)).toBeInTheDocument();
- expect(
- screen.getByText(CHECK_CONDITIONS_USING_DATA_FROM_TEXT),
- ).toBeInTheDocument();
- expect(screen.getByTestId('advanced-options')).toBeInTheDocument();
- });
-
- it('should not render evaluation window for anomaly based alert', () => {
- jest.spyOn(alertState, 'useCreateAlertState').mockReturnValueOnce(
- createMockAlertContextState({
- alertType: AlertTypes.ANOMALY_BASED_ALERT,
- }),
- );
- render(
);
- expect(screen.getByText(EVALUATION_SETTINGS_TEXT)).toBeInTheDocument();
- expect(
- screen.queryByText(CHECK_CONDITIONS_USING_DATA_FROM_TEXT),
- ).not.toBeInTheDocument();
- });
-
it('should render the condensed evaluation settings layout', () => {
- jest.spyOn(utils, 'showCondensedLayout').mockReturnValueOnce(true);
render(
);
- // Header, check conditions using data from and advanced options should be hidden
- expect(screen.queryByText(EVALUATION_SETTINGS_TEXT)).not.toBeInTheDocument();
- expect(
- screen.queryByText(CHECK_CONDITIONS_USING_DATA_FROM_TEXT),
- ).not.toBeInTheDocument();
- expect(screen.queryByTestId('advanced-options')).not.toBeInTheDocument();
- // Only evaluation window popover should be visible
expect(
screen.getByTestId('condensed-evaluation-settings-container'),
).toBeInTheDocument();
+ // Verify that default option is selected
+ expect(screen.getByText('Rolling')).toBeInTheDocument();
+ expect(screen.getByText('Last 5 minutes')).toBeInTheDocument();
});
});
diff --git a/frontend/src/container/CreateAlertV2/NotificationSettings/NotificationSettings.tsx b/frontend/src/container/CreateAlertV2/NotificationSettings/NotificationSettings.tsx
index 2ef35c450cb1..640d2b17bbe9 100644
--- a/frontend/src/container/CreateAlertV2/NotificationSettings/NotificationSettings.tsx
+++ b/frontend/src/container/CreateAlertV2/NotificationSettings/NotificationSettings.tsx
@@ -9,13 +9,10 @@ import {
} from '../context/constants';
import AdvancedOptionItem from '../EvaluationSettings/AdvancedOptionItem';
import Stepper from '../Stepper';
-import { showCondensedLayout } from '../utils';
import MultipleNotifications from './MultipleNotifications';
import NotificationMessage from './NotificationMessage';
function NotificationSettings(): JSX.Element {
- const showCondensedLayoutFlag = showCondensedLayout();
-
const {
notificationSettings,
setNotificationSettings,
@@ -82,10 +79,7 @@ function NotificationSettings(): JSX.Element {
return (
-
+
diff --git a/frontend/src/container/CreateAlertV2/NotificationSettings/__tests__/NotificationSettings.test.tsx b/frontend/src/container/CreateAlertV2/NotificationSettings/__tests__/NotificationSettings.test.tsx
index 181971676bac..7b8c36a5c3cf 100644
--- a/frontend/src/container/CreateAlertV2/NotificationSettings/__tests__/NotificationSettings.test.tsx
+++ b/frontend/src/container/CreateAlertV2/NotificationSettings/__tests__/NotificationSettings.test.tsx
@@ -1,7 +1,6 @@
import { fireEvent, render, screen } from '@testing-library/react';
import * as createAlertContext from 'container/CreateAlertV2/context';
import { createMockAlertContextState } from 'container/CreateAlertV2/EvaluationSettings/__tests__/testUtils';
-import * as utils from 'container/CreateAlertV2/utils';
import NotificationSettings from '../NotificationSettings';
@@ -26,7 +25,6 @@ jest.mock(
jest.mock('container/CreateAlertV2/utils', () => ({
...jest.requireActual('container/CreateAlertV2/utils'),
- showCondensedLayout: jest.fn().mockReturnValue(false),
}));
const initialNotificationSettings = createMockAlertContextState()
@@ -42,10 +40,10 @@ const REPEAT_NOTIFICATIONS_TEXT = 'Repeat notifications';
const ENTER_TIME_INTERVAL_TEXT = 'Enter time interval...';
describe('NotificationSettings', () => {
- it('renders the notification settings tab with step number 4 and default values', () => {
+ it('renders the notification settings tab with step number 3 and default values', () => {
render(
);
expect(screen.getByText('Notification settings')).toBeInTheDocument();
- expect(screen.getByText('4')).toBeInTheDocument();
+ expect(screen.getByText('3')).toBeInTheDocument();
expect(screen.getByTestId('multiple-notifications')).toBeInTheDocument();
expect(screen.getByTestId('notification-message')).toBeInTheDocument();
expect(screen.getByText(REPEAT_NOTIFICATIONS_TEXT)).toBeInTheDocument();
@@ -56,15 +54,6 @@ describe('NotificationSettings', () => {
).toBeInTheDocument();
});
- it('renders the notification settings tab with step number 3 in condensed layout', () => {
- jest.spyOn(utils, 'showCondensedLayout').mockReturnValueOnce(true);
- render(
);
- expect(screen.getByText('Notification settings')).toBeInTheDocument();
- expect(screen.getByText('3')).toBeInTheDocument();
- expect(screen.getByTestId('multiple-notifications')).toBeInTheDocument();
- expect(screen.getByTestId('notification-message')).toBeInTheDocument();
- });
-
describe('Repeat notifications', () => {
it('renders the repeat notifications with inputs hidden when the repeat notifications switch is off', () => {
render(
);
diff --git a/frontend/src/container/CreateAlertV2/utils.tsx b/frontend/src/container/CreateAlertV2/utils.tsx
index 41ae9c7577c4..2788d4a93844 100644
--- a/frontend/src/container/CreateAlertV2/utils.tsx
+++ b/frontend/src/container/CreateAlertV2/utils.tsx
@@ -27,16 +27,6 @@ import {
import { EVALUATION_WINDOW_TIMEFRAME } from './EvaluationSettings/constants';
import { GetCreateAlertLocalStateFromAlertDefReturn } from './types';
-// UI side feature flag
-export const showNewCreateAlertsPage = (): boolean =>
- localStorage.getItem('showNewCreateAlertsPage') === 'true';
-
-// UI side FF to switch between the 2 layouts of the create alert page
-// Layout 1 - Default layout
-// Layout 2 - Condensed layout
-export const showCondensedLayout = (): boolean =>
- localStorage.getItem('hideCondensedLayout') !== 'true';
-
export function Spinner(): JSX.Element | null {
const { isCreatingAlertRule, isUpdatingAlertRule } = useCreateAlertState();
diff --git a/frontend/src/container/EditAlertV2/EditAlertV2.tsx b/frontend/src/container/EditAlertV2/EditAlertV2.tsx
index f02b2e363b37..4a434f51f08d 100644
--- a/frontend/src/container/EditAlertV2/EditAlertV2.tsx
+++ b/frontend/src/container/EditAlertV2/EditAlertV2.tsx
@@ -8,11 +8,10 @@ import { PostableAlertRuleV2 } from 'types/api/alerts/alertTypesV2';
import AlertCondition from '../CreateAlertV2/AlertCondition';
import { buildInitialAlertDef } from '../CreateAlertV2/context/utils';
-import EvaluationSettings from '../CreateAlertV2/EvaluationSettings';
import Footer from '../CreateAlertV2/Footer';
import NotificationSettings from '../CreateAlertV2/NotificationSettings';
import QuerySection from '../CreateAlertV2/QuerySection';
-import { showCondensedLayout, Spinner } from '../CreateAlertV2/utils';
+import { Spinner } from '../CreateAlertV2/utils';
interface EditAlertV2Props {
alertType?: AlertTypes;
@@ -33,15 +32,12 @@ function EditAlertV2({
useShareBuilderUrl({ defaultValue: currentQueryToRedirect });
- const showCondensedLayoutFlag = showCondensedLayout();
-
return (
<>
- {!showCondensedLayoutFlag ?
: null}
diff --git a/frontend/src/container/RoutingPolicies/utils.tsx b/frontend/src/container/RoutingPolicies/utils.tsx
index 725e226782a9..26cad317e576 100644
--- a/frontend/src/container/RoutingPolicies/utils.tsx
+++ b/frontend/src/container/RoutingPolicies/utils.tsx
@@ -5,10 +5,6 @@ import { SuccessResponseV2 } from 'types/api';
import { RoutingPolicy } from './types';
-export function showRoutingPoliciesPage(): boolean {
- return localStorage.getItem('showRoutingPoliciesPage') === 'true';
-}
-
export function mapApiResponseToRoutingPolicies(
response: SuccessResponseV2
,
): RoutingPolicy[] {
diff --git a/frontend/src/pages/AlertList/index.tsx b/frontend/src/pages/AlertList/index.tsx
index 078db79f6ed3..c4ef230a0646 100644
--- a/frontend/src/pages/AlertList/index.tsx
+++ b/frontend/src/pages/AlertList/index.tsx
@@ -8,7 +8,6 @@ import ROUTES from 'constants/routes';
import AllAlertRules from 'container/ListAlertRules';
import { PlannedDowntime } from 'container/PlannedDowntime/PlannedDowntime';
import RoutingPolicies from 'container/RoutingPolicies';
-import { showRoutingPoliciesPage } from 'container/RoutingPolicies/utils';
import TriggeredAlerts from 'container/TriggeredAlerts';
import { useSafeNavigate } from 'hooks/useSafeNavigate';
import useUrlQuery from 'hooks/useUrlQuery';
@@ -28,36 +27,27 @@ function AllAlertList(): JSX.Element {
const search = urlQuery.get('search');
- const showRoutingPoliciesPageFlag = showRoutingPoliciesPage();
-
const configurationTab = useMemo(() => {
- if (showRoutingPoliciesPageFlag) {
- const tabs = [
- {
- label: 'Planned Downtime',
- key: 'planned-downtime',
- children: ,
- },
- {
- label: 'Routing Policies',
- key: 'routing-policies',
- children: ,
- },
- ];
- return (
-
- );
- }
+ const tabs = [
+ {
+ label: 'Planned Downtime',
+ key: 'planned-downtime',
+ children: ,
+ },
+ {
+ label: 'Routing Policies',
+ key: 'routing-policies',
+ children: ,
+ },
+ ];
return (
-
+
);
- }, [showRoutingPoliciesPageFlag]);
+ }, []);
const items: TabsProps['items'] = [
{