Skip to content

Commit

Permalink
pass current user email down
Browse files Browse the repository at this point in the history
  • Loading branch information
lovincyrus committed Sep 30, 2024
1 parent 4578191 commit da2a5eb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
export let open = false;
export let groupName: string;
export let currentUserEmail: string;
export let onRename: (groupName: string, newName: string) => void;
export let onRemoveUser: (groupName: string, email: string) => void;
Expand Down Expand Up @@ -121,7 +122,7 @@
<span class="text-sm font-medium text-gray-900">
{member.userName}
<span class="text-gray-500 font-normal">
{member.userEmail === "You" ? "(You)" : ""}
{member.userEmail === currentUserEmail ? "(You)" : ""}
</span>
</span>
<span class="text-xs text-gray-500">{member.userEmail}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export let data: V1MemberUsergroup[];
export let users: V1MemberUser[];
export let currentUserEmail: string;
export let onRename: (groupName: string, newName: string) => void;
export let onDelete: (deletedGroupName: string) => void;
export let onAddRole: (groupName: string, role: string) => void;
Expand Down Expand Up @@ -59,6 +60,7 @@
name: row.original.groupName,
role: row.original.roleName,
users: users,
currentUserEmail: currentUserEmail,
onRename: onRename,
onDelete: onDelete,
onAddRole: onAddRole,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
export let name: string;
export let role: string | undefined = undefined;
export let currentUserEmail: string;
export let onRename: (groupName: string, newName: string) => void;
export let onDelete: (deletedGroupName: string) => void;
export let onAddRole: (groupName: string, role: string) => void;
Expand Down Expand Up @@ -167,6 +168,7 @@
<EditUserGroupDialog
bind:open={isEditDialogOpen}
groupName={name}
{currentUserEmail}
{onRename}
{onRemoveUser}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
createAdminServiceAddOrganizationMemberUsergroup,
createAdminServiceCreateUsergroup,
createAdminServiceDeleteUsergroup,
createAdminServiceGetCurrentUser,
createAdminServiceListOrganizationMemberUsergroups,
createAdminServiceListOrganizationMemberUsers,
createAdminServiceRemoveOrganizationMemberUsergroup,
Expand Down Expand Up @@ -31,6 +32,7 @@
createAdminServiceListOrganizationMemberUsers(organization);
const queryClient = useQueryClient();
const currentUser = createAdminServiceGetCurrentUser();
const createUserGroup = createAdminServiceCreateUsergroup();
const renameUserGroup = createAdminServiceRenameUsergroup();
const deleteUserGroup = createAdminServiceDeleteUsergroup();
Expand Down Expand Up @@ -217,6 +219,7 @@
<OrgGroupsTable
data={$listOrganizationMemberUsergroups.data.members}
users={$listOrganizationMemberUsers.data?.members ?? []}
currentUserEmail={$currentUser.data?.user.email}
onRename={handleRename}
onDelete={handleDelete}
onAddRole={handleAddRole}
Expand Down

0 comments on commit da2a5eb

Please sign in to comment.