Skip to content

Commit 643a9c6

Browse files
authored
Updated Audit Logs page to use mds (#2897)
Signed-off-by: Benjamin Perez <[email protected]>
1 parent 0c3a941 commit 643a9c6

File tree

4 files changed

+184
-279
lines changed

4 files changed

+184
-279
lines changed

portal-ui/src/screens/Console/Common/FormComponents/DateRangeSelector/DateRangeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React from "react";
18-
import { Button, OpenListIcon, SyncIcon } from "mds";
18+
import { Button, OpenListIcon, SyncIcon, Grid } from "mds";
1919
import { DateTime } from "luxon";
20-
import { Box, Grid } from "@mui/material";
20+
import { Box } from "@mui/material";
2121
import ScheduleIcon from "@mui/icons-material/Schedule";
2222
import WatchLaterIcon from "@mui/icons-material/WatchLater";
2323
import DateTimePickerWrapper from "../DateTimePickerWrapper/DateTimePickerWrapper";

portal-ui/src/screens/Console/Common/FormComponents/FilterInputWrapper/FilterInputWrapper.tsx

Lines changed: 25 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React, { Fragment } from "react";
18-
import { Theme } from "@mui/material/styles";
19-
import createStyles from "@mui/styles/createStyles";
20-
import withStyles from "@mui/styles/withStyles";
21-
import TextField from "@mui/material/TextField";
22-
import { searchField } from "../common/styleLibrary";
18+
import { InputBox, InputLabel, Box } from "mds";
2319

2420
interface IFilterInputWrapper {
25-
classes: any;
2621
value: string;
2722
onChange: (txtVar: string) => any;
2823
label: string;
@@ -31,45 +26,7 @@ interface IFilterInputWrapper {
3126
name: string;
3227
}
3328

34-
const styles = (theme: Theme) =>
35-
createStyles({
36-
searchField: {
37-
...searchField.searchField,
38-
height: 30,
39-
padding: 0,
40-
"& input": {
41-
padding: "0 12px",
42-
height: 28,
43-
fontSize: 12,
44-
fontWeight: 600,
45-
color: "#393939",
46-
},
47-
"&.isDisabled": {
48-
"&:hover": {
49-
borderColor: "#EAEDEE",
50-
},
51-
},
52-
"& input.Mui-disabled": {
53-
backgroundColor: "#EAEAEA",
54-
},
55-
},
56-
labelStyle: {
57-
color: "#393939",
58-
fontSize: 12,
59-
marginBottom: 4,
60-
},
61-
buttonKit: {
62-
display: "flex",
63-
alignItems: "center",
64-
},
65-
fieldContainer: {
66-
flexGrow: 1,
67-
margin: "0 15px",
68-
},
69-
});
70-
7129
const FilterInputWrapper = ({
72-
classes,
7330
label,
7431
onChange,
7532
value,
@@ -79,27 +36,31 @@ const FilterInputWrapper = ({
7936
}: IFilterInputWrapper) => {
8037
return (
8138
<Fragment>
82-
<div className={classes.fieldContainer}>
83-
<div className={classes.labelStyle}>{label}</div>
84-
<div className={classes.buttonKit}>
85-
<TextField
86-
placeholder={placeholder}
87-
id={id}
88-
name={name}
89-
label=""
90-
onChange={(val) => {
91-
onChange(val.target.value);
92-
}}
93-
InputProps={{
94-
disableUnderline: true,
95-
}}
96-
className={classes.searchField}
97-
value={value}
98-
/>
99-
</div>
100-
</div>
39+
<Box
40+
sx={{
41+
flexGrow: 1,
42+
margin: "0 15px",
43+
}}
44+
>
45+
<InputLabel>{label}</InputLabel>
46+
<InputBox
47+
placeholder={placeholder}
48+
id={id}
49+
name={name}
50+
label=""
51+
onChange={(val) => {
52+
onChange(val.target.value);
53+
}}
54+
sx={{
55+
"& input": {
56+
height: 30,
57+
},
58+
}}
59+
value={value}
60+
/>
61+
</Box>
10162
</Fragment>
10263
);
10364
};
10465

105-
export default withStyles(styles)(FilterInputWrapper);
66+
export default FilterInputWrapper;

portal-ui/src/screens/Console/Logs/LogSearch/LogSearchFullModal.tsx

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,22 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

1717
import React, { Fragment } from "react";
18-
import { Grid } from "@mui/material";
19-
import { Theme } from "@mui/material/styles";
20-
import { Button } from "mds";
18+
import { Button, Grid } from "mds";
2119
import get from "lodash/get";
22-
import createStyles from "@mui/styles/createStyles";
23-
import withStyles from "@mui/styles/withStyles";
2420
import ModalWrapper from "../../Common/ModalWrapper/ModalWrapper";
25-
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
2621
import { IReqInfoSearchResults } from "./types";
2722
import { LogSearchColumnLabels } from "./utils";
2823

2924
interface ILogSearchFullModal {
3025
modalOpen: boolean;
3126
logSearchElement: IReqInfoSearchResults;
3227
onClose: () => void;
33-
classes: any;
3428
}
3529

36-
const styles = (theme: Theme) =>
37-
createStyles({
38-
buttonContainer: {
39-
textAlign: "right",
40-
},
41-
objectKeyCol: {
42-
fontWeight: 700,
43-
paddingRight: "10px",
44-
textAlign: "left",
45-
},
46-
...modalBasic,
47-
});
48-
4930
const LogSearchFullModal = ({
5031
modalOpen,
5132
logSearchElement,
5233
onClose,
53-
classes,
5434
}: ILogSearchFullModal) => {
5535
const jsonItems = Object.keys(logSearchElement);
5636

@@ -69,7 +49,13 @@ const LogSearchFullModal = ({
6949
<tbody>
7050
{jsonItems.map((objectKey: string, index: number) => (
7151
<tr key={`logSearch-${index.toString()}`}>
72-
<th className={classes.objectKeyCol}>
52+
<th
53+
style={{
54+
fontWeight: 700,
55+
paddingRight: "10px",
56+
textAlign: "left",
57+
}}
58+
>
7359
{get(LogSearchColumnLabels, objectKey, `${objectKey}`)}
7460
</th>
7561
<td>{get(logSearchElement, objectKey, "")}</td>
@@ -78,7 +64,11 @@ const LogSearchFullModal = ({
7864
</tbody>
7965
</table>
8066
</Grid>
81-
<Grid item xs={12} className={classes.buttonContainer}>
67+
<Grid
68+
item
69+
xs={12}
70+
sx={{ display: "flex", justifyContent: "flex-end" }}
71+
>
8272
<Button
8373
id={"close-log-search"}
8474
variant="callAction"
@@ -93,4 +83,4 @@ const LogSearchFullModal = ({
9383
);
9484
};
9585

96-
export default withStyles(styles)(LogSearchFullModal);
86+
export default LogSearchFullModal;

0 commit comments

Comments
 (0)