Skip to content

Commit

Permalink
fix(creation-flow-database): default container value (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBonnet authored Dec 23, 2024
1 parent d481776 commit c0a1910
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export function StepGeneralFeature() {
defaultValues: {
...generalData,
accessibility: 'PRIVATE',
mode: match({ cloudProvider, cluster, generalData })
mode: match({ cloudProvider, cluster, generalData, showManagedWithVpcOptions })
// If 'generalData' has 'mode', use it
.with({ generalData: { mode: 'CONTAINER' } }, () => DatabaseModeEnum.CONTAINER)
.with({ generalData: { mode: 'MANAGED' } }, () => DatabaseModeEnum.MANAGED)
Expand All @@ -132,8 +132,12 @@ export function StepGeneralFeature() {
{ cloudProvider: 'AWS', cluster: { kubernetes: P.not('SELF_MANAGED') } },
() => DatabaseModeEnum.CONTAINER
)
// If 'cloudProvider' is 'ON_PREMISE', return 'CONTAINER'
.with({ cloudProvider: 'ON_PREMISE' }, () => DatabaseModeEnum.CONTAINER)
.with(P.union({ cloudProvider: 'AWS' }, { showManagedWithVpcOptions: true }), () => DatabaseModeEnum.CONTAINER)
// If 'cloudProvider' is 'ON_PREMISE', 'GCP' or 'SCW' return 'CONTAINER'
.with(
P.union({ cloudProvider: 'ON_PREMISE' }, { cloudProvider: 'GCP' }, { cloudProvider: 'SCW' }),
() => DatabaseModeEnum.CONTAINER
)
.otherwise(() => DatabaseModeEnum.MANAGED),
},
mode: 'onChange',
Expand Down

0 comments on commit c0a1910

Please sign in to comment.