Skip to content

Commit

Permalink
fix: safari issues and change svg assests
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakravarthy7102 committed Nov 17, 2023
1 parent e161626 commit 27cc554
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build/static/css/main.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/css/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/static/js/bundle.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions src/ui/components/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
.dialog-content {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;
}

.dialog-header {
Expand Down
1 change: 0 additions & 1 deletion src/ui/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
.menu-content {
display: flex;
flex-direction: column;
height: 100%;
width: 100%;

.sidebar-list {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Badge from "../../badge";
import "./deletePermissions.scss";

import { ReactComponent as SecuityKeyIcon } from "../../../../assets/secuity-key.svg";
import { ReactComponent as SecuityKeyIcon } from "../../../../assets/roles-and-permissions.svg";
import { ReactComponent as TrashIcon } from "../../../../assets/trash.svg";

export default function DeletePermissions({
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/userroles/components/NoRolesFound.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "./noRolesFound.scss";

import { ReactComponent as SecuityKeyIcon } from "../../../../assets/secuity-key.svg";
import { ReactComponent as SecuityKeyIcon } from "../../../../assets/roles-and-permissions.svg";

export default function NoRolesFound() {
return (
<section className="paper-container">
<div>
<SecuityKeyIcon />
<SecuityKeyIcon className="icon" />
<h1>Currently, you don’t have any Roles</h1>
<p>Once added, all created user roles will be found here</p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/userroles/components/RolesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from ".
import { PlaceholderTableRows } from "../../usersListTable/UsersListTable";
import { Role } from "../types";
import NoRolesFound from "./NoRolesFound";
import DeleteRolesDialog from "./dialogs/DeleteRoles";
import DeleteRoleDialog from "./dialogs/DeleteRole";
import EditRoleDialog from "./dialogs/EditRole";
import "./rolesTable.scss";

Expand Down Expand Up @@ -123,7 +123,7 @@ export function RolesTable({
</TableBody>
</Table>
{showDeleteDialog && currentlySelectedRole !== undefined ? (
<DeleteRolesDialog
<DeleteRoleDialog
deleteRoleFromRawResponse={deleteRoleFromRawResponse}
onCloseDialog={() => setShowDeleteDialog(false)}
currentlySelectedRoleName={currentlySelectedRole.role}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
& > svg {
height: 37px;
width: 30px;
color: var(--color-primary);
}

& > h1 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ReactComponent as GreenCheckIcon } from "../../../../../assets/green-ch
import { ReactComponent as LoaderIcon } from "../../../../../assets/loader.svg";
import { ReactComponent as NoResultsIcon } from "../../../../../assets/no-results.svg";
import { ReactComponent as PlusAdd } from "../../../../../assets/plus-square.svg";
import { ReactComponent as SecuityKeyIcon } from "../../../../../assets/secuity-key.svg";
import { ReactComponent as SecuityKeyIcon } from "../../../../../assets/roles-and-permissions.svg";

import { getImageUrl } from "../../../../../utils";
import Button from "../../../button";
Expand Down Expand Up @@ -120,7 +120,7 @@ export default function AssignRolesDialog({
if (roles.length < 1) {
return (
<div className="info-container">
<SecuityKeyIcon />
<SecuityKeyIcon className="security-icon" />
<h1>You have not created any User Roles</h1>
<p>
<Link to="/roles">Click here</Link> to create roles that you can assign to users
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { PopupContentContext } from "../../../../contexts/PopupContentContext";
import Button from "../../../button";
import { Dialog, DialogContent, DialogFooter } from "../../../dialog";

import "./deleteRoles.scss";
import "./deleteRole.scss";

export default function DeleteRolesDialog({
export default function DeleteRoleDialog({
currentlySelectedRoleName,
deleteRoleFromRawResponse,
onCloseDialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from "../../../button";
import { Dialog, DialogContent, DialogFooter } from "../../../dialog";

import { getImageUrl } from "../../../../../utils";
import "./deleteRoles.scss";
import "./deleteRole.scss";

export default function DeleteUserRoleDialog({
onCloseDialog,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
width: 30px;
}

.security-icon {
color: var(--color-primary);
}

& > h1 {
color: var(--color-black);
text-align: center;
Expand Down
6 changes: 6 additions & 0 deletions src/ui/components/userroles/components/noRolesFound.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
max-width: 100%;
padding: 56px 0px;

.icon {
height: 54px;
width: 54px;
color: var(--color-primary);
}

& > div {
display: flex;
flex-direction: column;
Expand Down
13 changes: 9 additions & 4 deletions src/ui/pages/userroles/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export default function UserRolesList() {
const { getPermissionsForRole } = usePermissionsService();
const { showToast } = useContext(PopupContentContext);

// used to stores raw roles which is only array of role names data from response.
const [rolesRawResponse, setRolesRawResponse] = useState<string[]>([]);
// used to store roles with permissions data that are fetched on the client side.
const [roles, setRoles] = useState<Role[]>([]);
Expand Down Expand Up @@ -158,9 +157,15 @@ export default function UserRolesList() {
) : null}
</div>
<RolesTable
deleteRoleFromRawResponse={(role: string) =>
setRolesRawResponse(rolesRawResponse.filter((r) => r !== role))
}
deleteRoleFromRawResponse={(role: string) => {
const filteredRoles = rolesRawResponse.filter((r) => r !== role);
if (filteredRoles.length > 0) {
setRolesRawResponse(filteredRoles);
} else {
setRoles([]);
setRolesRawResponse([]);
}
}}
setCurrentActivePage={setCurrentActivePage}
setRoles={setRoles}
currentActivePage={currentActivePage}
Expand Down

0 comments on commit 27cc554

Please sign in to comment.