diff --git a/frontend/src/components/v3/generic/Alert/Alert.tsx b/frontend/src/components/v3/generic/Alert/Alert.tsx index 2e8190df15..af5fd7a498 100644 --- a/frontend/src/components/v3/generic/Alert/Alert.tsx +++ b/frontend/src/components/v3/generic/Alert/Alert.tsx @@ -6,7 +6,7 @@ import { cva, type VariantProps } from "cva"; import { cn } from "../../utils"; const alertVariants = cva( - "relative w-full border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", + "relative w-full border px-4 rounded-md py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current", { variants: { variant: { diff --git a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx index e90ba2c370..395a03d45c 100644 --- a/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx +++ b/frontend/src/pages/pam/PamAccountsPage/components/PamAccountsTable.tsx @@ -16,7 +16,6 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useNavigate, useSearch } from "@tanstack/react-router"; import { twMerge } from "tailwind-merge"; -import { createNotification } from "@app/components/notifications"; import { ProjectPermissionCan } from "@app/components/permissions"; import { Button, @@ -251,13 +250,8 @@ export const PamAccountsTable = ({ projectId }: Props) => { }); if (requiresApproval) { - createNotification({ - text: "This account is protected by an approval policy, you must request access", - type: "info" - }); - // Open request access modal with pre-populated path - handlePopUpOpen("requestAccount", { accountPath: fullAccountPath }); + handlePopUpOpen("requestAccount", { accountPath: fullAccountPath, accountAccessed: true }); return; } @@ -560,6 +554,7 @@ export const PamAccountsTable = ({ projectId }: Props) => { isOpen={popUp.requestAccount.isOpen} onOpenChange={(isOpen) => handlePopUpToggle("requestAccount", isOpen)} accountPath={popUp.requestAccount.data?.accountPath} + accountAccessed={popUp.requestAccount.data?.accountAccessed} /> void; }; @@ -45,7 +48,7 @@ const formSchema = z.object({ type FormData = z.infer; -const Content = ({ onOpenChange, accountPath }: Props) => { +const Content = ({ onOpenChange, accountPath, accountAccessed }: Props) => { const { projectId } = useProject(); const { mutateAsync: createApprovalRequest, isPending: isSubmitting } = useCreateApprovalRequest(); @@ -94,6 +97,15 @@ const Content = ({ onOpenChange, accountPath }: Props) => { return (
+ {accountAccessed && ( + + + This account is protected by an approval policy + + You must request access by filling out the fields below. + + + )}