@@ -80,7 +80,7 @@ class TimelineTemplateField extends Component {
80
80
< >
81
81
< div className = { styles . row } >
82
82
< div className = { cn ( styles . field , styles . col1 ) } >
83
- < label htmlFor = 'type' > Timeline Template < span > *</ span > :</ label >
83
+ < label htmlFor = 'type' > Timeline Template { ! this . props . readOnly && < span > *</ span > } :</ label >
84
84
</ div >
85
85
< div className = { cn ( styles . field , styles . col2 , { [ styles . disabled ] : this . state . validOptions . length === 0 } ) } >
86
86
< Select
@@ -90,7 +90,7 @@ class TimelineTemplateField extends Component {
90
90
placeholder = 'Timeline Template'
91
91
isClearable = { false }
92
92
onChange = { ( e ) => this . props . onUpdateSelect ( e . value , false , 'timelineTemplateId' ) }
93
- isDisabled = { this . state . validOptions . length === 0 }
93
+ isDisabled = { this . state . validOptions . length === 0 || this . props . readOnly }
94
94
/>
95
95
</ div >
96
96
</ div >
@@ -107,14 +107,16 @@ class TimelineTemplateField extends Component {
107
107
108
108
TimelineTemplateField . defaultProps = {
109
109
challengeTimelines : [ ] ,
110
- timelineTemplates : [ ]
110
+ timelineTemplates : [ ] ,
111
+ readOnly : false
111
112
}
112
113
113
114
TimelineTemplateField . propTypes = {
114
115
challengeTimelines : PropTypes . arrayOf ( PropTypes . shape ( ) ) . isRequired ,
115
116
timelineTemplates : PropTypes . arrayOf ( PropTypes . shape ( ) ) . isRequired ,
116
117
challenge : PropTypes . shape ( ) . isRequired ,
117
- onUpdateSelect : PropTypes . func . isRequired
118
+ onUpdateSelect : PropTypes . func . isRequired ,
119
+ readOnly : PropTypes . bool
118
120
}
119
121
120
122
export default TimelineTemplateField
0 commit comments