Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Organization Users page needs responsiveness #10413

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Common/UserSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default function UserSelector({
className="min-w-60 justify-start"
>
{selected ? (
<div className="flex items-center gap-2">
<div className="flex items-center gap-2 truncate">
<Avatar
imageUrl={selected.profile_picture_url}
name={formatName(selected)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function FacilityOrganizationUsers({ id, facilityId }: Props) {
return (
<FacilityOrganizationLayout id={id} facilityId={facilityId}>
<div className="space-y-6">
<div className="flex justify-between items-center">
<div className="flex justify-between items-center flex-wrap">
<h2 className="text-lg font-semibold">{t("users")}</h2>
<div className="flex gap-2">
<AddUserSheet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,18 +155,22 @@ export default function EditUserRoleSheet({
</div>
</div>

<div className="grid grid-cols-2 gap-4 pt-2 border-t">
<div>
<span className="text-sm text-gray-500">{t("username")}</span>
<p className="text-sm font-medium">{userRole.user.username}</p>
<div className="flex flex-col flex-wrap gap-2 pt-2 border-t">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Let's add truncate and tooltip for usernames (refer to other examples in codebase).

<div className="flex flex-wrap">
<div className="mr-3">
<span className="text-sm text-gray-500">{t("username")}</span>
<p className="text-sm font-medium truncate ">
{userRole.user.username}
</p>
</div>
<div>
<span className="text-sm text-gray-500">
{t("current_role")}
</span>
<p className="text-sm font-medium">{userRole.role.name}</p>
</div>
</div>
<div>
<span className="text-sm text-gray-500">
{t("current_role")}
</span>
<p className="text-sm font-medium">{userRole.role.name}</p>
</div>
<div className="col-span-2">
<span className="text-sm text-gray-500">
{t("last_login")}{" "}
</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ export default function LinkFacilityUserSheet({
{selectedUser && (
<div className="space-y-4">
<div className="rounded-lg border p-4 space-y-4">
<div className="flex items-start gap-4">
<div className="flex flex-wrap items-start gap-4">
<Avatar
imageUrl={selectedUser.profile_picture_url}
name={formatName(selectedUser)}
className="h-12 w-12"
/>
<div className="flex flex-col flex-1">
<div className="flex flex-col truncate">
<span className="font-medium text-lg">
{selectedUser.first_name} {selectedUser.last_name}
</span>
Expand All @@ -153,7 +153,7 @@ export default function LinkFacilityUserSheet({
</div>

<div className="grid grid-cols-2 gap-4 pt-2 border-t">
<div>
<div className="truncate">
<span className="text-sm text-gray-500">Username</span>
<p className="text-sm font-medium">
{selectedUser.username}
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Organization/OrganizationUsers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function OrganizationUsers({ id, navOrganizationId }: Props) {
return (
<OrganizationLayout id={id} navOrganizationId={navOrganizationId}>
<div className="space-y-6">
<div className="flex justify-between items-center">
<div className="justify-between items-center flex flex-wrap">
<div className="mt-1 flex flex-col justify-start space-y-2 md:flex-row md:justify-between md:space-y-0">
<EntityBadge
title={t("users")}
Expand All @@ -66,7 +66,7 @@ export default function OrganizationUsers({ id, navOrganizationId }: Props) {
translationParams={{ entity: "User" }}
/>
</div>
<div className="flex gap-2">
<div className="gap-2 flex flex-wrap mt-2">
<AddUserSheet
open={openAddUserSheet}
setOpen={(open) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Organization/components/AddUserSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function AddUserSheet({
return (
<Sheet open={open} onOpenChange={setOpen}>
<SheetTrigger asChild>
<Button variant="outline" data-cy="add-user-button" className="ml-3">
<Button variant="outline" data-cy="add-user-button">
<CareIcon icon="l-plus" className="mr-2 h-4 w-4" />
{t("add_user")}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Organization/components/LinkUserSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default function LinkUserSheet({
return (
<Sheet open={open} onOpenChange={setOpen}>
<SheetTrigger asChild>
<Button>
<Button variant="primary_gradient">
<CareIcon icon="l-plus" className="mr-2 h-4 w-4" />
Link User
</Button>
Expand Down
Loading