File tree Expand file tree Collapse file tree 4 files changed +16
-5
lines changed
components/PageLayout/AuthLayout
integrations/integration-merge Expand file tree Collapse file tree 4 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ export function Connect(props: {
87
87
category = "hris"
88
88
title = "Payroll system"
89
89
integrationId = "int_merge"
90
+ preConnectInput = { { categories : [ 'hris' ] } }
90
91
/>
91
92
</ >
92
93
) }
@@ -124,10 +125,12 @@ interface ConnectionsColumnProps {
124
125
integrationId ?: Id [ 'int' ]
125
126
/** Could also be inferred based on category */
126
127
title ?: string
128
+ /** TODO: Fix me... typing and hard-coding not ideal */
129
+ preConnectInput ?: unknown
127
130
}
128
131
129
132
function ConnectionsColumn ( props : ConnectionsColumnProps ) {
130
- const { connectWith, title} = props
133
+ const { connectWith, title, preConnectInput } = props
131
134
const connections = props . connections . filter (
132
135
( c ) =>
133
136
! props . category || c . institution ?. categories ?. includes ( props . category ) ,
@@ -146,7 +149,10 @@ function ConnectionsColumn(props: ConnectionsColumnProps) {
146
149
147
150
function addNewConnection ( ) {
148
151
if ( integrationId ) {
149
- void veniceConnect . connect ( { id : integrationId } , { connectWith} )
152
+ void veniceConnect . connect (
153
+ { id : integrationId } ,
154
+ { connectWith, preConnectInput} ,
155
+ )
150
156
}
151
157
}
152
158
Original file line number Diff line number Diff line change 7
7
ProfileIcon ,
8
8
SupportIcon ,
9
9
} from '@usevenice/ui/icons'
10
- import { UsersIcon } from 'lucide-react'
10
+ import { UsersIcon , WandIcon } from 'lucide-react'
11
11
import Image from 'next/image'
12
12
import Link from 'next/link'
13
13
import { useAuthState } from '../../../contexts/session-context'
@@ -17,7 +17,7 @@ const mainNavigation = [
17
17
{
18
18
name : 'Magic link' ,
19
19
href : '/admin/magic-link' ,
20
- icon : ArrowLeftRightIcon ,
20
+ icon : WandIcon ,
21
21
adminOnly : true ,
22
22
} ,
23
23
{
Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export const mergeImpl = {
88
88
89
89
preConnect : async ( config , context , input ) => {
90
90
const client = makeMergeClient ( { apiKey : config . apiKey } )
91
+ console . log ( '[Merge] preConnect' , config , context , input )
91
92
const res = await client . integrations . post ( '/create-link-token' , {
92
93
body : {
93
94
end_user_origin_id : context . userId ,
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ interface IntegrationOptions {
78
78
institutionId ?: Id [ 'ins' ]
79
79
80
80
resourceId ?: Id [ 'reso' ]
81
+
82
+ /** TODO: Fix me... */
83
+ preConnectInput ?: unknown
81
84
}
82
85
83
86
/** Also ledger-specific */
@@ -147,7 +150,7 @@ export function useVeniceConnect({
147
150
! enablePreconnectPrompt ||
148
151
opt . resourceExternalId ||
149
152
! preConnInputSchema
150
- ? { }
153
+ ? opts . preConnectInput ?? { }
151
154
: await new Promise ( ( resolve , reject ) => {
152
155
openDialog (
153
156
( { close} ) => (
@@ -252,6 +255,7 @@ export function useVeniceConnect({
252
255
envName ,
253
256
userId ,
254
257
providerByName ,
258
+ options . enablePreconnectPrompt ,
255
259
trpcCtx . preConnect ,
256
260
trpcCtx . listConnections ,
257
261
connectFnMapRef ,
You can’t perform that action at this time.
0 commit comments