Skip to content

Commit

Permalink
HPCC-31578 ECL Watch v9 fix LZ FileUpload Folder combobox
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jeclrsg committed Apr 8, 2024
1 parent d507384 commit 8268052
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion esp/src/src-react/components/forms/landing-zone/FileListForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -61,6 +66,8 @@ export const FileListForm: React.FunctionComponent<FileListFormProps> = ({

const closeForm = React.useCallback(() => {
setShowForm(false);
const uploaderBtn = document.querySelector("#uploaderBtn");
uploaderBtn["value"] = null;
}, [setShowForm]);

const doSubmit = React.useCallback((data) => {
Expand Down Expand Up @@ -235,8 +242,11 @@ export const FileListForm: React.FunctionComponent<FileListFormProps> = ({
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}
/>}
Expand Down

0 comments on commit 8268052

Please sign in to comment.