Skip to content

Commit

Permalink
Merge pull request #113907 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.2-112954

release-23.2: ui: enable Forward button to set timewindow for latest NOW value
  • Loading branch information
koorosh committed Nov 14, 2023
2 parents 6430899 + aa49aa1 commit d48b4f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Expand Up @@ -38,7 +38,7 @@ export const TimeFrameControls = ({
onArrowClick(direction);

const left = disabledArrows.includes(ArrowDirection.LEFT);
const right = disabledArrows.includes(ArrowDirection.RIGHT);
const canForward = !disabledArrows.includes(ArrowDirection.RIGHT);
const delay = 0.3;

return (
Expand Down Expand Up @@ -66,9 +66,10 @@ export const TimeFrameControls = ({
mouseLeaveDelay={delay}
>
<Button
onClick={handleChangeArrow(ArrowDirection.RIGHT)}
disabled={right}
className={cx("_action", right ? "disabled" : "active")}
onClick={handleChangeArrow(
canForward ? ArrowDirection.RIGHT : ArrowDirection.CENTER,
)}
className={cx("_action", "active")}
aria-label={"next time interval"}
>
<CaretRight className={cx("icon")} />
Expand Down
Expand Up @@ -365,8 +365,6 @@ describe("TimeScaleDropdown functions", function () {

it("generateDisabledArrows must return array with disabled buttons", () => {
const arrows = generateDisabledArrows(currentWindow);
const wrapper = makeTimeScaleDropdown(state);
expect(wrapper.find(".controls-content ._action.disabled").length).toBe(1);
expect(arrows).toEqual([ArrowDirection.CENTER, ArrowDirection.RIGHT]);
});

Expand Down

0 comments on commit d48b4f9

Please sign in to comment.