diff --git a/frontend/src/api/plannedDowntime/createDowntimeSchedule.ts b/frontend/src/api/plannedDowntime/createDowntimeSchedule.ts index 128fb9bf69..26970264cf 100644 --- a/frontend/src/api/plannedDowntime/createDowntimeSchedule.ts +++ b/frontend/src/api/plannedDowntime/createDowntimeSchedule.ts @@ -1,6 +1,7 @@ import axios from 'api'; import { ErrorResponseHandler } from 'api/ErrorResponseHandler'; import { AxiosError } from 'axios'; +import { Dayjs } from 'dayjs'; import { ErrorResponse, SuccessResponse } from 'types/api'; import { Recurrence } from './getAllDowntimeSchedules'; @@ -11,8 +12,8 @@ export interface DowntimeSchedulePayload { alertIds: string[]; schedule: { timezone?: string; - startTime?: string; - endTime?: string; + startTime?: string | Dayjs; + endTime?: string | Dayjs; recurrence?: Recurrence; }; } diff --git a/frontend/src/api/plannedDowntime/getAllDowntimeSchedules.ts b/frontend/src/api/plannedDowntime/getAllDowntimeSchedules.ts index 8e77606a3f..d323c63a19 100644 --- a/frontend/src/api/plannedDowntime/getAllDowntimeSchedules.ts +++ b/frontend/src/api/plannedDowntime/getAllDowntimeSchedules.ts @@ -1,6 +1,6 @@ import axios from 'api'; import { AxiosError, AxiosResponse } from 'axios'; -import { Option } from 'container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu'; +import { Option } from 'container/PlannedDowntime/PlannedDowntimeutils'; import { useQuery, UseQueryResult } from 'react-query'; export type Recurrence = { @@ -28,6 +28,7 @@ export interface DowntimeSchedules { createdBy: string | null; updatedAt: string | null; updatedBy: string | null; + kind: string | null; } export type PayloadProps = { data: DowntimeSchedules[] }; diff --git a/frontend/src/constants/features.ts b/frontend/src/constants/features.ts index bb905d0d69..f0b170545a 100644 --- a/frontend/src/constants/features.ts +++ b/frontend/src/constants/features.ts @@ -19,6 +19,5 @@ export enum FeatureKeys { OSS = 'OSS', ONBOARDING = 'ONBOARDING', CHAT_SUPPORT = 'CHAT_SUPPORT', - PLANNED_MAINTENANCE = 'PLANNED_MAINTENANCE', GATEWAY = 'GATEWAY', } diff --git a/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.styles.scss b/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.styles.scss deleted file mode 100644 index 893acc79c9..0000000000 --- a/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.styles.scss +++ /dev/null @@ -1,136 +0,0 @@ -.options { - width: 100%; - - .option { - padding: 8px 10px; - cursor: pointer; - overflow: auto; - } - - .option:hover { - background-color: var(--bg-slate-200); - } -} - -.submenu-container { - position: absolute; - top: 0; - right: 50%; - z-index: 1; - background-color: var(--bg-ink-400); - border: 1px solid var(--bg-slate-500); - max-height: 300px; - overflow-y: auto; - width: 160px; - display: flex; - flex-direction: column; - gap: 6px; - padding: 12px; - border-radius: 4px; - - .submenu-checkbox { - padding: 0px; - } -} - -.dropdown-submenu { - .dropdown-input { - box-sizing: border-box; - margin: 0; - padding: 4.5px 11px; - color: rgba(255, 255, 255, 0.85); - font-size: 13px; - line-height: 1.6153846153846154; - list-style: none; - font-family: Inter; - position: relative; - display: inline-block; - min-width: 0; - transition: all 0.2s; - } - - .ant-popover-inner { - padding: 0px; - } -} - -.options-container { - position: relative; - --arrow-x: 175px; - --arrow-y: 266px; - width: 350px; - box-sizing: border-box; - margin: 0; - padding: 4px; - color: var(--bg-vanilla-400); - font-size: 12px; - line-height: 1.6153846153846154; - list-style: none; - font-family: Inter; - z-index: 1050; - overflow: hidden; - font-variant: initial; - background-color: var(--bg-ink-400); - border-radius: 2px; - outline: none; - box-shadow: 4px 10px 16px 2px rgba(0, 0, 0, 0.3); -} - -.submenu-popover { - .ant-popover-inner { - padding: 0px; - } - .option { - padding: 8px 10px; - cursor: pointer; - overflow: auto; - } - - .option:hover { - background-color: var(--bg-slate-200); - } -} - -.save-option-btn { - height: 24px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - align-self: flex-end; - width: 60px; -} - -.submenu-header { - color: var(--bg-vanilla-200); - font-family: Inter; - font-size: 12px; - font-style: normal; - font-weight: 400; - padding-bottom: 8px; - text-transform: uppercase; -} - -.lightMode { - .option:hover { - background-color: var(--bg-vanilla-200); - } - - .submenu-container { - background-color: var(--bg-vanilla-100); - border: 1px solid var(--bg-vanilla-300); - } - - .dropdown-submenu { - .dropdown-input { - color: var(--bg-slate-100); - } - } - .options-container { - color: var(--bg-slate-100); - background-color: var(--bg-vanilla-100); - } - .submenu-header { - color: var(--bg-slate-200); - } -} diff --git a/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.tsx b/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.tsx deleted file mode 100644 index d2a3e041bf..0000000000 --- a/frontend/src/container/PlannedDowntime/DropdownWithSubMenu/DropdownWithSubMenu.tsx +++ /dev/null @@ -1,230 +0,0 @@ -import './DropdownWithSubMenu.styles.scss'; - -import { CheckOutlined } from '@ant-design/icons'; -import { Button, Checkbox, Popover, Typography } from 'antd'; -import { CheckboxChangeEvent } from 'antd/es/checkbox'; -import { FormInstance } from 'antd/lib'; -import { useEffect, useState } from 'react'; -import { popupContainer } from 'utils/selectPopupContainer'; - -import { recurrenceOptions } from '../PlannedDowntimeutils'; - -interface SubOption { - label: string; - value: string; -} - -export interface Option { - label: string; - value: string; - submenu?: SubOption[]; -} - -interface DropdownProps { - options: Option[]; - form: FormInstance; - setRecurrenceOption: React.Dispatch< - React.SetStateAction - >; -} - -export function DropdownWithSubMenu(props: DropdownProps): JSX.Element { - const { options, form, setRecurrenceOption } = props; - const [selectedOption, setSelectedOption] = useState