Skip to content

Commit ff4e959

Browse files
bexsoftBenjamin Perez
andauthored
Fixed styles in users policy modal (#139)
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
1 parent 37195fe commit ff4e959

File tree

4 files changed

+43
-43
lines changed

4 files changed

+43
-43
lines changed

portal-ui/src/screens/Console/Common/TableWrapper/TableActionButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import { IconButton } from "@material-ui/core";
1919
import ViewIcon from "./TableActionIcons/ViewIcon";
2020
import PencilIcon from "./TableActionIcons/PencilIcon";
2121
import DeleteIcon from "./TableActionIcons/DeleteIcon";
22+
import DescriptionIcon from "./TableActionIcons/DescriptionIcon";
2223
import { Link } from "react-router-dom";
23-
import DescriptionIcon from "@material-ui/icons/Description";
2424

2525
interface IActionButton {
2626
type: string;
@@ -41,7 +41,7 @@ const defineIcon = (type: string, selected: boolean) => {
4141
case "delete":
4242
return <DeleteIcon active={selected} />;
4343
case "description":
44-
return <DescriptionIcon />;
44+
return <DescriptionIcon active={selected} />;
4545
}
4646

4747
return null;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from "react";
2+
import { IIcon, selected, unSelected } from "./common";
3+
4+
const PencilIcon = ({ active = false }: IIcon) => {
5+
return (
6+
<svg
7+
xmlns="http://www.w3.org/2000/svg"
8+
width="16"
9+
height="16"
10+
viewBox="0 0 24 24"
11+
>
12+
<path
13+
fill={active ? selected : unSelected}
14+
d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"
15+
></path>
16+
</svg>
17+
);
18+
};
19+
20+
export default PencilIcon;

portal-ui/src/screens/Console/Policies/SetPolicy.tsx

Lines changed: 20 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import React, { useCallback, useEffect, useState } from "react";
1818
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
1919
import {
2020
Button,
21-
FormControlLabel,
2221
LinearProgress,
2322
Paper,
24-
Switch,
2523
Table,
2624
TableBody,
2725
TableCell,
@@ -30,10 +28,7 @@ import {
3028
TableRow,
3129
} from "@material-ui/core";
3230
import Grid from "@material-ui/core/Grid";
33-
import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
34-
import { RadioGroupSelector } from "../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
3531
import { modalBasic } from "../Common/FormComponents/common/styleLibrary";
36-
import { IElementValue } from "../Configurations/types";
3732
import { User } from "../Users/types";
3833
import ModalWrapper from "../Common/ModalWrapper/ModalWrapper";
3934
import { Policy, PolicyList } from "./types";
@@ -50,6 +45,9 @@ interface ISetPolicyProps {
5045
const styles = (theme: Theme) =>
5146
createStyles({
5247
...modalBasic,
48+
buttonContainer: {
49+
textAlign: "right",
50+
},
5351
});
5452

5553
const SetPolicy = ({
@@ -59,23 +57,6 @@ const SetPolicy = ({
5957
open,
6058
}: ISetPolicyProps) => {
6159
//Local States
62-
const [useConnectionString, setUseConnectionString] = useState<boolean>(
63-
false
64-
);
65-
const [connectionString, setConnectionString] = useState<string>("");
66-
const [host, setHostname] = useState<string>("");
67-
const [dbName, setDbName] = useState<string>("");
68-
const [port, setPort] = useState<string>("");
69-
const [user, setUser] = useState<string>("");
70-
const [password, setPassword] = useState<string>("");
71-
const [sslMode, setSslMode] = useState<string>("require");
72-
73-
const [table, setTable] = useState<string>("");
74-
const [format, setFormat] = useState<string>("namespace");
75-
const [queueDir, setQueueDir] = useState<string>("");
76-
const [queueLimit, setQueueLimit] = useState<string>("");
77-
const [comment, setComment] = useState<string>("");
78-
7960
const [records, setRecords] = useState<Policy[]>([]);
8061
const [loading, setLoading] = useState<boolean>(false);
8162
const [error, setError] = useState<string>("");
@@ -175,25 +156,24 @@ const SetPolicy = ({
175156
</Table>
176157
</TableContainer>
177158
</Grid>
178-
<Grid item xs={12} className={classes.buttonContainer}>
179-
<Button
180-
type="submit"
181-
variant="contained"
182-
color="primary"
183-
size={"small"}
184-
onClick={() => {
185-
closeModalAndRefresh();
186-
}}
187-
>
188-
Cancel
189-
</Button>
190-
</Grid>
191-
{loading && (
192-
<Grid item xs={12}>
193-
<LinearProgress />
194-
</Grid>
195-
)}
196159
</Grid>
160+
<Grid item xs={12} className={classes.buttonContainer}>
161+
<Button
162+
type="submit"
163+
variant="contained"
164+
color="primary"
165+
onClick={() => {
166+
closeModalAndRefresh();
167+
}}
168+
>
169+
Cancel
170+
</Button>
171+
</Grid>
172+
{loading && (
173+
<Grid item xs={12}>
174+
<LinearProgress />
175+
</Grid>
176+
)}
197177
</ModalWrapper>
198178
);
199179
};

portal-ui/src/screens/Console/Users/Users.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ class Users extends React.Component<IUsersProps, IUsersState> {
264264
};
265265

266266
const tableActions = [
267-
{ type: "description", onClick: setPolicyAction },
268267
{ type: "view", onClick: viewAction },
268+
{ type: "description", onClick: setPolicyAction },
269269
{ type: "delete", onClick: deleteAction },
270270
];
271271

0 commit comments

Comments
 (0)