mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
fix(studio): preserve Snowflake submit validation
This commit is contained in:
1 parent
bd73707225
commit
b8771444ad
1 file changed
+21
-7
+21
-7
@@ -46,7 +46,10 @@ import { PipelineCostDialog } from './PipelineCostDialog'
|
||||
import { PipelineRegionField } from './PipelineRegionField'
|
||||
import { PublicationSelection } from './PublicationSelection'
|
||||
import { SnowflakeFields } from './Snowflake/Fields'
|
||||
import { getSnowflakeValidationIssues } from './Snowflake/Snowflake.utils'
|
||||
import {
|
||||
getSnowflakeValidationIssues,
|
||||
SNOWFLAKE_PRIVATE_KEY_FORMAT_MESSAGE,
|
||||
} from './Snowflake/Snowflake.utils'
|
||||
import { TableCopySelection } from './TableCopySelection'
|
||||
import { useDestinationForm } from './useDestinationForm'
|
||||
import { ValidationFailuresSection } from './ValidationFailuresSection'
|
||||
@@ -224,11 +227,12 @@ export const DestinationForm = ({
|
||||
}
|
||||
)
|
||||
} else if (selectedType === 'Snowflake') {
|
||||
getSnowflakeValidationIssues(data, { secretsOptional: editMode }).forEach(
|
||||
({ path, message }) => {
|
||||
addRequiredFieldError(path, message)
|
||||
}
|
||||
)
|
||||
getSnowflakeValidationIssues(data, {
|
||||
secretsOptional: editMode,
|
||||
validatePrivateKeyFormat: false,
|
||||
}).forEach(({ path, message }) => {
|
||||
addRequiredFieldError(path, message)
|
||||
})
|
||||
} else if (selectedType === 'ClickHouse') {
|
||||
getClickHouseValidationIssues(data).forEach(({ path, message }) => {
|
||||
addRequiredFieldError(path, message)
|
||||
@@ -332,7 +336,7 @@ export const DestinationForm = ({
|
||||
(data.tableSyncCopyMode === 'include_tables' || data.tableSyncCopyMode === 'skip_tables') &&
|
||||
data.tableSyncCopyTableIds.length === 0
|
||||
) {
|
||||
form.setError('tableSyncCopyTableIds', { message: 'Select at least one table' })
|
||||
form.setError('tableSyncCopyTableIds', { message: 'Select at least one table.' })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -346,6 +350,16 @@ export const DestinationForm = ({
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedType === 'Snowflake') {
|
||||
const privateKeyIssue = getSnowflakeValidationIssues(data, {
|
||||
secretsOptional: editMode,
|
||||
}).find((issue) => issue.message === SNOWFLAKE_PRIVATE_KEY_FORMAT_MESSAGE)
|
||||
if (privateKeyIssue) {
|
||||
form.setError(privateKeyIssue.path, { message: privateKeyIssue.message })
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// Pipeline prerequisite validation models a new pipeline and cannot
|
||||
// account for resources already owned by an existing pipeline. Edits keep
|
||||
// the established direct-update flow after pruning stale table ids.
|
||||
|
||||
Reference in new issue
Block a user