diff --git a/apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx b/apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx index 7ebe7032e..4bf6da96c 100644 --- a/apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx +++ b/apps/workflows-dashboard/src/pages/WorkflowDefinition/WorkflowDefinition.tsx @@ -13,6 +13,10 @@ import { useWorkflowDefinitionExtensionsEdit } from '@/pages/WorkflowDefinition/ import { ViewWorkflow } from '@/pages/Workflows/components/organisms/WorkflowsList/components/ViewWorkflow'; import { isAxiosError } from 'axios'; import { Link, useParams } from 'react-router-dom'; +import { Dialog } from '@/components/atoms/Dialog'; +import { useState } from 'react'; +import { Button } from '@/components/atoms/Button'; +import { ClipboardIcon } from '@heroicons/react/24/outline'; export const VENDOR_DETAILS = { 'dow-jones': { @@ -24,7 +28,7 @@ export const VENDOR_DETAILS = { description: 'ComplyAdvantage offers AI-driven sanctions screening and monitoring for individuals', }, - asiaverify: { + 'asia-verify': { logoUrl: 'https://cdn.ballerine.io/logos/AsiaVerify_Logo.png', description: 'AsiaVerify provides company screening, UBO verification and registry information services focused on APAC region', @@ -57,6 +61,11 @@ export const WorkflowDefinition = () => { useWorkflowDefinitionExtensionsEdit(data); const { mutate: upgradeWorkflowDefinitionVersion } = useUpgradeWorkflowDefinitionVersionMutation(); + const [isIntegrationCatalogOpen, setIsIntegrationCatalogOpen] = useState(false); + + const copyToClipboard = (text: string) => { + navigator.clipboard.writeText(text); + }; if (isLoading) { return ( @@ -93,165 +102,272 @@ export const WorkflowDefinition = () => { if (!data) return null; return ( - -
-
-
- - -

X-State Visualizer

- -
- - - -
-
-
- -
-
-
-
- + <> + +
+
+
+ + +

X-State Visualizer

+ +
+ + + +
+
+
+ +
-
- { - console.log('changed value', value); - }} - onUpgrade={() => upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! })} - /> +
+
+ +
+
+ { + console.log('changed value', value); + }} + onUpgrade={() => + upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! }) + } + /> +
-
-
-
- upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! })} - enableViewMode={true} - viewDialogContent={ -
- {Object.entries(workflowDefinitionExtensions || {}).map(([category, plugins]) => ( -
-

-
- {category - .split(/(?=[A-Z])/) - .join(' ') - .replace('Plugins', '') - .replace(/^\w/, c => c.toUpperCase())}{' '} - Plugins -

-
- {(plugins as any[]).map(plugin => ( -
-
-
- {plugin.vendor === 'test' ? ( -
- Test -
- ) : plugin.vendor ? ( - {plugin.vendor} { - e.currentTarget.src = - 'https://cdn.ballerine.io/logos/ballerine-logo.png'; - }} - /> - ) : ( - Ballerine - )} -
-
-

- {(plugin.displayName || plugin.name).split(/(?=[A-Z])/).join(' ')} -

-

- {plugin.pluginKind} -

+
+
+ + upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! }) + } + enableViewMode={true} + viewDialogContent={ +
+
+ +
+ {isIntegrationCatalogOpen && ( +
+ +
+
+
+

Integration Catalog

+
-
- - {plugin.stateNames?.length > 0 && ( -
- {plugin.stateNames?.map((state: string) => ( - + {Object.entries(VENDOR_DETAILS).map(([vendorKey, vendorInfo]) => ( +
- {state} - +
+
+ {vendorKey} { + e.currentTarget.src = + 'https://cdn.ballerine.io/logos/ballerine-logo.png'; + }} + /> +
+
+
+

+ {vendorKey + .split('-') + .map( + word => + word.charAt(0).toUpperCase() + word.slice(1), + ) + .join(' ')} +

+ +
+

+ {vendorInfo.description} +

+
+
+
))}
- )} - -
- {plugin.successAction && ( -
- Success: - - {plugin.successAction} - +
+
+
+
+ )} + {Object.entries(workflowDefinitionExtensions || {}).map( + ([category, plugins]) => ( +
+

+
+ {category + .split(/(?=[A-Z])/) + .join(' ') + .replace('Plugins', '') + .replace(/^\w/, c => c.toUpperCase())}{' '} + Plugins +

+
+ {(plugins as any[]).map(plugin => ( +
+
+
+ {plugin.vendor === 'test' ? ( +
+ + Test + +
+ ) : plugin.vendor ? ( + {plugin.vendor} { + e.currentTarget.src = + 'https://cdn.ballerine.io/logos/ballerine-logo.png'; + }} + /> + ) : ( + Ballerine + )} +
+
+

+ {(plugin.displayName || plugin.name) + .split(/(?=[A-Z])/) + .join(' ')} +

+
+

+ {plugin.pluginKind} +

+ {plugin.vendor && ( +

+ by {plugin.vendor} +

+ )} +
+
- )} - {plugin.errorAction && ( -
- Error: - - {plugin.errorAction} - + {plugin.stateNames?.length > 0 && ( +
+ {plugin.stateNames?.map((state: string) => ( + + {state} + + ))} +
+ )} + +
+ {plugin.successAction && ( +
+ Success: + + {plugin.successAction} + +
+ )} + + {plugin.errorAction && ( +
+ Error: + + {plugin.errorAction} + +
+ )}
- )} -
+
+ ))}
- ))} -
-
- ))} -
- } - /> -
-
- { - console.log('changed value', value); - }} - onUpgrade={() => upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! })} - /> +
+ ), + )} +
+ } + /> +
+
+ { + console.log('changed value', value); + }} + onUpgrade={() => + upgradeWorkflowDefinitionVersion({ workflowDefinitionId: data.id! }) + } + /> +
-
- + + ); };