mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-03 02:25:48 +00:00
improvement: support search by integration destination
This commit is contained in:
+9
-10
@@ -8,6 +8,14 @@ type Props = {
|
|||||||
const FIELD_CLASSNAME =
|
const FIELD_CLASSNAME =
|
||||||
"truncate rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200";
|
"truncate rounded-md border border-mineshaft-700 bg-mineshaft-900 px-3 py-2 font-inter text-sm text-bunker-200";
|
||||||
|
|
||||||
|
export const getIntegrationDestination = (integration: TIntegration) =>
|
||||||
|
(integration.integration === "hashicorp-vault" &&
|
||||||
|
`${integration.app} - path: ${integration.path}`) ||
|
||||||
|
(integration.scope === "github-org" && `${integration.owner}`) ||
|
||||||
|
(["aws-parameter-store", "rundeck"].includes(integration.integration) && `${integration.path}`) ||
|
||||||
|
(integration.scope?.startsWith("github-") && `${integration.owner}/${integration.app}`) ||
|
||||||
|
integration.app;
|
||||||
|
|
||||||
export const IntegrationDetails = ({ integration }: Props) => {
|
export const IntegrationDetails = ({ integration }: Props) => {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-2 p-2">
|
<div className="flex flex-col gap-2 p-2">
|
||||||
@@ -55,16 +63,7 @@ export const IntegrationDetails = ({ integration }: Props) => {
|
|||||||
"App"
|
"App"
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<div className={FIELD_CLASSNAME}>
|
<div className={FIELD_CLASSNAME}>{getIntegrationDestination(integration)}</div>
|
||||||
{(integration.integration === "hashicorp-vault" &&
|
|
||||||
`${integration.app} - path: ${integration.path}`) ||
|
|
||||||
(integration.scope === "github-org" && `${integration.owner}`) ||
|
|
||||||
(["aws-parameter-store", "rundeck"].includes(integration.integration) &&
|
|
||||||
`${integration.path}`) ||
|
|
||||||
(integration.scope?.startsWith("github-") &&
|
|
||||||
`${integration.owner}/${integration.app}`) ||
|
|
||||||
integration.app}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{(integration.integration === "vercel" ||
|
{(integration.integration === "vercel" ||
|
||||||
|
|||||||
+2
-11
@@ -18,7 +18,7 @@ import { ProjectPermissionActions, ProjectPermissionSub } from "@app/context";
|
|||||||
import { TCloudIntegration } from "@app/hooks/api/integrations/types";
|
import { TCloudIntegration } from "@app/hooks/api/integrations/types";
|
||||||
import { TIntegration } from "@app/hooks/api/types";
|
import { TIntegration } from "@app/hooks/api/types";
|
||||||
|
|
||||||
import { IntegrationDetails } from "./IntegrationDetails";
|
import { getIntegrationDestination, IntegrationDetails } from "./IntegrationDetails";
|
||||||
|
|
||||||
type IProps = {
|
type IProps = {
|
||||||
integration: TIntegration;
|
integration: TIntegration;
|
||||||
@@ -77,16 +77,7 @@ export const IntegrationRow = ({
|
|||||||
<Td>{environment?.name ?? "-"}</Td>
|
<Td>{environment?.name ?? "-"}</Td>
|
||||||
<Td className="!min-w-[5rem] max-w-0">
|
<Td className="!min-w-[5rem] max-w-0">
|
||||||
<div className="flex items-center gap-2">
|
<div className="flex items-center gap-2">
|
||||||
<p className="truncate">
|
<p className="truncate">{getIntegrationDestination(integration)}</p>
|
||||||
{(integration.integration === "hashicorp-vault" &&
|
|
||||||
`${integration.app} - path: ${integration.path}`) ||
|
|
||||||
(integration.scope === "github-org" && `${integration.owner}`) ||
|
|
||||||
(["aws-parameter-store", "rundeck"].includes(integration.integration) &&
|
|
||||||
`${integration.path}`) ||
|
|
||||||
(integration.scope?.startsWith("github-") &&
|
|
||||||
`${integration.owner}/${integration.app}`) ||
|
|
||||||
integration.app}
|
|
||||||
</p>
|
|
||||||
<Tooltip
|
<Tooltip
|
||||||
position="left"
|
position="left"
|
||||||
className="min-w-[20rem] max-w-lg"
|
className="min-w-[20rem] max-w-lg"
|
||||||
|
|||||||
+12
-3
@@ -36,6 +36,7 @@ import { usePagination, useResetPageHelper } from "@app/hooks";
|
|||||||
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
import { OrderByDirection } from "@app/hooks/api/generic/types";
|
||||||
import { useSyncIntegration } from "@app/hooks/api/integrations/queries";
|
import { useSyncIntegration } from "@app/hooks/api/integrations/queries";
|
||||||
import { TCloudIntegration, TIntegration } from "@app/hooks/api/integrations/types";
|
import { TCloudIntegration, TIntegration } from "@app/hooks/api/integrations/types";
|
||||||
|
import { getIntegrationDestination } from "@app/views/IntegrationsPage/components/IntegrationsSection/components/IntegrationDetails";
|
||||||
|
|
||||||
import { IntegrationRow } from "./IntegrationRow";
|
import { IntegrationRow } from "./IntegrationRow";
|
||||||
|
|
||||||
@@ -120,7 +121,9 @@ export const IntegrationsTable = ({
|
|||||||
const filteredIntegrations = useMemo(
|
const filteredIntegrations = useMemo(
|
||||||
() =>
|
() =>
|
||||||
integrations
|
integrations
|
||||||
.filter(({ integration, secretPath, envId, isSynced }) => {
|
.filter((integration) => {
|
||||||
|
const { secretPath, envId, isSynced } = integration;
|
||||||
|
|
||||||
if (!filters.status.includes(IntegrationStatus.Synced) && isSynced) return false;
|
if (!filters.status.includes(IntegrationStatus.Synced) && isSynced) return false;
|
||||||
if (!filters.status.includes(IntegrationStatus.NotSynced) && isSynced === false)
|
if (!filters.status.includes(IntegrationStatus.NotSynced) && isSynced === false)
|
||||||
return false;
|
return false;
|
||||||
@@ -130,13 +133,19 @@ export const IntegrationsTable = ({
|
|||||||
)
|
)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!filters.integrations.includes(integration)) return false;
|
if (!filters.integrations.includes(integration.integration)) return false;
|
||||||
|
|
||||||
if (!filters.environmentIds.includes(envId)) return false;
|
if (!filters.environmentIds.includes(envId)) return false;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
integration.replace("-", " ").toLowerCase().includes(search.trim().toLowerCase()) ||
|
integration.integration
|
||||||
|
.replace("-", " ")
|
||||||
|
.toLowerCase()
|
||||||
|
.includes(search.trim().toLowerCase()) ||
|
||||||
secretPath.replace("-", " ").toLowerCase().includes(search.trim().toLowerCase()) ||
|
secretPath.replace("-", " ").toLowerCase().includes(search.trim().toLowerCase()) ||
|
||||||
|
getIntegrationDestination(integration)
|
||||||
|
?.toLowerCase()
|
||||||
|
.includes(search.trim().toLowerCase()) ||
|
||||||
environmentMap
|
environmentMap
|
||||||
.get(envId)
|
.get(envId)
|
||||||
?.name.replace("-", " ")
|
?.name.replace("-", " ")
|
||||||
|
|||||||
Reference in New Issue
Block a user