From cebbef4581eb15c92aacee445071361dac52eae9 Mon Sep 17 00:00:00 2001 From: Nikhil Kothari Date: Fri, 19 Jan 2024 15:10:04 +0530 Subject: [PATCH] feat: show warning if role profile is added to user --- .../feature/raven-users/AddRavenUsersContent.tsx | 2 +- .../components/feature/raven-users/UsersTable.tsx | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/raven-app/src/components/feature/raven-users/AddRavenUsersContent.tsx b/raven-app/src/components/feature/raven-users/AddRavenUsersContent.tsx index db09f5124..b8253e94c 100644 --- a/raven-app/src/components/feature/raven-users/AddRavenUsersContent.tsx +++ b/raven-app/src/components/feature/raven-users/AddRavenUsersContent.tsx @@ -31,7 +31,7 @@ const AddRavenUsersContent = ({ onClose }: { onClose: VoidFunction }) => { const [sortOrder, setSortOder] = useState<"asc" | "desc">("desc") const { data, error } = useFrappeGetDocList("User", { - fields: ["name", "full_name", "user_image", "creation", "enabled", "user_type"], + fields: ["name", "full_name", "user_image", "creation", "enabled", "user_type", "role_profile_name"], filters, orderBy: { field: 'creation', diff --git a/raven-app/src/components/feature/raven-users/UsersTable.tsx b/raven-app/src/components/feature/raven-users/UsersTable.tsx index d3f8de751..1a91ba119 100644 --- a/raven-app/src/components/feature/raven-users/UsersTable.tsx +++ b/raven-app/src/components/feature/raven-users/UsersTable.tsx @@ -1,8 +1,9 @@ import { User } from "@/types/Core/User" import { useMemo } from "react" -import { Checkbox, Flex, Table } from "@radix-ui/themes" +import { Badge, Box, Checkbox, Flex, Table, Tooltip } from "@radix-ui/themes" import { UserAvatar } from "@/components/common/UserAvatar" import { StandardDate } from "@/utils/dateConversions" +import { FiAlertTriangle } from "react-icons/fi" interface UsersTableProps { data: User[], @@ -62,6 +63,7 @@ export const UsersTable = ({ data, selected, setSelected, defaultSelected }: Use Name User ID Created on + @@ -79,6 +81,16 @@ export const UsersTable = ({ data, selected, setSelected, defaultSelected }: Use {user.name} + + {user.role_profile_name ? + + A role profile has been assigned to this user.
If you want to add the user to Raven, please change their role profile.}> + + + Role Profile Added +
+
: null} +
) })}