-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch order of namespaces and make Destination Default is the defaul… #21047
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…t option
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ import { ExampleSettingsTable } from "./ExampleSettingsTable"; | |
const destinationNamespaceValidationSchema = yup.object().shape({ | ||
namespaceDefinition: yup | ||
.string() | ||
.oneOf([NamespaceDefinitionType.source, NamespaceDefinitionType.destination, NamespaceDefinitionType.customformat]) | ||
.oneOf([NamespaceDefinitionType.destination, NamespaceDefinitionType.source, NamespaceDefinitionType.customformat]) | ||
.required("form.empty.error"), | ||
namespaceFormat: yup.string().when("namespaceDefinition", { | ||
is: NamespaceDefinitionType.customformat, | ||
|
@@ -48,7 +48,7 @@ export const DestinationNamespaceModal: React.FC<DestinationNamespaceModalProps> | |
return ( | ||
<Formik | ||
initialValues={{ | ||
namespaceDefinition: initialValues?.namespaceDefinition ?? NamespaceDefinitionType.source, | ||
namespaceDefinition: initialValues?.namespaceDefinition ?? NamespaceDefinitionType.destination, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will correctly set To make it the first option, you could move the destination Note: this is only visible in the upcoming stream table redesign, so you need to set |
||
namespaceFormat: initialValues.namespaceFormat, | ||
}} | ||
enableReinitialize | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -138,8 +138,8 @@ export const createConnectionValidationSchema = ({ | |
namespaceDefinition: yup | ||
.string() | ||
.oneOf([ | ||
NamespaceDefinitionType.source, | ||
NamespaceDefinitionType.destination, | ||
NamespaceDefinitionType.source, | ||
NamespaceDefinitionType.customformat, | ||
Comment on lines
141
to
143
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, not strictly necessary to change the order for the validation schema, but doesn't hurt. |
||
]) | ||
.required("form.empty.error"), | ||
|
@@ -365,7 +365,7 @@ export const useInitialValues = ( | |
scheduleData: connection.connectionId ? connection.scheduleData ?? null : DEFAULT_SCHEDULE, | ||
nonBreakingChangesPreference: connection.nonBreakingChangesPreference ?? NonBreakingChangesPreference.ignore, | ||
prefix: connection.prefix || "", | ||
namespaceDefinition: connection.namespaceDefinition || NamespaceDefinitionType.source, | ||
namespaceDefinition: connection.namespaceDefinition || NamespaceDefinitionType.destination, | ||
namespaceFormat: connection.namespaceFormat ?? SOURCE_NAMESPACE_TAG, | ||
geography: connection.geography || workspace.defaultGeography || "auto", | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strictly necessary to change the order here, since this just enforces that at least one of these options is selected. But it also doesn't hurt 👍