2025-09-09 14:56:29 +07:00
|
|
|
import './CreateAlertV2.styles.scss';
|
|
|
|
|
|
2025-09-10 21:43:54 +07:00
|
|
|
import { initialQueriesMap } from 'constants/queryBuilder';
|
|
|
|
|
import { useShareBuilderUrl } from 'hooks/queryBuilder/useShareBuilderUrl';
|
|
|
|
|
import { Query } from 'types/api/queryBuilder/queryBuilderData';
|
|
|
|
|
|
2025-09-15 22:52:07 +07:00
|
|
|
import AlertCondition from './AlertCondition';
|
2025-09-09 14:56:29 +07:00
|
|
|
import { CreateAlertProvider } from './context';
|
2025-09-10 21:43:54 +07:00
|
|
|
import CreateAlertHeader from './CreateAlertHeader';
|
2025-09-23 22:36:40 +07:00
|
|
|
import EvaluationSettings from './EvaluationSettings';
|
2025-09-24 10:22:05 +07:00
|
|
|
import NotificationSettings from './NotificationSettings';
|
2025-09-10 21:43:54 +07:00
|
|
|
import QuerySection from './QuerySection';
|
2025-09-23 22:36:40 +07:00
|
|
|
import { showCondensedLayout } from './utils';
|
2025-09-10 21:43:54 +07:00
|
|
|
|
|
|
|
|
function CreateAlertV2({
|
|
|
|
|
initialQuery = initialQueriesMap.metrics,
|
|
|
|
|
}: {
|
|
|
|
|
initialQuery?: Query;
|
|
|
|
|
}): JSX.Element {
|
|
|
|
|
useShareBuilderUrl({ defaultValue: initialQuery });
|
2025-09-09 14:56:29 +07:00
|
|
|
|
2025-09-23 22:36:40 +07:00
|
|
|
const showCondensedLayoutFlag = showCondensedLayout();
|
|
|
|
|
|
2025-09-09 14:56:29 +07:00
|
|
|
return (
|
2025-09-23 22:36:40 +07:00
|
|
|
<CreateAlertProvider>
|
|
|
|
|
<div className="create-alert-v2-container">
|
2025-09-09 14:56:29 +07:00
|
|
|
<CreateAlertHeader />
|
2025-09-10 21:43:54 +07:00
|
|
|
<QuerySection />
|
2025-09-15 22:52:07 +07:00
|
|
|
<AlertCondition />
|
2025-09-23 22:36:40 +07:00
|
|
|
{!showCondensedLayoutFlag ? <EvaluationSettings /> : null}
|
2025-09-24 10:22:05 +07:00
|
|
|
<NotificationSettings />
|
2025-09-23 22:36:40 +07:00
|
|
|
</div>
|
|
|
|
|
</CreateAlertProvider>
|
2025-09-09 14:56:29 +07:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-10 21:43:54 +07:00
|
|
|
CreateAlertV2.defaultProps = {
|
|
|
|
|
initialQuery: initialQueriesMap.metrics,
|
|
|
|
|
};
|
|
|
|
|
|
2025-09-09 14:56:29 +07:00
|
|
|
export default CreateAlertV2;
|