Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
Signed-off-by: hemahg <[email protected]>
  • Loading branch information
hemahg committed Dec 20, 2024
1 parent 870e96c commit fdf3cd9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import { useState } from "react";
export function DryrunSelect({
openDryrun,
cliCommand,
isDisabled,
}: {
openDryrun: () => void;
cliCommand: string;
isDisabled: boolean;
}) {
const t = useTranslations("ConsumerGroupsTable");

Expand Down Expand Up @@ -45,6 +47,7 @@ export function DryrunSelect({
key="split-action-secondary"
aria-label={t("dry_run")}
onClick={openDryrun}
isDisabled={isDisabled}
>
{t("dry_run")}
</MenuToggleAction>,
Expand All @@ -60,6 +63,7 @@ export function DryrunSelect({
value={0}
key={t("run_and_show_result")}
onClick={openDryrun}
isDisabled={isDisabled}
>
<PlayIcon /> {t("run_and_show_result")}
</DropdownItem>
Expand All @@ -72,6 +76,7 @@ export function DryrunSelect({
}}
aria-describedby="tooltip-ref1"
ref={tooltipRef}
isDisabled={isDisabled}
>
<CopyIcon /> {t("copy_dry_run_command")}
{isCopied && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,13 @@ export function ResetOffset({
id="custom-offset-input"
name={t("custom_offset")}
value={offset.offset}
onChange={(_event, value) => handleOffsetChange(value)}
onChange={(_event, value) => {
if (/^\d*$/.test(value)) {
handleOffsetChange(value);
}
}}
type="number"
min={0}
/>
</FormGroup>
)}
Expand Down Expand Up @@ -223,7 +228,17 @@ export function ResetOffset({
>
{t("save")}
</Button>
<DryrunSelect openDryrun={openDryrun} cliCommand={cliCommand} />
<DryrunSelect
openDryrun={openDryrun}
cliCommand={cliCommand}
isDisabled={
selectOffset === "custom"
? !offset.offset
: selectOffset === "specificDateTime"
? !offset.offset
: selectOffset !== "latest" && selectOffset !== "earliest"
}
/>
<Button
variant="link"
onClick={closeResetOffset}
Expand Down

0 comments on commit fdf3cd9

Please sign in to comment.