From 8268052998a4fe8768ce8724296703cc123ff9e6 Mon Sep 17 00:00:00 2001 From: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:00:45 -0400 Subject: [PATCH] HPCC-31578 ECL Watch v9 fix LZ FileUpload Folder combobox fix issue where the "Folder" combobox would not properly update the value based upon manually typing a custom path also, fixing a small bug where closing the dialog without uploading, reopening and attempting to upload the same (previously selected) file would not properly open the dialog Signed-off-by: Jeremy Clements <79224539+jeclrsg@users.noreply.github.com> --- .../components/forms/landing-zone/FileListForm.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx index 1112167f2a1..bda1c8bc8e3 100644 --- a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx +++ b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx @@ -8,12 +8,17 @@ import { TargetDropzoneTextField, TargetFolderTextField, TargetServerTextField } import { joinPath } from "src/Utility"; import nlsHPCC from "src/nlsHPCC"; import { MessageBox } from "../../../layouts/MessageBox"; +import { debounce } from "../../../util/throttle"; import * as FormStyles from "./styles"; const logger = scopedLogger("src-react/components/forms/landing-zone/FileListForm.tsx"); const myFileSprayService = new FileSprayService({ baseUrl: "" }); +const targetFolderTextChange = debounce((text, directory, onChange) => { + onChange(directory + text); +}, 200); + interface FileListFormValues { dropzone: string; machines: string; @@ -61,6 +66,8 @@ export const FileListForm: React.FunctionComponent = ({ const closeForm = React.useCallback(() => { setShowForm(false); + const uploaderBtn = document.querySelector("#uploaderBtn"); + uploaderBtn["value"] = null; }, [setShowForm]); const doSubmit = React.useCallback((data) => { @@ -235,8 +242,11 @@ export const FileListForm: React.FunctionComponent = ({ machineOS={os} required={true} placeholder={nlsHPCC.SelectValue} + onInputValueChange={(text) => targetFolderTextChange(text, directory, onChange)} onChange={(evt, option) => { - onChange(option.key); + if (option?.key) { + onChange(option.key); + } }} errorMessage={error && error?.message} />}