From 331a1f39043dd7899080f4c25540d95e67f776d9 Mon Sep 17 00:00:00 2001 From: Mohammad Khalilzadeh Date: Mon, 5 Aug 2024 14:17:41 +0330 Subject: [PATCH] completing create new maintenance window (no-repeat) UI --- .../CreateMaintenanceWindow/index.css | 40 ++++++-- .../CreateMaintenanceWindow/index.jsx | 98 ++++++++++++++++++- 2 files changed, 128 insertions(+), 10 deletions(-) diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css index a799bf0af..04960d08b 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.css @@ -1,11 +1,18 @@ -.maintenance-options > .MuiStack-root > .MuiStack-root.select-wrapper { - width: 380px; +.maintenance-options { + > .MuiStack-root { + > .MuiStack-root.select-wrapper, + .field { + width: 380px; + } + } } -.date-picker .MuiOutlinedInput-root, -.time-picker .MuiOutlinedInput-root { - height: 34px; - font-size: var(--env-var-font-size-medium); +.date-picker, +.time-picker { + .MuiOutlinedInput-root { + height: 34px; + font-size: var(--env-var-font-size-medium); + } } .date-picker .MuiOutlinedInput-root { @@ -19,3 +26,24 @@ .MuiInputAdornment-outlined .MuiIconButton-root svg { width: 20px; } + +.duration-config { + .field-text .MuiTextField-root, + .field { + width: 70px; + min-width: 70px; + max-width: 70px; + } + + > .MuiStack-root.select-wrapper { + width: 100px; + + > .MuiInputBase-root:has(> .MuiSelect-select) { + min-width: 100px; + } + } + + .select-wrapper .select-component > .MuiSelect-select { + text-transform: none; + } +} diff --git a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx index aea012e2c..b60b263a6 100644 --- a/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx +++ b/Client/src/Pages/Maintenance/CreateMaintenanceWindow/index.jsx @@ -9,6 +9,7 @@ import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider"; import dayjs from "dayjs"; import { DatePicker } from "@mui/x-date-pickers/DatePicker"; import { MobileTimePicker } from "@mui/x-date-pickers/MobileTimePicker"; +import Field from "../../../Components/Inputs/Field"; const directory = { title: "Create a maintenance window", @@ -45,9 +46,29 @@ const configOptionTitle = (title, description) => { ); }; +const timeFrames = [ + { _id: "seconds", name: "seconds" }, + { _id: "minutes", name: "minutes" }, + { _id: "hours", name: "hours" }, + { _id: "days", name: "days" }, +]; + +const sxButtons = { + width: 110, + height: 34, +}; + const CreateNewMaintenanceWindow = () => { const [values, setValues] = useState({ repeat: 1, + date: dayjs(), + startTime: dayjs(), + duration: { + value: "60", + unit: "minutes", + }, + friendlyName: "", + AddMonitors: "", }); const handleChange = (event, name) => { @@ -77,7 +98,13 @@ const CreateNewMaintenanceWindow = () => { className="date-localization-provider" dateAdapter={AdapterDayjs} > - + + handleChange({ target: { value: date } }, "date") + } + /> ), }, @@ -89,10 +116,68 @@ const CreateNewMaintenanceWindow = () => { className="time-localization-provider" dateAdapter={AdapterDayjs} > - + + handleChange({ target: { value: time } }, "startTime") + } + /> ), }, + { + title: "Duration", + component: ( + + handleChange(e, "duration")} + value={values.duration.value} + /> +