File tree Expand file tree Collapse file tree
SingularityUI/app/components/common/modalButtons Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,9 +100,14 @@ class ScaleModal extends Component {
100100 {
101101 name : 'largeScaleDownAcknowledged' ,
102102 type : FormModal . INPUT_TYPES . BOOLEAN ,
103- label : 'Explciit acknowledgement of large (>=10) scale down ' ,
103+ label : 'Explciit acknowledgement of large scale down (less than -10 or 1/2 of previous) ' ,
104104 defaultValue : false ,
105- dependsOnFormState : data => ( this . props . currentInstances - data . instances ) >= 10 ,
105+ dependsOnFormState : data => {
106+ const scaleDownExceedsAbsoluteMax = ( this . props . currentInstances - data . instances ) > 10 ;
107+ const scaleDownExceedsRelativeMax = ( this . props . currentInstances > 10 ) && ( data . instances < ( this . props . currentInstances / 2 ) ) ;
108+ // window.config flag in case the numbers change at some point
109+ return scaleDownExceedsAbsoluteMax || scaleDownExceedsRelativeMax || window . config . largeScaleDownAcknowledged ;
110+ } ,
106111 }
107112 ] } >
108113 < p > Scaling request:</ p >
You can’t perform that action at this time.
0 commit comments