File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,4 +3,11 @@ Changelog
33
44in 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
Original file line number Diff line number Diff 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 />
You can’t perform that action at this time.
0 commit comments