Skip to content

Commit

Permalink
Add more references to the centralized report prop types
Browse files Browse the repository at this point in the history
  • Loading branch information
tgolen committed Sep 28, 2022
1 parent f60dbb8 commit 2ffd0e2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 32 deletions.
6 changes: 2 additions & 4 deletions src/components/ArchivedReportFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import compose from '../libs/compose';
import personalDetailsPropType from '../pages/personalDetailsPropType';
import ONYXKEYS from '../ONYXKEYS';
import * as ReportUtils from '../libs/ReportUtils';
import reportPropTypes from '../pages/reportPropTypes';

const propTypes = {
/** The reason this report was archived */
Expand All @@ -27,10 +28,7 @@ const propTypes = {
}),

/** The archived report */
report: PropTypes.shape({
/** The policy this report is attached to */
policyID: PropTypes.string,
}).isRequired,
report: reportPropTypes.isRequired,

/** Personal details of all users */
personalDetails: PropTypes.objectOf(personalDetailsPropType).isRequired,
Expand Down
3 changes: 2 additions & 1 deletion src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ONYXKEYS from '../ONYXKEYS';
import Navigation from '../libs/Navigation/Navigation';
import ROUTES from '../ROUTES';
import Tooltip from './Tooltip';
import reportPropTypes from '../pages/reportPropTypes';

const personalDetailsPropTypes = PropTypes.shape({
/** The login of the person (either email or phone number) */
Expand All @@ -28,7 +29,7 @@ const personalDetailsPropTypes = PropTypes.shape({

const propTypes = {
/** The report currently being looked at */
report: PropTypes.oneOfType([PropTypes.object]),
report: reportPropTypes,

/* Onyx Props */

Expand Down
12 changes: 2 additions & 10 deletions src/pages/ReportParticipantsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import personalDetailsPropType from './personalDetailsPropType';
import withLocalize, {withLocalizePropTypes} from '../components/withLocalize';
import compose from '../libs/compose';
import * as ReportUtils from '../libs/ReportUtils';
import reportPropTypes from './reportPropTypes';

const propTypes = {
/* Onyx Props */
Expand All @@ -26,16 +27,7 @@ const propTypes = {
personalDetails: personalDetailsPropType.isRequired,

/** The active report */
report: PropTypes.shape({
/** The list of icons */
icons: PropTypes.arrayOf(PropTypes.string),

/** The report name */
reportName: PropTypes.string,

/** Array of participants */
participants: PropTypes.arrayOf(PropTypes.string),
}).isRequired,
report: reportPropTypes.isRequired,

/** Route params */
route: PropTypes.shape({
Expand Down
12 changes: 2 additions & 10 deletions src/pages/home/HeaderView.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import Text from '../../components/Text';
import Tooltip from '../../components/Tooltip';
import variables from '../../styles/variables';
import colors from '../../styles/colors';
import reportPropTypes from '../reportPropTypes';

const propTypes = {
/** Toggles the navigationMenu open and closed */
Expand All @@ -34,16 +35,7 @@ const propTypes = {
/* Onyx Props */

/** The report currently being looked at */
report: PropTypes.shape({
/** Name of the report */
reportName: PropTypes.string,

/** List of primarylogins of participants of the report */
participants: PropTypes.arrayOf(PropTypes.string),

/** Value indicating if the report is pinned or not */
isPinned: PropTypes.bool,
}),
report: reportPropTypes,

/** The policies which the user has access to and which the report could be tied to */
policies: PropTypes.shape({
Expand Down
9 changes: 2 additions & 7 deletions src/pages/home/report/ReportActionsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import * as ReportActionsUtils from '../../../libs/ReportActionsUtils';
import reportActionPropTypes from './reportActionPropTypes';
import CONST from '../../../CONST';
import * as StyleUtils from '../../../styles/StyleUtils';
import reportPropTypes from '../../reportPropTypes';

const propTypes = {
/** Position of the "New" line marker */
Expand All @@ -26,13 +27,7 @@ const propTypes = {
personalDetails: PropTypes.objectOf(participantPropTypes),

/** The report currently being looked at */
report: PropTypes.shape({
/** The largest sequenceNumber on this report */
maxSequenceNumber: PropTypes.number,

/** Whether there is an outstanding amount in IOU */
hasOutstandingIOU: PropTypes.bool,
}).isRequired,
report: reportPropTypes.isRequired,

/** Sorted actions prepared for display */
sortedReportActions: PropTypes.arrayOf(PropTypes.shape({
Expand Down

0 comments on commit 2ffd0e2

Please sign in to comment.