-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove syncInProgress, simplify sidebar, fix form paddings and set de…
…fault values for connect dropdowns (#263) * Remove syncInProgress flag from backend and ui * Simplify sidebar and remove unused pages * Remove spacing in schema form * Set default values for connect deeplink dropdowns * Removing uncessary settings * tweaking sidebar * tsignore * lint * adding missing orgs --------- Co-authored-by: Rodrigo Arze Leon <[email protected]> Co-authored-by: Amadeo Pellicce <[email protected]>
- Loading branch information
1 parent
3831513
commit 6e56acb
Showing
20 changed files
with
202 additions
and
420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 0 additions & 22 deletions
22
apps/web/app/dashboard/(authenticated)/api-access/page.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
52 changes: 0 additions & 52 deletions
52
apps/web/app/dashboard/(authenticated)/pipeline-runs/page.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
84 changes: 84 additions & 0 deletions
84
apps/web/app/dashboard/(authenticated)/settings/SettingsForm.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
'use client' | ||
|
||
import {Loader2} from 'lucide-react' | ||
import type {AppRouter} from '@openint/api' | ||
import {zOrganization} from '@openint/engine-backend/services/AuthProvider' | ||
import type {TRPCReact} from '@openint/engine-frontend' | ||
import {_trpcReact, useMutationToast} from '@openint/engine-frontend' | ||
import {Button, SchemaForm} from '@openint/ui' | ||
import useRefetchOnSwitch from '../useRefetchOnSwitch' | ||
|
||
const trpcReact = _trpcReact as unknown as TRPCReact<AppRouter> | ||
|
||
export default function SettingsForm() { | ||
const res = trpcReact.getCurrentOrganization.useQuery() | ||
useRefetchOnSwitch(res.refetch) | ||
|
||
const updateOrg = trpcReact.updateCurrentOrganization.useMutation({ | ||
...useMutationToast({ | ||
successMessage: 'Organization updated', | ||
errorMessage: 'Failed to save organization', | ||
}), | ||
}) | ||
|
||
if (res.isLoading || res.isRefetching) { | ||
return ( | ||
<div className="flex h-[calc(100vh-theme(spacing.96))] items-center justify-center"> | ||
<Loader2 className="h-10 w-10 animate-spin text-button" /> | ||
</div> | ||
) | ||
} | ||
|
||
if (!res.data) { | ||
return null | ||
} | ||
const orgsToShowUrlFor = [ | ||
// orgs in openint clerk app for ag | ||
'org_2nJZrA4Dk8i3wszhm6PsP3M2Vwy', | ||
'org_2lcCCimyICKI8cpPNQt195h5zrP', | ||
'org_2ms9FdeczlbrDIHJLcwGdpv3dTx', | ||
// orgs in ag app sh | ||
'org_2pBMOEKROMpNR7zckHtah4ebxAk', | ||
'org_2pBM0RSOqs5QzZi40A73hZ5aTjD', | ||
// orgs in ot app | ||
'org_2nkeyWpfGKK6W011qwV8dA1la8n', | ||
] | ||
const showDatabaseUrl = Boolean(!orgsToShowUrlFor.includes(res.data.id)) | ||
|
||
return ( | ||
<> | ||
<SchemaForm | ||
className="mt-4" | ||
schema={zOrganization.shape.publicMetadata.omit({ | ||
synced_data_schema: true, | ||
migrate_tables: true, | ||
database_url: showDatabaseUrl ? true : undefined, | ||
})} | ||
uiSchema={{ | ||
// Would be nice if this can be extracted from example field of the openapi spec | ||
database_url: { | ||
'ui:placeholder': 'postgres://username:password@host:port/database', | ||
}, | ||
webhook_url: { | ||
'ui:placeholder': 'https://yourapp.com/webhook', | ||
}, | ||
}} | ||
formData={res.data.publicMetadata} | ||
loading={updateOrg.isLoading} | ||
onSubmit={({formData}) => { | ||
updateOrg.mutate( | ||
{publicMetadata: formData}, | ||
{ | ||
onSuccess: () => { | ||
res.refetch() | ||
}, | ||
}, | ||
) | ||
}}> | ||
<Button type="submit" className="mt-4"> | ||
Save Settings | ||
</Button> | ||
</SchemaForm> | ||
</> | ||
) | ||
} |
Oops, something went wrong.