diff --git a/ui/app/(prowler)/providers/(set-up-provider)/update-credentials/page.tsx b/ui/app/(prowler)/providers/(set-up-provider)/update-credentials/page.tsx index c3476099ab5..0123ce73f2d 100644 --- a/ui/app/(prowler)/providers/(set-up-provider)/update-credentials/page.tsx +++ b/ui/app/(prowler)/providers/(set-up-provider)/update-credentials/page.tsx @@ -1,3 +1,4 @@ +import { Alert, cn } from "@nextui-org/react"; import React from "react"; import { @@ -14,7 +15,39 @@ export default function UpdateCredentialsPage({ searchParams }: Props) { return ( <> {searchParams.type === "aws" && !searchParams.via && ( - + <> +
+

+ If the provider was set up with static credentials, updates must + use static credentials. If it was set up with a role, updates must + use a role. +

+ + + To update provider credentials,{" "} + + you must use the same type that was originally configured. + {" "} + + } + /> +

+ To switch from static credentials to a role (or vice versa), you + need to delete the provider and set it up again. +

+ +
+ )} {((searchParams.type === "aws" && searchParams.via === "credentials") || diff --git a/ui/components/findings/table/data-table-row-actions.tsx b/ui/components/findings/table/data-table-row-actions.tsx index 8e15c942a03..a552030a920 100644 --- a/ui/components/findings/table/data-table-row-actions.tsx +++ b/ui/components/findings/table/data-table-row-actions.tsx @@ -76,7 +76,7 @@ export function DataTableRowActions({ description="Allows you to send the finding to Jira" textValue="Send to Jira" startContent={} - // onClick={() => setIsEditOpen(true)} + // onPress={() => setIsEditOpen(true)} > {findingId} Send to Jira @@ -86,7 +86,7 @@ export function DataTableRowActions({ description="Allows you to send the finding to Slack" textValue="Send to Slack" startContent={} - // onClick={() => setIsEditOpen(true)} + // onPress={() => setIsEditOpen(true)} > Send to Slack diff --git a/ui/components/invitations/table/data-table-row-actions.tsx b/ui/components/invitations/table/data-table-row-actions.tsx index 6a30365575b..a244443b90a 100644 --- a/ui/components/invitations/table/data-table-row-actions.tsx +++ b/ui/components/invitations/table/data-table-row-actions.tsx @@ -15,6 +15,7 @@ import { } from "@nextui-org/shared-icons"; import { Row } from "@tanstack/react-table"; import clsx from "clsx"; +import { useRouter } from "next/navigation"; import { useState } from "react"; import { VerticalDotsIcon } from "@/components/icons"; @@ -33,6 +34,7 @@ export function DataTableRowActions({ row, roles, }: DataTableRowActionsProps) { + const router = useRouter(); const [isEditOpen, setIsEditOpen] = useState(false); const [isDeleteOpen, setIsDeleteOpen] = useState(false); const invitationId = (row.original as { id: string }).id; @@ -82,11 +84,13 @@ export function DataTableRowActions({ > } + onPress={() => + router.push(`/invitations/check-details?id=${invitationId}`) + } > Check Details @@ -96,7 +100,7 @@ export function DataTableRowActions({ description="Allows you to edit the invitation" textValue="Edit Invitation" startContent={} - onClick={() => setIsEditOpen(true)} + onPress={() => setIsEditOpen(true)} > Edit Invitation @@ -113,7 +117,7 @@ export function DataTableRowActions({ className={clsx(iconClasses, "!text-danger")} /> } - onClick={() => setIsDeleteOpen(true)} + onPress={() => setIsDeleteOpen(true)} > Revoke Invitation diff --git a/ui/components/manage-groups/table/data-table-row-actions.tsx b/ui/components/manage-groups/table/data-table-row-actions.tsx index 00452446a72..88bfb32dad1 100644 --- a/ui/components/manage-groups/table/data-table-row-actions.tsx +++ b/ui/components/manage-groups/table/data-table-row-actions.tsx @@ -69,7 +69,7 @@ export function DataTableRowActions({ description="Allows you to edit the provider group" textValue="Edit Provider Group" startContent={} - onClick={() => router.push(`/manage-groups?groupId=${groupId}`)} + onPress={() => router.push(`/manage-groups?groupId=${groupId}`)} > Edit Provider Group @@ -86,7 +86,7 @@ export function DataTableRowActions({ className={clsx(iconClasses, "!text-danger")} /> } - onClick={() => setIsDeleteOpen(true)} + onPress={() => setIsDeleteOpen(true)} > Delete Provider Group diff --git a/ui/components/providers/table/data-table-row-actions.tsx b/ui/components/providers/table/data-table-row-actions.tsx index 7cc95cada5f..3a7cfc37f1b 100644 --- a/ui/components/providers/table/data-table-row-actions.tsx +++ b/ui/components/providers/table/data-table-row-actions.tsx @@ -15,6 +15,7 @@ import { } from "@nextui-org/shared-icons"; import { Row } from "@tanstack/react-table"; import clsx from "clsx"; +import { useRouter } from "next/navigation"; import { useState } from "react"; import { checkConnectionProvider } from "@/actions/providers/providers"; @@ -33,6 +34,7 @@ const iconClasses = export function DataTableRowActions({ row, }: DataTableRowActionsProps) { + const router = useRouter(); const [isEditOpen, setIsEditOpen] = useState(false); const [isDeleteOpen, setIsDeleteOpen] = useState(false); const providerId = (row.original as { id: string }).id; @@ -87,11 +89,15 @@ export function DataTableRowActions({ > } + onPress={() => + router.push( + `/providers/update-credentials?type=${providerType}&id=${providerId}${providerSecretId ? `&secretId=${providerSecretId}` : ""}`, + ) + } > Update Credentials @@ -100,7 +106,7 @@ export function DataTableRowActions({ description="Check the connection to the provider" textValue="Check Connection" startContent={} - onClick={handleTestConnection} + onPress={handleTestConnection} > Test Connection @@ -109,7 +115,7 @@ export function DataTableRowActions({ description="Allows you to edit the provider" textValue="Edit Provider" startContent={} - onClick={() => setIsEditOpen(true)} + onPress={() => setIsEditOpen(true)} > Edit Provider Alias @@ -126,7 +132,7 @@ export function DataTableRowActions({ className={clsx(iconClasses, "!text-danger")} /> } - onClick={() => setIsDeleteOpen(true)} + onPress={() => setIsDeleteOpen(true)} > Delete Provider diff --git a/ui/components/roles/table/data-table-row-actions.tsx b/ui/components/roles/table/data-table-row-actions.tsx index ff9d98884bd..abf674838d7 100644 --- a/ui/components/roles/table/data-table-row-actions.tsx +++ b/ui/components/roles/table/data-table-row-actions.tsx @@ -14,6 +14,7 @@ import { } from "@nextui-org/shared-icons"; import { Row } from "@tanstack/react-table"; import clsx from "clsx"; +import { useRouter } from "next/navigation"; import { useState } from "react"; import { VerticalDotsIcon } from "@/components/icons"; @@ -29,6 +30,7 @@ const iconClasses = export function DataTableRowActions({ row, }: DataTableRowActionsProps) { + const router = useRouter(); const [isDeleteOpen, setIsDeleteOpen] = useState(false); const roleId = (row.original as { id: string }).id; return ( @@ -59,11 +61,11 @@ export function DataTableRowActions({ > } + onPress={() => router.push(`/roles/edit?roleId=${roleId}`)} > Edit Role @@ -80,7 +82,7 @@ export function DataTableRowActions({ className={clsx(iconClasses, "!text-danger")} /> } - onClick={() => setIsDeleteOpen(true)} + onPress={() => setIsDeleteOpen(true)} > Delete Role diff --git a/ui/components/scans/table/scans/data-table-row-actions.tsx b/ui/components/scans/table/scans/data-table-row-actions.tsx index da35eb2f9b9..7a010239868 100644 --- a/ui/components/scans/table/scans/data-table-row-actions.tsx +++ b/ui/components/scans/table/scans/data-table-row-actions.tsx @@ -69,7 +69,7 @@ export function DataTableRowActions({ description="Allows you to edit the scan name" textValue="Edit Scan Name" startContent={} - onClick={() => setIsEditOpen(true)} + onPress={() => setIsEditOpen(true)} > Edit scan name diff --git a/ui/components/ui/sidebar/sidebar-wrap.tsx b/ui/components/ui/sidebar/sidebar-wrap.tsx index 48306327dfe..773963ccfa8 100644 --- a/ui/components/ui/sidebar/sidebar-wrap.tsx +++ b/ui/components/ui/sidebar/sidebar-wrap.tsx @@ -283,7 +283,7 @@ export const SidebarWrap = () => {