diff --git a/src/components/MoneyRequestHeader.js b/src/components/MoneyRequestHeader.js index bdd7365b7893..3df2f2c20074 100644 --- a/src/components/MoneyRequestHeader.js +++ b/src/components/MoneyRequestHeader.js @@ -53,6 +53,8 @@ const propTypes = { transactionID: PropTypes.string, }), + parentPolicy: PropTypes.any, + ...windowDimensionsPropTypes, }; @@ -63,6 +65,7 @@ const defaultProps = { parentReport: {}, parentReportAction: {}, transaction: {}, + parentPolicy: {} }; function MoneyRequestHeader(props) { @@ -71,6 +74,9 @@ function MoneyRequestHeader(props) { const moneyRequestReport = props.parentReport; const isSettled = ReportUtils.isSettled(moneyRequestReport.reportID); + console.log("[DEV] parentReport", props.parentReport); + console.log("[DEV] parentPolicy", props.parentPolicy); + // Only the requestor can take delete the request, admins can only edit it. const isActionOwner = props.parentReportAction.actorAccountID === lodashGet(props.session, 'accountID', null); const report = props.report; @@ -140,8 +146,14 @@ export default compose( canEvict: false, }, transaction: { - key: ({report, parentReportActions}) => - `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportActions, [report.parentReportActionID, 'originalMessage', 'IOUTransactionID'], '')}`, + key: ({report, parentReportAction}) => + `${ONYXKEYS.COLLECTION.TRANSACTION}${lodashGet(parentReportAction, [report.parentReportActionID, 'originalMessage', 'IOUTransactionID'], '')}`, }, + parentPolicy: { + key: (props) => { + console.log("[DEV] parentPolicy key", props); + return `${ONYXKEYS.COLLECTION.POLICY}${props.parentReport ? props.parentReport.policyID : undefined}`; + } + } }), )(MoneyRequestHeader);