File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ class GeneratedFieldset extends React.Component
209
209
210
210
heading : React .PropTypes .node
211
211
useHeading : React .PropTypes .bool
212
- formType : React .PropTypes .string
212
+ formType : React .PropTypes .oneOf ([ ' new ' , ' update ' ])
213
213
zIndex : React .PropTypes .number
214
214
215
215
lastFieldset : React .PropTypes .bool
@@ -320,14 +320,15 @@ class GeneratedForm extends React.Component
320
320
321
321
style : React .PropTypes .object
322
322
323
- formType : React .PropTypes .string
323
+ formType : React .PropTypes .oneOf ([ ' new ' , ' update ' ])
324
324
prefilled : React .PropTypes .bool
325
325
contextData : React .PropTypes .object ,
326
326
327
327
@defaultProps :
328
328
style : {}
329
329
330
330
render : =>
331
+ submitTxt = if @props .formType is " new" then " Submit" else " Update"
331
332
<form className = " generated-form" ref = " form" style = {this .props .style } onSubmit = {this .props .onSubmit }>
332
333
<TabGroupRegion >
333
334
{@ _renderHeaderFormError ()}
@@ -336,7 +337,7 @@ class GeneratedForm extends React.Component
336
337
{@ _renderFieldsets ()}
337
338
</div >
338
339
<div className = " form-footer" >
339
- <input type = " submit" value = " Submit " className = " btn btn-emphasis" />
340
+ <input type = " submit" value = {submitTxt} className = " btn btn-emphasis" />
340
341
</div >
341
342
</TabGroupRegion >
342
343
</form >
You can’t perform that action at this time.
0 commit comments