Skip to content

Commit

Permalink
Merge pull request #634 from The-Commit-Company/599-rav-25-show-a-war…
Browse files Browse the repository at this point in the history
…ning-if-a-role-profile-is-added-to-a-user-during-onboarding

feat: show warning if role profile is added to user
  • Loading branch information
nikkothari22 authored Jan 19, 2024
2 parents 0fe375b + cebbef4 commit 3d63b6b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const AddRavenUsersContent = ({ onClose }: { onClose: VoidFunction }) => {
const [sortOrder, setSortOder] = useState<"asc" | "desc">("desc")

const { data, error } = useFrappeGetDocList<User>("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',
Expand Down
14 changes: 13 additions & 1 deletion raven-app/src/components/feature/raven-users/UsersTable.tsx
Original file line number Diff line number Diff line change
@@ -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[],
Expand Down Expand Up @@ -62,6 +63,7 @@ export const UsersTable = ({ data, selected, setSelected, defaultSelected }: Use
<Table.ColumnHeaderCell>Name</Table.ColumnHeaderCell>
<Table.ColumnHeaderCell>User ID</Table.ColumnHeaderCell>
<Table.ColumnHeaderCell>Created on</Table.ColumnHeaderCell>
<Table.ColumnHeaderCell></Table.ColumnHeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
Expand All @@ -79,6 +81,16 @@ export const UsersTable = ({ data, selected, setSelected, defaultSelected }: Use

<Table.Cell>{user.name}</Table.Cell>
<Table.Cell><StandardDate date={user.creation} /></Table.Cell>
<Table.Cell>
{user.role_profile_name ?
<Box>
<Tooltip content={<span>A role profile has been assigned to this user.<br />If you want to add the user to Raven, please change their role profile.</span>}>
<Badge color='red' variant="solid">
<FiAlertTriangle size='12' />
Role Profile Added</Badge>
</Tooltip>
</Box> : null}
</Table.Cell>
</Table.Row>
)
})}
Expand Down

0 comments on commit 3d63b6b

Please sign in to comment.