diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx index e74f3117d55f9..6b8de98369b14 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/components/create_maintenance_windows_form.tsx @@ -64,7 +64,6 @@ export interface CreateMaintenanceWindowFormProps { onSuccess: () => void; initialValue?: FormProps; maintenanceWindowId?: string; - scopedQueryFeatureFlag?: boolean; } const useDefaultTimezone = () => { @@ -77,13 +76,7 @@ const useDefaultTimezone = () => { const TIMEZONE_OPTIONS = UI_TIMEZONE_OPTIONS.map((n) => ({ label: n })) ?? [{ label: 'UTC' }]; export const CreateMaintenanceWindowForm = React.memo((props) => { - const { - onCancel, - onSuccess, - initialValue, - maintenanceWindowId, - scopedQueryFeatureFlag = true, - } = props; + const { onCancel, onSuccess, initialValue, maintenanceWindowId } = props; const [defaultStartDateValue] = useState(moment().toISOString()); const [defaultEndDateValue] = useState(moment().add(30, 'minutes').toISOString()); @@ -125,7 +118,7 @@ export const CreateMaintenanceWindowForm = React.memo { - if (!isScopedQueryEnabled || !scopedQueryFeatureFlag) { + if (!isScopedQueryEnabled) { return null; } if (!query && !filters.length) { @@ -135,7 +128,7 @@ export const CreateMaintenanceWindowForm = React.memo>( async (formData, isValid) => { @@ -434,19 +427,17 @@ export const CreateMaintenanceWindowForm = React.memo )} - {scopedQueryFeatureFlag && ( - - - - {() => ( - - )} - - - )} + + + + {() => ( + + )} + + @@ -462,24 +453,22 @@ export const CreateMaintenanceWindowForm = React.memo - {scopedQueryFeatureFlag && ( - - - {() => ( - - )} - - - )} + + + {() => ( + + )} + + {isEditMode && ( diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts b/x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts index 1819059bf5279..22b992e3e6382 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/constants.ts @@ -123,5 +123,3 @@ export const STATUS_OPTIONS = [ { value: MaintenanceWindowStatus.Finished, name: i18n.TABLE_STATUS_FINISHED }, { value: MaintenanceWindowStatus.Archived, name: i18n.TABLE_STATUS_ARCHIVED }, ]; - -export const IS_SCOPED_QUERY_ENABLED = true; diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_create_page.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_create_page.tsx index d9dd4441d7796..80a5b1d018087 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_create_page.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_create_page.tsx @@ -14,7 +14,6 @@ import * as i18n from './translations'; import { PageHeader } from './components/page_header'; import { CreateMaintenanceWindowForm } from './components/create_maintenance_windows_form'; import { MAINTENANCE_WINDOW_DEEP_LINK_IDS } from '../../../common'; -import { IS_SCOPED_QUERY_ENABLED } from './constants'; export const MaintenanceWindowsCreatePage = React.memo(() => { useBreadcrumbs(MAINTENANCE_WINDOW_DEEP_LINK_IDS.maintenanceWindowsCreate); @@ -31,7 +30,6 @@ export const MaintenanceWindowsCreatePage = React.memo(() => { ); diff --git a/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_edit_page.tsx b/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_edit_page.tsx index 4f828873cb7a0..7f34a42349c99 100644 --- a/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_edit_page.tsx +++ b/x-pack/plugins/alerting/public/pages/maintenance_windows/maintenance_window_edit_page.tsx @@ -17,7 +17,6 @@ import { CreateMaintenanceWindowForm } from './components/create_maintenance_win import { MAINTENANCE_WINDOW_DEEP_LINK_IDS } from '../../../common'; import { useGetMaintenanceWindow } from '../../hooks/use_get_maintenance_window'; import { CenterJustifiedSpinner } from './components/center_justified_spinner'; -import { IS_SCOPED_QUERY_ENABLED } from './constants'; export const MaintenanceWindowsEditPage = React.memo(() => { const { navigateToMaintenanceWindows } = useMaintenanceWindowsNavigation(); @@ -44,7 +43,6 @@ export const MaintenanceWindowsEditPage = React.memo(() => { maintenanceWindowId={maintenanceWindowId} onCancel={navigateToMaintenanceWindows} onSuccess={navigateToMaintenanceWindows} - scopedQueryFeatureFlag={IS_SCOPED_QUERY_ENABLED} /> );