@@ -24,6 +24,7 @@ import Markdown from '../commons/Markdown'
2424const DEFAULT_QUESTION_ID : number = 0
2525
2626type Props = {
27+ listingPath ?: string ,
2728 overview : IAssessmentOverview ,
2829 updateEditingOverview : ( overview : IAssessmentOverview ) => void
2930}
@@ -33,12 +34,6 @@ interface IState {
3334 fieldValue : any
3435}
3536
36- const textareaStyle = {
37- "height" : "100%" ,
38- "width" : "100%" ,
39- "overflow" : "hidden" as "hidden" ,
40- "resize" : "none" as "none"
41- }
4237
4338export class EditingOverviewCard extends React . Component < Props , IState > {
4439 public constructor ( props : Props ) {
@@ -88,7 +83,7 @@ export class EditingOverviewCard extends React.Component<Props, IState> {
8883 private makeEditingOverviewTextarea = ( field : keyof IAssessmentOverview ) =>
8984 < Textarea
9085 autoFocus = { true }
91- style = { textareaStyle }
86+ className = { 'editing-textarea' }
9287 onChange = { this . handleEditOverview ( ) }
9388 onBlur = { this . saveEditOverview ( field ) }
9489 value = { this . state . fieldValue }
@@ -155,7 +150,7 @@ export class EditingOverviewCard extends React.Component<Props, IState> {
155150 : `${ getPrettyDate ( overview . closeAt ) } ` }
156151 </ div >
157152 </ Text >
158- { makeOverviewCardButton ( overview ) }
153+ { makeOverviewCardButton ( overview , this . props . listingPath ) }
159154 </ div >
160155 </ div >
161156 </ Card >
@@ -197,14 +192,13 @@ export class EditingOverviewCard extends React.Component<Props, IState> {
197192
198193}
199194
200- const makeOverviewCardButton = ( overview : IAssessmentOverview ) => {
195+ const makeOverviewCardButton = ( overview : IAssessmentOverview , listingPath : string | undefined ) => {
201196 const icon : IconName = IconNames . EDIT ;
202197 const label : string = "Edit mission" ;
198+ listingPath = listingPath || ( '/academy/' + assessmentCategoryLink ( overview . category ) ) ;
203199 return (
204200 < NavLink
205- to = { `/academy/${ assessmentCategoryLink (
206- overview . category
207- ) } /${ overview . id . toString ( ) } /${ DEFAULT_QUESTION_ID } `}
201+ to = { listingPath + `/${ overview . id . toString ( ) } /${ DEFAULT_QUESTION_ID } ` }
208202 >
209203 { controlButton ( label , icon ) }
210204 </ NavLink >
0 commit comments