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

Fix missing action chain schedule initial value #8068

Merged
merged 1 commit into from
Dec 21, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions web/html/src/manager/schedule-options/action-chain-picker.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState } from "react";
import { useEffect, useState } from "react";

import { Combobox } from "components/combobox";

Expand All @@ -14,6 +14,15 @@ type Props = {
export const ActionChainPicker = (props: Props) => {
const [selectedId, setSelectedId] = useState(props.actionChains[0]?.id || "");

useEffect(() => {
setInteropValue(selectedId);
}, []);

// This module needs to interface with legacy fields in schedule-options.jspf
const setInteropValue = (value: string) => {
document.getElementById("action-chain")?.setAttribute("value", value);
};

return (
<Combobox
options={props.actionChains}
Expand All @@ -25,8 +34,7 @@ export const ActionChainPicker = (props: Props) => {
return { id: cut, value: cut, label };
}}
onSelect={(item) => {
// This module needs to interface with legacy fields in schedule-options.jspf
document.getElementById("action-chain")?.setAttribute("value", item.id);
setInteropValue(item.id);
setSelectedId(item.id);
}}
onFocus={() => {
Expand Down
1 change: 1 addition & 0 deletions web/spacewalk-web.changes.eth.select-interop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix missing action chain schedule initial value
Loading