From 643a9c6c7c2f280b53dedded2787dcb8f488bd3f Mon Sep 17 00:00:00 2001 From: Alex <33497058+bexsoft@users.noreply.github.com> Date: Wed, 21 Jun 2023 14:32:19 -0600 Subject: [PATCH] Updated Audit Logs page to use mds (#2897) Signed-off-by: Benjamin Perez --- .../DateRangeSelector/DateRangeSelector.tsx | 4 +- .../FilterInputWrapper/FilterInputWrapper.tsx | 89 ++--- .../Logs/LogSearch/LogSearchFullModal.tsx | 38 +- .../Console/Logs/LogSearch/LogsSearchMain.tsx | 332 ++++++++---------- 4 files changed, 184 insertions(+), 279 deletions(-) diff --git a/portal-ui/src/screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx b/portal-ui/src/screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx index 2521fec2f..625ac7dcc 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx +++ b/portal-ui/src/screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx @@ -15,9 +15,9 @@ // along with this program. If not, see . import React from "react"; -import { Button, OpenListIcon, SyncIcon } from "mds"; +import { Button, OpenListIcon, SyncIcon, Grid } from "mds"; import { DateTime } from "luxon"; -import { Box, Grid } from "@mui/material"; +import { Box } from "@mui/material"; import ScheduleIcon from "@mui/icons-material/Schedule"; import WatchLaterIcon from "@mui/icons-material/WatchLater"; import DateTimePickerWrapper from "../DateTimePickerWrapper/DateTimePickerWrapper"; diff --git a/portal-ui/src/screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx b/portal-ui/src/screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx index 8daee48f5..e30919528 100644 --- a/portal-ui/src/screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx +++ b/portal-ui/src/screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx @@ -15,14 +15,9 @@ // along with this program. If not, see . import React, { Fragment } from "react"; -import { Theme } from "@mui/material/styles"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; -import TextField from "@mui/material/TextField"; -import { searchField } from "../common/styleLibrary"; +import { InputBox, InputLabel, Box } from "mds"; interface IFilterInputWrapper { - classes: any; value: string; onChange: (txtVar: string) => any; label: string; @@ -31,45 +26,7 @@ interface IFilterInputWrapper { name: string; } -const styles = (theme: Theme) => - createStyles({ - searchField: { - ...searchField.searchField, - height: 30, - padding: 0, - "& input": { - padding: "0 12px", - height: 28, - fontSize: 12, - fontWeight: 600, - color: "#393939", - }, - "&.isDisabled": { - "&:hover": { - borderColor: "#EAEDEE", - }, - }, - "& input.Mui-disabled": { - backgroundColor: "#EAEAEA", - }, - }, - labelStyle: { - color: "#393939", - fontSize: 12, - marginBottom: 4, - }, - buttonKit: { - display: "flex", - alignItems: "center", - }, - fieldContainer: { - flexGrow: 1, - margin: "0 15px", - }, - }); - const FilterInputWrapper = ({ - classes, label, onChange, value, @@ -79,27 +36,31 @@ const FilterInputWrapper = ({ }: IFilterInputWrapper) => { return ( -
-
{label}
-
- { - onChange(val.target.value); - }} - InputProps={{ - disableUnderline: true, - }} - className={classes.searchField} - value={value} - /> -
-
+ + {label} + { + onChange(val.target.value); + }} + sx={{ + "& input": { + height: 30, + }, + }} + value={value} + /> +
); }; -export default withStyles(styles)(FilterInputWrapper); +export default FilterInputWrapper; diff --git a/portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx b/portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx index dfbd9d60e..316d69339 100644 --- a/portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx +++ b/portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx @@ -15,14 +15,9 @@ // along with this program. If not, see . import React, { Fragment } from "react"; -import { Grid } from "@mui/material"; -import { Theme } from "@mui/material/styles"; -import { Button } from "mds"; +import { Button, Grid } from "mds"; import get from "lodash/get"; -import createStyles from "@mui/styles/createStyles"; -import withStyles from "@mui/styles/withStyles"; import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper"; -import { modalBasic } from "../../Common/FormComponents/common/styleLibrary"; import { IReqInfoSearchResults } from "./types"; import { LogSearchColumnLabels } from "./utils"; @@ -30,27 +25,12 @@ interface ILogSearchFullModal { modalOpen: boolean; logSearchElement: IReqInfoSearchResults; onClose: () => void; - classes: any; } -const styles = (theme: Theme) => - createStyles({ - buttonContainer: { - textAlign: "right", - }, - objectKeyCol: { - fontWeight: 700, - paddingRight: "10px", - textAlign: "left", - }, - ...modalBasic, - }); - const LogSearchFullModal = ({ modalOpen, logSearchElement, onClose, - classes, }: ILogSearchFullModal) => { const jsonItems = Object.keys(logSearchElement); @@ -69,7 +49,13 @@ const LogSearchFullModal = ({ {jsonItems.map((objectKey: string, index: number) => ( - + {get(LogSearchColumnLabels, objectKey, `${objectKey}`)} {get(logSearchElement, objectKey, "")} @@ -78,7 +64,11 @@ const LogSearchFullModal = ({ - + - + /> + -
-
- Enable your preferred options to get filtered records. -
- You can use '*' to match any character, '.' to signify a - single character or '\' to scape an special character (E.g. - mybucket-*) -
-
- - - - -
-
- - - -
-
+ + Enable your preferred options to get filtered records. +
+ You can use '*' to match any character, '.' to signify a + single character or '\' to scape an special character (E.g. + mybucket-*) +
+ + + + + + + + + + +
- +