diff --git a/src/components/editTopicDialog.tsx b/src/components/editTopicDialog.tsx index b9283bc..1e5214c 100644 --- a/src/components/editTopicDialog.tsx +++ b/src/components/editTopicDialog.tsx @@ -51,7 +51,7 @@ export const EditTopicDialog = observer(() => { , , - ContentType + Content type } label="AVRO" /> } label="JSON" /> diff --git a/src/components/topicDialog.tsx b/src/components/topicDialog.tsx index 6fc0138..855fe69 100644 --- a/src/components/topicDialog.tsx +++ b/src/components/topicDialog.tsx @@ -53,7 +53,7 @@ export const TopicDialog = observer( , , - ContentType + Content type } label="AVRO" /> } label="JSON" /> diff --git a/src/components/validateTopicForm.tsx b/src/components/validateTopicForm.tsx index 4f65082..f0877aa 100644 --- a/src/components/validateTopicForm.tsx +++ b/src/components/validateTopicForm.tsx @@ -93,9 +93,9 @@ function composeValidators(validators: Validator[]): Validate { export function validateTopicForm(values: TopicFormikValues, includeAdvanced: boolean): FormikErrors { const validate = composeValidators([ - validateRequired(["group", "topic", "description", "schema"]), + validateRequired(values.contentType === "AVRO" ? ["group", "topic", "description", "schema"] : ["group", "topic", "description"]), validateTopic, - validateSchema, + values.contentType === "AVRO" && validateSchema, includeAdvanced && validateMaxMessageSize, includeAdvanced && validateRetentionTime, ]);