Skip to content

Commit 19f01d8

Browse files
authored
Fix editing destination selected type (supabase#41555)
1 parent 1ee6105 commit 19f01d8

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

apps/docs/next-env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationPanel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ReadReplicaForm } from './ReadReplicaForm'
1717

1818
interface DestinationPanelProps {
1919
visible: boolean
20+
type?: DestinationType
2021
existingDestination?: {
2122
sourceId?: number
2223
destinationId: number
@@ -29,13 +30,14 @@ interface DestinationPanelProps {
2930

3031
export const DestinationPanel = ({
3132
visible,
33+
type,
3234
existingDestination,
3335
onClose,
3436
}: DestinationPanelProps) => {
3537
const unifiedReplication = useFlag('unifiedReplication')
3638

3739
const [selectedType, setSelectedType] = useState<DestinationType>(
38-
unifiedReplication ? 'Read Replica' : 'BigQuery'
40+
type || (unifiedReplication ? 'Read Replica' : 'BigQuery')
3941
)
4042

4143
const editMode = !!existingDestination

apps/studio/components/interfaces/Database/Replication/DestinationPanel/DestinationTypeSelection.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useFlag } from 'common'
22
import { AnalyticsBucket, BigQuery, Database } from 'icons'
33
import { cn, RadioGroupStacked, RadioGroupStackedItem } from 'ui'
4-
import { Admonition } from 'ui-patterns'
54
import { DestinationType } from './DestinationPanel.types'
65

76
type DestinationTypeSelectionProps = {
@@ -25,14 +24,11 @@ export const DestinationTypeSelection = ({
2524

2625
return (
2726
<div className="px-5 py-5">
28-
<div className="flex flex-col gap-y-2 mb-4">
27+
<div className="flex flex-col gap-y-1 mb-4">
2928
<p className="text-sm font-medium text-foreground">Type</p>
30-
{editMode && (
31-
<Admonition
32-
type="default"
33-
title="The destination type cannot be changed after creation"
34-
/>
35-
)}
29+
<p className="text-foreground-light text-sm">
30+
The destination type cannot be changed after creation
31+
</p>
3632
</div>
3733
<RadioGroupStacked
3834
disabled={editMode}

apps/studio/components/interfaces/Database/Replication/DestinationRow.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface DestinationRowProps {
3232
sourceId?: number
3333
destinationId: number
3434
destinationName: string
35-
type: DestinationType | 'Other'
35+
type?: DestinationType
3636
pipeline?: Pipeline
3737
error: ResponseError | null
3838
isLoading: boolean
@@ -222,6 +222,7 @@ export const DestinationRow = ({
222222

223223
<DestinationPanel
224224
visible={showEditDestinationPanel}
225+
type={type}
225226
onClose={() => setShowEditDestinationPanel(false)}
226227
existingDestination={{
227228
sourceId,

apps/studio/components/interfaces/Database/Replication/Destinations.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export const Destinations = () => {
171171
? 'BigQuery'
172172
: 'iceberg' in destination.config
173173
? 'Analytics Bucket'
174-
: 'Other'
174+
: undefined
175175

176176
return (
177177
<DestinationRow

0 commit comments

Comments
 (0)