diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx index 94a5e1772..aa9612dc1 100644 --- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx +++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.integrations/route.tsx @@ -1,5 +1,6 @@ +import { ExclamationCircleIcon } from "@heroicons/react/24/solid"; import type { LoaderArgs } from "@remix-run/server-runtime"; -import { useState } from "react"; +import { useCallback, useState } from "react"; import { UseDataFunctionReturn, typedjson, @@ -75,7 +76,8 @@ export const handle: Handle = { }; export default function Integrations() { - const { clients, options, callbackUrl } = useTypedLoaderData(); + const { clients, clientMissingFields, options, callbackUrl } = + useTypedLoaderData(); const organization = useOrganization(); const project = useProject(); @@ -107,11 +109,20 @@ export default function Integrations() { organizationId={organization.id} callbackUrl={callbackUrl} /> - +
+ {clientMissingFields.length > 0 && ( + + )} + +
@@ -139,7 +150,7 @@ function PossibleIntegrationsList({ }); return ( -
+
Connect an API - Missing an API? - - Create your own Integration + {/* Missing an API? */} + {/* + Create your own Integration */}
); } @@ -244,119 +255,179 @@ function ConnectedIntegrationsList({ }); return ( -
- - - - -
- Your connected Integrations - + + + + +
+ Your connected Integrations + +
+ {clients.length > 0 && ( +
+ setFilterText(e.target.value)} + /> + + + + Name + API + ID + Type + Jobs + Scopes + Client id + Connections + Added + Go to page + + + + {filteredItems.length === 0 ? ( + +
+ + No connected Integrations match your filters. + +
+
+ ) : ( + <> + {filteredItems.map((client) => { + const path = integrationClientPath( + organization, + project, + client + ); + return ( + + {client.title} + + + + {client.integration.name} + + + {client.slug} + + {client.authMethod.name} + + {client.jobCount} + + {client.authSource === "LOCAL" + ? "–" + : client.scopesCount} + + + {client.authSource === "LOCAL" ? ( + "–" + ) : ( + Auto + ) + } + content={ + client.customClientId + ? client.customClientId + : "This uses the Trigger.dev OAuth client" + } + /> + )} + + + {client.authSource === "LOCAL" + ? "–" + : client.connectionsCount} + + + {formatDateTime(client.createdAt, "medium")} + + + + ); + })} + + )} +
+
- {clients.length > 0 && ( -
- setFilterText(e.target.value)} - /> - - - - Name - API - ID - Type - Jobs - Scopes - Client id - Connections - Added - Go to page - - - - {filteredItems.length === 0 ? ( - -
- - No connected Integrations match your filters. - -
-
- ) : ( - <> - {filteredItems.map((client) => { - const path = integrationClientPath( - organization, - project, - client - ); - return ( - - {client.title} - - - - {client.integration.name} - - - {client.slug} - - {client.authMethod.name} - - {client.jobCount} - - {client.authSource === "LOCAL" - ? "–" - : client.scopesCount} - - - {client.authSource === "LOCAL" ? ( - "–" - ) : ( - Auto - ) - } - content={ - client.customClientId - ? client.customClientId - : "This uses the Trigger.dev OAuth client" - } - /> - )} - - - {client.authSource === "LOCAL" - ? "–" - : client.connectionsCount} - - - {formatDateTime(client.createdAt, "medium")} - - - - ); - })} - - )} -
-
-
- )} -
+ )} + + ); +} + +function IntegrationsWithMissingFields({ + clients, + organizationId, + callbackUrl, +}: { + clients: Client[]; + organizationId: string; + callbackUrl: string; +}) { + const clicked = useCallback((id: string) => {}, [clients]); + + return ( +
+ + + Integrations with missing details + + + + + Name + API + ID + Added + Go to page + + + + {clients.map((client) => { + return ( + + clicked(client.id)}> + + {" "} + {client.title} + + + clicked(client.id)}> + + + {client.integration.name} + + + clicked(client.id)}> + {client.slug} + + clicked(client.id)}> + {formatDateTime(client.createdAt, "medium")} + + clicked(client.id)} /> + + ); + })} + +
); }