mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-10 04:28:33 +00:00
improvement: only sort by status if 1 or more integrations is failing to sync; otherwise sort by integration
This commit is contained in:
+5
-1
@@ -11,6 +11,7 @@ import {
|
|||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
|
import { twMerge } from "tailwind-merge";
|
||||||
|
|
||||||
import { ProjectPermissionCan } from "@app/components/permissions";
|
import { ProjectPermissionCan } from "@app/components/permissions";
|
||||||
import { Badge, IconButton, Td, Tooltip, Tr } from "@app/components/v2";
|
import { Badge, IconButton, Td, Tooltip, Tr } from "@app/components/v2";
|
||||||
@@ -56,7 +57,10 @@ export const IntegrationRow = ({
|
|||||||
return (
|
return (
|
||||||
<Tr
|
<Tr
|
||||||
onClick={() => router.push(`/integrations/details/${integration.id}`)}
|
onClick={() => router.push(`/integrations/details/${integration.id}`)}
|
||||||
className="group h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700"
|
className={twMerge(
|
||||||
|
"group h-10 cursor-pointer transition-colors duration-100 hover:bg-mineshaft-700",
|
||||||
|
isSynced === false && "bg-red/5 hover:bg-red/10"
|
||||||
|
)}
|
||||||
key={`integration-${id}`}
|
key={`integration-${id}`}
|
||||||
>
|
>
|
||||||
<Td>
|
<Td>
|
||||||
|
|||||||
+7
-2
@@ -1,4 +1,4 @@
|
|||||||
import { useMemo, useState } from "react";
|
import { useEffect, useMemo, useState } from "react";
|
||||||
import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
|
import { faCheckCircle } from "@fortawesome/free-regular-svg-icons";
|
||||||
import {
|
import {
|
||||||
faArrowDown,
|
faArrowDown,
|
||||||
@@ -115,7 +115,12 @@ export const IntegrationsTable = ({
|
|||||||
orderBy,
|
orderBy,
|
||||||
setOrderDirection,
|
setOrderDirection,
|
||||||
setOrderBy
|
setOrderBy
|
||||||
} = usePagination<IntegrationsOrderBy>(IntegrationsOrderBy.Status, { initPerPage: 20 });
|
} = usePagination<IntegrationsOrderBy>(IntegrationsOrderBy.App, { initPerPage: 20 });
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (integrations?.some((integration) => integration.isSynced === false))
|
||||||
|
setOrderBy(IntegrationsOrderBy.Status);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const environmentMap = new Map(environments.map((env) => [env.id, env]));
|
const environmentMap = new Map(environments.map((env) => [env.id, env]));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user