|
@@ -25,6 +25,7 @@ import { executionOptions } from "@src/constants";
|
|
|
import type { Field } from "@src/@types/Field";
|
|
import type { Field } from "@src/@types/Field";
|
|
|
|
|
|
|
|
import executionImage from "./images/execution.svg";
|
|
import executionImage from "./images/execution.svg";
|
|
|
|
|
+import LoadingButton from "@src/components/ui/LoadingButton/LoadingButton";
|
|
|
|
|
|
|
|
const Wrapper = styled.div<any>`
|
|
const Wrapper = styled.div<any>`
|
|
|
display: flex;
|
|
display: flex;
|
|
@@ -56,6 +57,7 @@ type Props = {
|
|
|
disableExecutionOptions: boolean;
|
|
disableExecutionOptions: boolean;
|
|
|
onChange?: (fieldName: string, fieldValue: string) => void;
|
|
onChange?: (fieldName: string, fieldValue: string) => void;
|
|
|
executionLabel: string;
|
|
executionLabel: string;
|
|
|
|
|
+ executing?: boolean;
|
|
|
onCancelClick: () => void;
|
|
onCancelClick: () => void;
|
|
|
onExecuteClick: (options: Field[]) => void;
|
|
onExecuteClick: (options: Field[]) => void;
|
|
|
};
|
|
};
|
|
@@ -66,6 +68,7 @@ type State = {
|
|
|
class ReplicaExecutionOptions extends React.Component<Props, State> {
|
|
class ReplicaExecutionOptions extends React.Component<Props, State> {
|
|
|
static defaultProps = {
|
|
static defaultProps = {
|
|
|
executionLabel: "Execute",
|
|
executionLabel: "Execute",
|
|
|
|
|
+ executing: false,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
state: State = {
|
|
state: State = {
|
|
@@ -137,13 +140,17 @@ class ReplicaExecutionOptions extends React.Component<Props, State> {
|
|
|
<Button secondary onClick={this.props.onCancelClick}>
|
|
<Button secondary onClick={this.props.onCancelClick}>
|
|
|
Cancel
|
|
Cancel
|
|
|
</Button>
|
|
</Button>
|
|
|
- <Button
|
|
|
|
|
- onClick={() => {
|
|
|
|
|
- this.props.onExecuteClick(this.state.fields);
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- {this.props.executionLabel}
|
|
|
|
|
- </Button>
|
|
|
|
|
|
|
+ {this.props.executing ? (
|
|
|
|
|
+ <LoadingButton>Executing ...</LoadingButton>
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <Button
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ this.props.onExecuteClick(this.state.fields);
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {this.props.executionLabel}
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ )}
|
|
|
</Buttons>
|
|
</Buttons>
|
|
|
</Wrapper>
|
|
</Wrapper>
|
|
|
);
|
|
);
|