Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import NoPermission from 'components/ui/NoPermission'
import { useAuthConfigQuery } from 'data/auth/auth-config-query'
import { useAuthConfigUpdateMutation } from 'data/auth/auth-config-update-mutation'
import { useAsyncCheckProjectPermissions } from 'hooks/misc/useCheckPermissions'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import {
AlertDescription_Shadcn_,
AlertTitle_Shadcn_,
Expand Down Expand Up @@ -42,6 +43,8 @@ const schema = object({

const BasicAuthSettingsForm = () => {
const { ref: projectRef } = useParams()
const showManualLinking = useIsFeatureEnabled('authentication:show_manual_linking')

const {
data: authConfig,
error: authConfigError,
Expand Down Expand Up @@ -169,38 +172,40 @@ const BasicAuthSettingsForm = () => {
)}
/>
</CardContent>
<CardContent>
<FormField_Shadcn_
control={form.control}
name="SECURITY_MANUAL_LINKING_ENABLED"
render={({ field }) => (
<FormItemLayout
layout="flex-row-reverse"
label="Allow manual linking"
description={
<>
Enable{' '}
<InlineLink
className="text-foreground-light hover:text-foreground"
href="https://supabase.com/docs/guides/auth/auth-identity-linking#manual-linking-beta"
>
manual linking APIs
</InlineLink>{' '}
for your project
</>
}
>
<FormControl_Shadcn_>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
disabled={!canUpdateConfig}
/>
</FormControl_Shadcn_>
</FormItemLayout>
)}
/>
</CardContent>
{showManualLinking && (
<CardContent>
<FormField_Shadcn_
control={form.control}
name="SECURITY_MANUAL_LINKING_ENABLED"
render={({ field }) => (
<FormItemLayout
layout="flex-row-reverse"
label="Allow manual linking"
description={
<>
Enable{' '}
<InlineLink
className="text-foreground-light hover:text-foreground"
href="https://supabase.com/docs/guides/auth/auth-identity-linking#manual-linking-beta"
>
manual linking APIs
</InlineLink>{' '}
for your project
</>
}
>
<FormControl_Shadcn_>
<Switch
checked={field.value}
onCheckedChange={field.onChange}
disabled={!canUpdateConfig}
/>
</FormControl_Shadcn_>
</FormItemLayout>
)}
/>
</CardContent>
)}
<CardContent>
<FormField_Shadcn_
control={form.control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { parseAsString, useQueryState } from 'nuqs'

import AlertError from 'components/ui/AlertError'
import NoSearchResults from 'components/ui/NoSearchResults'
import { useIsFeatureEnabled } from 'hooks/misc/useIsFeatureEnabled'
import { buttonVariants, cn, Tabs_Shadcn_, TabsList_Shadcn_, TabsTrigger_Shadcn_ } from 'ui'
import { Admonition } from 'ui-patterns/admonition'
import { Input } from 'ui-patterns/DataInputs/Input'
Expand All @@ -17,6 +18,8 @@ const CATEGORIES = [
] as const

export const AvailableIntegrations = () => {
const showStripeWrapper = useIsFeatureEnabled('integrations:show_stripe_wrapper')

const [selectedCategory, setSelectedCategory] = useQueryState(
'category',
parseAsString.withDefault('all').withOptions({ clearOnDefault: true })
Expand All @@ -26,16 +29,26 @@ export const AvailableIntegrations = () => {
parseAsString.withDefault('').withOptions({ clearOnDefault: true })
)

const { availableIntegrations, installedIntegrations, error, isError, isLoading, isSuccess } =
useInstalledIntegrations()
const {
availableIntegrations: allIntegrations,
installedIntegrations,
error,
isError,
isLoading,
isSuccess,
} = useInstalledIntegrations()

const installedIds = installedIntegrations.map((i) => i.id)

// available integrations for install
const availableIntegrations = showStripeWrapper
? allIntegrations
: allIntegrations.filter((x) => x.id !== 'stripe_wrapper')
const integrationsByCategory =
selectedCategory === 'all'
? availableIntegrations
: availableIntegrations.filter((i) => i.type === selectedCategory)

const filteredIntegrations = (
search.length > 0
? integrationsByCategory.filter((i) => i.name.toLowerCase().includes(search.toLowerCase()))
Expand Down
Loading
Loading