Skip to content

Commit

Permalink
chore: build files
Browse files Browse the repository at this point in the history
  • Loading branch information
Chakravarthy7102 committed Nov 2, 2023
1 parent d8194d8 commit 643d7f1
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 28 deletions.
8 changes: 8 additions & 0 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@
"static/media/favicon.ico": "/static/media/favicon.ico",
"static/media/ST_icon_light_theme.svg": "/static/media/ST_icon_light_theme.svg",
"static/media/ST_full_logo_dark_theme.svg": "/static/media/ST_full_logo_dark_theme.svg",
"static/media/secuity-key.svg": "/static/media/secuity-key.svg",
"static/media/ST_full_logo_light_theme.svg": "/static/media/ST_full_logo_light_theme.svg",
"static/media/ST_icon_dark_theme.svg": "/static/media/ST_icon_dark_theme.svg",
"static/media/auth-method.svg": "/static/media/auth-method.svg",
"static/media/logo.svg": "/static/media/logo.svg",
"static/media/plus-square.svg": "/static/media/plus-square.svg",
"static/media/roles-and-permissions.svg": "/static/media/roles-and-permissions.svg",
"static/media/no-results.svg": "/static/media/no-results.svg",
"static/media/email.svg": "/static/media/email.svg",
"static/media/user-managment.svg": "/static/media/user-managment.svg",
"static/media/lock.svg": "/static/media/lock.svg",
"static/media/checkmark-green.svg": "/static/media/checkmark-green.svg",
"static/media/plus.svg": "/static/media/plus.svg",
"static/media/green-check.svg": "/static/media/green-check.svg",
"static/media/clear.svg": "/static/media/clear.svg",
"static/media/provider-apple.svg": "/static/media/provider-apple.svg",
"static/media/search.png": "/static/media/search.png",
Expand All @@ -40,6 +44,7 @@
"static/media/trash-opened.svg": "/static/media/trash-opened.svg",
"static/media/checkmark.svg": "/static/media/checkmark.svg",
"index.html": "/index.html",
"static/media/loader.svg": "/static/media/loader.svg",
"static/media/star_sparkle.svg": "/static/media/star_sparkle.svg",
"static/media/close.svg": "/static/media/close.svg",
"static/media/copy.svg": "/static/media/copy.svg",
Expand All @@ -56,10 +61,13 @@
"static/media/chevron-up-selected.svg": "/static/media/chevron-up-selected.svg",
"static/media/chevron-right.svg": "/static/media/chevron-right.svg",
"static/media/people.svg": "/static/media/people.svg",
"static/media/hamburger-menu.svg": "/static/media/hamburger-menu.svg",
"static/media/provider-facebook.svg": "/static/media/provider-facebook.svg",
"static/media/Union-yellow.png": "/static/media/Union-yellow.png",
"static/media/Union.png": "/static/media/Union.png",
"static/media/checkmark-yellow.svg": "/static/media/checkmark-yellow.svg",
"static/media/spinner.svg": "/static/media/spinner.svg",
"static/media/cross.svg": "/static/media/cross.svg",
"static/media/triangle-down.svg": "/static/media/triangle-down.svg",
"main.css.map": "/static/css/main.css.map",
"bundle.js.map": "/static/js/bundle.js.map",
Expand Down
4 changes: 2 additions & 2 deletions 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.

3 changes: 3 additions & 0 deletions build/static/media/cross.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/static/media/green-check.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions build/static/media/hamburger-menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions build/static/media/loader.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/static/media/no-results.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions build/static/media/plus-square.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions build/static/media/secuity-key.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build/static/media/spinner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/ui/components/header/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
background: var(--color-white);

display: flex;
justify-content: start;
justify-content: flex-start;
align-items: center;
gap: 14px;

Expand Down
80 changes: 59 additions & 21 deletions src/ui/components/userroles/components/RolesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export function RolesTable() {

const [selectedRolesToDelete, setSelectedRolesToDelete] = useState<string[]>([]);
const [showDeleteDialog, setShowDeleteDialog] = useState(false);
const [showEditDialog, setShowEditDialog] = useState(true);
const [showEditDialog, setShowEditDialog] = useState(false);

const [isLoading, setIsLoading] = useState(false);

Expand Down Expand Up @@ -85,32 +85,14 @@ export function RolesTable() {
<TableRow
key={role}
data-active={selected ? "true" : "false"}
onClick={() => {
onClick={(e) => {
setSelectedRole(roles[index]);
setShowEditDialog(true);
}}>
<TableCell>{role}</TableCell>
<TableCell>
<div className="permissions-container">
<div
id="permissions"
className="permissions">
{permissions.map((permission) => {
return (
<Badge
key={permission}
text={permission}
/>
);
})}
{permissions.length < 1 ? (
<Button
color="info"
size="xs">
No Permissions
</Button>
) : null}
</div>
<Permissions permissions={permissions} />
<button
onClick={(e) => {
e.stopPropagation();
Expand Down Expand Up @@ -144,3 +126,59 @@ export function RolesTable() {
</>
);
}

function Permissions({ permissions }: { permissions: string[] }) {
const [badgeRenderLimit, setBadgeRenderLimit] = useState(4);

useEffect(() => {
function handleResizeEvent() {
const matchesTablet = window.matchMedia("(min-width: 768px)");
const matchesMobile = window.matchMedia("(min-width: 568px)");

if (matchesMobile.matches === false) {
setBadgeRenderLimit(1);
} else if (matchesTablet.matches === false) {
setBadgeRenderLimit(2);
} else {
setBadgeRenderLimit(4);
}
}

handleResizeEvent();
window.addEventListener("resize", handleResizeEvent);

() => {
window.removeEventListener("resize", handleResizeEvent);
};
}, []);

return (
<div
id="permissions"
className="permissions">
{permissions.slice(0, badgeRenderLimit).map((permission) => {
return (
<Badge
className="badge-width"
key={permission}
text={permission}
/>
);
})}
{badgeRenderLimit < permissions.length ? (
<Button
size="sm"
color="info">
...
</Button>
) : null}
{permissions.length < 1 ? (
<Button
color="info"
size="xs">
No Permissions
</Button>
) : null}
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export default function DeleteUserRoleDialog({
</Button>
<Button
isLoading={isDeletingRoles}
disabled={isDeletingRoles}
onClick={handleDeleteUserRole}
color="danger">
Yes, Delete
Expand Down
6 changes: 5 additions & 1 deletion src/ui/components/userroles/components/rolesTable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@
.permissions-container {
display: flex;
justify-content: space-between;
gap: 14px;

& > .permissions {
display: flex;
gap: 24px;
max-width: 400px;
overflow: hidden;

.badge-width {
width: 80px !important;
}
}

& > .delete-role {
Expand Down

0 comments on commit 643d7f1

Please sign in to comment.