Skip to content

Commit

Permalink
Merge pull request #214 from TouK/fix-issue-with-radio-buttons
Browse files Browse the repository at this point in the history
fix: Resolve an issue with radio buttons
  • Loading branch information
Dzuming authored Oct 16, 2024
2 parents 7f9f08e + ba61d02 commit 6cf9222
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/components/editTopicDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormControl, FormControlLabel, FormLabel, Radio } from "@mui/material";
import { FormControl, FormControlLabel, FormLabel, Radio, RadioGroup } from "@mui/material";
import { Field, FormikErrors } from "formik";
import { CheckboxWithLabel, RadioGroup, TextField } from "formik-mui";
import { CheckboxWithLabel, TextField } from "formik-mui";
import { observer } from "mobx-react-lite";
import React from "react";
import { TopicFormikValues } from "../models";
Expand Down Expand Up @@ -52,7 +52,7 @@ export const EditTopicDialog = observer(() => {
<Field required component={TextField} autoFocus label="Topic description" name="description" key="description" fullWidth />,
<FormControl key="contentType">
<FormLabel>ContentType</FormLabel>
<Field component={RadioGroup} row name={"contentType"}>
<Field as={RadioGroup} row name={"contentType"}>
<FormControlLabel value="AVRO" control={<Radio />} label="AVRO" />
<FormControlLabel value="JSON" control={<Radio />} label="JSON" />
</Field>
Expand All @@ -76,7 +76,7 @@ export const EditTopicDialog = observer(() => {
const advancedFields = (): JSX.Element[] => [
<FormControl key="advancedValues.acknowledgement">
<FormLabel>Acknowledgement</FormLabel>
<Field component={RadioGroup} row name={"advancedValues.acknowledgement"}>
<Field as={RadioGroup} row name={"advancedValues.acknowledgement"}>
<FormControlLabel value="LEADER" control={<Radio />} label="LEADER" />
<FormControlLabel value="ALL" control={<Radio />} label="ALL" />
</Field>
Expand Down
8 changes: 4 additions & 4 deletions src/components/subscriptionDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormControl, FormControlLabel, FormLabel, Radio } from "@mui/material";
import { FormControl, FormControlLabel, FormLabel, Radio, RadioGroup } from "@mui/material";
import { Field, FormikErrors } from "formik";
import { CheckboxWithLabel, RadioGroup, TextField } from "formik-mui";
import { CheckboxWithLabel, TextField } from "formik-mui";
import { observer, useObserver } from "mobx-react-lite";
import React from "react";
import { useLocation, useNavigate } from "react-router-dom";
Expand Down Expand Up @@ -73,7 +73,7 @@ export const SubscriptionDialog = ({
const advancedFields = (): JSX.Element[] => [
<FormControl key="advancedValues.mode">
<FormLabel>Mode</FormLabel>
<Field component={RadioGroup} row name={"advancedValues.mode"}>
<Field as={RadioGroup} row name={"advancedValues.mode"}>
<FormControlLabel value="ANYCAST" control={<Radio />} label="ANYCAST" />
<FormControlLabel value="BROADCAST" control={<Radio />} label="BROADCAST" />
</Field>
Expand Down Expand Up @@ -129,7 +129,7 @@ export const SubscriptionDialog = ({
/>,
<FormControl key="advancedValues.trackingMode">
<FormLabel>Tracking mode</FormLabel>
<Field component={RadioGroup} row name={"advancedValues.trackingMode"}>
<Field as={RadioGroup} row name={"advancedValues.trackingMode"}>
<FormControlLabel value="trackingOff" control={<Radio />} label="No tracking" />
<FormControlLabel value="discardedOnly" control={<Radio />} label="Track message discarding only" />
<FormControlLabel value="trackingAll" control={<Radio />} label="Track everything" />
Expand Down
8 changes: 4 additions & 4 deletions src/components/topicDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box, Button, FormControl, FormControlLabel, FormLabel, Radio } from "@mui/material";
import { Box, Button, FormControl, FormControlLabel, FormLabel, Radio, RadioGroup } from "@mui/material";
import { Field, FormikErrors } from "formik";
import { CheckboxWithLabel, RadioGroup, TextField } from "formik-mui";
import { CheckboxWithLabel, TextField } from "formik-mui";
import { observer } from "mobx-react-lite";
import React from "react";
import { useNavigate } from "react-router-dom";
Expand Down Expand Up @@ -54,7 +54,7 @@ export const TopicDialog = observer(
<Field required component={TextField} label="Topic description" name="description" key="description" fullWidth />,
<FormControl key="contentType">
<FormLabel>ContentType</FormLabel>
<Field component={RadioGroup} row name={"contentType"}>
<Field as={RadioGroup} row name={"contentType"}>
<FormControlLabel value="AVRO" control={<Radio />} label="AVRO" />
<FormControlLabel value="JSON" control={<Radio />} label="JSON" />
</Field>
Expand All @@ -78,7 +78,7 @@ export const TopicDialog = observer(
const advancedFields = (): JSX.Element[] => [
<FormControl key="advancedValues.acknowledgement">
<FormLabel>Acknowledgement</FormLabel>
<Field component={RadioGroup} row name={"advancedValues.acknowledgement"}>
<Field as={RadioGroup} row name={"advancedValues.acknowledgement"}>
<FormControlLabel value="LEADER" control={<Radio />} label="LEADER" />
<FormControlLabel value="ALL" control={<Radio />} label="ALL" />
</Field>
Expand Down

0 comments on commit 6cf9222

Please sign in to comment.