@@ -80,7 +80,7 @@ class TimelineTemplateField extends Component {
8080 < >
8181 < div className = { styles . row } >
8282 < 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 >
8484 </ div >
8585 < div className = { cn ( styles . field , styles . col2 , { [ styles . disabled ] : this . state . validOptions . length === 0 } ) } >
8686 < Select
@@ -90,7 +90,7 @@ class TimelineTemplateField extends Component {
9090 placeholder = 'Timeline Template'
9191 isClearable = { false }
9292 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 }
9494 />
9595 </ div >
9696 </ div >
@@ -107,14 +107,16 @@ class TimelineTemplateField extends Component {
107107
108108TimelineTemplateField . defaultProps = {
109109 challengeTimelines : [ ] ,
110- timelineTemplates : [ ]
110+ timelineTemplates : [ ] ,
111+ readOnly : false
111112}
112113
113114TimelineTemplateField . propTypes = {
114115 challengeTimelines : PropTypes . arrayOf ( PropTypes . shape ( ) ) . isRequired ,
115116 timelineTemplates : PropTypes . arrayOf ( PropTypes . shape ( ) ) . isRequired ,
116117 challenge : PropTypes . shape ( ) . isRequired ,
117- onUpdateSelect : PropTypes . func . isRequired
118+ onUpdateSelect : PropTypes . func . isRequired ,
119+ readOnly : PropTypes . bool
118120}
119121
120122export default TimelineTemplateField
0 commit comments