mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-20 20:07:53 +00:00
Merge pull request #4749 from Infisical/migrate-badge-component
feature(front-end): v3 Badge migration, additional stories/variants, and misc styling fixes/improvements
This commit is contained in:
+3
-2
@@ -14,7 +14,8 @@ import { format } from "date-fns";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { Badge, IconButton, Td, Tooltip, Tr } from "@app/components/v2";
|
||||
import { IconButton, Td, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub, useProject } from "@app/context";
|
||||
import { TCloudIntegration } from "@app/hooks/api/integrations/types";
|
||||
import { TIntegration } from "@app/hooks/api/types";
|
||||
@@ -103,7 +104,7 @@ export const IntegrationRow = ({
|
||||
<Td>
|
||||
{" "}
|
||||
{typeof integration.isSynced !== "boolean" ? (
|
||||
<Badge variant="primary" key={integration.id}>
|
||||
<Badge variant="info" key={integration.id}>
|
||||
Pending Sync
|
||||
</Badge>
|
||||
) : (
|
||||
|
||||
+7
-12
@@ -13,12 +13,12 @@ import {
|
||||
faToggleOff,
|
||||
faToggleOn,
|
||||
faTrash,
|
||||
faTriangleExclamation,
|
||||
faXmark
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { format } from "date-fns";
|
||||
import { AlertTriangleIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
@@ -29,7 +29,6 @@ import {
|
||||
SecretSyncStatusBadge
|
||||
} from "@app/components/secret-syncs";
|
||||
import {
|
||||
Badge,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
@@ -39,6 +38,7 @@ import {
|
||||
Tooltip,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
@@ -173,15 +173,10 @@ export const SecretSyncRow = ({
|
||||
) : (
|
||||
<Td>
|
||||
<Tooltip content="The source location for this sync has been deleted. Configure a new source or remove this sync.">
|
||||
<div className="w-min">
|
||||
<Badge
|
||||
className="flex h-5 w-min items-center gap-1.5 whitespace-nowrap"
|
||||
variant="primary"
|
||||
>
|
||||
<FontAwesomeIcon icon={faTriangleExclamation} />
|
||||
<span>Source Folder Deleted</span>
|
||||
</Badge>
|
||||
</div>
|
||||
<Badge variant="danger">
|
||||
<AlertTriangleIcon />
|
||||
<span>Source Folder Deleted</span>
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
</Td>
|
||||
)}
|
||||
@@ -237,7 +232,7 @@ export const SecretSyncRow = ({
|
||||
content="Auto-Sync is disabled. Changes to the source location will not be automatically synced to the destination."
|
||||
>
|
||||
<div>
|
||||
<Badge className="flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<Badge variant="neutral">
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
{!syncStatus && "Auto-Sync Disabled"}
|
||||
</Badge>
|
||||
|
||||
+4
-16
@@ -1,5 +1,5 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { faArrowUpRightFromSquare, faBookOpen, faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faPlus } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useNavigate, useSearch } from "@tanstack/react-router";
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { CreateSecretSyncModal } from "@app/components/secret-syncs";
|
||||
import { TSecretSyncForm } from "@app/components/secret-syncs/forms/schemas";
|
||||
import { Button, Spinner } from "@app/components/v2";
|
||||
import { DocumentationLinkBadge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { ProjectPermissionSub, useProject } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
@@ -91,22 +92,9 @@ export const SecretSyncsTab = () => {
|
||||
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<div className="flex items-start gap-1">
|
||||
<div className="flex items-center gap-1.5">
|
||||
<p className="text-lg font-medium text-mineshaft-100">Secret Syncs</p>
|
||||
<a
|
||||
href="https://infisical.com/docs/integrations/secret-syncs/overview"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="mt-[0.32rem] ml-1 inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1.5 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<DocumentationLinkBadge href="https://infisical.com/docs/integrations/secret-syncs/overview" />
|
||||
</div>
|
||||
<p className="text-sm text-bunker-300">
|
||||
Use App Connections to sync secrets to third-party services.
|
||||
|
||||
+7
-10
@@ -11,11 +11,13 @@ import {
|
||||
faXmark
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { XIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { SecretRotationV2StatusBadge } from "@app/components/secret-rotations-v2/SecretRotationV2StatusBadge";
|
||||
import { Badge, IconButton, TableContainer, Tag, Td, Tooltip, Tr } from "@app/components/v2";
|
||||
import { IconButton, TableContainer, Tag, Td, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import {
|
||||
ProjectPermissionSecretRotationActions,
|
||||
ProjectPermissionSub
|
||||
@@ -70,15 +72,10 @@ export const SecretOverviewSecretRotationRow = ({
|
||||
<div className="flex-1">{secretRotationName}</div>
|
||||
{statuses?.some((status) => status === SecretRotationStatus.Failed) && (
|
||||
<Tooltip className="max-w-sm" content="One or more secrets failed to rotate.">
|
||||
<div>
|
||||
<Badge
|
||||
variant="danger"
|
||||
className="flex h-5 w-min items-center gap-1 whitespace-nowrap"
|
||||
>
|
||||
<FontAwesomeIcon icon={faXmark} />
|
||||
<span>Rotation Failed</span>
|
||||
</Badge>
|
||||
</div>
|
||||
<Badge variant="danger">
|
||||
<XIcon />
|
||||
Rotation Failed
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+8
-9
@@ -1,20 +1,18 @@
|
||||
import {
|
||||
faCheck,
|
||||
faChevronRight,
|
||||
faCode,
|
||||
faCopy,
|
||||
faEye,
|
||||
faFolder,
|
||||
faKey,
|
||||
faTags
|
||||
faKey
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { CurlyBracesIcon, TagsIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import {
|
||||
Badge,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
@@ -25,6 +23,7 @@ import {
|
||||
Tooltip,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { useProject } from "@app/context";
|
||||
import { reverseTruncate } from "@app/helpers/reverseTruncate";
|
||||
import { useTimedReset } from "@app/hooks";
|
||||
@@ -135,15 +134,15 @@ export const QuickSearchSecretItem = ({
|
||||
<Td>
|
||||
<div className="flex w-full items-center justify-end gap-4">
|
||||
{tagMatch && (
|
||||
<Badge variant="primary" className="flex items-center gap-1 whitespace-nowrap">
|
||||
<FontAwesomeIcon size="xs" icon={faTags} />
|
||||
<Badge variant="neutral">
|
||||
<TagsIcon />
|
||||
{tagMatch.slug}
|
||||
</Badge>
|
||||
)}
|
||||
{metadataMatch && !tagMatch && (
|
||||
<Badge variant="primary" className="flex items-center gap-1 whitespace-nowrap">
|
||||
<FontAwesomeIcon size="xs" icon={faCode} />
|
||||
<p className="truncate">Metadata Match</p>
|
||||
<Badge variant="neutral">
|
||||
<CurlyBracesIcon />
|
||||
Metadata
|
||||
</Badge>
|
||||
)}
|
||||
{isSingleEnv ? (
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Helmet } from "react-helmet";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
import { PageHeader, Tab, TabList, TabPanel, Tabs } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v2/Badge";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { useProject } from "@app/context";
|
||||
import { useGetAccessRequestsCount, useGetSecretApprovalRequestCount } from "@app/hooks/api";
|
||||
import { ProjectType } from "@app/hooks/api/projects/types";
|
||||
@@ -50,13 +50,17 @@ export const SecretApprovalsPage = () => {
|
||||
<Tab variant="project" value={TabSection.SecretApprovalRequests}>
|
||||
Change Requests
|
||||
{Boolean(secretApprovalReqCount?.open) && (
|
||||
<Badge className="ml-2">{secretApprovalReqCount?.open}</Badge>
|
||||
<Badge variant="warning" isSquare className="ml-2">
|
||||
{secretApprovalReqCount?.open}
|
||||
</Badge>
|
||||
)}
|
||||
</Tab>
|
||||
<Tab variant="project" value={TabSection.ResourceApprovalRequests}>
|
||||
Access Requests
|
||||
{Boolean(accessApprovalRequestCount?.pendingCount) && (
|
||||
<Badge className="ml-2">{accessApprovalRequestCount?.pendingCount}</Badge>
|
||||
<Badge variant="warning" isSquare className="ml-2">
|
||||
{accessApprovalRequestCount?.pendingCount}
|
||||
</Badge>
|
||||
)}
|
||||
</Tab>
|
||||
<Tab variant="project" value={TabSection.Policies}>
|
||||
|
||||
+23
-46
@@ -2,23 +2,18 @@
|
||||
/* eslint-disable react/jsx-no-useless-fragment */
|
||||
import { useCallback, useMemo, useState } from "react";
|
||||
import {
|
||||
faArrowUpRightFromSquare,
|
||||
faBan,
|
||||
faBookOpen,
|
||||
faCheck,
|
||||
faCheckCircle,
|
||||
faChevronDown,
|
||||
faClipboardCheck,
|
||||
faLock,
|
||||
faMagnifyingGlass,
|
||||
faPlus,
|
||||
faSearch,
|
||||
faStopwatch,
|
||||
faUser,
|
||||
IconDefinition
|
||||
faUser
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { format, formatDistance } from "date-fns";
|
||||
import { BanIcon, CheckIcon, ClipboardCheckIcon, LucideIcon, TimerIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal";
|
||||
@@ -34,7 +29,7 @@ import {
|
||||
Pagination,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v2/Badge";
|
||||
import { Badge, DocumentationLinkBadge } from "@app/components/v3";
|
||||
import {
|
||||
ProjectPermissionMemberActions,
|
||||
ProjectPermissionSub,
|
||||
@@ -207,12 +202,12 @@ export const AccessApprovalRequest = ({
|
||||
|
||||
let displayData: {
|
||||
label: string;
|
||||
type: "primary" | "danger" | "success";
|
||||
type: "warning" | "danger" | "success";
|
||||
tooltipContent?: string;
|
||||
icon: IconDefinition | null;
|
||||
icon: LucideIcon | null;
|
||||
} = {
|
||||
label: "",
|
||||
type: "primary",
|
||||
type: "warning",
|
||||
icon: null
|
||||
};
|
||||
|
||||
@@ -225,7 +220,7 @@ export const AccessApprovalRequest = ({
|
||||
displayData = {
|
||||
label: "Access Expired",
|
||||
type: "danger",
|
||||
icon: faStopwatch,
|
||||
icon: TimerIcon,
|
||||
tooltipContent: request.privilege?.temporaryAccessEndTime
|
||||
? `Expired ${format(request.privilege.temporaryAccessEndTime, "M/d/yyyy h:mm aa")}`
|
||||
: undefined
|
||||
@@ -234,27 +229,27 @@ export const AccessApprovalRequest = ({
|
||||
displayData = {
|
||||
label: "Access Granted",
|
||||
type: "success",
|
||||
icon: faCheck,
|
||||
icon: CheckIcon,
|
||||
tooltipContent: `Granted ${format(request.updatedAt, "M/d/yyyy h:mm aa")}`
|
||||
};
|
||||
else if (isRejectedByAnyone)
|
||||
displayData = {
|
||||
label: "Rejected",
|
||||
type: "danger",
|
||||
icon: faBan,
|
||||
icon: BanIcon,
|
||||
tooltipContent: `Rejected ${format(request.updatedAt, "M/d/yyyy h:mm aa")}`
|
||||
};
|
||||
else if (userReviewStatus === ApprovalStatus.APPROVED) {
|
||||
displayData = {
|
||||
label: "Pending Additional Reviews",
|
||||
type: "primary",
|
||||
icon: faClipboardCheck
|
||||
type: "warning",
|
||||
icon: ClipboardCheckIcon
|
||||
};
|
||||
} else if (!isReviewedByUser)
|
||||
displayData = {
|
||||
label: "Review Required",
|
||||
type: "primary",
|
||||
icon: faClipboardCheck
|
||||
type: "warning",
|
||||
icon: ClipboardCheckIcon
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -301,22 +296,9 @@ export const AccessApprovalRequest = ({
|
||||
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<div className="flex items-start gap-1">
|
||||
<div className="flex items-center gap-x-2">
|
||||
<p className="text-xl font-medium text-mineshaft-100">Access Requests</p>
|
||||
<a
|
||||
href="https://infisical.com/docs/documentation/platform/access-controls/access-requests"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="mt-[0.32rem] ml-1 inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1.5 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/access-controls/access-requests" />
|
||||
</div>
|
||||
<p className="text-sm text-bunker-300">
|
||||
Request and review access to secrets in sensitive environments and folders
|
||||
@@ -476,6 +458,8 @@ export const AccessApprovalRequest = ({
|
||||
filteredRequests?.slice(offset, perPage * page).map((request) => {
|
||||
const details = generateRequestDetails(request);
|
||||
|
||||
const StatusIcon = details.displayData.icon;
|
||||
|
||||
return (
|
||||
<div
|
||||
key={request.id}
|
||||
@@ -489,7 +473,7 @@ export const AccessApprovalRequest = ({
|
||||
}
|
||||
}}
|
||||
>
|
||||
<div className="flex w-full items-center justify-between">
|
||||
<div className="flex flex-1 items-center justify-between">
|
||||
<div className="flex w-full flex-col justify-between">
|
||||
<div className="mb-1 flex w-full items-center">
|
||||
<FontAwesomeIcon
|
||||
@@ -513,7 +497,7 @@ export const AccessApprovalRequest = ({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3">
|
||||
<div className="flex shrink-0 items-center gap-3">
|
||||
{request.requestedByUserId === user.id && (
|
||||
<div className="flex items-center gap-1.5 text-xs whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faUser} size="sm" />
|
||||
@@ -521,17 +505,10 @@ export const AccessApprovalRequest = ({
|
||||
</div>
|
||||
)}
|
||||
<Tooltip content={details.displayData.tooltipContent}>
|
||||
<div>
|
||||
<Badge
|
||||
className="flex items-center gap-1.5 whitespace-nowrap"
|
||||
variant={details.displayData.type}
|
||||
>
|
||||
{details.displayData.icon && (
|
||||
<FontAwesomeIcon icon={details.displayData.icon} />
|
||||
)}
|
||||
<span>{details.displayData.label}</span>
|
||||
</Badge>
|
||||
</div>
|
||||
<Badge variant={details.displayData.type}>
|
||||
{StatusIcon && <StatusIcon />}
|
||||
{details.displayData.label}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+19
-37
@@ -9,6 +9,7 @@ import {
|
||||
faUserSlash
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { BanIcon, CheckIcon, HourglassIcon } from "lucide-react";
|
||||
import ms from "ms";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
@@ -24,7 +25,7 @@ import {
|
||||
ModalContent,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v2/Badge";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionActions, useProject, useUser } from "@app/context";
|
||||
import { usePopUp } from "@app/hooks";
|
||||
import { useListWorkspaceGroups, useReviewAccessRequest } from "@app/hooks/api";
|
||||
@@ -42,13 +43,13 @@ import { EditAccessRequestModal } from "@app/pages/secret-manager/SecretApproval
|
||||
const getReviewedStatusSymbol = (status?: ApprovalStatus, isOrgMembershipActive?: boolean) => {
|
||||
if (status === ApprovalStatus.APPROVED)
|
||||
return (
|
||||
<Badge variant="success" className="flex h-4 items-center justify-center">
|
||||
<Badge variant="success">
|
||||
<FontAwesomeIcon icon={faCheck} size="xs" />
|
||||
</Badge>
|
||||
);
|
||||
if (status === ApprovalStatus.REJECTED)
|
||||
return (
|
||||
<Badge variant="danger" className="flex h-4 items-center justify-center">
|
||||
<Badge variant="danger">
|
||||
<FontAwesomeIcon icon={faBan} size="xs" />
|
||||
</Badge>
|
||||
);
|
||||
@@ -58,13 +59,13 @@ const getReviewedStatusSymbol = (status?: ApprovalStatus, isOrgMembershipActive?
|
||||
// Can't do a tooltip here because nested tooltips doesn't work properly as of yet.
|
||||
// TODO(daniel): Fix nested tooltips in the future.
|
||||
|
||||
<Badge className="flex h-4 items-center justify-center bg-mineshaft-400/50 text-bunker-300">
|
||||
<Badge variant="neutral">
|
||||
<FontAwesomeIcon size="xs" icon={faUserSlash} />
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Badge variant="primary" className="flex h-4 items-center justify-center">
|
||||
<Badge variant="warning">
|
||||
<FontAwesomeIcon icon={faHourglass} size="xs" />
|
||||
</Badge>
|
||||
);
|
||||
@@ -346,9 +347,7 @@ export const ReviewAccessRequestModal = ({
|
||||
<span>Approvers</span>
|
||||
{approverSequence.isMyReviewInThisSequence &&
|
||||
request.status === ApprovalStatus.PENDING && (
|
||||
<Badge variant="primary" className="h-min">
|
||||
Awaiting Your Review
|
||||
</Badge>
|
||||
<Badge variant="warning">Awaiting Your Review</Badge>
|
||||
)}
|
||||
</div>
|
||||
<div className="max-h-[40vh] thin-scrollbar overflow-y-auto rounded-sm py-2">
|
||||
@@ -364,43 +363,28 @@ export const ReviewAccessRequestModal = ({
|
||||
let BadgeComponent: ReactNode = null;
|
||||
if (approver.hasRejected) {
|
||||
StepComponent = (
|
||||
<Badge
|
||||
variant="danger"
|
||||
className="flex h-6 min-w-6 items-center justify-center"
|
||||
>
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
<Badge isSquare variant="danger">
|
||||
<BanIcon />
|
||||
</Badge>
|
||||
);
|
||||
BadgeComponent = <Badge variant="danger">Rejected</Badge>;
|
||||
} else if (approver.hasApproved) {
|
||||
StepComponent = (
|
||||
<Badge
|
||||
variant="success"
|
||||
className="flex h-6 min-w-6 items-center justify-center"
|
||||
>
|
||||
<FontAwesomeIcon icon={faCheck} />
|
||||
<Badge isSquare variant="success">
|
||||
<CheckIcon />
|
||||
</Badge>
|
||||
);
|
||||
BadgeComponent = <Badge variant="success">Approved</Badge>;
|
||||
} else if (isPending) {
|
||||
StepComponent = (
|
||||
<Badge
|
||||
variant="primary"
|
||||
className="flex h-6 min-w-6 items-center justify-center"
|
||||
>
|
||||
<FontAwesomeIcon icon={faHourglass} />
|
||||
<Badge isSquare variant="warning">
|
||||
<HourglassIcon />
|
||||
</Badge>
|
||||
);
|
||||
BadgeComponent = <Badge variant="primary">Pending</Badge>;
|
||||
BadgeComponent = <Badge variant="warning">Pending</Badge>;
|
||||
} else {
|
||||
StepComponent = (
|
||||
<Badge
|
||||
className={
|
||||
isInactive
|
||||
? "py-auto my-auto flex h-6 min-w-6 items-center justify-center gap-1.5 bg-mineshaft-400/50 text-center whitespace-nowrap text-bunker-200"
|
||||
: ""
|
||||
}
|
||||
>
|
||||
<Badge isSquare variant="neutral">
|
||||
<span>{index + 1}</span>
|
||||
</Badge>
|
||||
);
|
||||
@@ -447,12 +431,10 @@ export const ReviewAccessRequestModal = ({
|
||||
{member.user.username}
|
||||
<span className="text-xs">
|
||||
<Tooltip content="This user has been deactivated and no longer has an active organization membership.">
|
||||
<div>
|
||||
<Badge className="pointer-events-none mr-auto ml-1 flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
Inactive
|
||||
</Badge>
|
||||
</div>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Inactive
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
</span>
|
||||
</span>
|
||||
|
||||
+3
-17
@@ -2,8 +2,6 @@ import { useMemo, useState } from "react";
|
||||
import {
|
||||
faArrowDown,
|
||||
faArrowUp,
|
||||
faArrowUpRightFromSquare,
|
||||
faBookOpen,
|
||||
faCheckCircle,
|
||||
faFileShield,
|
||||
faFilter,
|
||||
@@ -36,6 +34,7 @@ import {
|
||||
THead,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { DocumentationLinkBadge } from "@app/components/v3";
|
||||
import {
|
||||
ProjectPermissionSub,
|
||||
TProjectPermission,
|
||||
@@ -243,22 +242,9 @@ export const ApprovalPolicyList = ({ projectId }: IProps) => {
|
||||
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<div className="flex items-start gap-1">
|
||||
<div className="flex items-center gap-x-2">
|
||||
<p className="text-xl font-medium text-mineshaft-100">Policies</p>
|
||||
<a
|
||||
href="https://infisical.com/docs/documentation/platform/pr-workflows"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="mt-[0.32rem] ml-1 inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1.5 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pr-workflows" />
|
||||
</div>
|
||||
<p className="text-sm text-bunker-300">
|
||||
Implement granular policies for access requests and secrets management
|
||||
|
||||
+9
-12
@@ -1,6 +1,5 @@
|
||||
import { useMemo } from "react";
|
||||
import {
|
||||
faBan,
|
||||
faClipboardCheck,
|
||||
faEdit,
|
||||
faEllipsisV,
|
||||
@@ -9,6 +8,7 @@ import {
|
||||
faUserGroup
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { BanIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
Tooltip,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v2/Badge";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { getMemberLabel } from "@app/helpers/members";
|
||||
@@ -100,6 +100,8 @@ export const ApprovalPolicyRow = ({
|
||||
});
|
||||
}, [policy, members, groups]);
|
||||
|
||||
const { variant, Icon } = policyDetails[policy.policyType];
|
||||
|
||||
return (
|
||||
<>
|
||||
<Tr
|
||||
@@ -116,13 +118,8 @@ export const ApprovalPolicyRow = ({
|
||||
<Td>{policy.environments.map((env) => env.name).join(", ")}</Td>
|
||||
<Td>{policy.secretPath || "*"}</Td>
|
||||
<Td>
|
||||
<Badge
|
||||
className={twMerge(
|
||||
policyDetails[policy.policyType].className,
|
||||
"flex w-min items-center gap-1.5 whitespace-nowrap"
|
||||
)}
|
||||
>
|
||||
<FontAwesomeIcon icon={policyDetails[policy.policyType].icon} />
|
||||
<Badge variant={variant}>
|
||||
<Icon />
|
||||
<span>{policyDetails[policy.policyType].name}</span>
|
||||
</Badge>
|
||||
</Td>
|
||||
@@ -196,7 +193,7 @@ export const ApprovalPolicyRow = ({
|
||||
className={twMerge("grow border-mineshaft-600", index !== 0 && "border-r")}
|
||||
/>
|
||||
{labels.length > 1 && (
|
||||
<Badge className="my-auto flex h-5 w-min min-w-5 items-center justify-center gap-1.5 bg-mineshaft-400/50 text-center whitespace-nowrap text-bunker-200">
|
||||
<Badge variant="neutral">
|
||||
<span>{index + 1}</span>
|
||||
</Badge>
|
||||
)}
|
||||
@@ -225,8 +222,8 @@ export const ApprovalPolicyRow = ({
|
||||
<span className="text-xs">
|
||||
<Tooltip content="This user has been deactivated and no longer has an active organization membership.">
|
||||
<div>
|
||||
<Badge className="pointer-events-none mr-auto ml-1 flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Inactive
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
import { components, OptionProps } from "react-select";
|
||||
import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
|
||||
import { faBan } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { BanIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { Badge } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { BypasserType } from "@app/hooks/api/accessApproval/types";
|
||||
import { ApproverType } from "@app/hooks/api/secretApproval/types";
|
||||
|
||||
@@ -26,8 +26,8 @@ export const PolicyMemberOption = ({
|
||||
{children}
|
||||
</p>
|
||||
{!props.data.isOrgMembershipActive && (
|
||||
<Badge className="pointer-events-none mr-auto ml-1 flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
<Badge className="ml-auto" variant="neutral">
|
||||
<BanIcon />
|
||||
Inactive
|
||||
</Badge>
|
||||
)}
|
||||
|
||||
+17
-27
@@ -1,23 +1,19 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
faArrowUpRightFromSquare,
|
||||
faBookOpen,
|
||||
faCheck,
|
||||
faCheckCircle,
|
||||
faChevronDown,
|
||||
faCodeBranch,
|
||||
faCodeMerge,
|
||||
faMagnifyingGlass,
|
||||
faSearch,
|
||||
faXmark
|
||||
faSearch
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useSearch } from "@tanstack/react-router";
|
||||
import { format, formatDistance } from "date-fns";
|
||||
import { GitMergeIcon, XIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -30,6 +26,7 @@ import {
|
||||
Skeleton,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge, DocumentationLinkBadge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import {
|
||||
ProjectPermissionMemberActions,
|
||||
@@ -139,22 +136,9 @@ export const SecretApprovalRequest = () => {
|
||||
<div className="w-full rounded-lg border border-mineshaft-600 bg-mineshaft-900 p-4">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<div>
|
||||
<div className="flex items-start gap-1">
|
||||
<div className="flex items-center gap-x-2">
|
||||
<p className="text-xl font-medium text-mineshaft-100">Change Requests</p>
|
||||
<a
|
||||
href="https://infisical.com/docs/documentation/platform/pr-workflows"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="mt-[0.32rem] ml-1 inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1.5" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1.5 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/pr-workflows" />
|
||||
</div>
|
||||
<p className="text-sm text-bunker-300">Review pending and closed change requests</p>
|
||||
</div>
|
||||
@@ -329,12 +313,18 @@ export const SecretApprovalRequest = () => {
|
||||
{status === "close" && (
|
||||
<Tooltip content={updatedAt ? format(new Date(updatedAt), "M/dd/yyyy h:mm a") : ""}>
|
||||
<div className="my-auto ml-auto">
|
||||
<Badge
|
||||
variant={hasMerged ? "success" : "danger"}
|
||||
className="flex h-min items-center gap-1"
|
||||
>
|
||||
<FontAwesomeIcon icon={hasMerged ? faCodeMerge : faXmark} />
|
||||
{hasMerged ? "Merged" : "Rejected"}
|
||||
<Badge variant={hasMerged ? "success" : "danger"}>
|
||||
{hasMerged ? (
|
||||
<>
|
||||
<GitMergeIcon />
|
||||
Merged
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<XIcon />
|
||||
Rejected
|
||||
</>
|
||||
)}
|
||||
</Badge>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
+4
-2
@@ -33,7 +33,6 @@ import { createNotification } from "@app/components/notifications";
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { CreateSecretRotationV2Modal } from "@app/components/secret-rotations-v2";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
DeleteActionModal,
|
||||
DropdownMenu,
|
||||
@@ -51,6 +50,7 @@ import {
|
||||
ModalContent,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import {
|
||||
ProjectPermissionActions,
|
||||
ProjectPermissionDynamicSecretActions,
|
||||
@@ -829,7 +829,9 @@ export const ActionBar = ({
|
||||
>
|
||||
<div className="flex w-full justify-between">
|
||||
<span>Tags</span>
|
||||
{Boolean(filteredTags) && <Badge>{filteredTags} Applied</Badge>}
|
||||
{Boolean(filteredTags) && (
|
||||
<Badge variant="info">{filteredTags} Applied</Badge>
|
||||
)}
|
||||
</div>
|
||||
</DropdownSubMenuTrigger>
|
||||
<DropdownSubMenuContent className="max-h-80 thin-scrollbar overflow-y-auto rounded-l-none">
|
||||
|
||||
+7
-23
@@ -13,16 +13,12 @@ import {
|
||||
} from "react-icons/si";
|
||||
import { VscAzure } from "react-icons/vsc";
|
||||
import { faAws, faGithub, faGoogle } from "@fortawesome/free-brands-svg-icons";
|
||||
import {
|
||||
faArrowUpRightFromSquare,
|
||||
faBookOpen,
|
||||
faClock,
|
||||
faDatabase
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { faClock, faDatabase } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
import { Modal, ModalContent } from "@app/components/v2";
|
||||
import { DocumentationLinkBadge } from "@app/components/v3";
|
||||
import { DynamicSecretProviders } from "@app/hooks/api/dynamicSecret/types";
|
||||
import { ProjectEnv } from "@app/hooks/api/types";
|
||||
|
||||
@@ -202,23 +198,11 @@ export const CreateDynamicSecretForm = ({
|
||||
<Modal isOpen={isOpen} onOpenChange={(state) => handleFormReset(state)}>
|
||||
<ModalContent
|
||||
title={
|
||||
<div className="flex items-center">
|
||||
<div className="flex items-center gap-x-2">
|
||||
<span>{modalTitle ? `${modalTitle} Dynamic Secret` : "Dynamic Secrets"} </span>
|
||||
<a
|
||||
<DocumentationLinkBadge
|
||||
href={`https://infisical.com/docs/documentation/platform/dynamic-secrets/${selectedProvider ? (UniqueLinks[selectedProvider] ?? selectedProvider) : "overview"}`}
|
||||
target="_blank"
|
||||
className="mb-0.5 ml-1.5"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1 mb-[0.03rem] text-[12px]" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
/>
|
||||
</div>
|
||||
}
|
||||
subTitle="Configure dynamic secret parameters"
|
||||
@@ -234,11 +218,11 @@ export const CreateDynamicSecretForm = ({
|
||||
exit={{ opacity: 0, translateX: -30 }}
|
||||
>
|
||||
<div className="mb-4 text-mineshaft-300">Select a service to connect to:</div>
|
||||
<div className="flex flex-wrap items-center gap-4">
|
||||
<div className="grid grid-cols-4 gap-2">
|
||||
{DYNAMIC_SECRET_LIST.map(({ icon, provider, title }) => (
|
||||
<div
|
||||
key={`dynamic-secret-provider-${provider}`}
|
||||
className="flex h-32 w-32 cursor-pointer flex-col items-center space-y-4 rounded-sm border border-mineshaft-500 bg-bunker-600 p-6 transition-all hover:border-primary/70 hover:bg-primary/10 hover:text-white"
|
||||
className="flex h-30 w-42 cursor-pointer flex-col items-center space-y-4 rounded-sm border border-mineshaft-500 bg-bunker-600 p-6 transition-all hover:border-primary/70 hover:bg-primary/10 hover:text-white"
|
||||
role="button"
|
||||
tabIndex={0}
|
||||
onClick={() => {
|
||||
|
||||
+4
-17
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
import { faArrowUpRightFromSquare, faBookOpen, faClone } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faClone } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import { z } from "zod";
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
Switch
|
||||
} from "@app/components/v2";
|
||||
import { SecretPathInput } from "@app/components/v2/SecretPathInput";
|
||||
import { DocumentationLinkBadge } from "@app/components/v3";
|
||||
import { ProjectPermissionSecretActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { useDebounce } from "@app/hooks";
|
||||
import { useGetAccessibleSecrets } from "@app/hooks/api/dashboard";
|
||||
@@ -227,23 +228,9 @@ export const ReplicateFolderFromBoard = ({
|
||||
bodyClassName="overflow-visible"
|
||||
className="max-w-2xl"
|
||||
title={
|
||||
<div className="flex items-center gap-1 text-mineshaft-300">
|
||||
<div className="flex items-center gap-x-2 text-mineshaft-300">
|
||||
<span>Replicate Secrets</span>
|
||||
<a
|
||||
target="_blank"
|
||||
href="https://infisical.com/docs/documentation/platform/folder#replicating-folder-contents"
|
||||
className="mb-1 ml-1"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
<div className="inline-block rounded-md bg-yellow/20 px-1.5 text-sm text-yellow opacity-80 hover:opacity-100">
|
||||
<FontAwesomeIcon icon={faBookOpen} className="mr-1 mb-[0.03rem] text-[12px]" />
|
||||
<span>Docs</span>
|
||||
<FontAwesomeIcon
|
||||
icon={faArrowUpRightFromSquare}
|
||||
className="mb-[0.07rem] ml-1 text-[10px]"
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
<DocumentationLinkBadge href="https://infisical.com/docs/documentation/platform/folder#replicating-folder-contents" />
|
||||
</div>
|
||||
}
|
||||
subTitle="Copy folder contents from other locations into this context"
|
||||
|
||||
+8
-12
@@ -1,16 +1,12 @@
|
||||
/* eslint-disable jsx-a11y/label-has-associated-control */
|
||||
import React, { useCallback, useState } from "react";
|
||||
import {
|
||||
faClipboardCheck,
|
||||
faCodeCommit,
|
||||
faFolder,
|
||||
faKey,
|
||||
faSave
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { faCodeCommit, faFolder, faKey, faSave } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
import { ClipboardCheckIcon } from "lucide-react";
|
||||
|
||||
import { Badge, Button, Input, Modal, ModalContent } from "@app/components/v2";
|
||||
import { Button, Input, Modal, ModalContent } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { PendingAction } from "@app/hooks/api/secretFolders/types";
|
||||
import { SecretVersionDiffView } from "@app/pages/secret-manager/CommitDetailsPage/components/SecretVersionDiffView";
|
||||
import { HIDDEN_SECRET_VALUE_API_MASK } from "@app/pages/secret-manager/SecretDashboardPage/components/SecretListView/SecretItem";
|
||||
@@ -329,9 +325,9 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
<div className="flex-1">
|
||||
{/* Header */}
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="h-2 w-2 rounded-full bg-yellow-500" />
|
||||
<div className="h-2 w-2 rounded-full bg-warning" />
|
||||
<span className="font-medium text-mineshaft-100">Pending Changes</span>
|
||||
<Badge variant="primary" className="text-xs">
|
||||
<Badge variant="warning">
|
||||
{totalChangesCount} Change{totalChangesCount !== 1 ? "s" : ""}
|
||||
</Badge>
|
||||
</div>
|
||||
@@ -375,9 +371,9 @@ export const CommitForm: React.FC<CommitFormProps> = ({
|
||||
<ModalContent
|
||||
title={
|
||||
<div className="flex items-center gap-2">
|
||||
<FontAwesomeIcon icon={faClipboardCheck} className="text-mineshaft-400" />
|
||||
Review Changes
|
||||
<Badge variant="primary" className="mt-[0.05rem]">
|
||||
<Badge variant="warning">
|
||||
<ClipboardCheckIcon />
|
||||
{totalChangesCount} Change{totalChangesCount !== 1 ? "s" : ""}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
+5
-8
@@ -9,14 +9,13 @@ import {
|
||||
faFolder,
|
||||
faKey,
|
||||
faRotate,
|
||||
faSearch,
|
||||
faWarning
|
||||
faSearch
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { AlertTriangleIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -38,6 +37,7 @@ import {
|
||||
Tooltip,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { useProject } from "@app/context";
|
||||
import {
|
||||
getUserTablePreference,
|
||||
@@ -396,11 +396,8 @@ export const CompareEnvironments = ({ secretPath }: Props) => {
|
||||
</>
|
||||
}
|
||||
>
|
||||
<Badge
|
||||
variant="primary"
|
||||
className="-mt-[0.05rem] flex h-4 items-center gap-x-1 pt-[0.1rem] leading-3 font-normal"
|
||||
>
|
||||
<FontAwesomeIcon icon={faWarning} className="-mt-[0.1rem] w-2.5" />
|
||||
<Badge variant="warning">
|
||||
<AlertTriangleIcon />
|
||||
{missingKeyCount}
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
|
||||
+10
-16
@@ -1,15 +1,9 @@
|
||||
import { ChangeEvent, Dispatch, DragEvent, SetStateAction, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { subject } from "@casl/ability";
|
||||
import {
|
||||
faArrowRight,
|
||||
faAsterisk,
|
||||
faComment,
|
||||
faKey,
|
||||
faPlus,
|
||||
faUpload
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { faArrowRight, faPlus, faUpload } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { AsteriskIcon, KeyIcon, MessageSquareIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
@@ -22,7 +16,6 @@ import {
|
||||
parseYaml
|
||||
} from "@app/components/utilities/parseSecrets";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
FormLabel,
|
||||
Lottie,
|
||||
@@ -31,6 +24,7 @@ import {
|
||||
Select,
|
||||
SelectItem
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
||||
import { usePopUp, useToggle } from "@app/hooks";
|
||||
import { PendingAction } from "@app/hooks/api/secretFolders/types";
|
||||
@@ -115,23 +109,23 @@ const MatrixImportModalTableRow = ({
|
||||
</td>
|
||||
<td className="whitespace-nowrap">
|
||||
<div className="flex h-full items-start justify-center">
|
||||
<Badge className="pointer-events-none flex h-[36px] w-full items-center justify-center gap-1.5 border border-mineshaft-600 bg-mineshaft-600 whitespace-nowrap text-bunker-200">
|
||||
<Badge isFullWidth variant="neutral">
|
||||
{mapKey === "key" && (
|
||||
<>
|
||||
<FontAwesomeIcon icon={faKey} />
|
||||
<span>Secret Key</span>
|
||||
<KeyIcon />
|
||||
Secret Key
|
||||
</>
|
||||
)}
|
||||
{mapKey === "value" && (
|
||||
<>
|
||||
<FontAwesomeIcon icon={faAsterisk} />
|
||||
<span>Secret Value</span>
|
||||
<AsteriskIcon />
|
||||
Secret Value
|
||||
</>
|
||||
)}
|
||||
{mapKey === "comment" && (
|
||||
<>
|
||||
<FontAwesomeIcon icon={faComment} />
|
||||
<span>Comment</span>
|
||||
<MessageSquareIcon />
|
||||
Comment
|
||||
</>
|
||||
)}
|
||||
</Badge>
|
||||
|
||||
+2
-2
@@ -67,10 +67,10 @@ export const SecretRotationItem = ({
|
||||
</Tooltip>
|
||||
)}
|
||||
</div>
|
||||
<SecretRotationV2StatusBadge className="mx-2" secretRotation={secretRotation} />
|
||||
<SecretRotationV2StatusBadge secretRotation={secretRotation} />
|
||||
<div
|
||||
key="actions"
|
||||
className="flex h-full shrink-0 self-start transition-all group-hover:gap-x-2"
|
||||
className="ml-2 flex h-full shrink-0 self-start transition-all group-hover:gap-x-2"
|
||||
>
|
||||
<Tooltip content="View Rotation Secrets">
|
||||
<IconButton
|
||||
|
||||
+9
-14
@@ -1,7 +1,6 @@
|
||||
import { useCallback } from "react";
|
||||
import { subject } from "@casl/ability";
|
||||
import {
|
||||
faBan,
|
||||
faCheck,
|
||||
faCopy,
|
||||
faDownload,
|
||||
@@ -15,6 +14,7 @@ import {
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
import { BanIcon, RefreshCwIcon } from "lucide-react";
|
||||
|
||||
import { createNotification } from "@app/components/notifications";
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
@@ -26,7 +26,6 @@ import {
|
||||
SecretSyncRemoveStatusBadge
|
||||
} from "@app/components/secret-syncs";
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
@@ -35,6 +34,7 @@ import {
|
||||
IconButton,
|
||||
Tooltip
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
@@ -143,24 +143,19 @@ export const SecretSyncActionTriggers = ({ secretSync }: Props) => {
|
||||
<SecretSyncImportStatusBadge secretSync={secretSync} />
|
||||
<SecretSyncRemoveStatusBadge secretSync={secretSync} />
|
||||
{secretSync.isAutoSyncEnabled ? (
|
||||
<Badge
|
||||
variant="success"
|
||||
className="flex h-5 w-min items-center gap-1.5 whitespace-nowrap"
|
||||
>
|
||||
<FontAwesomeIcon icon={faRotate} />
|
||||
<span>Auto-Sync Enabled</span>
|
||||
<Badge variant="info">
|
||||
<RefreshCwIcon />
|
||||
Auto-Sync Enabled
|
||||
</Badge>
|
||||
) : (
|
||||
<Tooltip
|
||||
className="text-xs"
|
||||
content="Auto-Sync is disabled. Changes to the source location will not be automatically synced to the destination."
|
||||
>
|
||||
<div>
|
||||
<Badge className="flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faBan} />
|
||||
<span>Auto-Sync Disabled</span>
|
||||
</Badge>
|
||||
</div>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Auto-Sync Disabled
|
||||
</Badge>
|
||||
</Tooltip>
|
||||
)}
|
||||
<div>
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { AWS_REGIONS } from "@app/helpers/appConnections";
|
||||
import { TAwsParameterStoreSync } from "@app/hooks/api/secretSyncs/types/aws-parameter-store-sync";
|
||||
|
||||
@@ -18,8 +18,8 @@ export const AwsParameterStoreSyncDestinationSection = ({ secretSync }: Props) =
|
||||
<>
|
||||
<GenericFieldLabel label="Region">
|
||||
{awsRegion?.name}
|
||||
<Badge className="ml-1" variant="success">
|
||||
{awsRegion?.slug}{" "}
|
||||
<Badge className="ml-1" variant="neutral">
|
||||
{awsRegion?.slug}
|
||||
</Badge>
|
||||
</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Path">{path}</GenericFieldLabel>
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { AWS_REGIONS } from "@app/helpers/appConnections";
|
||||
import {
|
||||
AwsSecretsManagerSyncMappingBehavior,
|
||||
@@ -19,8 +19,8 @@ export const AwsSecretsManagerSyncDestinationSection = ({ secretSync }: Props) =
|
||||
<>
|
||||
<GenericFieldLabel label="Region">
|
||||
{awsRegion?.name}
|
||||
<Badge className="ml-1" variant="success">
|
||||
{awsRegion?.slug}{" "}
|
||||
<Badge className="ml-1" variant="neutral">
|
||||
{awsRegion?.slug}
|
||||
</Badge>
|
||||
</GenericFieldLabel>
|
||||
<GenericFieldLabel label="Mapping Behavior" className="capitalize">
|
||||
|
||||
+6
-8
@@ -1,8 +1,8 @@
|
||||
import { faEye } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { EyeIcon } from "lucide-react";
|
||||
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge, Table, TBody, Td, Th, THead, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Table, TBody, Td, Th, THead, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { TAwsParameterStoreSync } from "@app/hooks/api/secretSyncs/types/aws-parameter-store-sync";
|
||||
|
||||
type Props = {
|
||||
@@ -40,11 +40,9 @@ export const AwsParameterStoreSyncOptionsSection = ({ secretSync }: Props) => {
|
||||
}
|
||||
>
|
||||
<div className="w-min">
|
||||
<Badge className="flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<FontAwesomeIcon icon={faEye} />
|
||||
<span>
|
||||
{tags.length} Tag{tags.length > 1 ? "s" : ""}
|
||||
</span>
|
||||
<Badge variant="neutral">
|
||||
<EyeIcon />
|
||||
{tags.length} Tag{tags.length > 1 ? "s" : ""}
|
||||
</Badge>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
+6
-5
@@ -1,8 +1,10 @@
|
||||
import { faEye } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { EyeIcon } from "lucide-react";
|
||||
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge, Table, TBody, Td, Th, THead, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Table, TBody, Td, Th, THead, Tooltip, Tr } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { TAwsSecretsManagerSync } from "@app/hooks/api/secretSyncs/types/aws-secrets-manager-sync";
|
||||
|
||||
type Props = {
|
||||
@@ -40,11 +42,10 @@ export const AwsSecretsManagerSyncOptionsSection = ({ secretSync }: Props) => {
|
||||
}
|
||||
>
|
||||
<div className="w-min">
|
||||
<Badge className="flex h-5 w-min items-center gap-1.5 bg-mineshaft-400/50 whitespace-nowrap text-bunker-300">
|
||||
<Badge variant="neutral">
|
||||
<EyeIcon />
|
||||
<FontAwesomeIcon icon={faEye} />
|
||||
<span>
|
||||
{tags.length} Tag{tags.length > 1 ? "s" : ""}
|
||||
</span>
|
||||
{tags.length} Tag{tags.length > 1 ? "s" : ""}
|
||||
</Badge>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { TRenderSync } from "@app/hooks/api/secretSyncs/types/render-sync";
|
||||
|
||||
type Props = {
|
||||
|
||||
+3
-2
@@ -5,7 +5,8 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge, IconButton } from "@app/components/v2";
|
||||
import { IconButton } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { SECRET_SYNC_INITIAL_SYNC_BEHAVIOR_MAP } from "@app/helpers/secretSyncs";
|
||||
@@ -114,7 +115,7 @@ export const SecretSyncOptionsSection = ({ secretSync, onEditOptions }: Props) =
|
||||
{AdditionalSyncOptionsComponent}
|
||||
{disableSecretDeletion && (
|
||||
<GenericFieldLabel label="Secret Deletion">
|
||||
<Badge variant="primary">Disabled</Badge>
|
||||
<Badge variant="neutral">Disabled</Badge>
|
||||
</GenericFieldLabel>
|
||||
)}
|
||||
</div>
|
||||
|
||||
+7
-8
@@ -1,10 +1,12 @@
|
||||
import { subject } from "@casl/ability";
|
||||
import { faEdit, faTriangleExclamation } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faEdit } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { AlertTriangleIcon } from "lucide-react";
|
||||
|
||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||
import { GenericFieldLabel } from "@app/components/secret-syncs";
|
||||
import { Badge, IconButton, Tooltip } from "@app/components/v2";
|
||||
import { IconButton, Tooltip } from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ProjectPermissionSub } from "@app/context";
|
||||
import { ProjectPermissionSecretSyncActions } from "@app/context/ProjectPermissionContext/types";
|
||||
import { TSecretSync } from "@app/hooks/api/secretSyncs";
|
||||
@@ -34,12 +36,9 @@ export const SecretSyncSourceSection = ({ secretSync, onEditSource }: Props) =>
|
||||
{(!folder || !environment) && (
|
||||
<Tooltip content="The source location for this sync has been deleted. Configure a new source or remove this sync.">
|
||||
<div className="mr-1 inline-block w-min">
|
||||
<Badge
|
||||
className="flex h-5 w-min items-center gap-1.5 whitespace-nowrap"
|
||||
variant="primary"
|
||||
>
|
||||
<FontAwesomeIcon icon={faTriangleExclamation} />
|
||||
<span>Folder Deleted</span>
|
||||
<Badge variant="danger">
|
||||
<AlertTriangleIcon />
|
||||
Folder Deleted
|
||||
</Badge>
|
||||
</div>
|
||||
</Tooltip>
|
||||
|
||||
+14
-7
@@ -2,11 +2,11 @@
|
||||
import { BsMicrosoftTeams } from "react-icons/bs";
|
||||
import { faEllipsis } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { BanIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { OrgPermissionCan } from "@app/components/permissions";
|
||||
import {
|
||||
Badge,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
Td,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||
import { useGetMicrosoftTeamsIntegrationTeams } from "@app/hooks/api";
|
||||
import {
|
||||
@@ -66,30 +67,36 @@ export const MicrosoftTeamsConfigRow = ({
|
||||
{microsoftTeamsConfig.isAccessRequestNotificationEnabled &&
|
||||
!isLoadingConfig &&
|
||||
microsoftTeamsConfig.accessRequestChannels?.channelIds?.length > 0 ? (
|
||||
<Badge>
|
||||
<p>
|
||||
{microsoftTeamsConfig.accessRequestChannels.channelIds
|
||||
.map((channel) => microsoftTeamsChannelIdToName[channel])
|
||||
.join(", ")}
|
||||
</Badge>
|
||||
</p>
|
||||
) : isLoadingConfig ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<Badge variant="danger">Disabled</Badge>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Disabled
|
||||
</Badge>
|
||||
)}
|
||||
</Td>
|
||||
<Td>
|
||||
{microsoftTeamsConfig.isSecretRequestNotificationEnabled &&
|
||||
!isLoadingConfig &&
|
||||
microsoftTeamsConfig.secretRequestChannels?.channelIds?.length > 0 ? (
|
||||
<Badge>
|
||||
<p>
|
||||
{microsoftTeamsConfig.secretRequestChannels.channelIds
|
||||
.map((channel) => microsoftTeamsChannelIdToName[channel])
|
||||
.join(", ")}
|
||||
</Badge>
|
||||
</p>
|
||||
) : isLoadingConfig ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<Badge variant="danger">Disabled</Badge>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Disabled
|
||||
</Badge>
|
||||
)}
|
||||
</Td>
|
||||
|
||||
|
||||
+14
-7
@@ -2,11 +2,11 @@
|
||||
import { BsSlack } from "react-icons/bs";
|
||||
import { faEllipsis } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { BanIcon } from "lucide-react";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
import { OrgPermissionCan } from "@app/components/permissions";
|
||||
import {
|
||||
Badge,
|
||||
DropdownMenu,
|
||||
DropdownMenuContent,
|
||||
DropdownMenuItem,
|
||||
@@ -15,6 +15,7 @@ import {
|
||||
Td,
|
||||
Tr
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { OrgPermissionActions, OrgPermissionSubjects } from "@app/context";
|
||||
import { useGetSlackIntegrationChannels } from "@app/hooks/api";
|
||||
import {
|
||||
@@ -61,32 +62,38 @@ export const SlackConfigRow = ({ handlePopUpOpen, isSlackConfigLoading, slackCon
|
||||
{slackConfig.isAccessRequestNotificationEnabled &&
|
||||
!isLoadingConfig &&
|
||||
slackConfig.accessRequestChannels.length > 0 ? (
|
||||
<Badge>
|
||||
<p>
|
||||
{slackConfig.accessRequestChannels
|
||||
.split(", ")
|
||||
.map((channel) => slackChannelIdToName[channel])
|
||||
.join(", ")}
|
||||
</Badge>
|
||||
</p>
|
||||
) : isLoadingConfig ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<Badge variant="danger">Disabled</Badge>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Disabled
|
||||
</Badge>
|
||||
)}
|
||||
</Td>
|
||||
<Td>
|
||||
{slackConfig.isSecretRequestNotificationEnabled &&
|
||||
!isLoadingConfig &&
|
||||
slackConfig.secretRequestChannels.length > 0 ? (
|
||||
<Badge>
|
||||
<p>
|
||||
{slackConfig.secretRequestChannels
|
||||
.split(", ")
|
||||
.map((channel) => slackChannelIdToName[channel])
|
||||
.join(", ")}
|
||||
</Badge>
|
||||
</p>
|
||||
) : isLoadingConfig ? (
|
||||
<Spinner size="xs" />
|
||||
) : (
|
||||
<Badge variant="danger">Disabled</Badge>
|
||||
<Badge variant="neutral">
|
||||
<BanIcon />
|
||||
Disabled
|
||||
</Badge>
|
||||
)}
|
||||
</Td>
|
||||
|
||||
|
||||
+2
-2
@@ -11,7 +11,6 @@ import { useNavigate, useSearch } from "@tanstack/react-router";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
CardTitle,
|
||||
@@ -25,6 +24,7 @@ import {
|
||||
TabPanel,
|
||||
Tabs
|
||||
} from "@app/components/v2";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { useProject } from "@app/context";
|
||||
import { useCreateIntegration } from "@app/hooks/api";
|
||||
@@ -254,7 +254,7 @@ export const AWSParameterStoreConfigurePage = () => {
|
||||
>
|
||||
{awsRegions.map((awsRegion) => (
|
||||
<SelectItem value={awsRegion.slug} key={`aws-environment-${awsRegion.slug}`}>
|
||||
{awsRegion.name} <Badge variant="success">{awsRegion.slug}</Badge>
|
||||
{awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
|
||||
</SelectItem>
|
||||
))}
|
||||
</Select>
|
||||
|
||||
+2
-2
@@ -14,7 +14,6 @@ import { motion } from "framer-motion";
|
||||
import z from "zod";
|
||||
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
Card,
|
||||
CardTitle,
|
||||
@@ -29,6 +28,7 @@ import {
|
||||
Tabs
|
||||
} from "@app/components/v2";
|
||||
import { SecretPathInput } from "@app/components/v2/SecretPathInput";
|
||||
import { Badge } from "@app/components/v3";
|
||||
import { ROUTE_PATHS } from "@app/const/routes";
|
||||
import { useProject } from "@app/context";
|
||||
import { useCreateIntegration } from "@app/hooks/api";
|
||||
@@ -332,7 +332,7 @@ export const AwsSecretManagerConfigurePage = () => {
|
||||
className="flex w-full justify-between"
|
||||
key={`aws-environment-${awsRegion.slug}`}
|
||||
>
|
||||
{awsRegion.name} <Badge variant="success">{awsRegion.slug}</Badge>
|
||||
{awsRegion.name} <Badge variant="neutral">{awsRegion.slug}</Badge>
|
||||
</SelectItem>
|
||||
))}
|
||||
</Select>
|
||||
|
||||
Reference in New Issue
Block a user