From 83443ca9fbb08b0db94cc4a76a87449e4dbca5b6 Mon Sep 17 00:00:00 2001 From: Etheryte Date: Wed, 20 Dec 2023 10:39:47 +0100 Subject: [PATCH] Fix missing action chain schedule initial value --- .../schedule-options/action-chain-picker.tsx | 14 +++++++++++--- web/spacewalk-web.changes.eth.select-interop | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 web/spacewalk-web.changes.eth.select-interop diff --git a/web/html/src/manager/schedule-options/action-chain-picker.tsx b/web/html/src/manager/schedule-options/action-chain-picker.tsx index 3ba81d09a337..dcdfc1c267a0 100644 --- a/web/html/src/manager/schedule-options/action-chain-picker.tsx +++ b/web/html/src/manager/schedule-options/action-chain-picker.tsx @@ -1,4 +1,4 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { Combobox } from "components/combobox"; @@ -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 ( { 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={() => { diff --git a/web/spacewalk-web.changes.eth.select-interop b/web/spacewalk-web.changes.eth.select-interop new file mode 100644 index 000000000000..b0cdc7e06d95 --- /dev/null +++ b/web/spacewalk-web.changes.eth.select-interop @@ -0,0 +1 @@ +- Fix missing action chain schedule initial value