Skip to content

Commit 185744b

Browse files
Poleg KashtiPoleg Kashti
authored andcommitted
Add: Modify consumer form
1 parent 07f9ea4 commit 185744b

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

frontend/src/components/ACLPage/Form/ForConsumers/Form.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const ForConsumersForm: FC<AclDetailedFormProps> = ({ formRef }) => {
4949
const topicCount = clusterStats?.[0]?.topicCount ?? 0;
5050
const topics = useTopicsOptions(clusterName, topicCount);
5151

52-
const consumerGroups = useConsumerGroupsOptions(clusterName, 100);
52+
const consumerGroups = useConsumerGroupsOptions(clusterName, 1000);
5353
const consumerCount = consumerGroups.length;
5454

5555
const onSubmit = async (formData: FormValues) => {

frontend/src/components/common/Checkbox/Checkbox.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ interface CheckboxProps {
88
name: string;
99
label: React.ReactNode;
1010
hint?: string;
11+
checked?: boolean;
12+
onChange?: (value: boolean) => void; // Add onChange prop
1113
}
1214

13-
const Checkbox: React.FC<CheckboxProps> = ({ name, label, hint }) => {
15+
const Checkbox: React.FC<CheckboxProps> = ({ name, label, hint, checked, onChange}) => {
1416
const { register } = useFormContext();
1517

1618
return (
1719
<div>
1820
<InputLabel>
19-
<input {...register(name)} type="checkbox" />
21+
<input {...register && register(name)} type="checkbox" checked={checked} onChange={onChange ? (e) => onChange(e.target.checked) : undefined} />
2022
{label}
2123
</InputLabel>
2224
<InputHint>{hint}</InputHint>

frontend/src/lib/hooks/api/consumers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function useConsumerGroups(props: UseConsumerGroupsProps) {
3030
return useQuery(
3131
['clusters', clusterName, 'consumerGroups', rest],
3232
() => api.getConsumerGroupsPage(props),
33-
{ suspense: false, keepPreviousData: true }
33+
{ suspense: true, keepPreviousData: true }
3434
);
3535
}
3636

0 commit comments

Comments
 (0)