Skip to content

Commit 9978578

Browse files
author
Parth Shandilya
committed
st2-history: Disable button after onClick
1 parent fb14fc9 commit 9978578

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,11 @@ Changelog
33

44
in development
55
--------------
6-
* Create a changelog and required machinery
6+
7+
Added
8+
~~~~~
9+
10+
* Added feature for disabling button for synchronous responses
11+
- Button gets disabled onClick on `Connect` and `Submit` in st2-login and st2-history module respectively
12+
13+
Contributed by @ParthS007

apps/st2-history/history-popup.component.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export default class HistoryPopup extends React.Component {
3939

4040
state = {
4141
preview: false,
42+
disabled: false,
4243
}
4344

4445
static getDerivedStateFromProps(props, state) {
@@ -89,6 +90,7 @@ export default class HistoryPopup extends React.Component {
8990
delete this.state.payload[payLoadKey];
9091
}
9192
this.props.onSubmit(this.state.payload);
93+
this.setState({ disabled: true });
9294
}
9395

9496
render() {
@@ -136,6 +138,7 @@ export default class HistoryPopup extends React.Component {
136138
submit
137139
className="st2-details__toolbar-button"
138140
value="Submit"
141+
disabled={this.state.disabled}
139142
onClick={(e) => this.handleSubmit(e)}
140143
data-test="rerun_submit"
141144
/>

0 commit comments

Comments
 (0)