Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.2: ui: enable Forward button to set timewindow for latest NOW value #113907

Merged
merged 1 commit into from Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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