diff --git a/package-lock.json b/package-lock.json index 3e19d39..a1811b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "MIT", "dependencies": { "@stackone/expressions": "^0.16.0", - "@stackone/malachite": "^0.4.0", + "@stackone/malachite": "^0.5.0", "@tanstack/react-query": "^5.77.2" }, "devDependencies": { @@ -1192,10 +1192,11 @@ } }, "node_modules/@stackone/malachite": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@stackone/malachite/-/malachite-0.4.0.tgz", - "integrity": "sha512-Oknt0sTaafFhJNTgCLNsZ7CeouzXOU/17WnydU5/U/3I1cJrH5PCD5lmdJr+1CRofzZmKrKOA+IKo4a5uK4vyA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@stackone/malachite/-/malachite-0.5.0.tgz", + "integrity": "sha512-6rXExYUIORdMI2VS1KoX1bstnq/PK/Zwm0tQLUtCek1CCh7Irvu98QyiN2lXTqJjczJdtCNG4VN6bypnEvLMbQ==", "dependencies": { + "@uiw/react-json-view": "^2.0.0-alpha.35", "marked-react": "^3.0.0" }, "peerDependencies": { @@ -1505,6 +1506,19 @@ "integrity": "sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==", "dev": true }, + "node_modules/@uiw/react-json-view": { + "version": "2.0.0-alpha.36", + "resolved": "https://registry.npmjs.org/@uiw/react-json-view/-/react-json-view-2.0.0-alpha.36.tgz", + "integrity": "sha512-CF3vMYEB0wF74exmcvnj+PSKQIk5IQVYnUF1f3Ha9+kCadlL1ihfOxEBlubkYV11u1QrRffBKBU48yEuI8CE5g==", + "funding": { + "url": "https://jaywcjlove.github.io/#/sponsor" + }, + "peerDependencies": { + "@babel/runtime": ">=7.10.0", + "react": ">=18.0.0", + "react-dom": ">=18.0.0" + } + }, "node_modules/@vitejs/plugin-react-swc": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react-swc/-/plugin-react-swc-3.9.0.tgz", diff --git a/package.json b/package.json index f220d18..bf2d6f0 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "license": "MIT", "dependencies": { "@stackone/expressions": "^0.16.0", - "@stackone/malachite": "^0.4.0", + "@stackone/malachite": "^0.5.0", "@tanstack/react-query": "^5.77.2" }, "peerDependencies": { diff --git a/src/modules/integration-picker/IntegrationPicker.tsx b/src/modules/integration-picker/IntegrationPicker.tsx index 60d27d2..f347f7c 100644 --- a/src/modules/integration-picker/IntegrationPicker.tsx +++ b/src/modules/integration-picker/IntegrationPicker.tsx @@ -93,7 +93,6 @@ export const IntegrationPicker: React.FC = ({ connectorData={connectorData?.config ?? null} hubData={hubData ?? null} fields={fields} - guide={guide} errorHubData={errorHubData} errorConnectorData={errorConnectorData} onSelect={setSelectedIntegration} diff --git a/src/modules/integration-picker/components/IntegrationFields.tsx b/src/modules/integration-picker/components/IntegrationFields.tsx index 8fa2504..c625f73 100644 --- a/src/modules/integration-picker/components/IntegrationFields.tsx +++ b/src/modules/integration-picker/components/IntegrationFields.tsx @@ -1,19 +1,9 @@ -import { - Alert, - Dropdown, - Form, - Input, - Padded, - Spacer, - TextArea, - Typography, -} from '@stackone/malachite'; +import { Alert, CodeBlock, Dropdown, Input, Padded, Spacer, TextArea } from '@stackone/malachite'; import { useEffect, useState } from 'react'; import { ConnectorConfigField } from '../types'; interface IntegrationFieldsProps { fields: Array; - guide?: { supportLink?: string; description: string }; error?: { message: string; provider_response: string; @@ -21,12 +11,7 @@ interface IntegrationFieldsProps { onChange: (data: Record) => void; } -export const IntegrationForm: React.FC = ({ - fields, - guide, - onChange, - error, -}) => { +export const IntegrationForm: React.FC = ({ fields, onChange, error }) => { // Initialize formData with default values from fields const [formData, setFormData] = useState>(() => { const initialData: Record = {}; @@ -73,9 +58,11 @@ export const IntegrationForm: React.FC = ({ return ( - {guide && } - {error && } - {error && {error.provider_response}} + {error && ( + + + + )} {fields.map((field) => { const key = diff --git a/src/modules/integration-picker/components/IntegrationPickerContent.tsx b/src/modules/integration-picker/components/IntegrationPickerContent.tsx index 74a9257..6c6e0b7 100644 --- a/src/modules/integration-picker/components/IntegrationPickerContent.tsx +++ b/src/modules/integration-picker/components/IntegrationPickerContent.tsx @@ -24,7 +24,6 @@ interface IntegrationPickerContentProps { connectorData: ConnectorConfig | null; hubData: HubData | null; fields: ConnectorConfigField[]; - guide?: { supportLink?: string; description: string }; // Errors errorHubData: Error | null; @@ -43,7 +42,6 @@ export const IntegrationPickerContent: React.FC = connectorData, hubData, fields, - guide, errorHubData, errorConnectorData, onSelect, @@ -97,7 +95,6 @@ export const IntegrationPickerContent: React.FC = fields={fields} error={connectionState.error} onChange={onChange} - guide={guide} /> ); } diff --git a/src/modules/integration-picker/components/views/IntegrationFormView.tsx b/src/modules/integration-picker/components/views/IntegrationFormView.tsx index ffd2fc5..6dbf8cb 100644 --- a/src/modules/integration-picker/components/views/IntegrationFormView.tsx +++ b/src/modules/integration-picker/components/views/IntegrationFormView.tsx @@ -8,15 +8,13 @@ interface IntegrationFormViewProps { message: string; provider_response: string; }; - guide?: { supportLink?: string; description: string }; onChange: (data: Record) => void; } export const IntegrationFormView: React.FC = ({ fields, error, - guide, onChange, }) => { - return ; + return ; };