@@ -8,9 +8,9 @@ import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize
8
8
import Form from '../../components/Form' ;
9
9
import ONYXKEYS from '../../ONYXKEYS' ;
10
10
import TextInput from '../../components/TextInput' ;
11
+ import reportPropTypes from '../reportPropTypes' ;
11
12
import styles from '../../styles/styles' ;
12
13
import compose from '../../libs/compose' ;
13
- import reportPropTypes from '../reportPropTypes' ;
14
14
import * as Task from '../../libs/actions/Task' ;
15
15
import CONST from '../../CONST' ;
16
16
import focusAndUpdateMultilineInputRange from '../../libs/focusAndUpdateMultilineInputRange' ;
@@ -21,19 +21,16 @@ const propTypes = {
21
21
email : PropTypes . string . isRequired ,
22
22
} ) ,
23
23
24
- /** Task Report Info */
25
- task : PropTypes . shape ( {
26
- /** Title of the Task */
27
- report : reportPropTypes ,
28
- } ) ,
24
+ /** The report currently being looked at */
25
+ report : reportPropTypes ,
29
26
30
27
/* Onyx Props */
31
28
...withLocalizePropTypes ,
32
29
} ;
33
30
34
31
const defaultProps = {
35
32
session : { } ,
36
- task : { } ,
33
+ report : { } ,
37
34
} ;
38
35
39
36
function TaskDescriptionPage ( props ) {
@@ -43,7 +40,7 @@ function TaskDescriptionPage(props) {
43
40
( values ) => {
44
41
// Set the description of the report in the store and then call Task.editTaskReport
45
42
// to update the description of the report on the server
46
- Task . editTaskAndNavigate ( props . task . report , props . session . accountID , { description : values . description } ) ;
43
+ Task . editTaskAndNavigate ( props . report , props . session . accountID , { description : values . description } ) ;
47
44
} ,
48
45
[ props ] ,
49
46
) ;
@@ -72,7 +69,7 @@ function TaskDescriptionPage(props) {
72
69
name = "description"
73
70
label = { props . translate ( 'newTaskPage.descriptionOptional' ) }
74
71
accessibilityLabel = { props . translate ( 'newTaskPage.descriptionOptional' ) }
75
- defaultValue = { ( props . task . report && props . task . report . description ) || '' }
72
+ defaultValue = { ( props . report && props . report . description ) || '' }
76
73
ref = { ( el ) => ( inputRef . current = el ) }
77
74
autoGrowHeight
78
75
submitOnEnter
@@ -94,8 +91,8 @@ export default compose(
94
91
session : {
95
92
key : ONYXKEYS . SESSION ,
96
93
} ,
97
- task : {
98
- key : ONYXKEYS . TASK ,
94
+ report : {
95
+ key : ( { route } ) => ` ${ ONYXKEYS . COLLECTION . REPORT } ${ route . params . reportID } ` ,
99
96
} ,
100
97
} ) ,
101
98
) ( TaskDescriptionPage ) ;
0 commit comments