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

HPCC-32128 ECL Watch v9 add ZAP creation indicator #18851

Merged
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
11 changes: 9 additions & 2 deletions esp/src/src-react/components/forms/ZAPDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from "react";
import { Checkbox, DefaultButton, Dropdown, Icon, IDropdownProps, IOnRenderComboBoxLabelProps, IStackTokens, ITextFieldProps, mergeStyleSets, PrimaryButton, Stack, TextField, TooltipHost } from "@fluentui/react";
import { Checkbox, DefaultButton, Dropdown, Icon, IDropdownProps, IOnRenderComboBoxLabelProps, IStackTokens, ITextFieldProps, mergeStyleSets, PrimaryButton, Spinner, Stack, TextField, TooltipHost } from "@fluentui/react";
import { useForm, Controller } from "react-hook-form";
import { LogType } from "@hpcc-js/comms";
import { scopedLogger } from "@hpcc-js/util";
Expand Down Expand Up @@ -164,6 +164,8 @@ export const ZAPDialog: React.FunctionComponent<ZAPDialogProps> = ({
}), [theme]);

const [emailDisabled, setEmailDisabled] = React.useState(true);
const [submitDisabled, setSubmitDisabled] = React.useState(false);
const [spinnerHidden, setSpinnerHidden] = React.useState(true);
const [columnMode, setColumnMode] = React.useState(ColumnMode.DEFAULT);
const [logFormat, setLogFormat] = React.useState(LogFormat.CSV);
const [showCustomColumns, setShowCustomColumns] = React.useState(false);
Expand All @@ -184,6 +186,8 @@ export const ZAPDialog: React.FunctionComponent<ZAPDialogProps> = ({
const logFilter = data.LogFilter;

delete data.LogFilter;
setSubmitDisabled(true);
setSpinnerHidden(false);

for (const key in data) {
formData.append(key, data[key]);
Expand Down Expand Up @@ -223,6 +227,8 @@ export const ZAPDialog: React.FunctionComponent<ZAPDialogProps> = ({
link.click();
link.remove();

setSubmitDisabled(false);
setSpinnerHidden(true);
closeForm();

if (logAccessorMessage !== "") {
Expand Down Expand Up @@ -253,7 +259,8 @@ export const ZAPDialog: React.FunctionComponent<ZAPDialogProps> = ({

return <MessageBox title={nlsHPCC.ZippedAnalysisPackage} minWidth={440} show={showForm} setShow={closeForm}
footer={<>
<PrimaryButton text={nlsHPCC.Submit} onClick={handleSubmit(onSubmit)} />
<Spinner label={nlsHPCC.LoadingData} labelPosition="right" style={{ display: spinnerHidden ? "none" : "inherit" }} />
<PrimaryButton text={nlsHPCC.Submit} disabled={submitDisabled} onClick={handleSubmit(onSubmit)} />
<DefaultButton text={nlsHPCC.Cancel} onClick={() => closeForm()} />
</>}>
<Controller
Expand Down
Loading