From d84105646329570a4b4ca328b84dcb0352127c97 Mon Sep 17 00:00:00 2001 From: Rodrigo Arze Leon Date: Thu, 24 Oct 2024 19:32:13 -0400 Subject: [PATCH] Fix style for inputs active/selected state (#67) * Fix style for inputs active/selected state * Filter connectors in ag connector so we prevent dups --------- Co-authored-by: Rodrigo Arze Leon --- .../components/AGConnectionPortal.tsx | 15 +++++++++------ packages/ui/components/SchemaForm.tsx | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/engine-frontend/components/AGConnectionPortal.tsx b/packages/engine-frontend/components/AGConnectionPortal.tsx index fe3a7717..9af52dd3 100644 --- a/packages/engine-frontend/components/AGConnectionPortal.tsx +++ b/packages/engine-frontend/components/AGConnectionPortal.tsx @@ -4,13 +4,13 @@ import {AlertTriangle} from 'lucide-react' import React from 'react' import type {Id} from '@openint/cdk' import type {UIPropsNoChildren} from '@openint/ui' -import { Card, ResourceCard } from '@openint/ui' +import {Card, ResourceCard} from '@openint/ui' import {cn} from '@openint/ui/utils' import {R} from '@openint/util' import {WithConnectConfig} from '../hocs/WithConnectConfig' import {_trpcReact} from '../providers/TRPCProvider' -import {ConnectDialog} from './ConnectDialog' import {AgResourceRowActions} from './AgResourceRowActions' +import {ConnectDialog} from './ConnectDialog' type ConnectEventType = 'open' | 'close' | 'error' @@ -48,7 +48,7 @@ const AGConnectionPortalComponent: React.FC = ({ const handleMessage = React.useCallback(async (event: MessageEvent) => { if (event.data.type === 'triggerConnectDialog') { console.log('triggerConnectDialog', event.data.value) - if(event.data.value) { + if (event.data.value) { await listConnectionsRes.refetch().then(() => { setOpenDialog(event.data.value) }) @@ -122,20 +122,23 @@ const AGConnectionPortalComponent: React.FC = ({ ))} {category.connections.length === 0 && ( - +

{`No data source connected`}

-
-
+ +
)} {openDialog && ( c.connectorName, + )} // trigger refetch of connections onEvent={() => listConnectionsRes.refetch()} /> diff --git a/packages/ui/components/SchemaForm.tsx b/packages/ui/components/SchemaForm.tsx index 457a912a..3adabfd9 100644 --- a/packages/ui/components/SchemaForm.tsx +++ b/packages/ui/components/SchemaForm.tsx @@ -49,7 +49,7 @@ function generateUiSchema(jsonSchema: RJSFSchema): UiSchema { const friendlyLabel = titleCase(key) uiSchema[key] = { 'ui:title': friendlyLabel, - 'ui:classNames': 'pt-2 mr-2', + 'ui:classNames': 'pt-2 mx-1', } if (typeof value === 'object' && isTypeObject(value)) {