@@ -34,7 +34,8 @@ class Prompt extends React.Component {
34
34
event . target . select ( ) ;
35
35
}
36
36
handleOk ( ) {
37
- this . props . onOk ( this . state . inputValue , {
37
+ if ( this . props . isCustom ) this . props . onOk ( ) ;
38
+ else this . props . onOk ( this . state . inputValue , {
38
39
scope : this . state . globalSelected ? 'global' : 'local' ,
39
40
isCloud : this . state . cloudSelected
40
41
} ) ;
@@ -58,7 +59,20 @@ class Prompt extends React.Component {
58
59
}
59
60
}
60
61
render ( ) {
61
- return (
62
+ if ( this . props . isCustom ) return (
63
+ < PromptComponent
64
+ isCustom = { this . props . isCustom }
65
+ width = { this . props . width }
66
+ height = { this . props . height }
67
+ title = { this . props . title }
68
+ enterTitle = { this . props . enterTitle }
69
+ closeTitle = { this . props . closeTitle }
70
+ onOk = { this . handleOk }
71
+ onCancel = { this . handleCancel }
72
+ onKeyPress = { this . handleKeyPress }
73
+ />
74
+ )
75
+ else return (
62
76
< PromptComponent
63
77
isAddingCloudVariableScratchSafe = { this . state . isAddingCloudVariableScratchSafe }
64
78
canAddCloudVariable = { this . state . canAddCloudVariable }
@@ -93,7 +107,14 @@ Prompt.propTypes = {
93
107
showCloudOption : PropTypes . bool . isRequired ,
94
108
showVariableOptions : PropTypes . bool . isRequired ,
95
109
title : PropTypes . string . isRequired ,
96
- vm : PropTypes . instanceOf ( VM )
110
+ vm : PropTypes . instanceOf ( VM ) ,
111
+
112
+ /* custom modals */
113
+ isCustom : PropTypes . bool ,
114
+ width : PropTypes . number ,
115
+ height : PropTypes . number ,
116
+ enterTitle : PropTypes . string ,
117
+ closeTitle : PropTypes . string
97
118
} ;
98
119
99
120
export default Prompt ;
0 commit comments