diff --git a/frontend/src/container/CreateAlertV2/AlertCondition/AlertCondition.tsx b/frontend/src/container/CreateAlertV2/AlertCondition/AlertCondition.tsx index 174af6e93de2..e25142deb482 100644 --- a/frontend/src/container/CreateAlertV2/AlertCondition/AlertCondition.tsx +++ b/frontend/src/container/CreateAlertV2/AlertCondition/AlertCondition.tsx @@ -13,14 +13,12 @@ import APIError from 'types/api/error'; import { useCreateAlertState } from '../context'; import AdvancedOptions from '../EvaluationSettings/AdvancedOptions'; import Stepper from '../Stepper'; -import { showCondensedLayout } from '../utils'; import AlertThreshold from './AlertThreshold'; import AnomalyThreshold from './AnomalyThreshold'; import { ANOMALY_TAB_TOOLTIP, THRESHOLD_TAB_TOOLTIP } from './constants'; function AlertCondition(): JSX.Element { const { alertType, setAlertType } = useCreateAlertState(); - const showCondensedLayoutFlag = showCondensedLayout(); const { data, @@ -108,11 +106,9 @@ function AlertCondition(): JSX.Element { refreshChannels={refreshChannels} /> )} - {showCondensedLayoutFlag ? ( -
- -
- ) : null} +
+ +
); } diff --git a/frontend/src/container/CreateAlertV2/AlertCondition/AlertThreshold.tsx b/frontend/src/container/CreateAlertV2/AlertCondition/AlertThreshold.tsx index 02c1f0929b71..95663daa518c 100644 --- a/frontend/src/container/CreateAlertV2/AlertCondition/AlertThreshold.tsx +++ b/frontend/src/container/CreateAlertV2/AlertCondition/AlertThreshold.tsx @@ -18,7 +18,6 @@ import { THRESHOLD_OPERATOR_OPTIONS, } from '../context/constants'; import EvaluationSettings from '../EvaluationSettings/EvaluationSettings'; -import { showCondensedLayout } from '../utils'; import ThresholdItem from './ThresholdItem'; import { AnomalyAndThresholdProps, UpdateThreshold } from './types'; import { @@ -43,8 +42,6 @@ function AlertThreshold({ setNotificationSettings, } = useCreateAlertState(); - const showCondensedLayoutFlag = showCondensedLayout(); - const { currentQuery } = useQueryBuilder(); const queryNames = getQueryNames(currentQuery); @@ -163,17 +160,12 @@ function AlertThreshold({ }), ); - const evaluationWindowContext = showCondensedLayoutFlag ? ( - - ) : ( - Evaluation Window. - ); - return (
{/* Main condition sentence */}
@@ -219,7 +211,7 @@ function AlertThreshold({ options={matchTypeOptionsWithTooltips} /> - during the {evaluationWindowContext} + during the
diff --git a/frontend/src/container/CreateAlertV2/AlertCondition/__tests__/AlertThreshold.test.tsx b/frontend/src/container/CreateAlertV2/AlertCondition/__tests__/AlertThreshold.test.tsx index ab91089e205a..468d67b8a840 100644 --- a/frontend/src/container/CreateAlertV2/AlertCondition/__tests__/AlertThreshold.test.tsx +++ b/frontend/src/container/CreateAlertV2/AlertCondition/__tests__/AlertThreshold.test.tsx @@ -110,7 +110,6 @@ jest.mock('container/NewWidget/RightContainer/alertFomatCategories', () => ({ jest.mock('container/CreateAlertV2/utils', () => ({ ...jest.requireActual('container/CreateAlertV2/utils'), - showCondensedLayout: jest.fn().mockReturnValue(false), })); const TEST_STRINGS = { @@ -159,7 +158,9 @@ describe('AlertThreshold', () => { expect(screen.getByText('Send a notification when')).toBeInTheDocument(); expect(screen.getByText('the threshold(s)')).toBeInTheDocument(); expect(screen.getByText('during the')).toBeInTheDocument(); - expect(screen.getByText('Evaluation Window.')).toBeInTheDocument(); + expect( + screen.getByTestId('condensed-evaluation-settings-container'), + ).toBeInTheDocument(); }); it('renders query selection dropdown', async () => { diff --git a/frontend/src/container/CreateAlertV2/CreateAlertV2.tsx b/frontend/src/container/CreateAlertV2/CreateAlertV2.tsx index dc60cedb7c93..e4f87d95e481 100644 --- a/frontend/src/container/CreateAlertV2/CreateAlertV2.tsx +++ b/frontend/src/container/CreateAlertV2/CreateAlertV2.tsx @@ -8,12 +8,11 @@ import AlertCondition from './AlertCondition'; import { CreateAlertProvider } from './context'; import { buildInitialAlertDef } from './context/utils'; import CreateAlertHeader from './CreateAlertHeader'; -import EvaluationSettings from './EvaluationSettings'; import Footer from './Footer'; import NotificationSettings from './NotificationSettings'; import QuerySection from './QuerySection'; import { CreateAlertV2Props } from './types'; -import { showCondensedLayout, Spinner } from './utils'; +import { Spinner } from './utils'; function CreateAlertV2({ alertType }: CreateAlertV2Props): JSX.Element { const queryToRedirect = buildInitialAlertDef(alertType); @@ -23,8 +22,6 @@ function CreateAlertV2({ alertType }: CreateAlertV2Props): JSX.Element { useShareBuilderUrl({ defaultValue: currentQueryToRedirect }); - const showCondensedLayoutFlag = showCondensedLayout(); - return ( @@ -32,7 +29,6 @@ function CreateAlertV2({ alertType }: CreateAlertV2Props): JSX.Element { - {!showCondensedLayoutFlag ? : null}